##// END OF EJS Templates
obsolete: track markers in _succs...
Boris Feld -
r33912:34e10e09 default
parent child Browse files
Show More
@@ -330,8 +330,14 b' def getobsoleted(repo, tr):'
330 class _succs(list):
330 class _succs(list):
331 """small class to represent a successors with some metadata about it"""
331 """small class to represent a successors with some metadata about it"""
332
332
333 def __init__(self, *args, **kwargs):
334 super(_succs, self).__init__(*args, **kwargs)
335 self.markers = set()
336
333 def copy(self):
337 def copy(self):
334 return _succs(self)
338 new = _succs(self)
339 new.markers = self.markers.copy()
340 return new
335
341
336 def successorssets(repo, initialnode, closest=False, cache=None):
342 def successorssets(repo, initialnode, closest=False, cache=None):
337 """Return set of all latest successors of initial nodes
343 """Return set of all latest successors of initial nodes
@@ -527,13 +533,16 b' def successorssets(repo, initialnode, cl'
527 succssets = []
533 succssets = []
528 for mark in sorted(succmarkers[current]):
534 for mark in sorted(succmarkers[current]):
529 # successors sets contributed by this marker
535 # successors sets contributed by this marker
530 markss = [_succs()]
536 base = _succs()
537 base.markers.add(mark)
538 markss = [base]
531 for suc in mark[1]:
539 for suc in mark[1]:
532 # cardinal product with previous successors
540 # cardinal product with previous successors
533 productresult = []
541 productresult = []
534 for prefix in markss:
542 for prefix in markss:
535 for suffix in cache[suc]:
543 for suffix in cache[suc]:
536 newss = prefix.copy()
544 newss = prefix.copy()
545 newss.markers.update(suffix.markers)
537 for part in suffix:
546 for part in suffix:
538 # do not duplicated entry in successors set
547 # do not duplicated entry in successors set
539 # first entry wins.
548 # first entry wins.
@@ -548,12 +557,13 b' def successorssets(repo, initialnode, cl'
548 candidate = sorted(((set(s), s) for s in succssets if s),
557 candidate = sorted(((set(s), s) for s in succssets if s),
549 key=lambda x: len(x[1]), reverse=True)
558 key=lambda x: len(x[1]), reverse=True)
550 for setversion, listversion in candidate:
559 for setversion, listversion in candidate:
551 for seenset in seen:
560 for seenset, seensuccs in seen:
552 if setversion.issubset(seenset):
561 if setversion.issubset(seenset):
562 seensuccs.markers.update(listversion.markers)
553 break
563 break
554 else:
564 else:
555 final.append(listversion)
565 final.append(listversion)
556 seen.append(setversion)
566 seen.append((setversion, listversion))
557 final.reverse() # put small successors set first
567 final.reverse() # put small successors set first
558 cache[current] = final
568 cache[current] = final
559 return cache[initialnode]
569 return cache[initialnode]
General Comments 0
You need to be logged in to leave comments. Login now