# HG changeset patch # User mpm@selenic.com # Date 1115849194 28800 # Node ID 0263ce8be574cc2146b9880422c7aaa389a0eca9 # Parent 14bff5d8e526a0e50a24ba4a257439759ec8c251 Add -q option to import Make import complain if patching fails diff -r 14bff5d8e526 -r 0263ce8be574 hg --- a/hg Wed May 11 13:56:22 2005 -0800 +++ b/hg Wed May 11 14:06:34 2005 -0800 @@ -133,12 +133,15 @@ elif cmd == "import" or cmd == "patch": ioptions = {} opts = [('p', 'strip', 1, 'path strip'), - ('b', 'base', "", 'base path')] + ('b', 'base', "", 'base path'), + ('q', 'quiet', "", 'silence diff') + ] args = fancyopts.fancyopts(args, opts, ioptions, 'hg import [options] ') d = ioptions["base"] strip = ioptions["strip"] + quiet = ioptions["quiet"] and "> /dev/null" or "" for patch in args: ui.status("applying %s\n" % patch) @@ -149,7 +152,8 @@ if l[:3] == "---": break text += l - os.system("patch -p%d < %s > /dev/null" % (strip, pf)) + if os.system("patch -p%d < %s %s" % (strip, pf, quiet)): + raise "patch failed!" f = os.popen("lsdiff --strip %d %s" % (strip, pf)) files = f.read().splitlines() f.close()