hg 解绑到新分支

发布于 2024-08-21 18:31:35 字数 230 浏览 5 评论 0原文

是否可以将捆绑的变更集解绑到存储库中的新分支中?我尝试在执行解绑之前切换到新分支,但这不起作用。

基本上我已经开始了一条新的开发线,并意识到我的提交应该在一个新的分支中。我已经完成了 hg strip 将变更集删除到捆绑包中,现在我想将此捆绑包重新提交到新分支。

我想我可以为每个提交重新创建补丁,然后手动重新提交每个补丁(或者编写一个脚本来执行此操作),但这似乎没有必要。感谢您的帮助!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

无法言说的痛 2024-08-28 18:31:35

一般来说,取消捆绑将完全按原样添加旧变更集(从相同的父变更集开始)。为每次提交重新创建补丁的一个不错的选择可能是使用移植或变基扩展(在这种情况下我会选择变基)。

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).

攒一口袋星星 2024-08-28 18:31:35

不会。分支属性是变更集本身的一部分,更改它会更改哈希值,本质上使其成为不同的变更集。捆绑只是手动完成的推/拉,它无法更改变更集,因此无法更改其分支。唯一可以做的是实际修改变更集或重新创建变更集,例如导出/导入、移植、histedit、mq 和转换。

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.

娇纵 2024-08-28 18:31:35

您可以将存储库克隆到临时存储库,将捆绑包解绑到其中,检查更改,如果满意,请将它们推送到主存储库。如果您不批准更改,只需删除临时存储库和捆绑包即可。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文