[PATCH 4 of 6 V2] templates: shorten definition of changeset labels in command-line style

Denis Laxalde denis at laxalde.org
Tue Mar 28 17:09:02 EDT 2017


# HG changeset patch
# User Denis Laxalde <denis at laxalde.org>
# Date 1490733525 -7200
#      Tue Mar 28 22:38:45 2017 +0200
# Node ID 59177c6110f2dc3e60730b00d54738528071b8ed
# Parent  b331a0451cdb6225f4763e6f32353127f6b4d2bc
# Available At https://bitbucket.org/dlax/hg-work
#              hg pull https://bitbucket.org/dlax/hg-work -r 59177c6110f2
# EXP-Topic obsolete-ui
templates: shorten definition of changeset labels in command-line style

We'll add more labels and the line is already quite long, so let's define a
variable to hold all evolution "troubles" labels.

diff --git a/mercurial/templates/map-cmdline.default b/mercurial/templates/map-cmdline.default
--- a/mercurial/templates/map-cmdline.default
+++ b/mercurial/templates/map-cmdline.default
@@ -29,7 +29,8 @@ lfile_copies_switch = '{if(file_copies_s
 
 # General templates
 _trouble_label = 'trouble.{trouble}'
-_cset_labels = '{separate(" ", "log.changeset", "changeset.{phase}", "{if(troubles, "changeset.troubled {troubles%_trouble_label}")}")}'
+_troubles_labels = '{if(troubles, "changeset.troubled {troubles%_trouble_label}")}'
+_cset_labels = '{separate(" ", "log.changeset", "changeset.{phase}", "{_troubles_labels}")}'
 cset = '{label("{_cset_labels}",
                "changeset:   {rev}:{node|short}")}\n'
 


More information about the Mercurial-devel mailing list