# HG changeset patch # User Yuya Nishihara # Date 1424265455 -32400 # Node ID d091f62be5ae5ec541fd17a214ca79abbb4b4f29 # Parent 75a2df2bbde8d4e27b6492a3dd2290bfad230b1e 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. diff -r 75a2df2bbde8 -r d091f62be5ae mercurial/templatekw.py --- 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.""" diff -r 75a2df2bbde8 -r d091f62be5ae tests/test-command-template.t --- 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