[Bug 4442] New: The hgignore fileset and hg status are not consistent

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Thu Nov 6 15:21:54 CST 2014


http://bz.selenic.com/show_bug.cgi?id=4442

          Priority: normal
            Bug ID: 4442
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: The hgignore fileset and hg status are not consistent
          Severity: bug
    Classification: Unclassified
                OS: Linux
          Reporter: vgatien-baron at janestreet.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: 3.0.2
         Component: Mercurial
           Product: Mercurial

When running hg status, a file seems to be ignored when the path relative to
the root of the file itself or its containing directories are matched by one
pattern.

When using the fileset 'hgignore()', it looks like only the file itself is
matched against the hgignore, resulting in an undesirable inconsistency (I'm
trying to find files that are committed and ignored to complain about them).

As is shown by this test, the problem apparently only happens for re patterns
that are anchored on the right:

#!/bin/bash
cd /tmp
for syntax in $'syntax:glob\na' $'syntax:re\na' $'syntax:re\na$'; do
  rm -rf repo
  hg init repo
  cd repo
  echo "$syntax"  > .hgignore
  hg debugignore
  mkdir a
  touch a/b
  # this shows that a/b is matched by the hgignore
  hg st -A a/b
  hg add a/b
  # but not when using filesets, with the last regexp
  hg locate 'set:hgignore()'
  cd ../
  echo
  echo
done

outputs:

(?:(?:|.*/)a(?:/|$))
I a/b
a/b


(?:.*a)
I a/b
a/b


(?:.*a$)
I a/b

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list