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

login
register
mail settings
Submitter Denis Laxalde
Date March 28, 2017, 9:09 p.m.
Message ID <59177c6110f2dc3e6073.1490735342@marimba>
Download mbox | patch
Permalink /patch/19793/
State Accepted
Headers show

Comments

Denis Laxalde - March 28, 2017, 9:09 p.m.
# HG changeset patch
# User Denis Laxalde <denis@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.

Patch

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'