# HG changeset patch # User Yuya Nishihara # Date 1522548389 -32400 # Node ID 8e57c3b0dce4fe33aec215d1ad53a4f1320a0afc # Parent d29f6fbd11813e5e1ec65e1f00c65d403f6d0f36 templatefuncs: do not crash because of invalid value fed to mailmap() diff -r d29f6fbd1181 -r 8e57c3b0dce4 mercurial/templatefuncs.py --- a/mercurial/templatefuncs.py Sat Mar 31 23:34:15 2018 -0700 +++ b/mercurial/templatefuncs.py Sun Apr 01 11:06:29 2018 +0900 @@ -175,7 +175,7 @@ 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 -r d29f6fbd1181 -r 8e57c3b0dce4 tests/test-mailmap.t --- a/tests/test-mailmap.t Sat Mar 31 23:34:15 2018 -0700 +++ b/tests/test-mailmap.t Sun Apr 01 11:06:29 2018 +0900 @@ -65,3 +65,8 @@ Proper Name 4 Testuser Improper user + +No TypeError beacause of invalid input + + $ hg log -T '{mailmap(termwidth)}\n' -r0 + 80