diff --git a/mercurial/templatefuncs.py b/mercurial/templatefuncs.py --- a/mercurial/templatefuncs.py +++ b/mercurial/templatefuncs.py @@ -175,7 +175,7 @@ def mailmap(context, mapping, args): if len(args) != 1: raise error.ParseError(_("mailmap expects one argument")) - author = evalfuncarg(context, mapping, args[0]) + author = evalstring(context, mapping, args[0]) cache = context.resource(mapping, 'cache') repo = context.resource(mapping, 'repo') diff --git a/tests/test-mailmap.t b/tests/test-mailmap.t --- a/tests/test-mailmap.t +++ b/tests/test-mailmap.t @@ -65,3 +65,8 @@ A commit with improperly formatted user Proper Name 4 Testuser Improper user + +No TypeError beacause of invalid input + + $ hg log -T '{mailmap(termwidth)}\n' -r0 + 80