push: feed pulloperation object to _pullobsolete function
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Fri, 31 Jan 2014 01:12:35 -0800
changeset 20478 80628d4069be
parent 20477 2607a21bb40b
child 20479 c38e5556d87b
child 20491 da64679bfc8a
push: feed pulloperation object to _pullobsolete function We now have all necessary information in the `pulloperation` object itself.
mercurial/exchange.py
--- a/mercurial/exchange.py	Fri Jan 31 01:04:05 2014 -0800
+++ b/mercurial/exchange.py	Fri Jan 31 01:12:35 2014 -0800
@@ -484,8 +484,7 @@
             # should be seen as public
             phases.advanceboundary(pullop.repo, phases.public, subset)
 
-        _pullobsolete(pullop.repo, pullop.remote,
-                      pullop.gettransaction)
+        _pullobsolete(pullop)
         pullop.closetransaction()
     finally:
         pullop.releasetransaction()
@@ -493,7 +492,7 @@
 
     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
@@ -503,14 +502,14 @@
     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