mercurial/phases.py
changeset 22070 c1ca47204590
parent 22069 616a455b02ca
child 22079 5dcc58649b1a
equal deleted inserted replaced
22069:616a455b02ca 22070:c1ca47204590
   227                 self._updateroots(phase, roots)
   227                 self._updateroots(phase, roots)
   228                 # some roots may need to be declared for lower phases
   228                 # some roots may need to be declared for lower phases
   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 
   239         repo = repo.unfiltered()
   239         repo = repo.unfiltered()
   240         currentroots = self.phaseroots[targetphase]
   240         currentroots = self.phaseroots[targetphase]
   287     Simplify boundary to contains phase roots only."""
   287     Simplify boundary to contains phase roots only."""
   288     phcache = repo._phasecache.copy()
   288     phcache = repo._phasecache.copy()
   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 
   296     This function move boundary *backward* this means that all nodes
   296     This function move boundary *backward* this means that all nodes
   297     are set in the target phase or kept in a *higher* phase.
   297     are set in the target phase or kept in a *higher* phase.
   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):
   305     """List phases root for serialization over pushkey"""
   305     """List phases root for serialization over pushkey"""
   306     keys = {}
   306     keys = {}