mercurial/templatekw.py
changeset 38948 390287321b4b
parent 38774 87a581d1391c
child 39367 83f8f7b9fa60
--- a/mercurial/templatekw.py	Tue Jul 24 22:33:08 2018 +0900
+++ b/mercurial/templatekw.py	Tue Jul 24 22:13:21 2018 +0900
@@ -168,9 +168,8 @@
 
 @templatekeyword('author', requires={'ctx'})
 def showauthor(context, mapping):
-    """String. The unmodified author of the changeset."""
-    ctx = context.resource(mapping, 'ctx')
-    return ctx.user()
+    """Alias for ``{user}``"""
+    return showuser(context, mapping)
 
 @templatekeyword('bisect', requires={'repo', 'ctx'})
 def showbisect(context, mapping):
@@ -757,6 +756,12 @@
     ui = context.resource(mapping, 'ui')
     return ui.termwidth()
 
+@templatekeyword('user', requires={'ctx'})
+def showuser(context, mapping):
+    """String. The unmodified author of the changeset."""
+    ctx = context.resource(mapping, 'ctx')
+    return ctx.user()
+
 @templatekeyword('instabilities', requires={'ctx'})
 def showinstabilities(context, mapping):
     """List of strings. Evolution instabilities affecting the changeset.