Chris Roberts

Mercurial: skipping unreadable ignore file

• Posted in Programming

On a particularly busy day recently (these things never happen on a quiet day), the project I was working on stopped building on my local machine.

Our build server, and my colleagues, were all able to build the repository - it was just me. It didn't take long to track the problem down to a step in the build process which extracts revision information from Mercurial. This was failing with the following error message:

skipping unreadable ignore file '': invalid mode ('r') or filename

Further investigation revealed that this issue was affecting all of my projects, not just the one I was working on.

So - my next suspicion was Mercurial itself - especially as I had installed a new version of SourceTree just that morning (ok - so these things are rarely the PC's fault!). The trouble is, downgrading SourceTree didn't solve the problem. Neither did uninstalling it and reverting to an installation of the command-line only Mercurial toolset.

After far too much head-scratching, I found the root of the problem - a rogue entry in my mercurial.ini file. This file doesn't get removed through uninstall / reinstall cycles - which explains why my attempts at doing so didn't fix the problem!

On my Windows installation, mercurial.ini was found in c:\Users\<User Name>\. In the [UI] section was the following line, which simply needed removing:


In hindsight, during installation of SourceTree I was asked whether I'd like a global ignore file. I elected not to have one, so I suspect the installer incorrectly added the problem configuration setting.