[PATCH 09 of 13] pull: move pulled subset into the object

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


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1391160102 28800
#      Fri Jan 31 01:21:42 2014 -0800
# Node ID 7935b9c338c49f4a53fd1ab15948708573248e4f
# Parent  3cf21b2679fabc81e5b7d2bdb3d5c7f4c6bad923
pull: move pulled subset into the object

We compute the set of local changeset that were target of the pull. This is then
used by phases logic to decide which part of the history should have it phase
updated.

We move this information into the object to allow extraction of phase
synchronisation in its own function.

I expect obsolete marker exchange to use it too in the future.

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -334,10 +334,12 @@ class pulloperation(object):
         self.force = force
         # the name the pull transaction
         self._trname = 'pull\n' + util.hidepassword(remote.url())
         # hold the transaction once created
         self._tr = None
+        # heads of the set of changeset target by the pull
+        self.pulledsubset = None
 
     def gettransaction(self):
         """get appropriate pull transaction, creating it if needed"""
         if self._tr is None:
             self._tr = self.repo.transaction(self._trname)
@@ -408,24 +410,28 @@ def pull(repo, remote, heads=None, force
             subset = common + rheads
         else:
             # We pulled a specific subset
             # sync on this subset
             subset = pullop.heads
+        pullop.pulledsubset = subset
 
         # Get remote phases data from remote
         remotephases = pullop.remote.listkeys('phases')
         publishing = bool(remotephases.get('publishing', False))
         if remotephases and not publishing:
             # remote is new and unpublishing
-            pheads, _dr = phases.analyzeremotephases(pullop.repo, subset,
+            pheads, _dr = phases.analyzeremotephases(pullop.repo,
+                                                     pullop.pulledsubset,
                                                      remotephases)
             phases.advanceboundary(pullop.repo, phases.public, pheads)
-            phases.advanceboundary(pullop.repo, phases.draft, subset)
+            phases.advanceboundary(pullop.repo, phases.draft,
+                                   pullop.pulledsubset)
         else:
             # Remote is old or publishing all common changesets
             # should be seen as public
-            phases.advanceboundary(pullop.repo, phases.public, subset)
+            phases.advanceboundary(pullop.repo, phases.public,
+                                   pullop.pulledsubset)
 
         _pullobsolete(pullop)
         pullop.closetransaction()
     finally:
         pullop.releasetransaction()


More information about the Mercurial-devel mailing list