# HG changeset patch # User Pierre-Yves David # Date 1350395398 -7200 # Node ID 612db9d7e76a3d96d5f01f88c05ed0cf27266a73 # Parent 46e1a4e2422527a5db3313ddb4bf9da54bfee002 obsolete: have `allsuccessors` takes a list of nodes Additional logic, used to detect mutable history troubles, will need to quickly compute successors of a whole set of changeset. diff -r 46e1a4e24225 -r 612db9d7e76a mercurial/bookmarks.py --- a/mercurial/bookmarks.py Fri Oct 19 00:30:11 2012 +0200 +++ b/mercurial/bookmarks.py Tue Oct 16 15:49:58 2012 +0200 @@ -267,7 +267,7 @@ if c.phase() > phases.public: # obsolescence marker does not apply to public changeset succs.update(obsolete.allsuccessors(repo.obsstore, - c.node())) + [c.node()])) validdests = set(repo.set('%ln::', succs)) validdests.remove(old) return new in validdests diff -r 46e1a4e24225 -r 612db9d7e76a mercurial/discovery.py --- a/mercurial/discovery.py Fri Oct 19 00:30:11 2012 +0200 +++ b/mercurial/discovery.py Tue Oct 16 15:49:58 2012 +0200 @@ -298,7 +298,7 @@ if nh in repo and repo[nh].phase() <= phases.public: newhs.add(nh) else: - for suc in obsolete.allsuccessors(repo.obsstore, nh): + for suc in obsolete.allsuccessors(repo.obsstore, [nh]): if suc != nh and suc in allfuturecommon: discardedheads.add(nh) break diff -r 46e1a4e24225 -r 612db9d7e76a mercurial/obsolete.py --- a/mercurial/obsolete.py Fri Oct 19 00:30:11 2012 +0200 +++ b/mercurial/obsolete.py Tue Oct 16 15:49:58 2012 +0200 @@ -351,11 +351,13 @@ for data in ctx._repo.obsstore.successors.get(ctx.node(), ()): yield marker(ctx._repo, data) -def allsuccessors(obsstore, node): - """Yield every successor of +def allsuccessors(obsstore, nodes): + """Yield node for every successor of . + + Some successors may be unknown locally. This is a linear yield unsuited to detecting split changesets.""" - remaining = set([node]) + remaining = set(nodes) seen = set(remaining) while remaining: current = remaining.pop()