cvs2svn迁移后svn合并问题

发布于 2024-08-20 03:32:00 字数 544 浏览 6 评论 0原文

我们的团队有一个 cvs 存储库,我们通过 cvs2svn 将其转换为 svn。我们的存储库有一个主分支(让我们调用 main),它实际上充当主干(即使它在技术上很久以前就从主干分支出来)。

在 cvs2svn 转换之后,我将 main 分支到 branch

我在 branch 中做了一个小更改,然后尝试将 branch 合并回 main

[~/main] svn merge https:.../branch

这应该计算与 branch< 的差异/code> 由于分割发生,并将该 diff 应用于 main。然而,这件事可以追溯到几年前,导致了无数的冲突。

关于如何解决这个问题有什么想法吗?我已经搜索过谷歌但找不到任何东西。

我知道我可以调用 svn merge 并传入确切的修订号。我正在寻找更好的替代方案。

Our team had a cvs repository, which we converted to svn via cvs2svn. Our repository has a main branch (let's call in main), that effectively serves as trunk (even though it was technically branched off from trunk far in the past).

After the cvs2svn conversion, I branched off main to branch.

I made a small change in branch, and then attempted to merge branch back into main:

[~/main] svn merge https:.../branch

This should compute the diff to branch since the split happened, and apply that diff to main. It goes back a couple years too far back, however, leading to a zillion conflicts.

Any ideas on how to fix this? I've scoured Google but can't find anything.

I know that I can call svn merge and pass in the exact revision numbers. I'm looking for a better alternative.

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

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

发布评论

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

评论(1

嘿哥们儿 2024-08-27 03:32:01

您需要告诉 svn merge 您的合并点是什么,以便它知道要同步到 main 的提交范围。由于您没有指定范围,因此它默认为通过 HEAD 修订版的提交范围。这会导致太多的修改。

这将获取您将从中同步的上一个提交修订版:

svn log --xml --stop-on-copy https://.../branch | grep 'revision=' | head -n 1 | sed 's/.*revision="\([0-9][0-9]*\)".*/\1/g'

基本上,这将获取分支上的第一个副本修订版(我将其称为“REV”)。然后,您将其合并到“主”副本的 HEAD 修订版(在主目录中):

cd main
svn merge https://.../branch:REV https://.../branch:HEAD .

这应该将“分支”副本上从 REV 到 HEAD 的所有更改应用到“主”副本。即使对于从分支到主的重复合并,这也应该可以正常工作。

干杯!

You need to tell svn merge what your merge point is so it knows what range of commits to sync to main. Since you didn't specify a range, it defaults to the range of commits through the HEAD revision. This causes too many revisions.

This will get the previous commit revision that you will be syncing from:

svn log --xml --stop-on-copy https://.../branch | grep 'revision=' | head -n 1 | sed 's/.*revision="\([0-9][0-9]*\)".*/\1/g'

Basically, that gets the first copy revision on the branch (which I'll call "REV"). You'll then merge that to your 'main' copy's HEAD revision (in the main dir):

cd main
svn merge https://.../branch:REV https://.../branch:HEAD .

That should apply all changes from REV through HEAD on the 'branch' copy to the 'main' copy. This should work fine even for repeat merges from branch to main.

Cheers!

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