# HG changeset patch # User mpm@selenic.com # Date 1116037328 28800 # Node ID ab03c7a52cf2210029543ea3404bc2e503a1d0b4 # Parent 6fa994fe90fc105ea31c26516f1695f92f9d01c9 Minor changes to import so that we can successfully import Ingo's kernel history patchset. diff --git a/hg b/hg --- a/hg +++ b/hg @@ -136,6 +136,12 @@ elif cmd == "commit" or cmd == "checkin" repo.commit(repo.current) elif cmd == "import" or cmd == "patch": + try: + import psyco + psyco.full() + except: + pass + ioptions = {} opts = [('p', 'strip', 1, 'path strip'), ('b', 'base', "", 'base path'), @@ -154,14 +160,16 @@ elif cmd == "import" or cmd == "patch": text = "" for l in file(pf): - if l[:3] == "---": break + if l[:4] == "--- ": break text += l - if os.system("patch -p%d < %s %s" % (strip, pf, quiet)): - raise "patch failed!" f = os.popen("lsdiff --strip %d %s" % (strip, pf)) files = filter(None, map(lambda x: x.rstrip(), f.read().splitlines())) f.close() + + if files: + if os.system("patch -p%d < %s %s" % (strip, pf, quiet)): + raise "patch failed!" repo.commit(repo.current, files, text) elif cmd == "status":