Bug 911495 - Propagate errors, r=jdm
authorSteve Fink <sfink@mozilla.com>
Sat, 31 Aug 2013 13:15:52 -0700
changeset 75 8d608039123e
parent 74 37b57ace9b1f
child 76 db8bbbde5cbb
push id56
push usersfink@mozilla.com
push dateSat, 31 Aug 2013 22:08:09 +0000
reviewersjdm
bugs911495
Bug 911495 - Propagate errors, r=jdm
__init__.py
--- a/__init__.py
+++ b/__init__.py
@@ -160,17 +160,19 @@ def extsetup(ui=None):
       insert = q.fullseriesend()
     except:
       insert = q.full_series_end()
 
     # Do the import as normal. The first patch of any bug is actually imported
     # and the rest are stored in the global delayed_imports. The imported
     # patches have dumb filenames because there's no way to tell mq to pick the
     # patch name *after* download.
-    orig(ui, repo, *files, **opts)
+    ret = orig(ui, repo, *files, **opts)
+    if ret:
+      return ret
 
     # If the user passed a name, then mq used that so we don't need to rename
     if not opts['name']:
       # cache the lookup of the name. findcmd is not fast.
       qrename = cmdutil.findcmd("qrename", commands.table)[1][0]
 
       # For all the already imported patches, rename them. Except there will
       # only be one, since if the url resolves to multiple patches then
@@ -203,17 +205,19 @@ def extsetup(ui=None):
     # bz:// handler will have cached the lookup so we don't hit the network
     # here. Each one of these pushes an unapplied patch onto the beginning of
     # the queue, and unapplied patches are ignored when importing them, so do
     # these in reverse order.
     for patch in reversed(list(bzhandler.delayed_imports)):
       newopts['name'] = checkpatchname(patch)
       path = makebzurl(patch.bug.num, patch.id)
 
-      orig(ui, repo, path, **newopts)
+      ret = orig(ui, repo, path, **newopts)
+      if ret:
+        return ret
 
   extensions.wrapcommand(cmdtable, 'qimport', qimporthook)
 
   # Here we setup the protocol handlers
   processors = {
     'bz' : bzhandler.Handler,
     'pb' : pb.Handler,
     'scp' : scp.Handler