ignoring files but not directories

Harvey Chapman hchapman-hg at 3gfp.com
Wed Jul 20 17:06:19 UTC 2011


I'm trying to ignore all dependency files labeled like file.d, but not ignore an init.d directory or any of its contents. I can't seem to get it to work. I have a layout like this:

src/file.d
api/file.d
etc/init.d/somefiles

and a .hgignore like this:

syntax: regex
\.d$

As I understand it, that rule is ignoring the entire init.d directory causing mercurial to ignore the contents. So what are the correct hgignore rules to do this? If it helps, all of the .d directories are under a separate subtree from the dependency files.

After that sentence, I tried:

^(src|api|app|utils)/.*\.d$

This works, but it's not really what I want. This is a blacklist. I'd like to have a whitelist, or better stated: match everything not in whitelist. Or better yet, I'd like to have a rule that says ignore all FILES that end in ".d".

Thank you,
Harvey


More information about the Mercurial mailing list