.hgignore is designed to be tracked by Mercurial (doc). The standard way to ignore files in local clone only is to use ui.ignore
setting:
# .hg/hgrc
[ui]
ignore = /path/to/repo/.hg/hgignore
If you have multiple local ignore files then you can write
[ui]
ignore.first = /path/to/repo/.hg/firstignore
ignore.second = /path/to/repo/.hg/secondignore
Additional global ignore files can be configured in this way:
[ui]
ignore.first = /path/to/repo/.hg/firstignore
ignore.second = /path/to/repo/.hg/secondignore
ignore.third = ~/thirdignore
All settings live in hgrc
file. More details here:
hgrc
file location: docui.ignore
setting reference: doc- about
.hgignore
files: doc - original recipe: Tips And Tricks