# HG changeset patch # User Pierre-Yves David # Date 1407307941 25200 # Node ID c1ca472045907dfa9477cbe64fd0d626d04fa484 # Parent 616a455b02caf8cdbe34faa0f9283c0560a0e9f9 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. diff -r 616a455b02ca -r c1ca47204590 hgext/mq.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 diff -r 616a455b02ca -r c1ca47204590 mercurial/changegroup.py --- 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) diff -r 616a455b02ca -r c1ca47204590 mercurial/commands.py --- 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: diff -r 616a455b02ca -r c1ca47204590 mercurial/localrepo.py --- 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 diff -r 616a455b02ca -r c1ca47204590 mercurial/phases.py --- 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):