# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2018-02-28 14:24:10 # Node ID ab5f18a9dcacf135bcde59076d221860dcb5e651 # Parent d0d5eef57fb0b180db538de2452f7b0dc4edef92 py3: slice over bytes or use startswith() to prevent getting ascii values Differential Revision: https://phab.mercurial-scm.org/D2496 diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -4482,7 +4482,7 @@ def resolve(ui, repo, *pats, **opts): 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, diff --git a/mercurial/fileset.py b/mercurial/fileset.py --- a/mercurial/fileset.py +++ b/mercurial/fileset.py @@ -392,7 +392,7 @@ def sizematcher(x): 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