show: use filter() function to strip "tip" tag
authorYuya Nishihara <yuya@tcha.org>
Thu, 14 Jun 2018 23:22:51 +0900
changeset 38450 b45c353ebbc7
parent 38449 bc8d925342f0
child 38451 3c07e0b1f6c6
show: use filter() function to strip "tip" tag Before, an empty tag "" was inserted in place of "tip", resulting in double spaces.
mercurial/templates/map-cmdline.show
--- 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))