Patchwork [3,of,5] push: use stepsdone to control bookmark push

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 18, 2014, 11:48 p.m.
Message ID <9435cddbb3cb5dff6cfd.1408405681@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5489/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 18, 2014, 11:48 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1408153257 25200
#      Fri Aug 15 18:40:57 2014 -0700
# Node ID 9435cddbb3cb5dff6cfd8216fcccf890ceb9d20a
# Parent  9548edead3a6e03cb104206c55665fc5839712dc
push: use stepsdone to control bookmark push

If bookmark are to be integrated in the unified bundle2 we need a way to disable
the old style push.

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -631,12 +631,13 @@  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:
+    if pushop.ret == 0 or 'bookmarks' in pushop.stepsdone:
         return
+    pushop.stepsdone.add('bookmarks')
     ui = pushop.ui
     remote = pushop.remote
     for b, old, new in pushop.outbookmarks:
         if remote.pushkey('bookmarks', b, old, new):
             ui.status(_("updating bookmark %s\n") % b)