obsolete: add an allprecursors method mirroring allsuccessors one.
Detection of bumped changeset should use `allprecursors(<mutable>)` instead or
`allsuccessors(<immutable>)` so we need the all precursors function to exists.
--- a/mercurial/obsolete.py Mon Dec 23 16:04:51 2013 -0800
+++ b/mercurial/obsolete.py Mon Dec 23 13:36:13 2013 -0800
@@ -456,6 +456,28 @@
seen.add(suc)
remaining.add(suc)
+def allprecursors(obsstore, nodes, ignoreflags=0):
+ """Yield node for every precursors of <nodes>.
+
+ Some precursors may be unknown locally.
+
+ This is a linear yield unsuited to detecting folded changesets. It includes
+ initial nodes too."""
+
+ remaining = set(nodes)
+ seen = set(remaining)
+ while remaining:
+ current = remaining.pop()
+ yield current
+ for mark in obsstore.precursors.get(current, ()):
+ # ignore marker flagged with specified flag
+ if mark[2] & ignoreflags:
+ continue
+ suc = mark[0]
+ if suc not in seen:
+ seen.add(suc)
+ remaining.add(suc)
+
def foreground(repo, nodes):
"""return all nodes in the "foreground" of other node