Mercurial > evolve
changeset 5298:b117e4732656
obshistory: add _originmarkers() function to be used for obslog --origin
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Fri, 24 Apr 2020 01:15:38 +0800 |
parents | a73cdef2e33f |
children | 2d48fc2c47fc |
files | hgext3rd/evolve/obshistory.py |
diffstat | 1 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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)