template: skip "Precursors" in test output when empty
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 29 May 2017 17:07:23 +0200
changeset 2496 5ed8af9c4a21
parent 2495 0db53f48db2d
child 2497 1e9b86ed78c9
template: skip "Precursors" in test output when empty This should clarify the test output a bit.
tests/test-evolve-templates.t
--- a/tests/test-evolve-templates.t	Mon May 29 16:59:59 2017 +0200
+++ b/tests/test-evolve-templates.t	Mon May 29 17:07:23 2017 +0200
@@ -12,7 +12,7 @@
   > [extensions]
   > evolve =
   > [alias]
-  > tlog = log -G -T '{node|short}\n  Precursors: {precursors}\n  Successors: {successors}\n  Fate: {obsfate_quiet}\n'
+  > tlog = log -G -T '{node|short}{if(precursors, "\n  Precursors: {precursors}")}\n  Successors: {successors}\n  Fate: {obsfate_quiet}\n'
   > EOF
 
 Test templates on amended commit
@@ -71,11 +71,9 @@
   |    Successors:
   |    Fate:
   | @  471f378eab4c
-  |/     Precursors:
-  |      Successors: [d004c8f274b9]
+  |/     Successors: [d004c8f274b9]
   |      Fate: superseed as d004c8f274b9
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
   $ hg up 'desc(A1)' --hidden
@@ -90,11 +88,9 @@
   |    Successors:
   |    Fate:
   | @  a468dc9b3633
-  |/     Precursors:
-  |      Successors: [d004c8f274b9]
+  |/     Successors: [d004c8f274b9]
   |      Fate: superseed as d004c8f274b9
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
 Precursors template should show the precursor as we force its display with
@@ -109,15 +105,12 @@
   |      Successors: [d004c8f274b9]
   |      Fate: superseed as d004c8f274b9
   | x  f137d23bb3e1
-  | |    Precursors:
   | |    Successors:
   | |    Fate: pruned
   | x  471f378eab4c
-  |/     Precursors:
-  |      Successors: [a468dc9b3633]
+  |/     Successors: [a468dc9b3633]
   |      Fate: superseed as a468dc9b3633
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
 
@@ -125,11 +118,9 @@
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg tlog
   @  d004c8f274b9
-  |    Precursors:
   |    Successors:
   |    Fate:
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
   $ hg tlog --hidden
@@ -142,15 +133,12 @@
   |      Successors: [d004c8f274b9]
   |      Fate: superseed as d004c8f274b9
   | x  f137d23bb3e1
-  | |    Precursors:
   | |    Successors:
   | |    Fate: pruned
   | x  471f378eab4c
-  |/     Precursors:
-  |      Successors: [a468dc9b3633]
+  |/     Successors: [a468dc9b3633]
   |      Fate: superseed as a468dc9b3633
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
 
@@ -255,11 +243,9 @@
   |    Successors:
   |    Fate:
   | @  471597cad322
-  |/     Precursors:
-  |      Successors: [337fec4d2edc, f257fde29c7a]
+  |/     Successors: [337fec4d2edc, f257fde29c7a]
   |      Fate: superseed as 337fec4d2edc,f257fde29c7a
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
   $ hg up f257fde29c7a
@@ -269,15 +255,12 @@
 log
   $ hg tlog
   @  f257fde29c7a
-  |    Precursors:
   |    Successors:
   |    Fate:
   o  337fec4d2edc
-  |    Precursors:
   |    Successors:
   |    Fate:
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
 Precursors template should show the precursor as we force its display with
@@ -292,11 +275,9 @@
   |    Successors:
   |    Fate:
   | x  471597cad322
-  |/     Precursors:
-  |      Successors: [337fec4d2edc, f257fde29c7a]
+  |/     Successors: [337fec4d2edc, f257fde29c7a]
   |      Fate: superseed as 337fec4d2edc,f257fde29c7a
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
 Test templates with folded commit
@@ -368,11 +349,9 @@
   |    Successors:
   |    Fate:
   | @  471f378eab4c
-  |/     Precursors:
-  |      Successors: [eb5a0daa2192]
+  |/     Successors: [eb5a0daa2192]
   |      Fate: superseed as eb5a0daa2192
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
   $ hg up 'desc(B0)' --hidden
@@ -388,15 +367,12 @@
   |    Successors:
   |    Fate:
   | @  0dec01379d3b
-  | |    Precursors:
   | |    Successors: [eb5a0daa2192]
   | |    Fate: superseed as eb5a0daa2192
   | x  471f378eab4c
-  |/     Precursors:
-  |      Successors: [eb5a0daa2192]
+  |/     Successors: [eb5a0daa2192]
   |      Fate: superseed as eb5a0daa2192
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
   $ hg up 'desc(C0)'
@@ -406,11 +382,9 @@
 log
   $ hg tlog
   @  eb5a0daa2192
-  |    Precursors:
   |    Successors:
   |    Fate:
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
 Precursors template should show both precursors as we force its display with
@@ -421,15 +395,12 @@
   |    Successors:
   |    Fate:
   | x  0dec01379d3b
-  | |    Precursors:
   | |    Successors: [eb5a0daa2192]
   | |    Fate: superseed as eb5a0daa2192
   | x  471f378eab4c
-  |/     Precursors:
-  |      Successors: [eb5a0daa2192]
+  |/     Successors: [eb5a0daa2192]
   |      Fate: superseed as eb5a0daa2192
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
 
@@ -515,11 +486,9 @@
   |      Successors:
   |      Fate:
   | @  471f378eab4c
-  |/     Precursors:
-  |      Successors: [fdf9bde5129a], [019fadeab383]
+  |/     Successors: [fdf9bde5129a], [019fadeab383]
   |      Fate: superseed as fdf9bde5129a + superseed as 019fadeab383
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
   $ hg up 'desc(A1)'
@@ -528,15 +497,12 @@
 log
   $ hg tlog
   o  019fadeab383
-  |    Precursors:
   |    Successors:
   |    Fate:
   | @  fdf9bde5129a
-  |/     Precursors:
-  |      Successors:
+  |/     Successors:
   |      Fate:
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
 Precursors template should a precursor as we force its display with --hidden
@@ -554,11 +520,9 @@
   |      Successors:
   |      Fate:
   | x  471f378eab4c
-  |/     Precursors:
-  |      Successors: [fdf9bde5129a], [65b757b745b9]
+  |/     Successors: [fdf9bde5129a], [65b757b745b9]
   |      Fate: superseed as fdf9bde5129a + superseed as 65b757b745b9
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
 Test templates with amended + folded commit
@@ -641,11 +605,9 @@
   |    Successors:
   |    Fate:
   | @  471f378eab4c
-  |/     Precursors:
-  |      Successors: [eb5a0daa2192]
+  |/     Successors: [eb5a0daa2192]
   |      Fate: superseed as eb5a0daa2192
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
   $ hg up 'desc(B0)' --hidden
@@ -658,15 +620,12 @@
   |    Successors:
   |    Fate:
   | @  0dec01379d3b
-  | |    Precursors:
   | |    Successors: [eb5a0daa2192]
   | |    Fate: superseed as eb5a0daa2192
   | x  471f378eab4c
-  |/     Precursors:
-  |      Successors: [eb5a0daa2192]
+  |/     Successors: [eb5a0daa2192]
   |      Fate: superseed as eb5a0daa2192
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
   $ hg up 'desc(B1)' --hidden
@@ -679,26 +638,21 @@
   |    Successors:
   |    Fate:
   | @  b7ea6d14e664
-  | |    Precursors:
   | |    Successors: [eb5a0daa2192]
   | |    Fate: superseed as eb5a0daa2192
   | x  471f378eab4c
-  |/     Precursors:
-  |      Successors: [eb5a0daa2192]
+  |/     Successors: [eb5a0daa2192]
   |      Fate: superseed as eb5a0daa2192
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
   $ hg up 'desc(C0)'
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg tlog
   @  eb5a0daa2192
-  |    Precursors:
   |    Successors:
   |    Fate:
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
   $ hg tlog --hidden
@@ -711,15 +665,12 @@
   | |    Successors: [eb5a0daa2192]
   | |    Fate: superseed as eb5a0daa2192
   | | x  0dec01379d3b
-  | |/     Precursors:
-  | |      Successors: [b7ea6d14e664]
+  | |/     Successors: [b7ea6d14e664]
   | |      Fate: superseed as b7ea6d14e664
   | x  471f378eab4c
-  |/     Precursors:
-  |      Successors: [eb5a0daa2192]
+  |/     Successors: [eb5a0daa2192]
   |      Fate: superseed as eb5a0daa2192
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
 
@@ -816,22 +767,18 @@
   |    Successors:
   |    Fate:
   | @  471f378eab4c
-  |/     Precursors:
-  |      Successors: [7a230b46bf61]
+  |/     Successors: [7a230b46bf61]
   |      Fate: superseed as 7a230b46bf61
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
   $ hg up 'desc(A2)'
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg tlog
   @  7a230b46bf61
-  |    Precursors:
   |    Successors:
   |    Fate:
   o  ea207398892e
-       Precursors:
        Successors:
        Fate:
   $ hg tlog --hidden
@@ -840,10 +787,8 @@
   |    Successors:
   |    Fate:
   | x  471f378eab4c
-  |/     Precursors:
-  |      Successors: [7a230b46bf61]
+  |/     Successors: [7a230b46bf61]
   |      Fate: superseed as 7a230b46bf61
   o  ea207398892e
-       Precursors:
        Successors:
        Fate: