Patchwork [3,of,5,V4] templates-default: factor out definition of changeset labels

login
register
mail settings
Submitter Denis Laxalde
Date Jan. 3, 2017, 12:54 p.m.
Message ID <412f8e24f48c8f7006f8.1483448077@sh77.tls.logilab.fr>
Download mbox | patch
Permalink /patch/18083/
State Accepted
Headers show

Comments

Denis Laxalde - Jan. 3, 2017, 12:54 p.m.
# HG changeset patch
# User Denis Laxalde <denis.laxalde@logilab.fr>
# Date 1483446329 -3600
#      Tue Jan 03 13:25:29 2017 +0100
# Node ID 412f8e24f48c8f7006f826a3eeb41f9521c53e4f
# Parent  7a01933ed8be3b286a0bbd666d46e7de3efa2d67
# EXP-Topic evolve-ui
templates-default: factor out definition of changeset labels

This is redundant for normal and debug mode and prepares extension of this
list that should effect both modes.
Pierre-Yves David - Jan. 4, 2017, 4:12 p.m.
On 01/03/2017 01:54 PM, Denis Laxalde wrote:
> # HG changeset patch
> # User Denis Laxalde <denis.laxalde@logilab.fr>
> # Date 1483446329 -3600
> #      Tue Jan 03 13:25:29 2017 +0100
> # Node ID 412f8e24f48c8f7006f826a3eeb41f9521c53e4f
> # Parent  7a01933ed8be3b286a0bbd666d46e7de3efa2d67
> # EXP-Topic evolve-ui
> templates-default: factor out definition of changeset labels
>
> This is redundant for normal and debug mode and prepares extension of this
> list that should effect both modes.

I've taken patch 1-3 under the assumption that:

   "Given that one cannot be exposed to trouble without using feature 
marked as experimental, we don't guarantee BC on the 'trouble' wording 
and it might change in the future."

If another reviewer object to the above sentence, please speak out 
before the 4.1 release.


Patch 2 only tests case with single trouble affecting a changesets, can 
you follow up with another cases that tests multiple troubles on a 
single changesets?

>
> 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
> @@ -28,13 +28,14 @@ lfile_copies_switch = '{if(file_copies_s
>                                                 % ' {name} ({source})'}\n"))}'
>
>  # General templates
> -cset = '{label("log.changeset changeset.{phase}",
> +_cset_labels = 'log.changeset changeset.{phase}'
> +cset = '{label("{_cset_labels}",
>                 "changeset:   {rev}:{node|short}")}\n'
>
>  lphase = '{label("log.phase",
>                   "phase:       {phase}")}\n'
>
> -fullcset = '{label("log.changeset changeset.{phase}",
> +fullcset = '{label("{_cset_labels}",
>                     "changeset:   {rev}:{node}")}\n'
>
>  parent = '{label("log.parent changeset.{phase}",
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

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
@@ -28,13 +28,14 @@  lfile_copies_switch = '{if(file_copies_s
                                                % ' {name} ({source})'}\n"))}'
 
 # General templates
-cset = '{label("log.changeset changeset.{phase}",
+_cset_labels = 'log.changeset changeset.{phase}'
+cset = '{label("{_cset_labels}",
                "changeset:   {rev}:{node|short}")}\n'
 
 lphase = '{label("log.phase",
                  "phase:       {phase}")}\n'
 
-fullcset = '{label("log.changeset changeset.{phase}",
+fullcset = '{label("{_cset_labels}",
                    "changeset:   {rev}:{node}")}\n'
 
 parent = '{label("log.parent changeset.{phase}",