diff -r d3e688b9ef2e -r 4591c9791a82 mercurial/templatefuncs.py --- a/mercurial/templatefuncs.py Wed Dec 12 22:19:57 2018 +0900 +++ b/mercurial/templatefuncs.py Wed Dec 12 22:45:02 2018 +0900 @@ -609,7 +609,7 @@ match = patre.search(src) if not match: - return + return templateutil.mappingnone() lm = {b'0': match.group(0)} lm.update((b'%d' % i, v) for i, v in enumerate(match.groups(), 1))