Suppose you have two unpublished commits in Mercurial and like to join them into single commit:
... --> THIS --> ... --> THAT --> ... --> LAST
Check that your commits are not published:
$ hg glog -r "draft() & ($THIS | $THAT)"
$ hg up
and import commits up to
THIS into MQ:
$ hg qimport $THIS::.
Un-apply all patches and apply only first
$ hg qpop -a $ hg qpush $ hg qapplied ... THIS ...
$ hg qfold $THATNAME
To find name
$ hg qseries
qfold preserve commit messages!
Apply all patches and move them to repository history:
$ hg qpush -a $ hg qfinish -a
You can rearrange patches in MQ when they unapplied. In this way you may perform join in any
point of drafted changes. For this purposes edit
hg qfold $(hg qunapp) you can join all unapplied patches into current patch. Commit
messages would be preserved.
Tips on official Mercurial wiki about concatenating changesets.
Tips on official Mercurial wiki about rebase extension.
Can I squash commits in Mercurial?
With Mercurial, how can I “compress” a series of changesets into one?