SVN:从不存在的路径切换?
我有一个已移动的存储库,已重命名路径,然后截断了日志。所以我里面没有旧路径。当我尝试执行 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
嗯,已经解决了,但
应该能很好地解决问题
Well, already solved but
should do the trick nicely
我遇到了同样的问题,无法让它与“switch”或“switch --relocate”一起工作。正如最初的问题所述,我收到错误“无法从内部替换目录”,前者和后者“重新定位只能更改 URL 的存储库部分”,
因为我在 CentOS 上,所以我可以使用 sed 手动通过从工作目录的根目录运行以下命令来更新 .svn/entries 文件中的 url:
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:
如果它仍然是相同的存储库,并且只是存储库的路径发生了更改,那么您应该将
--relocate
选项传递给svn switch
。这有帮助吗?即
(警告:如果不是同一个存储库,则使用
--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 tosvn switch
. Does that help?i.e.
(Warning: If it's not the same repo, then using
--relocate
will break things)从新位置签出并将旧工作副本的内容复制到新工作副本上
checkout from new location and copy the contents of old working copy over your new Working copy
问题解决了。我创建了一个脚本来更改所有 .svn/entries 中的路径。一切正常。
Problem was solved. I've created a script that changed path in all .svn/entries. Everything works.