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

login
register
mail settings
Submitter Pierre-Yves David
Date Feb. 11, 2014, 12:01 a.m.
Message ID <b1956c52aad84168bbb1.1392076889@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/3548/
State Accepted
Commit bebf8b8479f30ca24800ed0e6a70d5123ab94d60
Headers show

Comments

Pierre-Yves David - Feb. 11, 2014, 12:01 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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)