# HG changeset patch # User Anton Shestakov # Date 1587662138 -28800 # Node ID b117e47326562b228510adf88ab5962c7276bf4e # Parent a73cdef2e33f25ba34a6e80c9b36e07af18db4d9 obshistory: add _originmarkers() function to be used for obslog --origin diff -r a73cdef2e33f -r b117e4732656 hgext3rd/evolve/obshistory.py --- a/hgext3rd/evolve/obshistory.py Fri May 08 04:02:22 2020 +0200 +++ b/hgext3rd/evolve/obshistory.py Fri Apr 24 01:15:38 2020 +0800 @@ -192,6 +192,24 @@ else: stack.append((prednode, path + (marker,))) +def _originmarkers(repo, ctx, filternonlocal): + predecessors = repo.obsstore.predecessors + successors = repo.obsstore.successors + if filternonlocal: + r = predecessorsandmarkers(repo, ctx.node()) + for (nodes, markers) in sorted(groupbyfoldid(r)): + yield (nodes, markers) + else: + markers = predecessors.get(ctx.node(), ()) + data = (((marker[0],), (marker,)) for marker in markers) + for (nodes, markers) in sorted(groupbyfoldid(data)): + yield (nodes, markers) + + # finding prune markers + for marker in successors.get(ctx.node(), ()): + if not marker[1]: + yield ((), (marker,)) + def _nodesandmarkers(repo, ctx, filternonlocal): if filternonlocal: r = obsutil.successorsandmarkers(repo, ctx)