[PATCH 2 of 2] bookmarks: indicate active bookmark with a '*' during summary

Cesar Mena cesar.mena at gmail.com
Fri Oct 8 12:58:10 CDT 2010


# HG changeset patch
# User Cesar Mena <cmena at pobox.com>
# Date 1277845967 14400
# Node ID dc49d654b16d912e66f8db08467bf136850eaa2b
# Parent  9dc401a9923cb0b241343a4c6e5a7740705f4165
bookmarks: indicate active bookmark with a '*' during summary

diff --git a/hgext/bookmarks.py b/hgext/bookmarks.py
--- a/hgext/bookmarks.py
+++ b/hgext/bookmarks.py
@@ -536,6 +536,13 @@
     setcurrent(repo, rev)
     return res
 
+def _summaryoverlay(ui, repo, overlay):
+    def fmttag(t):
+        if t == repo._bookmarkcurrent:
+            t = '*' + t
+        return t
+    overlay['tags'] = [fmttag(t) for t in repo.parents()[0].tags()]
+
 cmdtable = {
     "bookmarks":
         (bookmark,
@@ -547,3 +554,5 @@
 }
 
 colortable = {'bookmarks.current': 'green'}
+
+cmdextdatatable = {'summary': _summaryoverlay}


More information about the Mercurial-devel mailing list