##// END OF EJS Templates
bookmarks: split ui.write() so that it can be easily ported to formatter api...
Yuya Nishihara -
r22775:b59c2c8c default
parent child Browse files
Show More
@@ -1002,13 +1002,15 b' def bookmark(ui, repo, *names, **opts):'
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,
@@ -18,7 +18,7 b' list bookmarks with color'
18
18
19 $ hg --config extensions.color= --config color.mode=ansi \
19 $ hg --config extensions.color= --config color.mode=ansi \
20 > bookmark --color=always
20 > bookmark --color=always
21 \x1b[0;32m * X -1:000000000000\x1b[0m (esc)
21 \x1b[0;32m * \x1b[0m\x1b[0;32mX\x1b[0m\x1b[0;32m -1:000000000000\x1b[0m (esc)
22
22
23 update to bookmark X
23 update to bookmark X
24
24
@@ -18,7 +18,7 b' list bookmarks with color'
18
18
19 $ hg --config extensions.color= --config color.mode=ansi \
19 $ hg --config extensions.color= --config color.mode=ansi \
20 > bookmarks --color=always
20 > bookmarks --color=always
21 \x1b[0;32m * X -1:000000000000\x1b[0m (esc)
21 \x1b[0;32m * \x1b[0m\x1b[0;32mX\x1b[0m\x1b[0;32m -1:000000000000\x1b[0m (esc)
22
22
23 $ echo a > a
23 $ echo a > a
24 $ hg add a
24 $ hg add a
General Comments 0
You need to be logged in to leave comments. Login now