SVN:从不存在的路径切换?

发布于 2024-12-07 09:49:17 字数 199 浏览 0 评论 0原文

我有一个已移动的存储库,已重命名路径,然后截断了日志。所以我里面没有旧路径。当我尝试执行 svn switch https://new.repo/new/path svn 抱怨“无法替换内部目录”。我该如何避免这种情况?

PS 重新创建旧路径不是一个选项。

I have a repository which was moved, path renamed and then logs truncated. So I don't have old path in it. When I try to do svn switch https://new.repo/new/path svn complains "Cannot replace a directory from within". How do I avoid this?

P.S. Recreating old path is not an option.

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

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

发布评论

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

评论(5

伴梦长久 2024-12-14 09:49:18

嗯,已经解决了,但

svn --relocate https://old.repo/old/path https://new.repo/new/path

应该能很好地解决问题

Well, already solved but

svn --relocate https://old.repo/old/path https://new.repo/new/path

should do the trick nicely

暗恋未遂 2024-12-14 09:49:18

我遇到了同样的问题,无法让它与“switch”或“switch --relocate”一起工作。正如最初的问题所述,我收到错误“无法从内部替换目录”,前者和后者“重新定位只能更改 URL 的存储库部分”,

因为我在 CentOS 上,所以我可以使用 sed 手动通过从工作目录的根目录运行以下命令来更新 .svn/entries 文件中的 url:

find . -type f -name entries -exec sed "s/old\/path/new\/path/" -i {} \;

I had this same issue and was not able to get it to work with either "switch" or "switch --relocate". As the original question states, I got the error "Cannot replace a directory from within" with the former and with the latter "Relocate can only change the repository part of an URL"

As I am on CentOS I was able to use sed to manually update the url in the .svn/entries files by running the following from the root of my working directory:

find . -type f -name entries -exec sed "s/old\/path/new\/path/" -i {} \;
无畏 2024-12-14 09:49:17

如果它仍然是相同的存储库,并且只是存储库的路径发生了更改,那么您应该将 --relocate 选项传递给 svn switch。这有帮助吗?

svn switch --relocate https://new.repo/new/path

(警告:如果不是同一个存储库,则使用 --relocate 会破坏内容)

If it's still the same repo, and it's just the path to the repo that's changed, then you should be passing the --relocate option to svn switch. Does that help?

i.e.

svn switch --relocate https://new.repo/new/path

(Warning: If it's not the same repo, then using --relocate will break things)

孤独患者 2024-12-14 09:49:17

从新位置签出并将旧工作副本的内容复制到新工作副本上

checkout from new location and copy the contents of old working copy over your new Working copy

染墨丶若流云 2024-12-14 09:49:17

问题解决了。我创建了一个脚本来更改所有 .svn/entries 中的路径。一切正常。

Problem was solved. I've created a script that changed path in all .svn/entries. Everything works.

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