[PATCH 01 of 11 (19 more to go)] push: feed pushoperation object to _pushbookmark function

pierre-yves.david at ens-lyon.org pierre-yves.david at ens-lyon.org
Tue Feb 11 00:01:29 UTC 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1391133101 28800
#      Thu Jan 30 17:51:41 2014 -0800
# Node ID b1956c52aad84168bbb1baa1c3285c5e313e1bc4
# Parent  98eadbfffa0e987eaa9b24bcc92357be1bd252d5
push: feed pushoperation object to _pushbookmark function

This will able the bookmark synchronisation to have full information on the
ongoing push and pass information to other operation.

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -253,17 +253,20 @@ def push(repo, remote, force=False, revs
                 lock.release()
     finally:
         if locallock is not None:
             locallock.release()
 
-    _pushbookmark(pushop.ui, unfi, pushop.remote, pushop.revs)
+    _pushbookmark(pushop)
     return ret
 
-def _pushbookmark(ui, repo, remote, revs):
+def _pushbookmark(pushop):
     """Update bookmark position on remote"""
+    ui = pushop.ui
+    repo = pushop.repo.unfiltered()
+    remote = pushop.remote
     ui.debug("checking for updated bookmarks\n")
-    revnums = map(repo.changelog.rev, revs or [])
+    revnums = map(repo.changelog.rev, pushop.revs or [])
     ancestors = [a for a in repo.changelog.ancestors(revnums, inclusive=True)]
     (addsrc, adddst, advsrc, advdst, diverge, differ, invalid
      ) = bookmarks.compare(repo, repo._bookmarks, remote.listkeys('bookmarks'),
                            srchex=hex)
 


More information about the Mercurial-devel mailing list