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

login
register
mail settings
Submitter Pierre-Yves David
Date Feb. 12, 2014, 1:34 a.m.
Message ID <3cf21b2679fabc81e5b7.1392168862@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/3606/
State Accepted
Commit 80628d4069be724089ea487a300d62f4cbd8970d
Headers show

Comments

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

Patch

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
         else:
             # 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)
         pullop.closetransaction()
     finally:
         pullop.releasetransaction()
         lock.release()
 
     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