##// END OF EJS Templates
phase: add a transaction argument to retractboundary...
Pierre-Yves David -
r22070:c1ca4720 default
parent child Browse files
Show More
@@ -2011,7 +2011,7 b' class queue(object):'
2011 patchname = None
2011 patchname = None
2012 if rev and repo.ui.configbool('mq', 'secret', False):
2012 if rev and repo.ui.configbool('mq', 'secret', False):
2013 # if we added anything with --rev, move the secret root
2013 # if we added anything with --rev, move the secret root
2014 phases.retractboundary(repo, phases.secret, [n])
2014 phases.retractboundary(repo, tr, phases.secret, [n])
2015 self.parseseries()
2015 self.parseseries()
2016 self.applieddirty = True
2016 self.applieddirty = True
2017 self.seriesdirty = True
2017 self.seriesdirty = True
@@ -706,12 +706,12 b' def addchangegroup(repo, source, srctype'
706 # phases are going to be pushed alongside. Therefor
706 # phases are going to be pushed alongside. Therefor
707 # `targetphase` is ignored.
707 # `targetphase` is ignored.
708 phases.advanceboundary(repo, tr, phases.draft, srccontent)
708 phases.advanceboundary(repo, tr, phases.draft, srccontent)
709 phases.retractboundary(repo, phases.draft, added)
709 phases.retractboundary(repo, tr, phases.draft, added)
710 elif srctype != 'strip':
710 elif srctype != 'strip':
711 # publishing only alter behavior during push
711 # publishing only alter behavior during push
712 #
712 #
713 # strip should not touch boundary at all
713 # strip should not touch boundary at all
714 phases.retractboundary(repo, targetphase, added)
714 phases.retractboundary(repo, tr, targetphase, added)
715
715
716 # make changelog see real files again
716 # make changelog see real files again
717 cl.finalize(trp)
717 cl.finalize(trp)
@@ -4585,7 +4585,7 b' def phase(ui, repo, *revs, **opts):'
4585 olddata = repo._phasecache.getphaserevs(repo)[:]
4585 olddata = repo._phasecache.getphaserevs(repo)[:]
4586 phases.advanceboundary(repo, tr, targetphase, nodes)
4586 phases.advanceboundary(repo, tr, targetphase, nodes)
4587 if opts['force']:
4587 if opts['force']:
4588 phases.retractboundary(repo, targetphase, nodes)
4588 phases.retractboundary(repo, tr, targetphase, nodes)
4589 tr.close()
4589 tr.close()
4590 finally:
4590 finally:
4591 if tr is not None:
4591 if tr is not None:
@@ -1442,7 +1442,7 b' class localrepository(object):'
1442 # be compliant anyway
1442 # be compliant anyway
1443 #
1443 #
1444 # if minimal phase was 0 we don't need to retract anything
1444 # if minimal phase was 0 we don't need to retract anything
1445 phases.retractboundary(self, targetphase, [n])
1445 phases.retractboundary(self, tr, targetphase, [n])
1446 tr.close()
1446 tr.close()
1447 branchmap.updatecache(self.filtered('served'))
1447 branchmap.updatecache(self.filtered('served'))
1448 return n
1448 return n
@@ -229,10 +229,10 b' class phasecache(object):'
229 delroots.extend(olds - roots)
229 delroots.extend(olds - roots)
230 # declare deleted root in the target phase
230 # declare deleted root in the target phase
231 if targetphase != 0:
231 if targetphase != 0:
232 self.retractboundary(repo, targetphase, delroots)
232 self.retractboundary(repo, tr, targetphase, delroots)
233 repo.invalidatevolatilesets()
233 repo.invalidatevolatilesets()
234
234
235 def retractboundary(self, repo, targetphase, nodes):
235 def retractboundary(self, repo, tr, targetphase, nodes):
236 # Be careful to preserve shallow-copied values: do not update
236 # Be careful to preserve shallow-copied values: do not update
237 # phaseroots values, replace them.
237 # phaseroots values, replace them.
238
238
@@ -289,7 +289,7 b' def advanceboundary(repo, tr, targetphas'
289 phcache.advanceboundary(repo, tr, targetphase, nodes)
289 phcache.advanceboundary(repo, tr, targetphase, nodes)
290 repo._phasecache.replace(phcache)
290 repo._phasecache.replace(phcache)
291
291
292 def retractboundary(repo, targetphase, nodes):
292 def retractboundary(repo, tr, targetphase, nodes):
293 """Set nodes back to a phase changing other nodes phases if
293 """Set nodes back to a phase changing other nodes phases if
294 necessary.
294 necessary.
295
295
@@ -298,7 +298,7 b' def retractboundary(repo, targetphase, n'
298
298
299 Simplify boundary to contains phase roots only."""
299 Simplify boundary to contains phase roots only."""
300 phcache = repo._phasecache.copy()
300 phcache = repo._phasecache.copy()
301 phcache.retractboundary(repo, targetphase, nodes)
301 phcache.retractboundary(repo, tr, targetphase, nodes)
302 repo._phasecache.replace(phcache)
302 repo._phasecache.replace(phcache)
303
303
304 def listphases(repo):
304 def listphases(repo):
General Comments 0
You need to be logged in to leave comments. Login now