If anyone out there uses the bookmarks extension with the "track.current"
option enabled, this will enable them to see, within tortoise, which
bookmark is the current one (ie, will be updated on the next commit).
Right now, this patch shows the active bookmark by highlighting it in a
slightly different background color (reddish), but this could easily be
changed to something else - underlined, italics, etc.
Without this modification, I found myself frequently having to check on the
command line what my current bookmark was (as I switch bookmarks a lot).
- Paul
# HG changeset patch
# User paulm
# Date 1259860730 28800
# Node ID 492222ae40f7e6dcafadd0f15008020b89b6a36d
# Parent 56120d3f682afd91d38f318357bedee2411c65dd
'Active' bookmarks highlighted in log view
diff -r 56120d3f682a -r 492222ae40f7 tortoisehg/hgtk/logview/treemodel.py
--- a/tortoisehg/hgtk/logview/treemodel.py Tue Dec 01 11:06:58 2009 -0600
+++ b/tortoisehg/hgtk/logview/treemodel.py Thu Dec 03 09:18:50 2009 -0800
@@ -159,13 +159,28 @@
escape = gtklib.markup_escape_text
summary = escape(hglib.toutf(summary))
node = ctx.node()
+
+ # Check if we're using bookmarks, and have the
+ # 'track.current' option set; if so,
+ # find what the 'current' bookmark is
+ currentBookmark = None
+ try:
+ bookmarks = hglib.extensions.find('bookmarks')
+ except KeyError:
+ pass
+ else:
+ if self.repo.ui.configbool('bookmarks', 'track.current'):
+ currentBookmark = bookmarks.current(self.repo)
+
tags = self.repo.nodetags(node)
taglist = hglib.toutf(', '.join(tags))
tstr = ''
for tag in tags:
if tag not in self.hidetags:
- tstr += gtklib.markup(' %s ' % tag, color='black',
- background='#ffffaa') + ' '
+ style = {'color':'black', 'background':'#ffffaa'}
+ if tag == currentBookmark:
+ style['background'] = '#ffcc99'
+ tstr += gtklib.markup(' %s ' % tag, **style) + ' '
branch = ctx.branch()
bstr = ''
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop