Mercurial > hg-stable
changeset 38300:a9de1d28681c
show: stringify filtered list of tags before testing emptiness
`names % "{ifeq(name, 'tip', '', name)}"}"` may return [''], which shouldn't
be falsy, but it is thanks to a templater bug. This patch converts [''] to ''
before testing truthness.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 12 Jun 2018 23:17:38 +0900 |
parents | 0fe65bb7e160 |
children | f9c426385853 |
files | mercurial/templates/map-cmdline.show |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/templates/map-cmdline.show Sat Mar 24 18:03:23 2018 +0900 +++ b/mercurial/templates/map-cmdline.show Tue Jun 12 23:17:38 2018 +0900 @@ -15,7 +15,8 @@ # 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(names % "{ifeq(name, 'tip', '', name)}", " ({label('log.{colorname}', join(names % "{ifeq(name, 'tip', '', name)}", ' '))})")}' +names_tags = '{if(stringify(names % "{ifeq(name, 'tip', '', name)}"), + " ({label('log.{colorname}', join(names % "{ifeq(name, 'tip', '', name)}", ' '))})")}' names_others = '{if(names, " ({label('log.{colorname}', join(names, ' '))})")}' cset_shortdesc = '{label("log.description", desc|firstline)}'