Patchwork [2,of,4] tests: make custom templates that use {whyunstable} terser

login
register
mail settings
Submitter Anton Shestakov
Date April 15, 2018, 12:37 p.m.
Message ID <bf715ddd88d1e4b0d3bd.1523795860@neuro>
Download mbox | patch
Permalink /patch/31082/
State Accepted
Headers show

Comments

Anton Shestakov - April 15, 2018, 12:37 p.m.
# HG changeset patch
# User Anton Shestakov <av6@dwimlabs.net>
# Date 1523788642 -28800
#      Sun Apr 15 18:37:22 2018 +0800
# Node ID bf715ddd88d1e4b0d3bd72d0f7ab6398662096ed
# Parent  5b7426809d1df5b486205c87321c9db59e5d1e74
tests: make custom templates that use {whyunstable} terser

These templates demonstrate that {whyunstable} is fully template-friendly, but
they don't need to produce such long lines of output.

Patch

diff --git a/tests/test-obsolete-divergent.t b/tests/test-obsolete-divergent.t
--- a/tests/test-obsolete-divergent.t
+++ b/tests/test-obsolete-divergent.t
@@ -723,10 +723,10 @@  Use scmutil.cleanupnodes API to create d
 
   $ hg log -r 1a2a9b5b0030 -T '{whyunstable}\n'
   content-divergent: 4:70d5a63ca112 (draft) predecessor a178212c3433
-  $ hg log -r 1a2a9b5b0030 -T '{whyunstable%"{instability}:{divergentnodes} {reason} {node}\n"}'
-  content-divergent: 4:70d5a63ca112 (draft) predecessor a178212c3433c4e77b573f6011e29affb8aefa33
-  $ hg log -r 1a2a9b5b0030 -T '{whyunstable%"{instability}:{divergentnodes % " {node} ({phase})"} {reason} {node}\n"}'
-  content-divergent: 70d5a63ca112acb3764bc1d7320ca90ea688d671 (draft) predecessor a178212c3433c4e77b573f6011e29affb8aefa33
+  $ hg log -r 1a2a9b5b0030 -T '{whyunstable % "{instability}:{divergentnodes} {reason} {node|shortest}\n"}'
+  content-divergent: 4:70d5a63ca112 (draft) predecessor a178
+  $ hg log -r 1a2a9b5b0030 -T '{whyunstable % "{instability}:{divergentnodes % " {node|shortest} ({phase})"} {reason} {node|shortest}\n"}'
+  content-divergent: 70d5 (draft) predecessor a178
 
 #if serve
 
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -1049,9 +1049,9 @@  test whyunstable template keyword
   $ hg log -r 50c51b361e60 -T '{whyunstable}\n'
   orphan: obsolete parent 3de5eca88c00
   phase-divergent: immutable predecessor 245bde4270cd
-  $ hg log -r 50c51b361e60 -T '{whyunstable%"{instability}: {reason} {node}\n"}'
-  orphan: obsolete parent 3de5eca88c00aa039da7399a220f4a5221faa585
-  phase-divergent: immutable predecessor 245bde4270cd1072a27757984f9cda8ba26f08ca
+  $ hg log -r 50c51b361e60 -T '{whyunstable % "{instability}: {reason} {node|shortest}\n"}'
+  orphan: obsolete parent 3de5
+  phase-divergent: immutable predecessor 245b
 
 #if serve