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

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 18, 2014, 9:50 p.m.
Message ID <dd73a65361e07db6abce.1408398604@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5475/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 18, 2014, 9:50 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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 = ()