hg
changeset 50 0263ce8be574
parent 49 14bff5d8e526
child 52 c78eea339e8b
--- 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] <patch names>')
     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()