mercurial/phases.py
changeset 33457 61714c282106
parent 33453 f6b7617a85bb
child 33458 cf694e6422f0
equal deleted inserted replaced
33456:ae052d04b89e 33457:61714c282106
   355         # Be careful to preserve shallow-copied values: do not update
   355         # Be careful to preserve shallow-copied values: do not update
   356         # phaseroots values, replace them.
   356         # phaseroots values, replace them.
   357 
   357 
   358         repo = repo.unfiltered()
   358         repo = repo.unfiltered()
   359         currentroots = self.phaseroots[targetphase]
   359         currentroots = self.phaseroots[targetphase]
       
   360         finalroots = oldroots = set(currentroots)
   360         newroots = [n for n in nodes
   361         newroots = [n for n in nodes
   361                     if self.phase(repo, repo[n].rev()) < targetphase]
   362                     if self.phase(repo, repo[n].rev()) < targetphase]
   362         if newroots:
   363         if newroots:
   363 
   364 
   364             if nullid in newroots:
   365             if nullid in newroots:
   374             updatedroots = repo.set('roots(%ln::)', aboveroots)
   375             updatedroots = repo.set('roots(%ln::)', aboveroots)
   375 
   376 
   376             finalroots = set(n for n in currentroots if repo[n].rev() <
   377             finalroots = set(n for n in currentroots if repo[n].rev() <
   377                              minnewroot)
   378                              minnewroot)
   378             finalroots.update(ctx.node() for ctx in updatedroots)
   379             finalroots.update(ctx.node() for ctx in updatedroots)
   379 
   380         if finalroots != oldroots:
   380             self._updateroots(targetphase, finalroots, tr)
   381             self._updateroots(targetphase, finalroots, tr)
       
   382             return True
       
   383         return False
   381 
   384 
   382     def filterunknown(self, repo):
   385     def filterunknown(self, repo):
   383         """remove unknown nodes from the phase boundary
   386         """remove unknown nodes from the phase boundary
   384 
   387 
   385         Nothing is lost as unknown nodes only hold data for their descendants.
   388         Nothing is lost as unknown nodes only hold data for their descendants.