手动更改后重新计算SVN转储中的校验和 [英] Recalculate checksum in SVN dump after manual changes
问题描述
在我们将项目迁移到公共资源托管时,我想从SVN存储库中删除一些个人"信息.到目前为止,我使用 svndumptool
和svndumpfilter
删除路径或修订的版本效果还不错.但是我也想从存储库中的特定文件中删除一些文本.
As we are migrating with a project to a public source hosting, I wanted to remove some "personal" information from the SVN repository. I did fine so far with removing paths or revisions using svndumptool
and svndumpfilter
. However I want to remove some text from a particular file in the repository as well.
我通过正则表达式转储手动删除了文本,效果很好,但是当我要使用转储时,会出现校验和不匹配的情况.显然这是因为我更改了文件,但没有更新校验和.
I removed the text manually by regex’ing the dump and that worked fine, but when I want to use the dump, I get a checksum mismatch. This is obviously because I changed the file but didn't update the checksum.
是否有任何工具可以重新计算转储中文件的校验和?还是在svn转储中存在用于文件的好编辑工具(应允许使用正则表达式替换),该工具还可以更新校验和?
Is there any tool that recalculates the checksum for the files in a dump? Or is there a good editing tool for files (should allow regex replacements) inside a svn dump that also updates the checksum?
推荐答案
好吧,我不想等待更长的时间,所以我自己编写了一个脚本,将与您分享.它使用 SvnDumpTool 或它的库.要执行自定义操作,您需要编辑源代码(并了解一些python).其中包含一个简单的示例,我认为脚本提供的抽象效果很好.
Okay, I didn't want to wait longer for answers, so I wrote a script myself, which I will share with you. It utilizes SvnDumpTool, or rather its library. To do custom actions you are required to edit the source (and know a bit python). A simple example is included and I think the abstraction the script provides is quite good.
无论如何,希望它对您和我一样有用,尽管花了我相当长的时间才能使它像这样工作:
Anyway, hope it is as useful for you as it was for me, although it took me quite a while to get it working like that:
SvnDumpToolEdit.py on Github.
这篇关于手动更改后重新计算SVN转储中的校验和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!