Changeset ba082673baed…
Parent f4363d3b6dde…
by
Changes to one file · Browse files at ba082673baed Showing diff from parent f4363d3b6dde Diff from another changeset...
@@ -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
|
Loading...