# HG changeset patch # User mpm@selenic.com # Date 1115848582 28800 # Node ID 14bff5d8e526a0e50a24ba4a257439759ec8c251 # Parent 9f64181ff9a9e80c6033f9784b66f551af7c7d24 Import comments from patches diff --git a/hg b/hg --- a/hg +++ b/hg @@ -20,7 +20,7 @@ import sys, os, time from mercurial import hg, mdiff, fancyopts def help(): - print """\ + print """\ commands: init create a new repository in this directory @@ -142,12 +142,18 @@ elif cmd == "import" or cmd == "patch": for patch in args: ui.status("applying %s\n" % patch) - pf = d + patch + pf = os.path.join(d, patch) + + text = "" + for l in file(pf): + if l[:3] == "---": break + text += l + os.system("patch -p%d < %s > /dev/null" % (strip, pf)) f = os.popen("lsdiff --strip %d %s" % (strip, pf)) files = f.read().splitlines() f.close() - repo.commit(repo.current, files) + repo.commit(repo.current, files, text) elif cmd == "status": (c, a, d) = repo.diffdir(repo.root, repo.current)