diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -1610,7 +1610,7 @@ def getbundlechunks(repo, source, heads= for name in getbundle2partsorder: func = getbundle2partsmapping[name] func(bundler, repo, source, bundlecaps=bundlecaps, b2caps=b2caps, - **kwargs) + **pycompat.strkwargs(kwargs)) return bundler.getchunks() diff --git a/mercurial/simplemerge.py b/mercurial/simplemerge.py --- a/mercurial/simplemerge.py +++ b/mercurial/simplemerge.py @@ -24,6 +24,7 @@ from .i18n import _ from . import ( error, mdiff, + pycompat, util, vfs as vfsmod, ) @@ -455,7 +456,8 @@ def simplemerge(ui, local, base, other, extrakwargs['base_marker'] = '|||||||' extrakwargs['name_base'] = name_base extrakwargs['minimize'] = False - for line in m3.merge_lines(name_a=name_a, name_b=name_b, **extrakwargs): + for line in m3.merge_lines(name_a=name_a, name_b=name_b, + **pycompat.strkwargs(extrakwargs)): out.write(line) if not opts.get('print'): diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py --- a/mercurial/templatekw.py +++ b/mercurial/templatekw.py @@ -119,23 +119,24 @@ def _showlist(name, values, mapping, plu expand 'end_foos'. ''' templ = mapping['templ'] + strmapping = pycompat.strkwargs(mapping) if not plural: plural = name + 's' if not values: noname = 'no_' + plural if noname in templ: - yield templ(noname, **mapping) + yield templ(noname, **strmapping) return if name not in templ: if isinstance(values[0], bytes): yield separator.join(values) else: for v in values: - yield dict(v, **mapping) + yield dict(v, **strmapping) return startname = 'start_' + plural if startname in templ: - yield templ(startname, **mapping) + yield templ(startname, **strmapping) vmapping = mapping.copy() def one(v, tag=name): try: @@ -146,7 +147,7 @@ def _showlist(name, values, mapping, plu vmapping[a] = b except ValueError: vmapping[name] = v - return templ(tag, **vmapping) + return templ(tag, **pycompat.strkwargs(vmapping)) lastname = 'last_' + name if lastname in templ: last = values.pop() @@ -158,7 +159,7 @@ def _showlist(name, values, mapping, plu yield one(last, tag=lastname) endname = 'end_' + plural if endname in templ: - yield templ(endname, **mapping) + yield templ(endname, **strmapping) def _formatrevnode(ctx): """Format changeset as '{rev}:{node|formatnode}', which is the default diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -371,7 +371,7 @@ def runsymbol(context, mapping, key, def except TemplateNotFound: v = default if callable(v): - return v(**mapping) + return v(**pycompat.strkwargs(mapping)) return v def buildtemplate(exp, context):