svn import 混乱,主干上什么也没有

发布于 2024-10-01 01:12:00 字数 1049 浏览 3 评论 0原文

我查看了 如何在没有主干的情况下在现有的 svn 存储库中创建主干目录并移动所有,它可能适用,但是,我有一个“主干”,但是开发人员(高级开发人员)导入的方式该项目与 svn 存储库可能会提供值得审查的差异。

从日志来看,开发人员在本地创建了一个 svn 树,一个 trunk/branches/tags 目录,创建了branches 目录中的所有文件,然后初始导入到 svn,提交主干和标签作为分支提交的一部分。

这意味着没有复制到分支的历史记录。接近保真度的日志是:

% cd work
% mkdir -p project/trunk project/branches project/tags
% cd project/branches
... begin a bunch of work on a java service v1.0
... happy lets import to svn
% cd ..
% pwd project
% svn import -m"Initial import"
A branches
A branches/file-n
A branches/file-n ...
A tags
A trunk
Sending...
Committed rn
% svn mv $repos/project $repos/project_name
...
Committed rn

所以 svn merge 在这里不起作用。 trunk 是初始提交的一部分,历史记录实际上并不允许干净合并。

我可以使用复制和提交建议以上?或者在这种情况下还有其他必要的方法吗?

I looked at how to create trunk directory in existing svn repo without a trunk and move all, and it might be applicable, however, I have a "trunk" but the manner in which the developer, a senior one at that, imported the project to the svn repos may provide a difference worth review.

It appears, looking at the log, that the developer locally created a svn tree, a trunk/branches/tags directory, created all the files in the branches directory, then on the initial import to svn, committed trunk and tags as part of the branches commit.

This means there's no history of a copy to a branch. The log, in near-fidelity, is:

% cd work
% mkdir -p project/trunk project/branches project/tags
% cd project/branches
... begin a bunch of work on a java service v1.0
... happy lets import to svn
% cd ..
% pwd project
% svn import -m"Initial import"
A branches
A branches/file-n
A branches/file-n ...
A tags
A trunk
Sending...
Committed rn
% svn mv $repos/project $repos/project_name
...
Committed rn

So svn merge does not really work here. trunk is part of the initial commit, history is not really allowing a clean merge.

Could I use the copy and commit suggestion above? Or is there another way that is necessary in this case?

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

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

发布评论

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

评论(1

夏见 2024-10-08 01:12:00

我在 SO 结合了几件事解决了这个问题。

最终,此举不会对我们组织的构建流程产生作用。这会将分支历史记录保留在主干上,但将分支留空。我们的构建不会喜欢这样。

相反,我通过 svn export 将文件复制到 trunk 目录(当然没有 .svn 目录)并提交它们。

现在,有些人可能会说,你只是失去了历史。我对此不太确定。分支的历史仍然存在,并且从主干创建了一个新分支。之前的分支仍然处于活动状态,并且可以在流程允许的情况下退役,标记为 EOL 等。

欢迎反馈。

I solved this with a combination of a couple of things here at SO.

Ultimately, a move would not have worked for our organization's build process. This would have kept the branch history on trunk, but left the branch empty. Our builds would not have liked that.

I instead copied the files to the trunk directory, sans .svn directories of course, via svn export and committed them.

Now, some might say, you just lost history. I'm not so sure about that. The history of the branch is still there, and a new branch was created from trunk. The previous branch remains active and can be retired is process allows, tagged EOL, etc.

Feedback welcome.

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