[PATCH 2 of 4] revset: define _symletters in terms of _syminitletters

Yuya Nishihara yuya at tcha.org
Sat Oct 8 02:27:32 EDT 2016


On Fri, 7 Oct 2016 17:09:33 +0200, Pulkit Goyal wrote:
> On Fri, Oct 7, 2016 at 2:50 PM, Augie Fackler <raf at durin42.com> wrote:
> > # HG changeset patch
> > # User Augie Fackler <augie at google.com>
> > # Date 1475842163 14400
> > #      Fri Oct 07 08:09:23 2016 -0400
> > # Node ID d7777ef3fe7f82524c2925d9af6c3e1884a4188d
> > # Parent  da814a1e51a7c97d0b4a1a7519bdca87802e4e6d
> > revset: define _symletters in terms of _syminitletters
> >
> > diff --git a/mercurial/revset.py b/mercurial/revset.py
> > --- a/mercurial/revset.py
> > +++ b/mercurial/revset.py
> > @@ -177,8 +177,7 @@ keywords = set(['and', 'or', 'not'])
> >                        if c.isalnum() or c in '._@' or ord(c) > 127)
> >
> >  # default set of valid characters for non-initial letters of symbols
> > -_symletters = set(c for c in [chr(i) for i in xrange(256)]
> > -                  if c.isalnum() or c in '-._/@' or ord(c) > 127)
> > +_symletters = _syminitletters | set('-/')
> Need to add a u'' here that is set(u'-/')

A revset expression is bytes. Testing it against unicode would cause
UnicodeDecodeError on Python 2 (and TypeError on Python 3.)


More information about the Mercurial-devel mailing list