Question

Is it possible to have a branch-specific ignore file in mercurial?

It would be handy to have dependencies included in a production branch, but not in a development branch.

Était-ce utile?

La solution

Mercurial always uses the checked out .hgignore file. So technically you can have different .hgignore files on different branches, but when you use this scheme, you need to take care that they stay different when you merge between this branches.

When you have only one system where the additional ignore patterns should apply, you can also specify an additional igore file within .hg/hgrc via the ui.ignore setting.

$ cat >> .hg/hgrc << EOF
[ui]
ignore=.hg/production_ignore
EOF
$ cat > .hg/production_ignore << EOF
# example ignore file, uses the same syntax as .hgignore
syntax: glob
*.swp
*.~
EOF
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top