tags:

views:

187

answers:

3

Is it possible to unbundle bundled changesets into a new branch in a repository? I have tried switching to a new branch before performing the unbundle, but that doesn't work.

Basically I have started a new development line and realized my commits should have been in a new branch. I've done hg strip to remove the changesets into a bundle and now I would like to recommit this bundle to a new branch.

I suppose I could recreate patches for each commit and then recommit each manually (or perhaps write a script to do it), but this seems unnecessary. Thanks for the help!

A: 

You could clone your repository to a temporary repository, unbundle the bundle into it, check the changes, and if you're satisfied, push them to your main repository. If you don't approve of the changes, simply delete the temporary repository and the bundle.

Ben.Vineyard
that doesn't change what branch they're on though
Ry4an
+1  A: 

In general, unbundle will add the old changesets exactly as they were (starting off from the same parent changeset). A nice alternative to recreating patches for each commit might be in using the transplant or rebase extension (I'd go for rebase in this case).

djc
Thanks for the help. I'll try this out and see how it goes.
Michael Mior
Sorry for the delay. In trying this out with the transplant extension, I find it won't do what I want. When I try with rebase, I get the error:`abort: source is ancestor of destination`
Michael Mior
Just to clarify, I added a new branch, committed, then tried to rebase changes onto the revision corresponding to the new branch
Michael Mior
A: 

No. The branch attribute is part of the changeset itself and altering it would alter the hashid, essentially making it a different changeset. A bundle is just a push/pull done manually, and it can't alter the changesets so it can't change their branch. The only things that can are things that actually modify the changeset or recreate it like export/import, transplant, histedit, mq, and convert.

Ry4an