##// END OF EJS Templates
obsolete: add an allprecursors method mirroring allsuccessors one....
Pierre-Yves David -
r20206:cdcbe103 default
parent child Browse files
Show More
@@ -456,6 +456,28 b' def allsuccessors(obsstore, nodes, ignor'
456 456 seen.add(suc)
457 457 remaining.add(suc)
458 458
459 def allprecursors(obsstore, nodes, ignoreflags=0):
460 """Yield node for every precursors of <nodes>.
461
462 Some precursors may be unknown locally.
463
464 This is a linear yield unsuited to detecting folded changesets. It includes
465 initial nodes too."""
466
467 remaining = set(nodes)
468 seen = set(remaining)
469 while remaining:
470 current = remaining.pop()
471 yield current
472 for mark in obsstore.precursors.get(current, ()):
473 # ignore marker flagged with specified flag
474 if mark[2] & ignoreflags:
475 continue
476 suc = mark[0]
477 if suc not in seen:
478 seen.add(suc)
479 remaining.add(suc)
480
459 481 def foreground(repo, nodes):
460 482 """return all nodes in the "foreground" of other node
461 483
General Comments 0
You need to be logged in to leave comments. Login now