Patchwork [2,of,2,py3,V2] commands: make sure using byteschr rather than ascii values

login
register
mail settings
Submitter Pulkit Goyal
Date March 16, 2017, 9:24 p.m.
Message ID <ec82445ccda47996e58a.1489699490@pulkit-goyal>
Download mbox | patch
Permalink /patch/19402/
State Accepted
Headers show

Comments

Pulkit Goyal - March 16, 2017, 9:24 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1489635793 -19800
#      Thu Mar 16 09:13:13 2017 +0530
# Node ID ec82445ccda47996e58a0c33fbbe8dbd7be0d2aa
# Parent  c894bad6625973565b21f556896527141f123dd5
commands: make sure using byteschr rather than ascii values

'MAR!?IC' is converted to their ascii values when slicing through it. This
patch uses pycompat.iterbytestr() to get bytes value.
Yuya Nishihara - March 17, 2017, 12:33 p.m.
On Fri, 17 Mar 2017 02:54:50 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1489635793 -19800
> #      Thu Mar 16 09:13:13 2017 +0530
> # Node ID ec82445ccda47996e58a0c33fbbe8dbd7be0d2aa
> # Parent  c894bad6625973565b21f556896527141f123dd5
> commands: make sure using byteschr rather than ascii values
> 
> 'MAR!?IC' is converted to their ascii values when slicing through it. This
> patch uses pycompat.iterbytestr() to get bytes value.

Queued only this, thanks.

Patch

diff -r c894bad66259 -r ec82445ccda4 mercurial/commands.py
--- a/mercurial/commands.py	Thu Mar 16 08:57:53 2017 +0530
+++ b/mercurial/commands.py	Thu Mar 16 09:13:13 2017 +0530
@@ -4757,7 +4757,7 @@ 
     stat = repo.status(node1, node2, m,
                        'ignored' in show, 'clean' in show, 'unknown' in show,
                        opts.get('subrepos'))
-    changestates = zip(states, 'MAR!?IC', stat)
+    changestates = zip(states, pycompat.iterbytestr('MAR!?IC'), stat)
 
     if (opts.get('all') or opts.get('copies')
         or ui.configbool('ui', 'statuscopies')) and not opts.get('no_status'):