Patchwork [5,of,6] log: add labels to the phase template

login
register
mail settings
Submitter Jordi Gutiérrez Hermoso
Date Oct. 5, 2014, 1:05 a.m.
Message ID <0ca9afeee507dace5a2d.1412471154@Iris>
Download mbox | patch
Permalink /patch/6126/
State Accepted
Commit 9579034d9eb2e12ed0825f99ccea56e2c468ee67
Headers show

Comments

Jordi Gutiérrez Hermoso - Oct. 5, 2014, 1:05 a.m.
# HG changeset patch
# User Jordi Gutiérrez Hermoso <jordigh@octave.org>
# Date 1412459339 14400
#      Sat Oct 04 17:48:59 2014 -0400
# Node ID 0ca9afeee507dace5a2d784ee794f718468d1dc8
# Parent  e2e9f9da5f6ce85a7c5b9fee7c78755946a39f25
log: add labels to the phase template

This copies the labelled default template and just adds an extra
{phase} keyword as necessary.

Patch

diff --git a/mercurial/templates/map-cmdline.phases b/mercurial/templates/map-cmdline.phases
--- a/mercurial/templates/map-cmdline.phases
+++ b/mercurial/templates/map-cmdline.phases
@@ -1,25 +1,73 @@ 
-changeset = 'changeset:   {rev}:{node|short}\n{branches}{bookmarks}{tags}phase:       {phase}\n{parents}user:        {author}\ndate:        {date|date}\nsummary:     {desc|firstline}\n\n'
-changeset_quiet = '{rev}:{node|short}\n'
-changeset_verbose = 'changeset:   {rev}:{node|short}\n{branches}{bookmarks}{tags}{parents}user:        {author}\ndate:        {date|date}\n{files}{file_copies_switch}description:\n{desc|strip}\n\n\n'
-changeset_debug = 'changeset:   {rev}:{node}\n{branches}{bookmarks}{tags}phase:       {phase}\n{parents}{manifest}user:        {author}\ndate:        {date|date}\n{file_mods}{file_adds}{file_dels}{file_copies_switch}{extras}description:\n{desc|strip}\n\n\n'
-start_files = 'files:      '
-file = ' {file}'
-end_files = '\n'
-start_file_mods = 'files:      '
-file_mod = ' {file_mod}'
-end_file_mods = '\n'
-start_file_adds = 'files+:     '
-file_add = ' {file_add}'
-end_file_adds = '\n'
-start_file_dels = 'files-:     '
-file_del = ' {file_del}'
-end_file_dels = '\n'
-start_file_copies = 'copies:     '
-file_copy = ' {name} ({source})'
-end_file_copies = '\n'
-parent = 'parent:      {rev}:{node|formatnode}\n'
-manifest = 'manifest:    {rev}:{node}\n'
-branch = 'branch:      {branch}\n'
-tag = 'tag:         {tag}\n'
-bookmark = 'bookmark:    {bookmark}\n'
-extra = 'extra:       {key}={value|stringescape}\n'
+# Base templates. Due to name clashes with existing keywords, we have
+# to replace some keywords with 'lkeyword', for 'labelled keyword'
+changeset = '{cset}{branches}{bookmarks}{tags}{lphase}{parents}{user}{ldate}{summary}\n'
+changeset_quiet = '{node}'
+changeset_verbose = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{lfiles}{lfile_copies_switch}{description}\n'
+changeset_debug = '{fullcset}{branches}{bookmarks}{tags}{lphase}{parents}{manifest}{user}{ldate}{lfile_mods}{lfile_adds}{lfile_dels}{lfile_copies_switch}{extras}{description}\n'
+
+# File templates
+lfiles = '{if(files,
+               label("ui.note log.files",
+                     "files:       {files}\n"))}'
+
+lfile_mods = '{if(file_mods,
+                  label("ui.debug log.files",
+                        "files:       {file_mods}\n"))}'
+
+lfile_adds = '{if(file_adds,
+                  label("ui.debug log.files",
+                        "files+:      {file_adds}\n"))}'
+
+lfile_dels = '{if(file_dels,
+                  label("ui.debug log.files",
+                        "files-:      {file_dels}\n"))}'
+
+lfile_copies_switch = '{if(file_copies_switch,
+                           label("ui.note log.copies",
+                                 "copies:     {file_copies_switch
+                                               % ' {name} ({source})'}\n"))}'
+
+# General templates
+cset = '{label("log.changeset changeset.{phase}",
+               "changeset:   {rev}:{node|short}")}\n'
+
+lphase = '{label("log.phase",
+                 "phase:       {phase}")}\n'
+
+fullcset = '{label("log.changeset changeset.{phase}",
+                   "changeset:   {rev}:{node}")}\n'
+
+parent = '{label("log.parent changeset.{phase}",
+                  "parent:      {rev}:{node|formatnode}")}\n'
+
+node = '{label("log.node",
+                "{rev}:{node|short}")}\n'
+
+manifest = '{label("ui.debug log.manifest",
+                   "manifest:    {rev}:{node}")}\n'
+
+branch = '{label("log.branch",
+                 "branch:      {branch}")}\n'
+
+tag = '{label("log.tag",
+              "tag:         {tag}")}\n'
+
+bookmark = '{label("log.bookmark",
+                   "bookmark:    {bookmark}")}\n'
+
+user = '{label("log.user",
+               "user:        {author}")}\n'
+
+summary = '{label("log.summary",
+                  "summary:     {desc|firstline}")}\n'
+
+ldate = '{label("log.date",
+                "date:        {date|date}")}\n'
+
+extra = '{label("ui.debug log.extra",
+                "extra:       {key}={value|stringescape}")}\n'
+
+description = '{label("ui.note log.description",
+                       "description:")}
+               {label("ui.note log.description",
+                       "{desc|strip}")}\n\n'