# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1498081576 -19800 # Node ID c31d456233046581c04485a2a71b7ffe628f537c # Parent 4e6dc34b5d7ae6286390bc4e18229658dd93bd84 py3: convert kwargs' keys' to str using pycompat.strkwargs() On Python 3, we must have keys of keyword arguments as str. diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -1610,7 +1610,7 @@ 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 . import ( error, mdiff, + pycompat, util, vfs as vfsmod, ) @@ -455,7 +456,8 @@ 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 @@ 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 @@ 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 @@ 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 @@ except TemplateNotFound: v = default if callable(v): - return v(**mapping) + return v(**pycompat.strkwargs(mapping)) return v def buildtemplate(exp, context):