# HG changeset patch # User Brodie Rao # Date 2010-04-02 20:22:09 # Node ID da809085bc9f84e441104e34151a7db34a6afd25 # Parent 36c6a667d7332b998b78cdf7e81957f7eaaf186b bookmark: make use of output labeling diff --git a/hgext/bookmarks.py b/hgext/bookmarks.py --- a/hgext/bookmarks.py +++ b/hgext/bookmarks.py @@ -152,15 +152,22 @@ def bookmark(ui, repo, mark=None, rev=No for bmark, n in marks.iteritems(): if ui.configbool('bookmarks', 'track.current'): current = repo._bookmarkcurrent - prefix = (bmark == current and n == cur) and '*' or ' ' + if bmark == current and n == cur: + prefix, label = '*', 'bookmarks.current' + else: + prefix, label = ' ', '' else: - prefix = (n == cur) and '*' or ' ' + if n == cur: + prefix, label = '*', 'bookmarks.current' + else: + prefix, label = ' ', '' if ui.quiet: - ui.write("%s\n" % bmark) + ui.write("%s\n" % bmark, label=label) else: ui.write(" %s %-25s %d:%s\n" % ( - prefix, bmark, repo.changelog.rev(n), hexfn(n))) + prefix, bmark, repo.changelog.rev(n), hexfn(n)), + label=label) return def _revstostrip(changelog, node):