【发布时间】:2017-01-06 10:19:14
【问题描述】:
这个问题最初是在 2009-2013 年间活跃的,有各种例子:
- It is possible to completely remove a file from my SVN repository?
- Delete file with all history from svn repository
等等。
目前,所有消息来源都指向一个糟糕的解决方案:
- http://www.microhowto.info/howto/permanently_delete_a_file_from_all_revisions_of_a_subversion_repository.html
- http://subversion.apache.org/faq.html#removal
- http://support.beanstalkapp.com/article/902-how-can-i-permanently-remove-files-from-a-repository
现在,如果只是这样,解决方案就不会那么糟糕了:
- 转储到文件。
- 过滤要删除的文件:
svndumpfilter exclude file_name_needs_to_be_removed.txt --drop-empty-revs --renumber-revs < source.dump > result.dump
- 将过滤后的转储文件加载到新的 repo 目录中。
但是当您使用 SVN 重命名、分支等时,您需要跟踪所有依赖项和 --drop-empty-revs --renumber-revs。
所以现在我们在 2016 年第三季度,Debian 拥有 SVN 1.8。是否有任何新的解决方案浮出水面?
【问题讨论】:
-
有没有机会让这听起来不像是纯粹的咆哮?
-
使用
--drop-empty-revs --renumber-revs是个坏主意,因为您会改变修订号。最好留下一个带有日志消息Removed by filtering的填充修订,就像svndumpfilter默认情况下所做的那样。
标签: svn repository history purge