Mercurial is presently ignoring a file which I believe shouldn't be ignored. The .hgignore
file is remarkably large, and after a cursory read-through it's not obvious which rule(s) is/are the culprit.
Is there a way to get Mercurial to tell me which rules in the .hgignore (if any) match a file?
You can't do this out of the box, but you can write Mercurial extension for this.
I've written extension hg-isignored that can show you which rules in .hgignore match specified folder or file.
Installation
Clone extension source somewhere, i.e. in
~/.hgrc.d/hg-isignored
folder:Add extension in extensions section of your
.hgrc
file:Now Mercurial will be able to use
isignored
command that's implemented by extension.Usage
While you're in Mercurial repository, run command
hg isignored PATH
, where instead of PATH insert folder or file that you want to check, i.e.hg isignored readme.txt
. Extension will tell you if specified PATH is ignored and will show you used rule.Testing
Init
No .hgignore
Added .hgignore
Not ignored file
Ignore folder
Ignore everything in folder