diff: use pycompat.{byteskwargs, strkwargs} to switch opts b/w bytes and str
authorPulkit Goyal <7895pulkit@gmail.com>
Sun, 26 Mar 2017 20:58:21 +0530
changeset 31631 a7acda2de4b8
parent 31630 451c980a8b57
child 31632 d059821fc89f
diff: use pycompat.{byteskwargs, strkwargs} to switch opts b/w bytes and str
mercurial/mdiff.py
mercurial/patch.py
--- 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):