I tried to use the accepted answer, but I had a huge repository and I wanted to export a small directory, and I couldn't afford to dump the entire repository.
So, I only exported the revisions where my directory changed (This may not work if the directory you want to export have references to other places in your repo).
svn log URL_to_docs | awk '/^r/{gsub(/^r/,"",$1);print $1}' > revisions.txt
#tac for revisions in reverse (oldest revision first)
tac revisions.txt | while read line; do svnadmin dump /svn/old_repo -r$line >> ./docs_revisions.dump ; done
#You don't have to filter if you commited only files in your directory docs in your exported revisions
svndumpfilter include path/to/docs --drop-empty-revs --renumber-revs --preserve-revprops < ./docs_revisions.dump > ./docs_only.dump
svnadmin load /svn/new_repos < ./docs_only.dump
You must replace your repo URL (URL_to_docs
), location in server (/svn/old_repo
) and path to docs in repository (path/to/docs
)
You can easily edit your docs_only.dump
if you want to change the location of your doc directory in your new repository.