rebase: add returning value from pullrebase function stable
authorliscju <piotr.listkiewicz@gmail.com>
Sun, 15 Nov 2015 22:18:48 +0100
branchstable
changeset 26960 6979fe2a6d75
parent 26959 ed5f20f9c22e
child 27010 f4fec0940278
child 27102 f97bb61b51e6
rebase: add returning value from pullrebase function So far pullrebase function has always returned None value, no matter what orig function returned. This behaviour made impossible for pull to change returned value from mercurial process (it has always ended with 0 value by default). This patch makes pullrebase returning with returned value from orig.
hgext/rebase.py
--- a/hgext/rebase.py	Fri Nov 13 15:56:02 2015 -0800
+++ b/hgext/rebase.py	Sun Nov 15 22:18:48 2015 +0100
@@ -1096,6 +1096,7 @@
 
 def pullrebase(orig, ui, repo, *args, **opts):
     'Call rebase after pull if the latter has been invoked with --rebase'
+    ret = None
     if opts.get('rebase'):
         wlock = lock = None
         try:
@@ -1113,7 +1114,7 @@
                 pass
             commands.postincoming = _dummy
             try:
-                orig(ui, repo, *args, **opts)
+                ret = orig(ui, repo, *args, **opts)
             finally:
                 commands.postincoming = origpostincoming
             revspostpull = len(repo)
@@ -1140,7 +1141,9 @@
     else:
         if opts.get('tool'):
             raise error.Abort(_('--tool can only be used with --rebase'))
-        orig(ui, repo, *args, **opts)
+        ret = orig(ui, repo, *args, **opts)
+
+    return ret
 
 def _setrebasesetvisibility(repo, revs):
     """store the currently rebased set on the repo object