[PATCH 7 of 8] ignore: add support for including subdir .hgignores
martin at geisler.net
Fri May 15 05:22:38 CDT 2015
Durham Goode <durham at fb.com> writes:
> At the moment we only support globs in sub-ignore files. regexs will
> cause an exception. This is because we can't reliabily modify a regex
> to have a prefix (ex: adding a prefix to '^foo|^bar' would require
> parsing the regex).
That is surprising from a high-level since regular languages are closed
However, I see what you're saying: blindly adding a prefix to a regex
doesn't do what you expect. I didn't look at the mechanics of the code,
but if you could strip off the path elements as you descend down the
directory tree, you should get the right behavior.
So if we have
.hgignore <- '^foo|^bar'
.hgignore <- '#include sub-dir/.hgignore'
then don't match
to conclude the directories should be ignored.
Maybe that's not what you want if you intend to make one big regular
expression upfront and run all paths through that.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 818 bytes
Desc: not available
More information about the Mercurial-devel