changeset 38455:b45c353ebbc7

show: use filter() function to strip "tip" tag Before, an empty tag "" was inserted in place of "tip", resulting in double spaces.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 14 Jun 2018 23:22:51 +0900
parents bc8d925342f0
children 3c07e0b1f6c6
files mercurial/templates/map-cmdline.show
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templates/map-cmdline.show	Thu Jun 14 23:10:14 2018 +0900
+++ b/mercurial/templates/map-cmdline.show	Thu Jun 14 23:22:51 2018 +0900
@@ -15,8 +15,11 @@
 # Treat branch and tags specially so we don't display "default" or "tip"
 cset_namespace = '{ifeq(namespace, "branches", names_branches, ifeq(namespace, "tags", names_tags, names_others))}'
 names_branches = '{ifeq(branch, "default", "", " ({label('log.{colorname}', branch)})")}'
-names_tags = '{if(stringify(names % "{ifeq(name, 'tip', '', name)}"),
-                  " ({label('log.{colorname}', join(names % "{ifeq(name, 'tip', '', name)}", ' '))})")}'
+names_tags = '{if(filter_tags(names),
+                  " ({label('log.{colorname}', join(filter_tags(names), ' '))})")}'
 names_others = '{if(names, " ({label('log.{colorname}', join(names, ' '))})")}'
 
 cset_shortdesc = '{label("log.description", desc|firstline)}'
+
+[templatealias]
+filter_tags(names) = filter(names, ifeq(name, 'tip', '', name))