The .hgignore
file only tells relevant commands to avoid picking up new files when you ask them to find files to add to your repository by scanning the directories and finding new and removed files.
The two I can remember, there might be more, are:
hg addremove
hg commit --addremove
That's it. If you either add a file to the repository before you tell Mercurial to ignore it, or specifically add a file to the repository even though it is being ignored, then Mercurial will start tracking the file.
And once it has started tracking it, it will keep on tracking it.
In other words, regardless of whether you have specified the file in .hgignore
, the following command will ask Mercurial to start tracking the file:
hg add manage.py
Whether you did this before or after you edited the .hgignore
file is irrelevant.
Your question sounds like Mercurial is already tracking this file. To get Mercurial to stop tracking the file, issue a forget command:
hg forget manage.py
and then do a commit. After that, changes to that file will not be picked up by Mercurial.