Patchwork [1,of,4] py3: use pycompat.byteskwargs() to convert opts to bytes

login
register
mail settings
Submitter Pulkit Goyal
Date April 7, 2017, 10:59 a.m.
Message ID <6b32872e4896993efe0a.1491562777@pulkit-goyal>
Download mbox | patch
Permalink /patch/19995/
State Accepted
Headers show

Comments

Pulkit Goyal - April 7, 2017, 10:59 a.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1491552933 -19800
#      Fri Apr 07 13:45:33 2017 +0530
# Node ID 6b32872e4896993efe0abcc13b6d9c4c9b8687b7
# Parent  f6d77af84ef3e936b15634759df2718d5363b78a
py3: use pycompat.byteskwargs() to convert opts to bytes

We have converted opts to unicodes before passing them.
Yuya Nishihara - April 7, 2017, 12:13 p.m.
On Fri, 07 Apr 2017 16:29:37 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1491552933 -19800
> #      Fri Apr 07 13:45:33 2017 +0530
> # Node ID 6b32872e4896993efe0abcc13b6d9c4c9b8687b7
> # Parent  f6d77af84ef3e936b15634759df2718d5363b78a
> py3: use pycompat.byteskwargs() to convert opts to bytes

Queued this, thanks.

Patch

diff -r f6d77af84ef3 -r 6b32872e4896 mercurial/commands.py
--- a/mercurial/commands.py	Thu Apr 06 14:41:42 2017 +0200
+++ b/mercurial/commands.py	Fri Apr 07 13:45:33 2017 +0530
@@ -2027,6 +2027,7 @@ 
 
     Returns 0 on success.
     """
+    opts = pycompat.byteskwargs(opts)
     changesets += tuple(opts.get('rev', []))
     if not changesets:
         changesets = ['.']
@@ -3185,6 +3186,7 @@ 
 
     Returns 0 if there are incoming changes, 1 otherwise.
     """
+    opts = pycompat.byteskwargs(opts)
     if opts.get('graph'):
         cmdutil.checkunsupportedgraphflags([], opts)
         def display(other, chlist, displayer):