Mercurial > public > mercurial-scm > hg-stable
diff mercurial/phases.py @ 22069:616a455b02ca
phase: add a transaction argument to advanceboundary
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.
The retractboundary function remains to be upgraded.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Wed, 06 Aug 2014 01:54:19 -0700 |
parents | 793f9276aeb9 |
children | c1ca47204590 |
line wrap: on
line diff
--- a/mercurial/phases.py Wed Aug 06 00:54:37 2014 -0700 +++ b/mercurial/phases.py Wed Aug 06 01:54:19 2014 -0700 @@ -208,7 +208,7 @@ self._phaserevs = None self.dirty = True - def advanceboundary(self, repo, targetphase, nodes): + def advanceboundary(self, repo, tr, targetphase, nodes): # Be careful to preserve shallow-copied values: do not update # phaseroots values, replace them. @@ -278,7 +278,7 @@ # (see branchmap one) self._phaserevs = None -def advanceboundary(repo, targetphase, nodes): +def advanceboundary(repo, tr, targetphase, nodes): """Add nodes to a phase changing other nodes phases if necessary. This function move boundary *forward* this means that all nodes @@ -286,7 +286,7 @@ Simplify boundary to contains phase roots only.""" phcache = repo._phasecache.copy() - phcache.advanceboundary(repo, targetphase, nodes) + phcache.advanceboundary(repo, tr, targetphase, nodes) repo._phasecache.replace(phcache) def retractboundary(repo, targetphase, nodes): @@ -339,7 +339,7 @@ oldphase = abs(int(oldphasestr)) # let's avoid negative index surprise if currentphase == oldphase and newphase < oldphase: tr = repo.transaction('pushkey-phase') - advanceboundary(repo, newphase, [bin(nhex)]) + advanceboundary(repo, tr, newphase, [bin(nhex)]) tr.close() return 1 elif currentphase == newphase: