如何完全删除包含空格的SVN标签? [英] How do I remove an SVN tag completely that contains spaces?

查看:356
本文介绍了如何完全删除包含空格的SVN标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图清理svn仓库并删除一个包含空格的标签,因此所有标签和分支都符合git:

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

但看起来,这并不是在这里完成的工作:如何使用reposurgeon将svn repo转换为git?



我如何完全删除它?

解决方案

在使用 <$ c时提供提交日志消息$ c> svn rm 删除远程存储库中的文件。当通过URL进行删除,重命名,复制等操作时,结果立即提交,即SVN仓库中需要日志消息的新版本。

所以命令应该是:

  PROJECT = myproject 
svnrepo = svn + ssh://rubo77@myserver.de/var/svn- repos / $ PROJECT
svn rm -m删除了标签$ svnrepo / tags / version 3.6.2

请注意,使用 svn rm 不会完全移除标签。创建此标记的修订版本仍然存在于版本库历史记录中。



完全删除路径的唯一选择是 svnbook.red-bean.com/en/1.7/svn.reposadmin.maint.html#svn.reposadmin.maint.tk.svndumpfilterrel =nofollow> svndumpfilter 工具:


  1. 使用 svnadmin dump / var / svn-repos / $ PROJECT>转储资源库; /tmp/$PROJECT.dump

  2. 使用 svndumpfilter 来过滤资料库历史记录:



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


  3. 查看 filterlog。 txt 以确保历史过滤已按预期完成。

  4. 使用 svnadmin创建新的空存储库创建命令。
  5. 使用 svnadmin load 将过滤的转储加载到新的存储库c>命令。存储库将具有完整的历史记录,但与tags / version 3.6.2相关的提交不再存在。



I tried to clean up the svn repository and remove a tag that contains a space, so all tags and branches are git conform:

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?

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. When doing delete, rename, copy etc via URL, the action results into immediate commit, i.e. new revision in SVN repository which log message is required.

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. 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:

  1. Dump the repository using svnadmin dump /var/svn-repos/$PROJECT > /tmp/$PROJECT.dump
  2. Filter the repository history using 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.

  4. Create new empty repository using svnadmin create command.

  5. Load the filtered dump to the new repository using svnadmin load command. The repository will have the whole history but commits related to "tags/version 3.6.2" do not exist anymore.

这篇关于如何完全删除包含空格的SVN标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆