diff mercurial/commands.py @ 1129:ee4f60abad93

Move generating short username to display in hg/hgweb annotate to ui module.
author Thomas Arendsen Hein <thomas@intevation.de>
date Sun, 28 Aug 2005 17:29:28 +0200
parents 624a3a4fa232
children 899b619a7eb2
line wrap: on
line diff
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -472,14 +472,7 @@ def annotate(ui, repo, *pats, **opts):
             return bcache[rev]
         except KeyError:
             cl = repo.changelog.read(repo.changelog.node(rev))
-            name = cl[1]
-            f = name.find('@')
-            if f >= 0:
-                name = name[:f]
-            f = name.find('<')
-            if f >= 0:
-                name = name[f+1:]
-            bcache[rev] = name
+            bcache[rev] = name = ui.shortuser(cl[1])
             return name
 
     if not pats: