equal
deleted
inserted
replaced
325 continue |
325 continue |
326 if set(succsmarkers(node) or []).issubset(addedmarkers): |
326 if set(succsmarkers(node) or []).issubset(addedmarkers): |
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 |
333 The successors set of a changeset A are the group of revisions that succeed |
336 The successors set of a changeset A are the group of revisions that succeed |
334 A. It succeeds A as a consistent whole, each revision being only a partial |
337 A. It succeeds A as a consistent whole, each revision being only a partial |
443 stackedset.remove(toproceed.pop()) |
446 stackedset.remove(toproceed.pop()) |
444 elif case2condition: |
447 elif case2condition: |
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 |
452 cache[current] = [] |
455 cache[current] = [] |
453 else: |
456 else: |
519 # duplicated entry and successors set that are strict subset of |
522 # duplicated entry and successors set that are strict subset of |
520 # another one. |
523 # another one. |
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. |
534 if part not in newss: |
537 if part not in newss: |
535 newss.append(part) |
538 newss.append(part) |