diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -40,6 +40,7 @@ from mercurial import ( merge as mergemod, mergeutil, obsolete, + obsutil, patch, phases, registrar, @@ -1454,7 +1455,7 @@ def _computeobsoletenotrebased(repo, reb cl = repo.changelog for r in rebaseobsrevs: node = cl.node(r) - for s in obsolete.allsuccessors(repo.obsstore, [node]): + for s in obsutil.allsuccessors(repo.obsstore, [node]): try: allsuccessors[cl.rev(s)] = cl.rev(node) except LookupError: diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py --- a/mercurial/obsolete.py +++ b/mercurial/obsolete.py @@ -869,27 +869,6 @@ def successormarkers(ctx): for data in ctx.repo().obsstore.successors.get(ctx.node(), ()): yield marker(ctx.repo(), data) -def allsuccessors(obsstore, nodes, ignoreflags=0): - """Yield node for every successor of . - - Some successors may be unknown locally. - - This is a linear yield unsuited to detecting split changesets. It includes - initial nodes too.""" - remaining = set(nodes) - seen = set(remaining) - while remaining: - current = remaining.pop() - yield current - for mark in obsstore.successors.get(current, ()): - # ignore marker flagged with specified flag - if mark[2] & ignoreflags: - continue - for suc in mark[1]: - if suc not in seen: - seen.add(suc) - remaining.add(suc) - def foreground(repo, nodes): """return all nodes in the "foreground" of other node @@ -911,7 +890,7 @@ def foreground(repo, nodes): plen = len(foreground) succs = set(c.node() for c in foreground) mutable = [c.node() for c in foreground if c.mutable()] - succs.update(allsuccessors(repo.obsstore, mutable)) + succs.update(obsutil.allsuccessors(repo.obsstore, mutable)) known = (n for n in succs if n in nm) foreground = set(repo.set('%ln::', known)) return set(c.node() for c in foreground) @@ -922,6 +901,11 @@ def allprecursors(obsstore, nodes, ignor util.nouideprecwarn(movemsg, '4.3') return obsutil.allprecursors(obsstore, nodes, ignoreflags) +def allsuccessors(obsstore, nodes, ignoreflags=0): + movemsg = 'obsolete.allsuccessors moved to obsutil.allsuccessors' + util.nouideprecwarn(movemsg, '4.3') + return obsutil.allsuccessors(obsstore, nodes, ignoreflags) + def exclusivemarkers(repo, nodes): movemsg = 'obsolete.exclusivemarkers moved to obsutil.exclusivemarkers' repo.ui.deprecwarn(movemsg, '4.3') diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py --- a/mercurial/obsutil.py +++ b/mercurial/obsutil.py @@ -57,6 +57,27 @@ def allprecursors(obsstore, nodes, ignor seen.add(suc) remaining.add(suc) +def allsuccessors(obsstore, nodes, ignoreflags=0): + """Yield node for every successor of . + + Some successors may be unknown locally. + + This is a linear yield unsuited to detecting split changesets. It includes + initial nodes too.""" + remaining = set(nodes) + seen = set(remaining) + while remaining: + current = remaining.pop() + yield current + for mark in obsstore.successors.get(current, ()): + # ignore marker flagged with specified flag + if mark[2] & ignoreflags: + continue + for suc in mark[1]: + if suc not in seen: + seen.add(suc) + remaining.add(suc) + def _filterprunes(markers): """return a set with no prune markers""" return set(m for m in markers if m[1])