comparison mercurial/commands.py @ 22775:b59c2c8c45df

bookmarks: split ui.write() so that it can be easily ported to formatter api Test output changes because color labels are applied separately.
author Yuya Nishihara <yuya@tcha.org>
date Fri, 03 Oct 2014 00:36:36 +0900
parents b17fd992d606
children 564ae7d2ec9b
comparison
equal deleted inserted replaced
22774:b17fd992d606 22775:b59c2c8c45df
1000 if bmark == current: 1000 if bmark == current:
1001 prefix, label = '*', 'bookmarks.current' 1001 prefix, label = '*', 'bookmarks.current'
1002 else: 1002 else:
1003 prefix, label = ' ', '' 1003 prefix, label = ' ', ''
1004 1004
1005 if ui.quiet: 1005 if not ui.quiet:
1006 ui.write("%s\n" % bmark, label=label) 1006 ui.write(' %s ' % prefix, label=label)
1007 else: 1007 ui.write(bmark, label=label)
1008 pad = " " * (25 - encoding.colwidth(bmark)) 1008 pad = " " * (25 - encoding.colwidth(bmark))
1009 ui.write(" %s %s%s %d:%s\n" % ( 1009 if not ui.quiet:
1010 prefix, bmark, pad, repo.changelog.rev(n), hexfn(n)), 1010 ui.write('%s %d:%s' % (
1011 pad, repo.changelog.rev(n), hexfn(n)),
1011 label=label) 1012 label=label)
1013 ui.write('\n')
1012 1014
1013 @command('branch', 1015 @command('branch',
1014 [('f', 'force', None, 1016 [('f', 'force', None,
1015 _('set branch name even if it shadows an existing branch')), 1017 _('set branch name even if it shadows an existing branch')),
1016 ('C', 'clean', None, _('reset branch name to parent branch name'))], 1018 ('C', 'clean', None, _('reset branch name to parent branch name'))],