SVN - 检索项目“替换为”的历史记录现有目录

发布于 2024-08-31 08:03:34 字数 305 浏览 5 评论 0原文

我从 SVN 主干创建了一个分支。在分支中,另一位开发人员删除了一个目录,但随后使用相同的文件读取了该目录。当我将分支中的更改合并回主干时(使用 TortoiseSVN),该目录有一条“替换为”消息。不幸的是,我将它们合并了(分支中的这些文件都没有更改,但由于它被删除和添加,所以它显示为更改)。现在,这些文件的历史记录只能追溯到在分支中读取它的时间。我在合并之前的标签中有旧历史记录,但必须去那里获取历史记录是很痛苦的。

有没有办法更新文件以将历史记录放回到主干中?即使我将标签合并到主干中,它实际上会更新完整的历史记录吗?我有一种感觉,它只会合并任何文件更改,而不是历史记录。

I created a branch from my SVN trunk. In the branch, another developer deleted a directory, but then readded it with the same files. When I merged the changes from the branch back into the trunk (using TortoiseSVN), this directory had a "replace into" message. I unfortunately merged those in (none of these files in the branch had changed, but since it was deleted and added, it showed up as a change). Now, the history for those files only goes back to the time it was readded in the branch. I have the old history in a tag from before the merge, but it is a pain to have to go to that to get the history.

Is there a way to update the files to get the history back into the trunk? Even if I merge the tag into the trunk, would it actually update the full history? I have a feeling it would just merge any file changes, not the history.

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

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

发布评论

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

评论(1

涫野音 2024-09-07 08:03:34

您应该再次删除最后添加的目录,然后通过从实际修订版复制来恢复(!!)旧目录。

例如:正确的目录是在 42 rev,在 43 时被删除,在 44 时创建新目录。所以当前的版本是 45。您删除目录 (46) 并执行某种操作(未经测试):(

svn copy http://server/full/server/path/to/directory@42 .

如果您想将目录恢复到当前目录或完整的服务器/本地路径,请指定 .

在此之后你会得到“旧”目录及其完整的历史记录

you should again delete the last added directory and after that restore (!!) old by copying from actual revision.

for example: the correct directory was at 42 rev, at 43 it was deleted and at 44 new was created. so current rev is 45. you delete directory (46) and do some kind of this (untested):

svn copy http://server/full/server/path/to/directory@42 .

(specify . if you want restore dir into current directory or complete server/local path otherwise)

after this you would get the "old" directory with its complete history

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