On 06.10.2009 15:05, Henrik Stuart wrote: > Adrian Buehlmann wrote: >> On 06.10.2009 14:09, Yuki KODAMA wrote: >>> # HG changeset patch >>> # User Yuki KODAMA <endflow....@gmail.com> >>> # Date 1254830545 -32400 >>> # Node ID ae6618e958e364bf3bd721e85582576815f577c1 >>> # Parent 59ee4c36d676b75ffcc5e8abc47c5cbe0eaade77 >>> thgconfig: change to 'comma separated list' for hidetags option >>> >>> diff --git a/tortoisehg/hgtk/logview/treemodel.py >>> b/tortoisehg/hgtk/logview/treemodel.py >>> --- a/tortoisehg/hgtk/logview/treemodel.py >>> +++ b/tortoisehg/hgtk/logview/treemodel.py >>> @@ -14,6 +14,7 @@ >>> dialog. Other portions stolen from graphlog extension. >>> ''' >>> >>> +import re >>> import gtk >>> import gobject >>> from mercurial import util, templatefilters >>> @@ -53,8 +54,15 @@ >>> self.tagrevs = [repo[r].rev() for t, r in repo.tagslist()] >>> self.branchtags = repo.branchtags() >>> self.set_author_color() >>> - self.hidetags = self.repo.ui.config( >>> - 'tortoisehg', 'hidetags', '').split() >>> + hidetags = self.repo.ui.config('tortoisehg', 'hidetags', '') >>> + if hidetags: >>> + hidetags = hglib.tounicode(hidetags) >>> + pat = r'(?:(?<!\\)(?<=\\\\)|(?<!\\)),' >>> + hidetags = [t.strip() for t in re.split(pat, hidetags) if t] >>> + hidetags = [t.replace('\\\\', '\\').replace('\\,', ',') >>> for t in hidetags] >>> + self.hidetags = [hglib.toutf(t) for t in hidetags] >>> + else: >>> + self.hidetags = [] >>> >>> def refresh(self): >>> repo = self.repo >>> diff --git a/tortoisehg/hgtk/thgconfig.py b/tortoisehg/hgtk/thgconfig.py >>> --- a/tortoisehg/hgtk/thgconfig.py >>> +++ b/tortoisehg/hgtk/thgconfig.py >>> @@ -124,9 +124,10 @@ >>> ' @ character, and \\n to a linefeed.' >>> ' Default: None')), >>> (_('Hide Tags'), 'tortoisehg.hidetags', [], >>> - _('Space separated list of tags that will not be shown.' >>> - ' Useful example: Specify "qbase qparent qtip" to hide the' >>> - ' standard tags inserted by the Mercurial Queues Extension.' >>> + _('Comma separated list of tags that will not be shown.' >>> + ' Commas in the tag name must be escaped using a backslash (\\).' >>> + ' Useful example: Specify "qbase,qparent,qtip" to hide the' >>> + ' standard tags inserted by the Mercurial Queues Extension.' >>> ' Default: None')), >>> ) >> Do we really need to support commas in tag names to hide ??? >> >> If someone *does* have commas in tag names then they probably >> don't whine if they can't hide them with tortoisehg.hidetags. >> >> Adding an escaping mechanism here seems a bit overkill to me. > > I see no reason to not support the branch/tag names that Mercurial does, > even if that complicates some things in TortoiseHg a bit. We could
Ok. Mercurial supports spaces in branch names and tags as well. Is this supported? > probably, though, extract that functionality into a common routine that > can be used both from branchcolor and hidetags. > > I had this patch in my TODO list as well, so thank you, Yuki. ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Tortoisehg-develop mailing list Tortoisehg-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop