bookmark: make use of output labeling
authorBrodie Rao <brodie@bitheap.org>
Fri, 02 Apr 2010 15:22:09 -0500
changeset 10820 da809085bc9f
parent 10819 36c6a667d733
child 10821 a6ac91c313af
bookmark: make use of output labeling
hgext/bookmarks.py
--- a/hgext/bookmarks.py	Fri Apr 02 15:22:07 2010 -0500
+++ b/hgext/bookmarks.py	Fri Apr 02 15:22:09 2010 -0500
@@ -152,15 +152,22 @@
             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):