How to manage minor changes that you want to keep local in mercurial

mercurialworkflows

I'm considering migrating a 14 year old cvs repository (history intact) to mercurial. I think I've got all the technical conversion bits down, but I still have some questions about working effectively in mercurial.

One of the things I see a lot in individual developers' cvs sandboxes (including my own) is local uncommitted changes that aren't ready to be pushed to the mainline. My understanding is that this is a bad thing. Most of my experiments with hg suggest that uncommitted changes are a bad thing to have. The inability to merge with them is enough for that. So what I want to know is how other people who use mercurial in day to day coding deal with it. How do you deal with incomplete changes to code when it comes time to update your repository? How do you deal with local changes that you don't (yet) want to share with other developers?

Best Answer

I handle it this way:

In my local repository, I commit every change, even if I'm experimenting. If I'm okay with the experiment, and it's tested, I push it to the remote repository. If not, it stays in my local repository (or go back to an older revision).

The idea is that the remote repository only contains working, tested versions of my projects.