hg unbundle into new branch
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!
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).
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.
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.
精彩评论