Patchwork [4,of,6,py3] diff: use pycompat.{byteskwargs, strkwargs} to switch opts b/w bytes and str

login
register
mail settings
Submitter Pulkit Goyal
Date March 26, 2017, 3:46 p.m.
Message ID <ad78dfda4e5669df04ea.1490543203@pulkit-goyal>
Download mbox | patch
Permalink /patch/19691/
State Accepted
Headers show

Comments

Pulkit Goyal - March 26, 2017, 3:46 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1490542101 -19800
#      Sun Mar 26 20:58:21 2017 +0530
# Node ID ad78dfda4e5669df04ea6441740f60658c2668a7
# Parent  bde955d3b6b93b57a0b8169dbe17b22979620c03
diff: use pycompat.{byteskwargs, strkwargs} to switch opts b/w bytes and str

Patch

diff -r bde955d3b6b9 -r ad78dfda4e56 mercurial/mdiff.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:
diff -r bde955d3b6b9 -r ad78dfda4e56 mercurial/patch.py
--- 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):