2

In the early stages of one of my projects the person I was working with added their entire elipse workspace to our mercurial repository. After I updated the .hgignore file to prevent this from happening again I ran hg forget to get rid of all the files out of our repository.

The problem is that when this other person pulled later on and changed to a new branch I had created he lost all his workspace plugins etc and can no longer build the project.

What is going wrong? doesn't .hgignore do just that, ignore the files? Why is it going through and deleting the files in his local copy?

KidProQuo
  • 25
  • 4

1 Answers1

1

What's going on is you ran hg forget which removed the files from the repository. The next time the developer updated their local working copy from that same repository to a revision after the removal of the files, the files were removed from that person's working copy, thus breaking his workspace.

Note that hg forget is just a hg remove -aF, but it's your workspace that Hg leaves the files in, not his.

See more here and here.

Community
  • 1
  • 1
Sumo
  • 4,066
  • 23
  • 40
  • Ah, okay. Is there a way of doing a repo cleanup without it affecting the newly ignored files on other peoples versions? Otherwise I guess I'll just get him to hg forget the files himself. – KidProQuo Sep 13 '11 at 08:42
  • 1
    `hg forget` only removes the files from the current branch, not from the entire project history, so the other dev is safe until they update to that revision. I think in this case, the dev who incorrectly committed these files is the one who will need to forget them to avoid deletion of them on their machine. – Sumo Sep 14 '11 at 03:53