changeset 31631:a7acda2de4b8

diff: use pycompat.{byteskwargs, strkwargs} to switch opts b/w bytes and str
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 26 Mar 2017 20:58:21 +0530
parents 451c980a8b57
children d059821fc89f
files mercurial/mdiff.py mercurial/patch.py
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/mdiff.py	Sun Mar 26 20:54:50 2017 +0530
+++ b/mercurial/mdiff.py	Sun Mar 26 20:58:21 2017 +0530
@@ -17,6 +17,7 @@
     bdiff,
     error,
     mpatch,
+    pycompat,
     util,
 )
 
@@ -61,6 +62,7 @@
         }
 
     def __init__(self, **opts):
+        opts = pycompat.byteskwargs(opts)
         for k in self.defaults.keys():
             v = opts.get(k)
             if v is None:
--- a/mercurial/patch.py	Sun Mar 26 20:54:50 2017 +0530
+++ b/mercurial/patch.py	Sun Mar 26 20:58:21 2017 +0530
@@ -2213,7 +2213,7 @@
         buildopts['nobinary'] = get('nobinary', forceplain=False)
         buildopts['noprefix'] = get('noprefix', forceplain=False)
 
-    return mdiff.diffopts(**buildopts)
+    return mdiff.diffopts(**pycompat.strkwargs(buildopts))
 
 def diff(repo, node1=None, node2=None, match=None, changes=None,
          opts=None, losedatafn=None, prefix='', relroot='', copy=None):