Mercurial/.hgignore - How do I ignore everything but the contents of a folder?

Posted by Beibin on Stack Overflow See other posts from Stack Overflow or by Beibin
Published on 2010-03-31T20:31:01Z Indexed on 2010/03/31 20:33 UTC
Read the original article Hit count: 355

Filed under:
|
|
|
|

I have a NetBeans project and the Mercurial repository is in the project root. I would like it to ignore everything except the contents of the "src" and "test" folders, and .hgignore itself.

I'm not familiar with regular expressions and can't come up with one that will do that.

The ones I tried:

(?!src/.*)

(?!test/.*)

(?!^.hgignore)

(?!src/.|test/.|.hgignore)

These seem to ignore everything, I can't figure out why.

Any advice would be great.

© Stack Overflow or respective owner

Related posts about mercurial

Related posts about ignore