Patchwork [3,of,8] py3: use pycompat.strkwargs() to convert kwargs keys to str

login
register
mail settings
Submitter Pulkit Goyal
Date June 26, 2017, 7:55 p.m.
Message ID <34b6d0746a92388e1075.1498506924@workspace>
Download mbox | patch
Permalink /patch/21744/
State Accepted
Headers show

Comments

Pulkit Goyal - June 26, 2017, 7:55 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1498503212 -19800
#      Tue Jun 27 00:23:32 2017 +0530
# Node ID 34b6d0746a92388e10751b8bff90a7b7bb22b1f4
# Parent  bd2b8d7fb25b256e1e9fa03d43a7fb6712d3daa3
py3: use pycompat.strkwargs() to convert kwargs keys to str

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2839,7 +2839,8 @@ 
                 user = opts.get('user') or old.user()
                 date = opts.get('date') or old.date()
             editform = mergeeditform(old, 'commit.amend')
-            editor = getcommiteditor(editform=editform, **opts)
+            editor = getcommiteditor(editform=editform,
+                                            **pycompat.strkwargs(opts))
             if not message:
                 editor = getcommiteditor(edit=True, editform=editform)
                 message = old.description()
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -2165,7 +2165,7 @@ 
     else:
         displayer = cmdutil.makelogtemplater(ui, repo, tmpl)
         for r in revs:
-            displayer.show(repo[r], **props)
+            displayer.show(repo[r], **pycompat.strkwargs(props))
         displayer.close()
 
 @command('debugupdatecaches', [])
diff --git a/mercurial/mdiff.py b/mercurial/mdiff.py
--- a/mercurial/mdiff.py
+++ b/mercurial/mdiff.py
@@ -84,6 +84,7 @@ 
 
     def copy(self, **kwargs):
         opts = dict((k, getattr(self, k)) for k in self.defaults)
+        opts = pycompat.strkwargs(opts)
         opts.update(kwargs)
         return diffopts(**opts)