No need to have a clone, you can work in the original repo. You can transfer D, E, and F over C, creating copies of D1, E1, and F1 (which will be identical to the originals, provided that there are no conflicting changes). You will have the following:
A -> B -> C -> N1 -> N2 -> N3 -> D -> E -> F \_ D1 -> E1 -> F1
Then you can delete the originals. See below script.
$ hg update C $ hg transplant DEF $ hg strip D
You need to enable two extensions: transplant and mq . To do this, add these lines to your hgrc :
[extensions] transplant= mq=
Update:. Starting with Mercurial 2.0, graft (built-in command) can be used instead of transplant ; reba, as Laurens Holst suggests , should work equally well.
Helgi source share