changeset 28827:1e184241de51

compact: add color labels to -Tcompact
author timeless <timeless@mozdev.org>
date Fri, 08 Apr 2016 16:05:52 +0000
parents 59dd920c0ddc
children 3640c1702c43
files mercurial/templates/map-cmdline.compact tests/test-status-color.t
diffstat 2 files changed, 29 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templates/map-cmdline.compact	Fri Apr 08 22:15:06 2016 +0200
+++ b/mercurial/templates/map-cmdline.compact	Fri Apr 08 16:05:52 2016 +0000
@@ -1,12 +1,30 @@
-changeset = '{rev}{tags}{bookmarks}{parents}   {node|short}   {date|isodate}   {author|user}\n  {desc|firstline|strip}\n\n'
-changeset_quiet = '{rev}:{node|short}\n'
-changeset_verbose = '{rev}{tags}{parents}   {node|short}   {date|isodate}   {author}\n  {desc|strip}\n\n'
+ldate = '{label("log.date",
+                "{date|isodate}")}'
+
+ldesc = '{label('ui.note log.description',
+                      '{desc|strip}')}'
+ldescfirst = '{label('ui.note log.description',
+                     '{desc|firstline|strip}')}'
+
+changeset = '{lrev}{tags}{bookmarks}{parents}   {lnode}   {ldate}   {luser}\n  {ldescfirst}\n\n'
+changeset_quiet = '{lrev}:{lnode}\n'
+changeset_verbose = '{lrev}{tags}{parents}   {lnode}   {ldate}   {lauthor}\n  {ldesc}\n\n'
+lrev = '{label("log.changeset changeset.{phase}",
+              "{rev}")}'
+lnode = '{label("log.node",
+                "{node|short}")}'
+lauthor = '{label("log.user",
+                  "{author}")}'
+luser = '{label("log.user",
+                "{author|user}")}'
 start_tags = '['
-tag = '{tag},'
+tag = '{label("log.tag",
+              "{tag},")}'
 last_tag = '{tag}]'
 start_parents = ':'
-parent = '{rev},'
-last_parent = '{rev}'
+parent = '{lrev},'
+last_parent = '{lrev}'
 start_bookmarks = '['
-bookmark = '{bookmark},'
+bookmark = '{label("log.bookmark",
+                   "{bookmark},")}'
 last_bookmark = '{bookmark}]'
--- a/tests/test-status-color.t	Fri Apr 08 22:15:06 2016 +0200
+++ b/tests/test-status-color.t	Fri Apr 08 16:05:52 2016 +0000
@@ -163,6 +163,10 @@
   [log.date|date:        Thu Jan 01 00:00:00 1970 +0000]
   [log.summary|summary:     initial checkin]
   
+  $ hg log -Tcompact --color=debug
+  [log.changeset changeset.draft|0][tip]   [log.node|389aef86a55e]   [log.date|1970-01-01 00:00 +0000]   [log.user|test]
+    [ui.note log.description|initial checkin]
+  
 Labels on empty strings should not be displayed, labels on custom
 templates should be.