just noticed .hgignore is under rev control

Peter Hosey boredzo at gmail.com
Thu Oct 30 01:52:03 UTC 2008


On Oct 29, 2008, at 18:09:02, Patrick Waugh wrote:
> Am I right to assume that one could confuse the repository if one  
> did not have it under revision control and one then made changes  
> to .hgignore?

It's normal to create, edit, and optionally hg add the .hgignore file  
yourself. Compare to .hgtags, which is normally created, edited, and  
automatically added and committed by the hg tag command (and which you  
only occasionally need to edit by hand).

There are two ways to handle .hgignore:

1. Version-control it.
2. Add it to itself.

It doesn't matter which you do because hg uses the .hgignore file in  
your working copy (if and only if there is one), regardless of  
any .hgignore files that may exist in history. This is how you're able  
to add it to itself: if hg instead only looked for it in history, then  
the .hgignore in the working copy (but not added) would not apply, so  
it would still show up as a '?' in hg status.

At any rate, even if you critically fail and leave a corrupted file,  
hg will simply warn about the syntax error; it shouldn't stop hg from  
working.

In case you're wondering, I prefer to version-control it. That  
probably has something to do with me coming from Subversion, where  
ignore is a property of a version-controlled directory.




More information about the Mercurial mailing list