views:

67

answers:

2

I'm developing a project, and I am making small, exploratory changes. After each change, I'd like to diff against the previous version I had. However, I don't want to commit each of these small changes to the permanent history until I'm satisfied that the final change should be made permanent. Then I'd like to commit it in one go.

What's the feature in Mercurial that lets me do this?

+6  A: 

I think you're looking for mercurial queues... it allows you to maintain a set of patches against source without committing them. You can push and pop patches until you get things right, then commit as appropriate.

Nice blog post here http://www.canonware.com/~ttt/2008/04/using-mercurial-patch-queues-for-daily.html

Or official documentation here http://hgbook.red-bean.com/read/advanced-uses-of-mercurial-queues.html

Sam Post
+1  A: 

You can use MQ as Sam mentioned, or you could just commit as usual and then use the Collapse extension or the HistEdit extension to fold the "intermediate" changesets together. You would just need to make sure you don't push them anywhere in the mean time.

Steve Losh
One advantage of the MQ approach is HG won't allow a push to a remote repo if you have patches applied.If you use Steve's alternate suggestions, you can also use MQ for it's folding functionality. Import existing changesets, fold, and then finalize them.
Mikezx6r