Using the "tortoisehg-stable-2.7.2174.123-x64-7b2a0a64ceca.msi" package under Windows 7: https://bitbucket.org/tortoisehg/thg-winbuild/downloads $ hg --version Mercurial Distributed SCM (version 2.6-rc+23-f01a351db791) (see http://mercurial.selenic.com for more information) Copyright (C) 2005-2012 Matt Mackall and others This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Init a repo: $ hg init Create a "foo/bar" file and commit: $ mkdir foo $ echo baz> foo/bar $ hg add $ hg commit -m "Initial" Mark everything else in the "foo" directory as ignored: $ echo ^foo$> .hgignore For some reason Mercurial 2.6 indicates files explicitly added under "foo" as 'deleted': $ hg status ! foo/bar ? .hgignore
At this stage (after the description) I can add ".hgignore" and commit: $ hg add adding .hgignore $ hg commit -m "Test" And I'm still seeing: $ hg status ! foo\bar I've probably first noticed this about a month ago with few existing repos of mine, trying couple of TortoiseHg nightly builds (but reverting quickly to the stable version).
Changing the ignore pattern to: glob:foo/** dismisses the problem, but I would like to use regexp syntax, as I've read it is more effective for ignoring whole directory hierarchies (when issuing `hg status`, for example). I would prefer to not having to edit existing .hgignore files just to workaround this issue, also.
Your regex is wrong -- it should be "^foo/", not "^foo$". The ignore regexes match files, not directories.
sid0: Nonetheless, tracked files that are present should not be reported as missing. Regression -> urgent Bisect sez: The first bad revision is: changeset: 18625:2cbd27f4f3c4 user: Durham Goode <durham@fb.com> date: Mon Feb 04 14:27:15 2013 -0800 summary: dirstate: walk returns None for files that have a symlink in their path http://www.selenic.com/hg/rev/2cbd27f4f3c4
For the record, the ignore file for my home directory is ".*" (ignore any file I haven't specifically tracked) but doesn't encounter this issue.
(In reply to comment #3) I've commented further to the general mailing list: http://www.selenic.com/pipermail/mercurial/2013-May/045508.html
Huh, we do match directories: http://selenic.com/repo/hg/file/4cdec37f0018/mercurial/dirstate.py#l667 It's been there since 2008 too. Surprising.
Investigating
The fix for this has been pushed upstream to stable. It should be in the next release (2.6.1, or 2.7, or whatever is next).
*** Bug 3930 has been marked as a duplicate of this bug. ***
*** Bug 3932 has been marked as a duplicate of this bug. ***
*** Bug 3995 has been marked as a duplicate of this bug. ***