Is it possible to rename directory in svn repository.
Not create new revision in which this directory will be renamed.
I would like to change the name of this directory starting from the first revision.
As far as I understand svndumpfilter utility can be used for this.
Is it correct?
Does anyone can give me small example how to do it?
https://metacpan.org/pod/release/SALVA/SVN-DumpReloc-0.02/bin/svn-dump-reloc looks interesting but does not (as it says) check for missing or duplicate directories. Going to write something custom…
You should svnadmin dump your repository, process the dump file and svnadmin load the processed file in an empty repo. No svndumpfilter needed.
The dump file can be processed with Sed or another tool (be sure that binary data doesn't get corrupted) and replace the directory name. For example:
Once you've finished processing the dump file:
I'd certainly recommend not to use sed, because it is unaware of the file format and you might easily render the SVN dump file unusable.
Additionally, if you want to replace a bit more than just a path, you need to either update or simply remove the SHA1 and MD5 check-sums, too.
Modifying an SVN dump is really not as trivial as it might seem at first.
I had the same problem, yesterday, and I wrote a little program for this purpose. I published it here for everyone to use:
https://github.com/nlmarco/svndumptransformer
It's free software and you're welcome to modify it, if you want/need more features.
This program modifies only text content (if a file - e.g. an image - is marked to have the mime-type "application/octet-stream", it is not modified). And since it really reads and understands the SVN dump format, it does not modify structural data belonging to the SVN dump - unlike the sed command above.
For me, this program as it currently is worked fine in renaming a product - causing all paths as well as project configuration files (=> gradle) and a few dozen Java classes to be renamed.
I hope that this program is useful to other people, too.
Btw. I'm aware that this question is very old, but I hope that my answer might help others who encounter this problem, now.