Mercurial 中的跨存储库合并?
我正在考虑从 SVN 切换到 Hg,目前 Foo 项目有一个典型的 SVN 布局:
Foo
trunk
branches
1.0
1.1
我可以使用 hg import 命令将此结构导入到 Hg 中,为主干和两个分支创建一个单独的存储库(通过使用 --config Convert.hg.clonebranches=1
导入开关。)
现在,如果客户在 Foo v1.0 中发现错误,我如何将此修复应用于 1.1 和主干存储库?它们是旧 SVN 分支的单独副本,因此 hg merge
不起作用,是吗?
如果我在 Hg 上从头开始一个新项目,那么我可以使用不同版本的标签,并轻松地将更改从一个标签合并到另一个标签,但从 SVN 导入时我没有这种奢侈......或者我错过了一些东西?
I am considering a switch from SVN to Hg and currently have a typical SVN layout for project Foo:
Foo
trunk
branches
1.0
1.1
I can import this structure into Hg using the hg import
command, creating a separate repository for the trunk and two branches (by using the --config convert.hg.clonebranches=1
import switch.)
Now, if a customer finds a bug in v1.0 of Foo, how can I apply this fix to the 1.1 and trunk repositories? They're separate copies of the old SVN branches so hg merge
isn't going to work is it?
If I was starting a new project from scratch on Hg then I could use tags for the different releases and easily merge changes from one tag to another, but I don't have this luxury when importing from SVN ... or have I missed something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我喜欢
hg移植
(移植扩展主页):这个将进行提交并将其移动到某个地方。 -s 选项可让您将其从一个存储库移动到另一个存储库。您还可以指定要进行的合并、单个修订、多个修订,或者让它启动“交互式变更集选择器”(无论这意味着什么)。 (虽然我还没有尝试过存储库之间的合并选项......但我知道指定变更集效果非常好!)
I like
hg transplant
(transplant extension homepage) for this: this will take a commit and move it somewhere. The -s option will let you move it from one repo to another.You could also specify a merge to happen, and single revisions, multiple revisions, or have it fire up an "interactive changeset selector" (whatever that means). (Although I haven't tried the merge option between repos... but I know that specifying a changeset works just great!)
您应该能够使用正常的推/拉合并来来回获取更改。 Convert 足够智能,1.0 和 1.1 中相同的部分将是相同的变更集。因此,在 1.0 中进行更改,您应该能够将其拉入 1.1 和 main 并干净地合并。
如果您认为您将从 1.1 和 main 进入 1.0,只需在进行更改之前 hg update 到您知道在 1.0 中的变更集,您就会也能够在 1.0 中干净地拉取并合并它。
You should be able to use normal push/pull merge to get the changes back and forth. Convert is smart enough that the parts of 1.0 and 1.1 that are identical will be the same changesets. So make the change in 1.0 and you should be able to pull it into 1.1 and main and merge cleanly.
If you think you'll be going from 1.1 and main into 1.0, just
hg update
to a changeset that you know is in 1.0 before making the change, and you'll be able to cleanly pull and merge that in 1.0 too.