Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem appears specifically to be that matches in subdirectories are different to the root. Note the following:</p> <pre><code>$ hg --version Mercurial Distributed SCM (version 1.1.2) </code></pre> <p>It's an older version, but it behaves in the same way. My project has the following files:</p> <pre><code>$ find . -name 'abc*' -print ./x/abcabc ./x/abc.ml ./abcabc ./abc.ml </code></pre> <p>Here's my .hgignore:</p> <pre><code>$ cat .hgignore ^.*(?&lt;!\.ml)$ </code></pre> <p>Now, when I run <code>stat</code>:</p> <pre><code>$ hg stat ? abc.ml </code></pre> <p>So, <code>hg</code> has failed to pick up <code>x/abc.ml</code>. But is this really a problem with the regular expression? Perhaps not:</p> <pre><code>$ python Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) [GCC 4.3.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. &gt;&gt;&gt; import mercurial.ignore &gt;&gt;&gt; import os &gt;&gt;&gt; root = os.getcwd() &gt;&gt;&gt; ignorefunc = mercurial.ignore.ignore(root, ['.hgignore'], lambda msg: None) &gt;&gt;&gt; &gt;&gt;&gt; ignorefunc("abc.ml") # No match - this is correct &gt;&gt;&gt; ignorefunc("abcabc") # Match - this is correct, we want to ignore this &lt;_sre.SRE_Match object at 0xb7c765d0&gt; &gt;&gt;&gt; ignorefunc("abcabc").span() (0, 6) &gt;&gt;&gt; ignorefunc("x/abcabc").span() # Match - this is correct, we want to ignore this (0, 8) &gt;&gt;&gt; ignorefunc("x/abc.ml") # No match - this is correct! &gt;&gt;&gt; </code></pre> <p>Notice that <code>ignorefunc</code> treated <code>abcabc</code> and <code>x/abcabc</code> the same (matched - i.e. ignore) whereas <code>abc.ml</code> and <code>x/abc.ml</code> are also treated the same (no match - i.e. don't ignore).</p> <p>So, perhaps the logic error is elsewhere in Mercurial, or perhaps I'm looking at the wrong bit of Mercurial (though I'd be surprised if that were the case). Unless I've missed something, maybe a bug (rather than an RFE which Martin Geisler pointed to) needs to be filed against Mercurial.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload