Well, I updated the patch to not use try/except/else.
I'm not sure what you mean by about the logview header, though. The only
thing my patch should change in the summary string is the background color
tag for certain tags. Any other information (such as headers) should be
preserved.
Did you mean that there's some other information that needs to be
added/updated elsewhere?
- Paul
On Fri, Dec 4, 2009 at 9:59 AM, Steve Borho <st...@borho.org> wrote:
> On Fri, Dec 4, 2009 at 11:33 AM, Paul Molodowitch
> <pa...@luma-pictures.com> wrote:
> > 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).
>
> Thanks.
>
> A couple of points before I can push this:
>
> 1) the summary should have a 'logview: ' header
> 2) I'm not sure try: except: else: is Python 2.4 safe, can someone verify
> this?
>
> Otherwise it's a nice patch.
>
> --
> Steve Borho
>
# HG changeset patch
# User paulm
# Date 1259955293 28800
# Node ID 65166a363f16a4541bd9f4265f67b0bc7d905ef2
# Parent 04402d95b4ed183288af3969d107d82141995fe0
'Active' bookmarks highlighted in log view
diff -r 04402d95b4ed -r 65166a363f16 tortoisehg/hgtk/logview/treemodel.py
--- a/tortoisehg/hgtk/logview/treemodel.py Thu Dec 03 21:41:30 2009 -0600
+++ b/tortoisehg/hgtk/logview/treemodel.py Fri Dec 04 11:34:53 2009 -0800
@@ -159,13 +159,29 @@
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
+ bookmarks = None
+ try:
+ bookmarks = hglib.extensions.find('bookmarks')
+ except KeyError:
+ pass
+ if bookmarks:
+ 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