如何重命名 SVN 分支并更新现有沙箱中的引用?

发布于 2024-10-19 00:37:56 字数 736 浏览 5 评论 0原文

我需要重命名一个 SVN 分支,所以我这样做了:

$ svn move https://server/repos/myrepo/branches/oldbranch \
    https://server/repos/myrepo/branches/newbranch

到目前为止,一切顺利——分支已被重命名。

问题是,我们从这个分支中签出了现有的沙箱,当我尝试更新时,我收到此错误:

$ svn update
svn: Target path '/branches/oldbranch' does not exist

一个相当不言自明的错误。经过快速搜索,我想我已经找到了解决方案:在分支重命名后重新定位 SVN 工作副本

问题是,当我尝试发出该命令,我收到另一个错误:

$ svn switch --relocate https://server/repos/myrepo/branches/oldbranch \
    https://server/repos/myrepo/branches/newbranch
svn: Relocate can only change the repository part of an URL

据我所知,我使用 --relocate 命令的方式与 Sander Rijken 相同。有什么想法为什么我会收到此错误吗?

I needed to rename a SVN branch, so I did:

$ svn move https://server/repos/myrepo/branches/oldbranch \
    https://server/repos/myrepo/branches/newbranch

So far, so good -- the branch has been renamed.

The trouble is, we have existing sandboxes checked out from this branch and when I try to update I get this error:

$ svn update
svn: Target path '/branches/oldbranch' does not exist

A fairly self-explanatory error. After a quick search I thought I had found the solution: Relocating SVN working copy following branch rename

The trouble is, that when I try to issue that command I get another error:

$ svn switch --relocate https://server/repos/myrepo/branches/oldbranch \
    https://server/repos/myrepo/branches/newbranch
svn: Relocate can only change the repository part of an URL

As far as I can see, I am using the --relocate command the same way as Sander Rijken. Any ideas why I get this error?

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

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

发布评论

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

评论(3

你不是我要的菜∠ 2024-10-26 00:37:56

执行即可。

svn switch https://server/repos/myrepo/branches/newbranch

只需在您的工作副本中

Just do

svn switch https://server/repos/myrepo/branches/newbranch

from within your working copy.

养猫人 2024-10-26 00:37:56

要更改相对路径,您必须使用pure svn switch(无论如何switch --relocate已被弃用),如第一种形式的 svn help switch 中所写

切换 URL[@PEGREV] [PATH]
更新工作副本以镜像存储库中的新 URL。

 此行为类似于“svn update”,并且是
 将工作副本移动到同一存储库中的分支或标记。

即在 oldbranch 的 WC 根目录中,现在是 newbranch,您必须使用

svn switch ^/branches/newbranch

For changing relative path you must to use pure svn switch (and anyway switch --relocate is deprecated), as written in svn help switch for 1-st form

switch URL[@PEGREV] [PATH]
Update the working copy to mirror a new URL within the repository.

 This behavior is similar to 'svn update', and is the way to
 move a working copy to a branch or tag within the same repository.

I.e in the root of WC for oldbranch, which is now newbranch, you have to use

svn switch ^/branches/newbranch

浅唱ヾ落雨殇 2024-10-26 00:37:56

如果您只是想在 Eclipse 中重命名 SVN 分支,最简单的方法就是进入 SVN Repository Exploring Perspective,然后右键单击您的分支 -> 。重构->重命名

If you had simply wanted to rename a SVN branch in Eclipse, the easiest would have been to go into the SVN Repository Exploring Perspective, and then right click on your branch -> Refactor-> Rename

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