Mercurial > hg
diff tests/test-obsolete-divergent.t @ 34847:e27f1f04c2cf
templatekw: introduce obsfate keyword
Introduce an obsfate printer that uses all helpers functions defined in
obsutil to get all the obsfate-related data and format a string according to
the current format in test-obsmarker-template.t.
Then, introduce an obsfate templatekw that uses the obsfateprinter to return a
list of strings.
The goal is not to replace existing obsfate template functions but to propose
a default, good-enough and easily usable obsfate definition for end-users that
don't want to customize it. Such output would ultimately get included in the
default log output.
Here are some output examples for a commit amended:
rewritten using amend as 5:a9b1f8652753 by test (at 1970-01-01 00:00 +0000)
Next patches will make the output dependent on the verbosity.
Exemple of use-cases:
For having the obsfate on a single-line between brackets:
{if(obsfate, " [{join(obsfate, "; ")}]")}
For having the obsfate in several lines:
{if(obsfate, "{obsfate % " Obsfate: {fate}\n"}")}
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Thu, 05 Oct 2017 17:42:56 +0200 |
parents | ecc96506c49d |
children | 62a4ccf9784a |
line wrap: on
line diff
--- a/tests/test-obsolete-divergent.t Tue Oct 10 02:25:03 2017 +0530 +++ b/tests/test-obsolete-divergent.t Thu Oct 05 17:42:56 2017 +0200 @@ -7,7 +7,7 @@ $ cat >> $HGRCPATH << EOF > [ui] - > logtemplate = {rev}:{node|short} {desc}\n + > logtemplate = {rev}:{node|short} {desc}{if(obsfate, " [{join(obsfate, "; ")}]")}\n > [experimental] > stabilization=createmarkers > [extensions] @@ -66,7 +66,7 @@ | | o 2:82623d38b9ba A_1 |/ - | x 1:007dc284c1f8 A_0 + | x 1:007dc284c1f8 A_0 [rewritten as 2:82623d38b9ba by test (at 1970-01-01 00:00 +0000); rewritten as 3:392fd25390da by test (at 1970-01-01 00:00 +0000)] |/ @ 0:d20a80d4def3 base @@ -127,11 +127,11 @@ $ hg log -G --hidden @ 4:01f36c5a8fda A_3 | - | x 3:392fd25390da A_2 + | x 3:392fd25390da A_2 [rewritten as 4:01f36c5a8fda by test (at 1970-01-01 00:00 +0000)] |/ | o 2:82623d38b9ba A_1 |/ - | x 1:007dc284c1f8 A_0 + | x 1:007dc284c1f8 A_0 [rewritten as 2:82623d38b9ba by test (at 1970-01-01 00:00 +0000); rewritten as 3:392fd25390da by test (at 1970-01-01 00:00 +0000)] |/ o 0:d20a80d4def3 base @@ -185,7 +185,7 @@ | | o 2:82623d38b9ba A_1 |/ - | x 1:007dc284c1f8 A_0 + | x 1:007dc284c1f8 A_0 [rewritten as 2:82623d38b9ba by test (at 1970-01-01 00:00 +0000); rewritten as 3:392fd25390da by test (at 1970-01-01 00:00 +0000)] |/ @ 0:d20a80d4def3 base @@ -259,11 +259,11 @@ $ hg log -G --hidden @ 4:01f36c5a8fda A_3 | - | x 3:392fd25390da A_2 + | x 3:392fd25390da A_2 [rewritten as 4:01f36c5a8fda by test (at 1970-01-01 00:00 +0000)] |/ - | x 2:82623d38b9ba A_1 + | x 2:82623d38b9ba A_1 [rewritten as 4:01f36c5a8fda by test (at 1970-01-01 00:00 +0000)] |/ - | x 1:007dc284c1f8 A_0 + | x 1:007dc284c1f8 A_0 [rewritten as 2:82623d38b9ba by test (at 1970-01-01 00:00 +0000); rewritten as 3:392fd25390da by test (at 1970-01-01 00:00 +0000)] |/ o 0:d20a80d4def3 base @@ -309,7 +309,7 @@ | | o 2:82623d38b9ba A_1 |/ - | x 1:007dc284c1f8 A_0 + | x 1:007dc284c1f8 A_0 [split as 2:82623d38b9ba, 3:392fd25390da by test (at 1970-01-01 00:00 +0000)] |/ @ 0:d20a80d4def3 base @@ -361,15 +361,15 @@ $ hg log -G --hidden @ 6:e442cfc57690 A_5 | - | x 5:6a411f0d7a0a A_4 + | x 5:6a411f0d7a0a A_4 [rewritten as 6:e442cfc57690 by test (at 1970-01-01 00:00 +0000)] |/ | o 4:01f36c5a8fda A_3 |/ - | x 3:392fd25390da A_2 + | x 3:392fd25390da A_2 [rewritten as 5:6a411f0d7a0a by test (at 1970-01-01 00:00 +0000)] |/ - | x 2:82623d38b9ba A_1 + | x 2:82623d38b9ba A_1 [rewritten as 4:01f36c5a8fda by test (at 1970-01-01 00:00 +0000)] |/ - | x 1:007dc284c1f8 A_0 + | x 1:007dc284c1f8 A_0 [split as 2:82623d38b9ba, 3:392fd25390da by test (at 1970-01-01 00:00 +0000)] |/ o 0:d20a80d4def3 base @@ -437,19 +437,19 @@ |/ | o 8:7ae126973a96 A_7 |/ - | x 7:3750ebee865d B_0 + | x 7:3750ebee865d B_0 [rewritten as 3:392fd25390da by test (at 1970-01-01 00:00 +0000)] | | - | x 6:e442cfc57690 A_5 + | x 6:e442cfc57690 A_5 [rewritten as 10:bed64f5d2f5a by test (at 1970-01-01 00:00 +0000); split as 8:7ae126973a96, 9:14608b260df8 by test (at 1970-01-01 00:00 +0000)] |/ - | x 5:6a411f0d7a0a A_4 + | x 5:6a411f0d7a0a A_4 [rewritten as 6:e442cfc57690 by test (at 1970-01-01 00:00 +0000)] |/ | o 4:01f36c5a8fda A_3 |/ - | x 3:392fd25390da A_2 + | x 3:392fd25390da A_2 [rewritten as 5:6a411f0d7a0a by test (at 1970-01-01 00:00 +0000)] |/ - | x 2:82623d38b9ba A_1 + | x 2:82623d38b9ba A_1 [rewritten as 4:01f36c5a8fda by test (at 1970-01-01 00:00 +0000)] |/ - | x 1:007dc284c1f8 A_0 + | x 1:007dc284c1f8 A_0 [split as 2:82623d38b9ba, 3:392fd25390da by test (at 1970-01-01 00:00 +0000)] |/ @ 0:d20a80d4def3 base @@ -535,25 +535,25 @@ $ hg log -G --hidden o 11:a139f71be9da A_A | - | x 10:bed64f5d2f5a A_9 + | x 10:bed64f5d2f5a A_9 [rewritten as 11:a139f71be9da by test (at 1970-01-01 00:00 +0000)] |/ - | x 9:14608b260df8 A_8 + | x 9:14608b260df8 A_8 [rewritten as 11:a139f71be9da by test (at 1970-01-01 00:00 +0000)] |/ - | x 8:7ae126973a96 A_7 + | x 8:7ae126973a96 A_7 [rewritten as 11:a139f71be9da by test (at 1970-01-01 00:00 +0000)] |/ - | x 7:3750ebee865d B_0 + | x 7:3750ebee865d B_0 [rewritten as 3:392fd25390da by test (at 1970-01-01 00:00 +0000)] | | - | x 6:e442cfc57690 A_5 + | x 6:e442cfc57690 A_5 [rewritten as 10:bed64f5d2f5a by test (at 1970-01-01 00:00 +0000); split as 8:7ae126973a96, 9:14608b260df8 by test (at 1970-01-01 00:00 +0000)] |/ - | x 5:6a411f0d7a0a A_4 + | x 5:6a411f0d7a0a A_4 [rewritten as 6:e442cfc57690 by test (at 1970-01-01 00:00 +0000)] |/ | o 4:01f36c5a8fda A_3 |/ - | x 3:392fd25390da A_2 + | x 3:392fd25390da A_2 [rewritten as 5:6a411f0d7a0a by test (at 1970-01-01 00:00 +0000)] |/ - | x 2:82623d38b9ba A_1 + | x 2:82623d38b9ba A_1 [rewritten as 4:01f36c5a8fda by test (at 1970-01-01 00:00 +0000)] |/ - | x 1:007dc284c1f8 A_0 + | x 1:007dc284c1f8 A_0 [split as 2:82623d38b9ba, 3:392fd25390da by test (at 1970-01-01 00:00 +0000)] |/ @ 0:d20a80d4def3 base