This is an archive of the discontinued Mercurial Phabricator instance.

show: Get rid of extraneous space if `tip` also has other bookmarks
AbandonedPublic

Authored by tom.prince on May 23 2018, 3:47 AM.

Details

Reviewers
None
Group Reviewers
hg-reviewers

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

tom.prince created this revision.May 23 2018, 3:47 AM
tom.prince abandoned this revision.May 23 2018, 4:09 AM
yuja added a subscriber: yuja.May 23 2018, 8:41 AM

-names_tags = '{if(names % "{ifeq(name, 'tip', '', name)}", " ({label('log.{colorname}', join(names % "{ifeq(name, 'tip', '', name)}", ' '))})")}'
+names_tags = '{if(names % "{ifeq(name, 'tip', '', name)}", " ({label('log.{colorname}', separate(names % "{ifeq(name, 'tip', '', name)}", ' '))})")}'

separate() can't be used here since it takes non-list arguments.

separate(sep, arg1, arg2, ...)

What we can do for now is to move the separator to the inner loop, and
strip the leading/trailing separator.

strip(names % "{ifeq(..., "{name} ")}")

Maybe we'll need a function to filter out empty values?