Submitter | Matt Harbison |
---|---|
Date | Jan. 12, 2018, 2:07 a.m. |
Message ID | <op.zcphh8nj9lwrgf@envy> |
Download | mbox | patch |
Permalink | /patch/26692/ |
State | Deferred, archived |
Headers | show |
Comments
On Thu, 11 Jan 2018 21:07:10 -0500, Matt Harbison wrote: > On Thu, 11 Jan 2018 11:13:57 -0500, Matt Harbison <mharbison72@gmail.com> > wrote: > >> Perhaps this could be 'path:'. > > I ended up needing to add this to avoid a parse error. The "*fileset*" > tests run, but I'm not sure if this should be allowed for normal > filesets. The '/' operator works because it is in the globchars string. > > diff --git a/mercurial/fileset.py b/mercurial/fileset.py > --- a/mercurial/fileset.py > +++ b/mercurial/fileset.py > @@ -72,13 +72,13 @@ > pos += 1 > else: > raise error.ParseError(_("unterminated string"), s) > - elif c.isalnum() or c in globchars or ord(c) > 127: > + elif c.isalnum() or c in globchars or ord(c) > 127 or c == ':': Yep, ':' is reserved. We could instead add ':' operator to separate matcher kind and pat, but I'm not sure which will be better. For now, we need quotes, "<kind>:<pat>".
Patch
diff --git a/mercurial/fileset.py b/mercurial/fileset.py --- a/mercurial/fileset.py +++ b/mercurial/fileset.py @@ -72,13 +72,13 @@ pos += 1 else: raise error.ParseError(_("unterminated string"), s) - elif c.isalnum() or c in globchars or ord(c) > 127: + elif c.isalnum() or c in globchars or ord(c) > 127 or c == ':': # gather up a symbol/keyword s = pos pos += 1 while pos < l: # find end of symbol d = program[pos] - if not (d.isalnum() or d in globchars or ord(d) > 127): + if not (d.isalnum() or d in globchars or ord(d) > 127 or d == ':'): break pos += 1