--- a/hgext3rd/evolve/templatekw.py Sat Nov 10 23:54:46 2018 -0500
+++ b/hgext3rd/evolve/templatekw.py Mon Nov 19 01:41:36 2018 +0000
@@ -41,44 +41,7 @@
return templatekw.showlist('trouble', ctx.instabilities(), args,
plural='troubles')
-if util.safehasattr(templatekw, 'showpredecessors'):
- templatekw.keywords["precursors"] = templatekw.showpredecessors
-else:
- # for version <= hg4.3
- def closestprecursors(repo, nodeid):
- """ Yield the list of next precursors pointing on visible changectx nodes
- """
-
- precursors = repo.obsstore.predecessors
- stack = [nodeid]
- seen = set(stack)
-
- while stack:
- current = stack.pop()
- currentpreccs = precursors.get(current, ())
-
- for prec in currentpreccs:
- precnodeid = prec[0]
-
- # Basic cycle protection
- if precnodeid in seen:
- continue
- seen.add(precnodeid)
-
- if precnodeid in repo:
- yield precnodeid
- else:
- stack.append(precnodeid)
-
- @eh.templatekw("precursors")
- def shownextvisibleprecursors(repo, ctx, **args):
- """Returns a string containing the list of the closest precursors
- """
- precursors = sorted(closestprecursors(repo, ctx.node()))
- precursors = [node.hex(p) for p in precursors]
-
- return templatekw._hybrid(None, precursors, lambda x: {'precursor': x},
- lambda d: d['precursor'][:12])
+templatekw.keywords["precursors"] = templatekw.showpredecessors
def closestsuccessors(repo, nodeid):
""" returns the closest visible successors sets instead.