[PATCH 05 of 16] push: extract bookmark exchange in its own method

pierre-yves.david at logilab.fr pierre-yves.david at logilab.fr
Wed Apr 17 10:58:40 CDT 2013


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1366205410 -7200
#      Wed Apr 17 15:30:10 2013 +0200
# Node ID e8228b2e83a7aa25d3a6be434e728a51d0613cef
# Parent  b5874256521657270bfee104401ee8a79196a3fb
push: extract bookmark exchange in its own method

diff --git a/mercurial/exchangeutil.py b/mercurial/exchangeutil.py
--- a/mercurial/exchangeutil.py
+++ b/mercurial/exchangeutil.py
@@ -204,11 +204,18 @@ class pushoperation(object):
             finally:
                 if lock is not None:
                     lock.release()
         finally:
             locallock.release()
+        self._pushbookmarks()
+        return ret
 
+    def _pushbookmarks(self):
+        """synchronise local bookmark position to remote"""
+        repo = self.repo
+        remote = self.remote
+        unfi = repo.unfiltered()
         repo.ui.debug("checking for updated bookmarks\n")
         rb = remote.listkeys('bookmarks')
         for k in rb.keys():
             if k in unfi._bookmarks:
                 nr, nl = rb[k], hex(repo._bookmarks[k])
@@ -221,11 +228,10 @@ class pushoperation(object):
                             repo.ui.status(_("updating bookmark %s\n") % k)
                         else:
                             repo.ui.warn(_('updating bookmark %s'
                                            ' failed!\n') % k)
 
-        return ret
 
 def pull(repo, remote, heads=None, force=False):
     # don't open transaction for nothing or you break future useful
     # rollback call
     tr = None


More information about the Mercurial-devel mailing list