[PATCH] minifileset: allow 'path:' patterns to have an explicit trailing slash

Yuya Nishihara yuya at tcha.org
Sun Feb 18 07:43:23 EST 2018


On Thu, 15 Feb 2018 22:05:47 -0500, Matt Harbison wrote:
> >> Basically, I spent some time last week writing ignore rules for some  
> >> converted repos, and got into the habit of appending a trailing '/' to  
> >> ensure the match is a directory, and not just a substring.  When I did  
> >> that here, it took awhile to figure out why the path was being  
> >> ignored.  ('path:' only matches directories)
> >>
> >> > Can't we reuse some parts of the match module to build a function or  
> >> regexp
> >> > from a pattern string?
> >>
> >> Probably.  I’ve seen a couple cases where a regex pattern would be  
> >> useful.  I just assumed those other match types were part of the  
> >> performance concern that was the reason for splitting out the mini  
> >> language in the first place.
> >
> > (CC Jun)
> >
> > I think the O(n) concern came from how fileset filters n-length list, not
> > from the matcher function itself.
> 
> Unless I'm missing something, the only time patternmatcher walks ctx is if
> there's a 'set:' kind.

Perhaps. And we can effectively disable 'set:' by not passing ctx to matcher.
57d6c0c74b1b could be partially backed out if we want to handle unsupported
'set:' in matcher.

> So if we filter that out that, the relative kinds
> (except relglob), and 'subinclude:', I don't see why we can't create one  
> of those to build the match function.  That would allow regex,  
> rootfilesin, and (rel)glob support too.


More information about the Mercurial-devel mailing list