Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

hglib: add username() method

Changeset ba082673baed

Parent f4363d3b6dde

by Yuki KODAMA

Changes to one file · Browse files at ba082673baed Showing diff from parent f4363d3b6dde Diff from another changeset...

 
14
15
16
17
 
18
19
20
 
195
196
197
 
 
 
 
 
 
 
14
15
16
 
17
18
19
20
 
195
196
197
198
199
200
201
202
203
@@ -14,7 +14,7 @@
 from mercurial.error import RepoError, ParseError, LookupError  from mercurial.error import UnknownCommand, AmbiguousCommand  from mercurial import hg, ui, util, extensions, commands, hook, match -from mercurial import dispatch, encoding +from mercurial import dispatch, encoding, templatefilters  _encoding = encoding.encoding  _encodingmode = encoding.encodingmode  _fallbackencoding = encoding.fallbackencoding @@ -195,3 +195,9 @@
   def utctime(date):   return time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(date[0])) + +def username(user): + author = templatefilters.person(user) + if not author: + author = util.shortuser(user) + return author