Recalculate checksum in SVN dump after manual changes
Asked Answered
H

1

4

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.

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?

Hah answered 7/10, 2010 at 23:0 Comment(3)
Easy path: remove the file entirely, reinsert as fresh copy.Hag
You mean adding it as a new revision to the end? I want to keep the history intact though.Hah
You could also simply run sed '/Text-content-md5/d' dumpfile.txt | svnadmin load repo to remove the checksum check for desired revisions.Zaria
H
2

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.

Hah answered 8/10, 2010 at 1:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.