templatekw: fix {join(bookmarks, sep)} to always show associated bookmarks
The default joinfmt, "x.values()[0]", can't be used here because it picks
either 'bookmark' or 'current' randomly.
I got wrong result with PYTHONHASHSEED=1 on my amd64 machine.
--- a/mercurial/templatekw.py Wed Feb 18 22:10:17 2015 +0900
+++ b/mercurial/templatekw.py Wed Feb 18 22:17:35 2015 +0900
@@ -202,7 +202,7 @@
current = repo._bookmarkcurrent
c = [{'bookmark': x, 'current': current} for x in bookmarks]
f = _showlist('bookmark', bookmarks, **args)
- return _hybrid(f, c)
+ return _hybrid(f, c, lambda x: x['bookmark'])
def showchildren(**args):
""":children: List of strings. The children of the changeset."""
--- a/tests/test-command-template.t Wed Feb 18 22:10:17 2015 +0900
+++ b/tests/test-command-template.t Wed Feb 18 22:17:35 2015 +0900
@@ -2381,6 +2381,11 @@
2
1
0
+ $ hg book -r1 baz
+ $ hg log --template "{rev} {join(bookmarks, ' ')}\n"
+ 2 bar foo
+ 1 baz
+ 0
Test stringify on sub expressions