phase: add a transaction argument to retractboundary
authorPierre-Yves David <pierre-yves.david@fb.com>
Tue, 05 Aug 2014 23:52:21 -0700
changeset 22070 c1ca47204590
parent 22069 616a455b02ca
child 22071 f8fc5df6a8cf
phase: add a transaction argument to retractboundary We now pass a transaction option to this phase movement function. The object is currently not used by the function, but it will be in the future. All call sites have been updated. Most call sites were already enclosed in a transaction for a long time. The handful of others have been recently updated in previous commit.
hgext/mq.py
mercurial/changegroup.py
mercurial/commands.py
mercurial/localrepo.py
mercurial/phases.py
--- a/hgext/mq.py	Wed Aug 06 01:54:19 2014 -0700
+++ b/hgext/mq.py	Tue Aug 05 23:52:21 2014 -0700
@@ -2011,7 +2011,7 @@
                     patchname = None
                     if rev and repo.ui.configbool('mq', 'secret', False):
                         # if we added anything with --rev, move the secret root
-                        phases.retractboundary(repo, phases.secret, [n])
+                        phases.retractboundary(repo, tr, phases.secret, [n])
                     self.parseseries()
                     self.applieddirty = True
                     self.seriesdirty = True
--- a/mercurial/changegroup.py	Wed Aug 06 01:54:19 2014 -0700
+++ b/mercurial/changegroup.py	Tue Aug 05 23:52:21 2014 -0700
@@ -706,12 +706,12 @@
                 # phases are going to be pushed alongside. Therefor
                 # `targetphase` is ignored.
                 phases.advanceboundary(repo, tr, phases.draft, srccontent)
-                phases.retractboundary(repo, phases.draft, added)
+                phases.retractboundary(repo, tr, phases.draft, added)
         elif srctype != 'strip':
             # publishing only alter behavior during push
             #
             # strip should not touch boundary at all
-            phases.retractboundary(repo, targetphase, added)
+            phases.retractboundary(repo, tr, targetphase, added)
 
         # make changelog see real files again
         cl.finalize(trp)
--- a/mercurial/commands.py	Wed Aug 06 01:54:19 2014 -0700
+++ b/mercurial/commands.py	Tue Aug 05 23:52:21 2014 -0700
@@ -4585,7 +4585,7 @@
             olddata = repo._phasecache.getphaserevs(repo)[:]
             phases.advanceboundary(repo, tr, targetphase, nodes)
             if opts['force']:
-                phases.retractboundary(repo, targetphase, nodes)
+                phases.retractboundary(repo, tr, targetphase, nodes)
             tr.close()
         finally:
             if tr is not None:
--- a/mercurial/localrepo.py	Wed Aug 06 01:54:19 2014 -0700
+++ b/mercurial/localrepo.py	Tue Aug 05 23:52:21 2014 -0700
@@ -1442,7 +1442,7 @@
                 # be compliant anyway
                 #
                 # if minimal phase was 0 we don't need to retract anything
-                phases.retractboundary(self, targetphase, [n])
+                phases.retractboundary(self, tr, targetphase, [n])
             tr.close()
             branchmap.updatecache(self.filtered('served'))
             return n
--- a/mercurial/phases.py	Wed Aug 06 01:54:19 2014 -0700
+++ b/mercurial/phases.py	Tue Aug 05 23:52:21 2014 -0700
@@ -229,10 +229,10 @@
                 delroots.extend(olds - roots)
             # declare deleted root in the target phase
             if targetphase != 0:
-                self.retractboundary(repo, targetphase, delroots)
+                self.retractboundary(repo, tr, targetphase, delroots)
         repo.invalidatevolatilesets()
 
-    def retractboundary(self, repo, targetphase, nodes):
+    def retractboundary(self, repo, tr, targetphase, nodes):
         # Be careful to preserve shallow-copied values: do not update
         # phaseroots values, replace them.
 
@@ -289,7 +289,7 @@
     phcache.advanceboundary(repo, tr, targetphase, nodes)
     repo._phasecache.replace(phcache)
 
-def retractboundary(repo, targetphase, nodes):
+def retractboundary(repo, tr, targetphase, nodes):
     """Set nodes back to a phase changing other nodes phases if
     necessary.
 
@@ -298,7 +298,7 @@
 
     Simplify boundary to contains phase roots only."""
     phcache = repo._phasecache.copy()
-    phcache.retractboundary(repo, targetphase, nodes)
+    phcache.retractboundary(repo, tr, targetphase, nodes)
     repo._phasecache.replace(phcache)
 
 def listphases(repo):