4

I'm trying to share a repository between my Mac (laptop) and PC (desktop). There are some external dependencies for the project that are stored on different places on each machine, and noted in the .classpath file in the Eclipse project. When the project changes are shared, the dependencies break. I'm trying to figure out how to keep this from happening.

I've tried using .hgignore with the following settings, among others, without success:

syntax: glob
*.classpath

Based on this question, it appears that the .hgignore file will not allow Mercurial to ignore files that are also committed to the repository. Is there another way around this? Other ways to configure the project to make it work?

Community
  • 1
  • 1
Feanor
  • 2,715
  • 4
  • 29
  • 43
  • The whole point of the .hgignore file is to keep certain files from getting committed. If you don't want .classpath files in the repo, remove them and change your .hgignore. I would also say that if the .classpath is not the same on all your machines, it just cannot be in the central repo. I'm not aware of a trick that lets you ignore it automatically on one or two machines but have it in your repo for all the other machines. – Tom Cabanski May 01 '10 at 22:40

1 Answers1

6

The file must not be already commited to be ignored (as you noted in your question), other wise a 'hg remove -Af .classpath' is required to remove it from the repo without removing it from your local working tree.

And:

syntax: glob
.classpath

should be enough (no '*' needed)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • VonC: Like I said, that was only one of the settings I tried; I thought the one you recommended would be enough as well, but tried others in hopes of finding a solution. Thanks for the info. – Feanor May 02 '10 at 04:31
  • Just tried this and it worked absolutely perfectly. Thanks so much for a great answer. – Feanor May 02 '10 at 05:28
  • 1
    you can also use hg forget to do hg remove -Af – jk. May 04 '10 at 09:37