[PATCH 6 of 6] pushbookmark: do not attempt to update bookmark if the push failed (BC)

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Aug 18 16:50:04 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1408152381 25200
#      Fri Aug 15 18:26:21 2014 -0700
# Node ID dd73a65361e07db6abcea976b6e48a79fe6d88f3
# Parent  8db10be23d42b45f7f86cecad186858059ed91f6
pushbookmark: do not attempt to update bookmark if the push failed (BC)

Before this patch, there was always an attempt to update bookmark even if prior
steps of the push failed. I cannot see good semantic reason to do so. We
disable this possibility to simplify the push flow with bundle2. Bookmark will
be included in the bundle and fails with other steps.

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -611,10 +611,12 @@ def _pushobsolete(pushop):
             msg = _('failed to push some obsolete markers!\n')
             repo.ui.warn(msg)
 
 def _pushbookmark(pushop):
     """Update bookmark position on remote"""
+    if pushop.ret == 0:
+        return
     ui = pushop.ui
     repo = pushop.repo.unfiltered()
     remote = pushop.remote
     ui.debug("checking for updated bookmarks\n")
     ancestors = ()


More information about the Mercurial-devel mailing list