obslog: support --all with --no-graph
authorAnton Shestakov <av6@dwimlabs.net>
Sun, 29 Mar 2020 17:41:48 +0700
changeset 5309 9923c6d6f0a8
parent 5308 0329246c70f3
child 5310 6d0d9ba04a1d
obslog: support --all with --no-graph
hgext3rd/evolve/obshistory.py
tests/test-evolve-obshistory-split.t
--- a/hgext3rd/evolve/obshistory.py	Sun Mar 29 17:21:56 2020 +0700
+++ b/hgext3rd/evolve/obshistory.py	Sun Mar 29 17:41:48 2020 +0700
@@ -446,12 +446,14 @@
     """
     fm = ui.formatter(b'debugobshistory', pycompat.byteskwargs(opts))
     predecessors = repo.obsstore.predecessors
+    successors = repo.obsstore.successors
     nodec = repo.changelog.node
     unfi = repo.unfiltered()
     nodes = [nodec(r) for r in revs]
     seen = set(nodes)
     toshow = []
 
+    walksuccessors = opts and opts.get('all')
     filternonlocal = opts and opts.get('filternonlocal')
     includediff = opts and opts.get('patch')
 
@@ -471,6 +473,13 @@
                 seen.add(p[0])
                 nodes.append(p[0])
 
+        if walksuccessors:
+            for successor in successors.get(ctxnode, ()):
+                for s in successor[1]:
+                    if s not in seen:
+                        seen.add(s)
+                        nodes.append(s)
+
     for ctx in toshow:
         displaynode(fm, unfi, ctx.node())
 
--- a/tests/test-evolve-obshistory-split.t	Sun Mar 29 17:21:56 2020 +0700
+++ b/tests/test-evolve-obshistory-split.t	Sun Mar 29 17:41:48 2020 +0700
@@ -258,6 +258,10 @@
       note: testing split
       (No patch available, context is not local)
   
+  337fec4d2edc (1) A0
+  
   $ hg obslog -R $TESTTMP/server --no-graph -f --all --patch tip
   f257fde29c7a (2) A0
   
+  337fec4d2edc (1) A0
+