changeset 20079:d4838302305c

merge with stable
author Matt Mackall <mpm@selenic.com>
date Thu, 21 Nov 2013 15:08:30 -0600
parents 43e872a35f8a (current diff) faa4b3fc4197 (diff)
children c845b1a95eed
files mercurial/templatekw.py tests/test-command-template.t
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templatekw.py	Thu Nov 21 11:49:31 2013 -0600
+++ b/mercurial/templatekw.py	Thu Nov 21 15:08:30 2013 -0600
@@ -188,6 +188,7 @@
     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
--- a/tests/test-command-template.t	Thu Nov 21 11:49:31 2013 -0600
+++ b/tests/test-command-template.t	Thu Nov 21 15:08:30 2013 -0600
@@ -1621,3 +1621,8 @@
   {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