You need to remove that file for it to be ignored.
hg remove -Af myfile
(remove from the revision while leaving a copy on your workspace: or hg forget
)
But your Mercurial repository won't "forget" those same files in the previous revisions.
Removing a file does not affect its history.
It is important to understand that removing a file has only two effects.
- It removes the current version of the file from the working directory.
- It stops Mercurial from tracking changes to the file, from the time of the next commit.
Removing a file does not in any way alter the history of the file.
Another way, when you have a lot of extra files you need now to ignore is:
- remove them (from the file system, not with an hg command, but with an OS 'rm' command)
hg addremove
(warning, it will add currently non-committed files, but it will hg remove
all the other files you just rm'ed)
See How to forget all removed files with Mercurial for more.