changeset 5263:9923c6d6f0a8

obslog: support --all with --no-graph
author Anton Shestakov <av6@dwimlabs.net>
date Sun, 29 Mar 2020 17:41:48 +0700
parents 0329246c70f3
children 6d0d9ba04a1d
files hgext3rd/evolve/obshistory.py tests/test-evolve-obshistory-split.t
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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
+