views:

64

answers:

2

Is it normal? So you just need to add \.hgignore to the list to ignore itself?

+7  A: 

Yes, but you don't want to ignore the .hgignore file. When a new person checks out your repository, don't you want them to get your ignored-files list? Instead, do hg add .hgignore; hg commit.

Bottom line: .hgignore is tracked like any other file in the repository.

Borealid
+1 for noting the symmetry - Mercurial shies away from special cases which is a Good Thing.
msw
I can see sometimes we want `.hgignore` to be versioned as well, such as the `*.orig`, `*~` (emacs previous version file)... other time I may have `.csv` or `.txt` that I want to ignore but my coworkers don't want to ignore. They can always change their `.hgignore`, of course, but will they commit the file or should they?
動靜能量
@Jian Lin: If they commit the file and push it, then anyone else pulling will also get their ignore settings. I think it's pretty unlikely there are files only *some* people want to ignore - if one person is not ignoring it, then it goes in the repo to be versioned. So the other people shouldn't be ignoring it b/c it's tracked!
Borealid
Please see the `ui.ignore` config setting if you need a local ignore file in addition to the normal `.hgignore` file: http://www.selenic.com/mercurial/hgrc.5.html#ui
Martin Geisler
+1  A: 

Just to supplement Borealid's answer: ? in hg status means that the file is in the working directory, but not tracked. You usually see it in one of two situations:

  1. A file got generated that you don't need to check in, like a compiled binary or something.
  2. You added a new file to your project, but haven't hg added it yet.

In #1, you'll want to add the file or file type to .hgignore. In #2, you want to hg add the file. In the case of .hgignore, it's #2.

tghw