<p><strong>Caveat:</strong>
I try all the posibilities listed here: <a href="https://stackoverflow.com/questions/254002/how-can-i-ignore-everything-under-a-folder-in-mercurial">How can I ignore everything under a folder in Mercurial</a>.<br>
None works as I hope.  </p>

<p>I want to ignore every thing under the folder <code>test</code>. But not ignore <code>srcProject\test\TestManager</code>  </p>

<p>I try</p>

<pre><code>syntax: glob
test/**
</code></pre>

<p>And it ignores <code>test</code> and <code>srcProject\test\TestManager</code></p>

<p>With:</p>

<pre><code>syntax: regexp
^/test/
</code></pre>

<p>It's the same thing.</p>

<p>Also with:</p>

<pre><code>syntax: regexp
test\\*
</code></pre>

<p>I have install TortoiseHG 0.4rc2 with Mercurial-626cb86a6523+tortoisehg, Python-2.5.1, PyGTK-2.10.6, GTK-2.10.11 in Windows</p>

You can use zero-width negative look-ahead and look-behind assertions to specify that you want to ignore
```
test
```
only when it's not preceded by
```
srcProject
```
and not followed by
```
TestManager
```
:
```
```
syntax: regexp
(?<!srcProject\\)test\\(?!TestManager)
```
```
Mercurial uses Python regular expressions, so you can find more info on zero-width assertions in the Python docs:
https://docs.python.org/library/re.html#regular-expression-syntax