Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8.1, 0.8.2, and 0.8.3

treemodel: show short username correctly

If it has '<hoge@foo.org>' as username, it doesn't show short username.
And we should use Mercurial's function to get username stripted email.

Changeset 596fef6e200f

Parent 7918eb3c6923

by Yuki KODAMA

Changes to one file · Browse files at 596fef6e200f Showing diff from parent 7918eb3c6923 Diff from another changeset...

 
10
11
12
13
 
14
15
16
 
41
42
43
44
45
46
47
 
136
137
138
139
140
141
 
 
142
143
144
145
146
 
10
11
12
 
13
14
15
16
 
41
42
43
 
44
45
46
 
135
136
137
 
 
 
138
139
140
 
141
142
143
@@ -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())