|See you at MIX11 »|
Here is how to merge/combine/fold multiple changesets to one. For instance when you commit some changes, then refactor, then apply review comments, . and at the end you have a set of changesets, and you want to get rid on the whole history, so there is only one left.
In the example below, I created two fake changesets: Foo and Bar
I want to merge them to one changeset. The idea in Mercurial is to :
- 1- update to a specific revision (5384) which will
a. revert the files' contents to this revision
b. mark this revision as the parent of next commits
2- revert the changes to the tip revision (5386), which will recreate the content, without changing the parent of commits
3- commit changes
4- delete old changeset
Complete story with screenshots
1- Right click on the revision 5384 and click Update, nothing hard here
2- Select the tip revision,
then in the files list,
right click on a file,
click on Revert to Revision
check 'all files'
ok, ok, ok, .
3- Go to Working Directory, and you'll see the file system is like at the tip, but the parent revision is the one you wanted, so the diff contains all the changes.
4- To delete the old changesets, you can use the 'mq' extensions from settings, then 'strip' them like this :
Trackback address for this post
Feedback awaiting moderation
This post has 49 feedbacks awaiting moderation...