D2496: py3: slice over bytes or use startswith() to prevent getting ascii values

2018-03-01 Thread yuja (Yuya Nishihara)
yuja added inline comments.

INLINE COMMENTS

> commands.py:4485
>  continue
> -flags = ''.join(['-%s ' % o[0] for o in flaglist
> +flags = ''.join(['-%s ' % o[0:1] for o in flaglist
> if opts.get(o)])

Could be '-%c ', but I don't have preference.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2496

To: pulkit, #hg-reviewers
Cc: yuja, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2496: py3: slice over bytes or use startswith() to prevent getting ascii values

2018-03-01 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG13beeddf852a: py3: slice over bytes or use startswith() to 
prevent getting ascii values (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2496?vs=6196=6229

REVISION DETAIL
  https://phab.mercurial-scm.org/D2496

AFFECTED FILES
  mercurial/commands.py
  mercurial/fileset.py

CHANGE DETAILS

diff --git a/mercurial/fileset.py b/mercurial/fileset.py
--- a/mercurial/fileset.py
+++ b/mercurial/fileset.py
@@ -392,7 +392,7 @@
 elif expr.startswith(">"):
 a = util.sizetoint(expr[1:])
 return lambda x: x > a
-elif expr[0].isdigit or expr[0] == '.':
+elif expr[0:1].isdigit or expr.startswith('.'):
 a = util.sizetoint(expr)
 b = _sizetomax(expr)
 return lambda x: x >= a and x <= b
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4482,7 +4482,7 @@
 for f in ms:
 if not m(f):
 continue
-flags = ''.join(['-%s ' % o[0] for o in flaglist
+flags = ''.join(['-%s ' % o[0:1] for o in flaglist
if opts.get(o)])
 hint = _("(try: hg resolve %s%s)\n") % (
  flags,



To: pulkit, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2496: py3: slice over bytes or use startswith() to prevent getting ascii values

2018-02-28 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2496

AFFECTED FILES
  mercurial/commands.py
  mercurial/fileset.py

CHANGE DETAILS

diff --git a/mercurial/fileset.py b/mercurial/fileset.py
--- a/mercurial/fileset.py
+++ b/mercurial/fileset.py
@@ -392,7 +392,7 @@
 elif expr.startswith(">"):
 a = util.sizetoint(expr[1:])
 return lambda x: x > a
-elif expr[0].isdigit or expr[0] == '.':
+elif expr[0:1].isdigit or expr.startswith('.'):
 a = util.sizetoint(expr)
 b = _sizetomax(expr)
 return lambda x: x >= a and x <= b
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4482,7 +4482,7 @@
 for f in ms:
 if not m(f):
 continue
-flags = ''.join(['-%s ' % o[0] for o in flaglist
+flags = ''.join(['-%s ' % o[0:1] for o in flaglist
if opts.get(o)])
 hint = _("(try: hg resolve %s%s)\n") % (
  flags,



To: pulkit, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel