My Mercurial folder structure is like this, where "temp" is in the root of the folder.
temp
| 1world
| world
| world.txt
|
+---sub1
| 1world
| world
| world.txt
|
+---sub2
+---sub3
| misc.txt
| other
| otherfile.txt
|
\---sub4
world
I would like to ignore everything in the temp folder and its subfolders, except for files which are named "world" (only "world" and not "1world" or "world.txt" etc.)
Using syntax: regexp in .hgignore, I can match temp > world using ^temp/(?!world$)
, but I'm not able to get the full regex string right (to match world in all temp subfolders as well).
Any guidance will be much appreciated!
Update
I managed to get the result I wanted by manually listing each folder as such:
^temp/(?!world$|sub1|sub2|sub3|sub4)
^temp/sub1/(?!world$)
^temp/sub2/(?!world$)
^temp/sub3/(?!world$)
^temp/sub4/(?!world$)
However, I would much prefer it if I could just match world in all subfolders with a pattern, as it's easy to forget to update .hgignore when things change.