[PATCH 4 of 4] show: use filter() function to strip "tip" tag

Yuya Nishihara yuya at tcha.org
Sat Jun 23 05:51:41 EDT 2018


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1528986171 -32400
#      Thu Jun 14 23:22:51 2018 +0900
# Node ID 7d4982dc9d52624ebd62f249639ca596101415ca
# Parent  f2d42f1933ce7e28647f2b834c86de3369fbbe00
show: use filter() function to strip "tip" tag

Before, an empty tag "" was inserted in place of "tip", resulting in double
spaces.

diff --git a/mercurial/templates/map-cmdline.show b/mercurial/templates/map-cmdline.show
--- a/mercurial/templates/map-cmdline.show
+++ b/mercurial/templates/map-cmdline.show
@@ -15,8 +15,11 @@ cset_shortnode = '{labelcset(shortest(no
 # 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))


More information about the Mercurial-devel mailing list