I have a Mercurial repository with several subrepos. Is there a possibility to only define a general .hgignore-File (e.g. to ignore object-files) both in the main repository and, optionally a specialized one in the sub-repositories?
There is not enough information in the manual. Specifying a .hgignore file with
[ui]
ignore = .hgignore
to .hgrc in my home-directory also does not work.
Any ideas?
A
.hgignore
file in each subrepo would serve as the specialized one for that subrepo. Then you can use the main repo's.hgignore
as the main one by including this in each subrepo'shgrc
file:The reason why doing
ignore = .hgignore
didn't work for you in your global.hgrc
(and won't in repohgrc
) is that having simply.hgignore
is a relative file path and its resolution to an absolute path depends on the current working directory used when invokinghg
. Examples:\repos\main\
and invokehg st
, it will look for\repos\main\.hgignore
. Same thing if you invokehg st -R nested
, because the current working directory is still the same.\repos\main\nested\
and then invokedhg st
, the config would now be looking at\repos\main\nested\.hgignore
.If you want to specify a global
.hgignore
that is in your home directory, you would need to specify it with a non-relative path (or at least much less relative):