Mercurial > hg
changeset 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 |
files | mercurial/commands.py tests/test-bookmarks-current.t tests/test-bookmarks.t |
diffstat | 3 files changed, 10 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Fri Oct 03 00:15:39 2014 +0900 +++ b/mercurial/commands.py Fri Oct 03 00:36:36 2014 +0900 @@ -1002,13 +1002,15 @@ else: prefix, label = ' ', '' - if ui.quiet: - ui.write("%s\n" % bmark, label=label) - else: - pad = " " * (25 - encoding.colwidth(bmark)) - ui.write(" %s %s%s %d:%s\n" % ( - prefix, bmark, pad, repo.changelog.rev(n), hexfn(n)), + if not ui.quiet: + ui.write(' %s ' % prefix, label=label) + ui.write(bmark, label=label) + pad = " " * (25 - encoding.colwidth(bmark)) + if not ui.quiet: + ui.write('%s %d:%s' % ( + pad, repo.changelog.rev(n), hexfn(n)), label=label) + ui.write('\n') @command('branch', [('f', 'force', None,
--- a/tests/test-bookmarks-current.t Fri Oct 03 00:15:39 2014 +0900 +++ b/tests/test-bookmarks-current.t Fri Oct 03 00:36:36 2014 +0900 @@ -18,7 +18,7 @@ $ hg --config extensions.color= --config color.mode=ansi \ > bookmark --color=always - \x1b[0;32m * X -1:000000000000\x1b[0m (esc) + \x1b[0;32m * \x1b[0m\x1b[0;32mX\x1b[0m\x1b[0;32m -1:000000000000\x1b[0m (esc) update to bookmark X
--- a/tests/test-bookmarks.t Fri Oct 03 00:15:39 2014 +0900 +++ b/tests/test-bookmarks.t Fri Oct 03 00:36:36 2014 +0900 @@ -18,7 +18,7 @@ $ hg --config extensions.color= --config color.mode=ansi \ > bookmarks --color=always - \x1b[0;32m * X -1:000000000000\x1b[0m (esc) + \x1b[0;32m * \x1b[0m\x1b[0;32mX\x1b[0m\x1b[0;32m -1:000000000000\x1b[0m (esc) $ echo a > a $ hg add a