# HG changeset patch # User Matt Mackall # Date 2013-11-21 21:08:30 # Node ID d4838302305c506fa6dff5f70b41fbb6a54dc0ef # Parent 43e872a35f8a5cc2d460526bbd894b1d76afc85b # Parent faa4b3fc4197e5ba6a6051adf5632bfd39ad5b9d merge with stable diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py --- a/mercurial/templatekw.py +++ b/mercurial/templatekw.py @@ -188,6 +188,7 @@ def showbranches(**args): branch = args['ctx'].branch() if branch != 'default': return showlist('branch', [branch], plural='branches', **args) + return showlist('branch', [], plural='branches', **args) def showbookmarks(**args): """:bookmarks: List of strings. Any bookmarks associated with the diff --git a/tests/test-command-template.t b/tests/test-command-template.t --- a/tests/test-command-template.t +++ b/tests/test-command-template.t @@ -1621,3 +1621,8 @@ Test recursive evaluation: {rev} $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n' test 0 + +Test branches inside if statement: + + $ hg log -r 0 --template '{if(branches, "yes", "no")}\n' + no