Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 22702:08a4e70ed183
branches: format rev as integer that is necessary for generic templater
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 02 Oct 2014 22:15:39 +0900 |
parents | cb28d2b3db0b |
children | bd6e95cb82b4 |
comparison
equal
deleted
inserted
replaced
22701:cb28d2b3db0b | 22702:08a4e70ed183 |
---|---|
1114 else: | 1114 else: |
1115 label = 'branches.inactive' | 1115 label = 'branches.inactive' |
1116 notice = _(' (inactive)') | 1116 notice = _(' (inactive)') |
1117 if tag == repo.dirstate.branch(): | 1117 if tag == repo.dirstate.branch(): |
1118 label = 'branches.current' | 1118 label = 'branches.current' |
1119 rev = str(ctx.rev()).rjust(31 - encoding.colwidth(tag)) | 1119 rev = ctx.rev() |
1120 rev = ui.label('%s:%s' % (rev, hexfunc(ctx.node())), | 1120 padsize = max(31 - len(str(rev)) - encoding.colwidth(tag), 0) |
1121 fmt = ' ' * padsize + '%d:%s' | |
1122 rev = ui.label(fmt % (rev, hexfunc(ctx.node())), | |
1121 'log.changeset changeset.%s' % ctx.phasestr()) | 1123 'log.changeset changeset.%s' % ctx.phasestr()) |
1122 labeledtag = ui.label(tag, label) | 1124 labeledtag = ui.label(tag, label) |
1123 if ui.quiet: | 1125 if ui.quiet: |
1124 ui.write("%s\n" % labeledtag) | 1126 ui.write("%s\n" % labeledtag) |
1125 else: | 1127 else: |