diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -2011,7 +2011,7 @@ class queue(object): 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 --git a/mercurial/changegroup.py b/mercurial/changegroup.py --- a/mercurial/changegroup.py +++ b/mercurial/changegroup.py @@ -706,12 +706,12 @@ def addchangegroup(repo, source, srctype # 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 --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -4585,7 +4585,7 @@ def phase(ui, repo, *revs, **opts): 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 --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1442,7 +1442,7 @@ class localrepository(object): # 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 --git a/mercurial/phases.py b/mercurial/phases.py --- a/mercurial/phases.py +++ b/mercurial/phases.py @@ -229,10 +229,10 @@ class phasecache(object): 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 @@ def advanceboundary(repo, tr, targetphas 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 @@ def retractboundary(repo, targetphase, n 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):