diff mercurial/commands.py @ 22705:d4869b280cd6

branches: include active, closed and current flags in template output
author Yuya Nishihara <yuya@tcha.org>
date Thu, 02 Oct 2014 23:26:02 +0900
parents 386339ffe421
children b17fd992d606
line wrap: on
line diff
--- a/mercurial/commands.py	Thu Oct 02 23:13:56 2014 +0900
+++ b/mercurial/commands.py	Thu Oct 02 23:26:02 2014 +0900
@@ -1116,7 +1116,8 @@
         else:
             label = 'branches.inactive'
             notice = _(' (inactive)')
-        if tag == repo.dirstate.branch():
+        current = (tag == repo.dirstate.branch())
+        if current:
             label = 'branches.current'
 
         fm.startitem()
@@ -1126,6 +1127,7 @@
         fmt = ' ' * padsize + ' %d:%s'
         fm.condwrite(not ui.quiet, 'rev node', fmt, rev, hexfunc(ctx.node()),
                      label='log.changeset changeset.%s' % ctx.phasestr())
+        fm.data(active=isactive, closed=not isopen, current=current)
         if not ui.quiet:
             fm.plain(notice)
         fm.plain('\n')