开发者

How to ignore some folders in HG?

Starting here, I'm wrestling with this right now. I've got two folders: Source and SQL. Source has multiple project folders. The project folders in Source and SQL have bin folders. I want to ignore all files in bin folders under Source, but not under SQL. I thought one of these might do the trick:

glob:Source\*\bin\
glob:Sourc开发者_运维技巧e\*\bin
glob:Source\*\bin\*
glob:Source\*\bin*
glob:Source*\bin\
glob:Source\*bin\

But no dice on all of the above.

It seems I'll have to enter a line for each folder under Source where I expect to have a bin folder (and then update my .hgignore file whenever I add a new project).

glob:Source\Project1\bin\
glob:Source\Project2\bin\
#etc

If this is not the case, any advice would be appreciated.


Have you tried a regexp:

syntax: regex
^Source/.*/bin

Also, do remember that anything you've already added isn't affected by ignore rules, so you need the files to be untracked to test this stuff.

Lastly, consider making each project a separate repo -- that's the standard advice in DVCS land be it Mercurial or git. In svn multiple projects in the same repo isn't such a bad idea because you can have different parts of the working directory updated to different revisions, but with a DVCS all files are updated/checkedout to the same revision, which makes putting multiple Projects in the same repo a hassle in general and a really bad idea in some circumstances.


Looking at my .hgignore file, my slashes seem to to be the other way around (a forwrad slash instead of a backslash). i.e:

glob:*/bin/*

Try that maybe?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜