##// END OF EJS Templates
obsolete: introduce a _succs class...
Boris Feld -
r33910:84f72072 default
parent child Browse files
Show More
@@ -327,6 +327,9 b' def getobsoleted(repo, tr):'
327 obsoleted.add(rev)
327 obsoleted.add(rev)
328 return obsoleted
328 return obsoleted
329
329
330 class _succs(list):
331 """small class to represent a successors with some metadata about it"""
332
330 def successorssets(repo, initialnode, closest=False, cache=None):
333 def successorssets(repo, initialnode, closest=False, cache=None):
331 """Return set of all latest successors of initial nodes
334 """Return set of all latest successors of initial nodes
332
335
@@ -445,7 +448,7 b' def successorssets(repo, initialnode, cl'
445 # case (2): end of walk.
448 # case (2): end of walk.
446 if current in repo:
449 if current in repo:
447 # We have a valid successors.
450 # We have a valid successors.
448 cache[current] = [(current,)]
451 cache[current] = [_succs((current,))]
449 else:
452 else:
450 # Final obsolete version is unknown locally.
453 # Final obsolete version is unknown locally.
451 # Do not count that as a valid successors
454 # Do not count that as a valid successors
@@ -521,13 +524,13 b' def successorssets(repo, initialnode, cl'
521 succssets = []
524 succssets = []
522 for mark in sorted(succmarkers[current]):
525 for mark in sorted(succmarkers[current]):
523 # successors sets contributed by this marker
526 # successors sets contributed by this marker
524 markss = [[]]
527 markss = [_succs()]
525 for suc in mark[1]:
528 for suc in mark[1]:
526 # cardinal product with previous successors
529 # cardinal product with previous successors
527 productresult = []
530 productresult = []
528 for prefix in markss:
531 for prefix in markss:
529 for suffix in cache[suc]:
532 for suffix in cache[suc]:
530 newss = list(prefix)
533 newss = _succs(prefix)
531 for part in suffix:
534 for part in suffix:
532 # do not duplicated entry in successors set
535 # do not duplicated entry in successors set
533 # first entry wins.
536 # first entry wins.
General Comments 0
You need to be logged in to leave comments. Login now