diff -r 6f150bb19317 -r 44c591f63458 mercurial/templater.py --- a/mercurial/templater.py Sat Mar 18 20:50:15 2017 +0900 +++ b/mercurial/templater.py Sat Mar 18 21:02:20 2017 +0900 @@ -13,6 +13,7 @@ from .i18n import _ from . import ( + color, config, encoding, error, @@ -576,13 +577,13 @@ fillchar = ' ' if len(args) > 2: fillchar = evalstring(context, mapping, args[2]) - if len(fillchar) != 1: + if len(color.stripeffects(fillchar)) != 1: # i18n: "pad" is a keyword raise error.ParseError(_("pad() expects a single fill character")) if len(args) > 3: left = evalboolean(context, mapping, args[3]) - fillwidth = width - encoding.colwidth(text) + fillwidth = width - encoding.colwidth(color.stripeffects(text)) if fillwidth <= 0: return text if left: