obsolete: add an any successors function
This function yield every nodes which succeed to a group of nodes.
The first user will be checkheads who need to know if we push successors for
remote extra heads.
--- a/mercurial/obsolete.py Tue Jul 17 18:14:16 2012 +0200
+++ b/mercurial/obsolete.py Tue Jul 17 17:31:29 2012 +0200
@@ -285,3 +285,17 @@
for data in ctx._repo.obsstore.successors.get(ctx.node(), ()):
yield marker(ctx._repo, data)
+def anysuccessors(obsstore, node):
+ """Yield every successor of <node>
+
+ This this a linear yield unsuitable to detect splitted changeset."""
+ remaining = set([node])
+ seen = set(remaining)
+ while remaining:
+ current = remaining.pop()
+ yield current
+ for mark in obsstore.precursors.get(current, ()):
+ for suc in mark[1]:
+ if suc not in seen:
+ seen.add(suc)
+ remaining.add(suc)