How to change a versioned svn property without changing/adding anything else in a repo?

73 Views Asked by At

I am the administrator of a very large, over 1.3 M revisions, SVN repo. I have to extract a large subset to create a new SVN repo and I can neither add new revisions to the original repo nor modify their dates. Yes, I need the complete history. One of the revisions to extract has (no idea how it happened 15 years ago) a custom svn versioned property whose value has a "è" char encoded in ASCII (1 byte) and not in UTF-8 (2 bytes) as SVN expects the client should have properly encoded. The tool I am using, Subdivision, correctly issues an error while processing that revision, as it finds bad property contents. The svnadmin verify command on that revisions finds no error, but it does not look at the encoding used.

Using svn propset would create a new revision, with a new date, what I cannot allow; moreover it would not solve the problem, because the buggy revision remains the same. The suggestion I am looking for is how to modify the revision file (<path_to_repo>/db/revs/Krevs/revno) in a way that keeps the repository coherent. The revision file has checksums and you can calculate them again, if you are sure of what is the precise set of characters to include. It could be useful to reproduce the issue in a minimal repo just to test, but how to create a buggy revision? Copying the buggy revision file from the original to another simpler repo is complex, at least at first sight. change svn file property on the fly with svnkit suggests a way to change the value of the property, but it seems to ignore the checksums and the size of the property.

1

There are 1 best solutions below

0
polik On

I found a solution. It's not important, at the moment, decide if Subdivision tried to manage what had to be passed unchanged; I just wanted to modify the files representing the repository revisions in a way that any tool could find the repository consistent. The versioned property contained an "è" that was in the revision file (<path_to_repo>/db/revs/Krevs/revno). I modified that file with a binary editor to change "è" to "e" and saved the file. The binary editor was chosen to avoid any other change. Then I used svn propget to read that property at that revno;I got an error because the checksum was incorrect, but the error message told me what the checksum should be, so I used the binary editor again to change the checksum too and saved the file. That made the revision file consistent and I had no more problems.