push: sanitize handling of bookmark push return value
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 25 Sep 2014 02:53:49 -0700
changeset 22621 76a43e0db516
parent 22620 4d52e6eb98ea
child 22622 ce6b9edee725
push: sanitize handling of bookmark push return value Mixing return and assignment does not make sense, let's unify this.
mercurial/commands.py
--- a/mercurial/commands.py	Thu Sep 25 01:43:24 2014 -0700
+++ b/mercurial/commands.py	Thu Sep 25 02:53:49 2014 -0700
@@ -5076,8 +5076,8 @@
     if opts.get('bookmark'):
         bresult = bookmarks.pushtoremote(ui, repo, other, opts['bookmark'])
         if bresult == 2:
-            return 2
-        if not result and bresult:
+            result = 2
+        elif not result and bresult:
             result = 2
 
     return result