[PATCH] match: visit directory 'foo' when given e.g. '-X foo/ba?'

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed May 27 21:41:14 CDT 2015



On 05/27/2015 03:16 PM, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz at google.com>
> # Date 1432748644 25200
> #      Wed May 27 10:44:04 2015 -0700
> # Node ID 39829cc793a5df9d598b81eb2c62ef50da50f16a
> # Parent  6ac860f700b5cfeda232d5305963047696b869ca
> match: visit directory 'foo' when given e.g. '-X foo/ba?'
>
> For globs like 'foo/ba?', _roots() will return 'foo'. Since visitdir
> excludes directories in the excluded roots, it would skip the entire
> foo directory, which is incorrect, since 'foo/ba?' doesn't mean that
> everything in foo/ should be exluded. Fix by only adding roots to the
> set of excluded roots if there are no excluded patterns.
>
> Since 'glob' is the default pattern type for globs, we also need to
> update some -X patterns in the tests to be of 'path' type to take
> advantage of the visitdir tricks. For consistency, also update the -I
> patterns.
>
> It seems a little unfortunate that 'foo' in 'hg files -X foo' is
> considered a pattern because of the implied 'glob' type, but improving
> that is left for another day.

You description sounds like a bug report. Shoud this be on stable?

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list