I use empty .hg_keepfiles to store some (otherwise empty) folders in Mercurial.
The problem is that I cannot find a working regular expression that excludes everything except files .hg_keep.
lets say that we have this structure:
a/b/c2/.hg_keep
a/b/c/d/.hg_keep
a/b/c/d/file1
a/b/c/d2/.hg_keep
a/b/.hg_keep
a/b/file2
a/b/file1
a/.hg_keep
a/file2
a/file1
and I want to save only files .hg_keepunder a/b/.
using http://gskinner.com/RegExr/ I created the following .hgignore:
syntax: regexp
.*b.*/(?!.*\.hg_keep)
but Mercurial ignores all .hg_keepfiles in subfolders b.
? .hgignore
? a/.hg_keep
? a/b/.hg_keep
? a/file1
? a/file
I a/b/c/d/.hg_keep
I a/b/c/d/file1
I a/b/c/d2/.hg_keep
I a/b/c2/.hg_keep
I a/b/file1
I a/b/file2
I know that I can hd addall files .hg_keep, but is there a solution with regex (or glob)?