hgext3rd/evolve/stablerange.py
changeset 2216 de76219b42b8
parent 2215 6d9cadc635d5
child 2217 37fa3d83f294
equal deleted inserted replaced
2215:6d9cadc635d5 2216:de76219b42b8
   426         else:
   426         else:
   427             bheads = set(bottomrevs)
   427             bheads = set(bottomrevs)
   428             parentrevs = cl.parentrevs
   428             parentrevs = cl.parentrevs
   429             parents = self._parents
   429             parents = self._parents
   430             du = bheads.difference_update
   430             du = bheads.difference_update
       
   431             reachableroots = repo.changelog.reachableroots
   431             for r in bottomrevs:
   432             for r in bottomrevs:
   432                 du(parents(r, parentrevs))
   433                 du(parents(r, parentrevs))
   433             for h in bheads:
   434             for h in bheads:
   434                 subset = cl.ancestors([h], inclusive=True)
   435                 # reachable roots is fast because is C
   435                 hrevs = [r for r in bottomrevs if r in subset]
   436                 #
       
   437                 # It is worth noting that will use this kind of filtering from
       
   438                 # "h" multiple time in a warming run. So using "ancestors" and
       
   439                 # caching that should be faster. But python code filtering on
       
   440                 # the ancestors end up being slower.
       
   441                 hrevs = reachableroots(bottomrevs[0], [h], bottomrevs, True)
   436                 start = self.depthrev(repo, h) - len(hrevs)
   442                 start = self.depthrev(repo, h) - len(hrevs)
   437                 entry = (h, start)
   443                 entry = (h, start)
   438                 result.append(entry)
   444                 result.append(entry)
   439         # top part is trivial
   445         # top part is trivial
   440         top = (rangeid[0], globalindex)
   446         top = (rangeid[0], globalindex)