On Tue, Jul 7, 2009 at 2:10 AM, Yuki KODAMA<endflow....@gmail.com> wrote:
> # HG changeset patch
> # User Yuki KODAMA <endflow....@gmail.com>
> # Date 1246899967 -32400
> # Node ID 735f5d73d3eb5b38d84df8dc0b21ac13eb3a66ea
> # Parent  123811ec40a6f4347743e258676df3b662034434
> treemodel: show short username correctly
>
> If it has '<h...@foo.org>' as username, it doesn't show short username.
> And we should use Mercurial's function to get username stripted email.
>
> diff --git a/hggtk/logview/treemodel.py b/hggtk/logview/treemodel.py
> --- a/hggtk/logview/treemodel.py
> +++ b/hggtk/logview/treemodel.py
> @@ -10,7 +10,7 @@
>  import gtk
>  import gobject
>  import re
> -from mercurial import util
> +from mercurial import util, templatefilters
>  from mercurial.hgweb import webutil
>  from thgutil import hglib
>  from hggtk import gtklib
> @@ -41,7 +41,6 @@
>         self.branch_names = {}
>         self.repo = repo
>         self.line_graph_data = graphdata
> -        self.author_re = re.compile('<....@.*>', 0)
>         self.color_func = color_func
>         self.parents = [x.rev() for x in repo.parents()]
>         self.heads = [repo[x].rev() for x in repo.heads()]
> @@ -136,11 +135,9 @@
>                 bstr += '<span color="%s" background="%s"> %s </span> ' % \
>                         ('black', '#aaffaa', branch)
>
> -            if '<' in ctx.user():
> -                author = self.author_re.sub('', ctx.user()).strip(' ')
> -            else:
> +            author = templatefilters.person(ctx.user())
> +            if not author:
>                 author = util.shortuser(ctx.user())
> -
>             author = hglib.toutf(author)
>             date = hglib.displaytime(ctx.date())
>             utc = hglib.utctime(ctx.date())
>

To reproduce this issue, please use stable-wiki changesets:
http://bitbucket.org/tortoisehg/stable/wiki/

regards,
Yuki

------------------------------------------------------------------------------
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to