views:

88

answers:

3

I have these in the proj/.hgignore:

syntax: glob
log/*
*~
*.orig
dump/*
*.hgignore
.hgignore
tmp/*

but for some reason, when I do an hg st or hg com, the file .hgignore still shows up to be modified or to be committed. So the .hgignore cannot be ignored? There might be particulars in my folder that my team didn't want to ignore but I do. So I don't want to commit this file.

+2  A: 

I think you're looking for this:

http://mercurial.selenic.com/wiki/TipsAndTricks#Ignore_files_in_local_working_copy_only

The overall .hgignore file is necessary to ignore anything, and so you can't exclude it.

Paul McMillan
That's only necessary if you want both a tracked .hgignore and an untracked one. If all he wants is an untracked one he just need to not commit it.
Ry4an
+3  A: 

Chris has it in the comment: you've probably already added your .hgignore file, and an add overrides the .hgignore. You need to hg forget .hgignore and hg commit and then you'll find your file is ignored.

Thats said, most people put the .hgignore file into the repo for a reason -- so that the next person to clone doesn't accidentally commit all of their log/temporary files.

Ry4an
thanks. so that means I have to remove .hgignore from the project for it to be ignored? so if this way, there is really no convenient way to have my own addition of filenames to the .hgignore once it is committed, and it is good to be committed for other people to have a base set of filenames... how about a .hgignore.local so that we can have our own additions?
動靜能量
The link in my answer is functionally equivalent to what you're requesting.
Paul McMillan
You're right, but it's only necessary if you want both stuff that's ignored for everyone and stuff that's ignored for just you. If you only want stuff that's ignored for you you can put it in .hgignore and never add/commit it, and it still takes effect. Your statement "The overall .hgignore file is necessary to ignore anything, and so you can't exclude it." is inaccurate -- it works just fine to put .hgignore and other stuff in .hgignore and never commit it.
Ry4an
A: 

You could use an extension like MQ to store your changes to .hgignore in patch. You can't push an MQ patch. You'll have to qpop this patch to do pushes and pulls, then qpush it to apply it again.

Mark Tolonen
Why the -1? He wanted to store personal changes to .hgignore that he didn't want to commit. He'll never accidentally commit it with this method.
Mark Tolonen