SVN - 创建新存储库并从旧存储库添加主干和分支
我想重命名我的 SVN 存储库。我尝试使用 svn copy 命令从一个存储库复制到另一个存储库,但这不起作用:
F:\Old>svn copy https://devserver2.sockltd.local/svn/Dantooine https://devserver2.sockltd.local/svn/IOCPTest
svn: Repository moved permanently to 'https://devserver2.sockltd.local/'; please relocate
当我查看存储库列表时,IOCPTest 不存在。
有没有某种方法可以重命名存储库,或者我应该导出旧存储库并将其内容转储到新存储库中。问题是,采用这种方法,我会失去分支和修订历史记录。
谢谢
I'd like to rename my SVN repository. I've tried an svn copy command to copy from one repository to another, but this doesn't work:
F:\Old>svn copy https://devserver2.sockltd.local/svn/Dantooine https://devserver2.sockltd.local/svn/IOCPTest
svn: Repository moved permanently to 'https://devserver2.sockltd.local/'; please relocate
When I have a look at the list of repositories IOCPTest doesn't exist.
Is there some way to rename a repository, or should I just export the old repository and dump its content into the new one. The problem is, with that approach, I'll loose branches and revision history.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在 VisualSVN 服务器的主应用程序窗口上发现了一项功能 - “导入现有存储库...”
它自动执行将一个存储库复制到新存储库的任务,同时提供指定新存储库的功能姓名。它可以很好地满足我的需求,并且也可以复制分支和修订历史记录:)
I've found a feature on the main application window of the VisualSVN server - "Import Existing Repository..."
It automates the task of copying one repository to a new one, while at the same time giving the facilty to specify the new repository name. It works fine for my needs and copies the branches and revision history too :)
这取决于 VisualSVN 如何在幕后组织您的存储库。如果 Dantooine 是一个单独的存储库(即有自己独立的版本号),那么最简单的方法就是复制/重命名服务器上的 Dantooine 目录。该名称不包含在存储库数据中 - 就 subversion 而言,这只是数据传输的 URL,它通过 GUID revprop 识别存储库 - 因此重命名后跟
svn switch --relocate
对你的客户来说应该足以感动它。如果您想创建存储库的完整副本/分支,您可以再次复制 Dantooine 目录。
或者,如果您确实想从存储库中复制/过滤分支,可以使用 svnadmin dump 来备份旧存储库,并使用 svndumpfilter python 脚本来删除分支如果您不想要,则使用 svnadmin load 将过滤后的备份加载到新的存储库中。
不过,所有这些可能都不是 VisualSVN 的做事方式 - 我自己从未使用过。
This depends how VisualSVN is organising your repository(ies) under the covers. If Dantooine is a separate repository (i.e. has its own independent version numbers) then easiest thing to do would be to copy / rename the Dantooine directory on the server. The name isn't included in the repository data - as far as subversion is concerned that's just the URL for data transport, it recognises repositories by a GUID revprop - so a rename followed by a
svn switch --relocate
on your clients should be enough to move it.If instead you want to create a complete copy / fork of the repository you can again just copy the Dantooine directory.
Or if you actually want to copy / filter the branches from the reposistory you can use
svnadmin dump
to make a backup of the old repository and thesvndumpfilter
python script to strip out branches you don't want, thensvnadmin load
to load the filtered backup into a fresh repository.All of this might not be the VisualSVN way to do things, though - I've never used that myself.