diff mercurial/templates/map-cmdline.default @ 34853:962f7df21a73

obsfate: add obsfate to default mapfile Use the verbosity aware template keyword introduced earlier. It has the nice property of being verbosity dependent but in order to customize the obsfate part, users will need to replace the lobsfate definition from default mapfile with the one using template functions (by copying the one from test-obsmarker- template.t for example). As it's a more advanced use-case, I'm more inclined to have the same code for the {obsfate} keyword, in the changeset printer and in the default mapfile for consistency. But, the definition in default mapfile could be replaced with one based on template filter to obsfate output customization if it is a big need for users.
author Boris Feld <boris.feld@octobus.net>
date Fri, 06 Oct 2017 17:53:36 +0200
parents 06b52671552b
children ec765a71bd65
line wrap: on
line diff
--- a/mercurial/templates/map-cmdline.default	Thu Oct 05 15:25:18 2017 +0200
+++ b/mercurial/templates/map-cmdline.default	Fri Oct 06 17:53:36 2017 +0200
@@ -2,10 +2,10 @@
 # to replace some keywords with 'lkeyword', for 'labelled keyword'
 
 [templates]
-changeset = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{ltroubles}{summary}\n'
+changeset = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{ltroubles}{lobsfate}{summary}\n'
 changeset_quiet = '{lnode}'
-changeset_verbose = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{ltroubles}{lfiles}{lfile_copies_switch}{description}\n'
-changeset_debug = '{fullcset}{branches}{bookmarks}{tags}{lphase}{parents}{manifest}{user}{ldate}{ltroubles}{lfile_mods}{lfile_adds}{lfile_dels}{lfile_copies_switch}{extras}{description}\n'
+changeset_verbose = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{ltroubles}{lobsfate}{lfiles}{lfile_copies_switch}{description}\n'
+changeset_debug = '{fullcset}{branches}{bookmarks}{tags}{lphase}{parents}{manifest}{user}{ldate}{ltroubles}{lobsfate}{lfile_mods}{lfile_adds}{lfile_dels}{lfile_copies_switch}{extras}{description}\n'
 
 # File templates
 lfiles = '{if(files,
@@ -76,6 +76,10 @@
 
 status = '{status} {path}\n{if(copy, "  {copy}\n")}'
 
+# Obsfate templates, it would be removed once we introduce the obsfate
+# template fragment
+lobsfate = '{if(obsfate, "{label('log.obsfate', '{obsfate % "obsfate:     {fate}\n"}')}")}'
+
 [templatealias]
 labelcset(expr) = label(separate(" ",
                                  "log.changeset",