Mercurial‎ > ‎

Rewriting History

This article discusses different approaches you can use to keep your commit history neat and tidy in Mercurial when it's displayed to you colleagues, even though you created it through a series of half-finished ones.

The scenario used as an example is this:

The file story.txt is located at a central repository of which you have created a local clone
The content of the file is:

Once upon a time

In you local repository you change the files in two different commits

Once upon a time
there was a prince

and then another:
Once upon a time
there was a prince
he conquered the world
and lived happily ever after

Now you want one of you colleagues to review your story, and you come to regret that you have made this through 2 separate commits, because you would really like to hand just one combined commit to your colleague for review. one that looks like this:

Once upon a time
there was a prince
he conquered the world
and lived happily ever after

So the challenge is, how do you accomplish that?




Comments