[PATCH 08 of 13] push: feed pulloperation object to _pullobsolete function

pierre-yves.david at ens-lyon.org pierre-yves.david at ens-lyon.org
Tue Feb 11 19:34:22 CST 2014

# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1391159555 28800
#      Fri Jan 31 01:12:35 2014 -0800
# Node ID 3cf21b2679fabc81e5b7d2bdb3d5c7f4c6bad923
# Parent  db3446f5f515408abe47e20ee4e1dbf0d4d66b7d
push: feed pulloperation object to _pullobsolete function

We now have all necessary information in the `pulloperation` object itself.

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -423,35 +423,34 @@ def pull(repo, remote, heads=None, force
             # Remote is old or publishing all common changesets
             # should be seen as public
             phases.advanceboundary(pullop.repo, phases.public, subset)
-        _pullobsolete(pullop.repo, pullop.remote,
-                      pullop.gettransaction)
+        _pullobsolete(pullop)
     return result
-def _pullobsolete(repo, remote, gettransaction):
+def _pullobsolete(pullop):
     """utility function to pull obsolete markers from a remote
     The `gettransaction` is function that return the pull transaction, creating
     one if necessary. We return the transaction to inform the calling code that
     a new transaction have been created (when applicable).
     Exists mostly to allow overriding for experimentation purpose"""
     tr = None
     if obsolete._enabled:
-        repo.ui.debug('fetching remote obsolete markers\n')
-        remoteobs = remote.listkeys('obsolete')
+        pullop.repo.ui.debug('fetching remote obsolete markers\n')
+        remoteobs = pullop.remote.listkeys('obsolete')
         if 'dump0' in remoteobs:
-            tr = gettransaction()
+            tr = pullop.gettransaction()
             for key in sorted(remoteobs, reverse=True):
                 if key.startswith('dump'):
                     data = base85.b85decode(remoteobs[key])
-                    repo.obsstore.mergemarkers(tr, data)
-            repo.invalidatevolatilesets()
+                    pullop.repo.obsstore.mergemarkers(tr, data)
+            pullop.repo.invalidatevolatilesets()
     return tr

More information about the Mercurial-devel mailing list