开发者

mercurial: ignore .h generated from .idl

is it possible to use .hgignore in mercurial开发者_如何转开发 to ignore header files generated from idl files?

I have a very large project in VS2008 and, by default, the midl tool generates .h files from .idl files in the same folder and with the same name. Naturally, I do not want the generated files controlled. Is it possible to configure mercurial to ignore a xxx.h file if there is xxx.idl file in the same folder?

Is there any other solution to my problem? Renaming the files for those ~100 projects would take ages and is not really an option I want to consider...


As stevevls pointed out you can just ignore all .h files and then manually add the .h files you do want tracked (hg add overrides ignores).

Another option would be to put something like this in your .hg/hgrc

[ui]
ignore.generated = .hgignore-generated

and then create that file either manually or with a hook so that it lists all the generated .h files. The file could be tracked or untracked at your option. On unix this would auto create that file:

find . -name '*.idl' | sed 's/\.idl$/.h/ >| .hgignore-generated

I've no idea how to script that on windows, but one imagines powershell can do it.


Yes, this is possible. .hgignore is very flexible and accepts globs and regexes. You could probably get away with :

syntax:glob
*.h

See here for more details: http://www.selenic.com/mercurial/hgignore.5.html.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜