[PATCH 1 of 2 V2] push: remove undocumented exit code 2 for bookmark exchange failure

Kevin Bullock kbullock+mercurial at ringworld.org
Fri Dec 7 13:43:15 CST 2012


# HG changeset patch
# User Kevin Bullock <kbullock at ringworld.org>
# Date 1354908879 21600
# Node ID 106b515749cf338617d24c2fae3850987bf46734
# Parent  f3991bcf4f0ff43b43a1b1d0210925a629ef3b9c
push: remove undocumented exit code 2 for bookmark exchange failure

This exit code was originally added in e1a145eebb6a, but was never
documented. It interferes with moving the remaining bookmark exchange
code into localrepo.push(), because that method returns an integer
indicating the number of heads added.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4784,13 +4784,11 @@ def push(ui, repo, dest=None, **opts):
             else:
                 ui.warn(_('bookmark %s does not exist on the local '
                           'or remote repository!\n') % b)
-                return 2
+                break
             old = rb.get(b, '')
             r = other.pushkey('bookmarks', b, old, new)
             if not r:
                 ui.warn(_('updating bookmark %s failed!\n') % b)
-                if not result:
-                    result = 2
 
     return result
 
diff --git a/tests/test-bookmarks-pushpull.t b/tests/test-bookmarks-pushpull.t
--- a/tests/test-bookmarks-pushpull.t
+++ b/tests/test-bookmarks-pushpull.t
@@ -101,7 +101,7 @@ push/pull name that doesn't exist
   searching for changes
   no changes found
   bookmark badname does not exist on the local or remote repository!
-  [2]
+  [1]
   $ hg pull -B anotherbadname ../a
   pulling from ../a
   abort: remote bookmark anotherbadname not found!


More information about the Mercurial-devel mailing list