简体   繁体   English

如何完全删除包含空格的SVN标签?

[英]How do I remove an SVN tag completely that contains spaces?

I tried to clean up the svn repository and remove a tag that contains a space, so all tags and branches are git conform: 我试图清理svn存储库并删除包含空格的标签,因此所有标签和分支均符合git规范:

PROJECT=myproject
svnrepo=svn+ssh://rubo77@myserver.de/var/svn-repos/$PROJECT
svn rm "$svnrepo/tags/version 3.6.2"

but it seems, that doesn't do the job here: How do I convert an svn repo to git using reposurgeon? 但是看来,这在这里不起作用: 如何使用reposurgeon将svn存储库转换为git?

How do I remove it entirely? 如何将其完全删除?

You have to supply commit log message when you use svn rm to delete the file in remote repository. 使用svn rm删除远程存储库中的文件时,必须提供提交日志消息。 When doing delete, rename, copy etc via URL, the action results into immediate commit, ie new revision in SVN repository which log message is required. 通过URL进行删除,重命名,复制等操作时,操作将立即提交,即SVN存储库中需要日志消息的新修订。

So the command should be : 所以命令应该是:

PROJECT=myproject
svnrepo=svn+ssh://rubo77@myserver.de/var/svn-repos/$PROJECT
svn rm -m "Removed the tag" "$svnrepo/tags/version 3.6.2"

Beware that using svn rm will not remove the tag completely. 请注意,使用svn rm不会完全删除该标签。 The revision where this tag was created will still exist in repository history. 创建此标记的修订版仍将存在于存储库历史记录中。

The only option to remove the path completely is to filter the repository history with svndumpfilter tool: 完全删除路径的唯一选择是使用svndumpfilter工具过滤存储库历史记录

  1. Dump the repository using svnadmin dump /var/svn-repos/$PROJECT > /tmp/$PROJECT.dump 使用svnadmin dump /var/svn-repos/$PROJECT > /tmp/$PROJECT.dump转储存储库
  2. Filter the repository history using svndumpfilter : 使用svndumpfilter过滤存储库历史记录:

    svndumpfilter exclude "tags/version 3.6.2" --drop-empty-revs < /tmp/$PROJECT.dump > /tmp/filtered.dump 2>/tmp/filterlog.txt

  3. Look though the filterlog.txt to make sure that the history filtration has completed as expected. 查看filterlog.txt以确保历史记录过滤按预期完成。

  4. Create new empty repository using svnadmin create command. 使用svnadmin create命令创建新的空存储库。

  5. Load the filtered dump to the new repository using svnadmin load command. 使用svnadmin load命令将过滤的转储加载到新的存储库。 The repository will have the whole history but commits related to "tags/version 3.6.2" do not exist anymore. 该存储库将具有整个历史记录,但不再存在与“标签/版本3.6.2”相关的提交。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM