changeset 20478:80628d4069be

push: feed pulloperation object to _pullobsolete function We now have all necessary information in the `pulloperation` object itself.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Fri, 31 Jan 2014 01:12:35 -0800
parents 2607a21bb40b
children c38e5556d87b da64679bfc8a
files mercurial/exchange.py
diffstat 1 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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