SVN load dump to exact folder

3.5k views Asked by At

Have a standard subversion layout with one branch :

Repo_1 repo_root |-branches |-branch_one |-tags |-trunk

And a second repository, Repo_2 repo_root |-branches |-tags |-trunk |-folder1

I want to export Repo_2/trunk/folder1 content to Repo_1/branches/branch_one/folder1

I'm making the folder dump : svnrdump dump svn://mysvnserver/Repo_2/trunk/folder1 > folder1.dump

Then loading it to my Repo_1 : svnadmin load Repo_1 --parent-dir branches/branch_one < folder1.dump

And getting the following Repo_1 structure : repo_root |-branches |-branch_one |-trunk |-folder1 |-tags |-trunk

getting the trunk folder I don't need there. Is there any way to plug in my "folder1" directly to "branch_one" ?

1

There are 1 answers

0
Lazy Badger On

Re-read carefully and fully Filtering Repository History in SVN Book, pay special attention on warnings

You forgot, that dump-file holds all relative paths for included in dump nodes inside file and --parent-dir change only starting mount-point of mentioned in dump nodes, not relative location

Each of your dump files will create a valid repository, but will preserve the paths exactly as they were in the original repository. This means that even though you would have a repository solely for your calc project, that repository would still have a top-level directory named calc. If you want your trunk, tags, and branches directories to live in the root of your repository, you might wish to edit your dump files, tweaking the Node-path and Node-copyfrom-path headers so that they no longer have that first calc/ path component

From my own experience I prefer always filter dumps with svndumpfilter include, even if dump was created with svnrdump for only part of repo-tree: it produce less (0) errors or svnadmin load. For example, moving remote REPO/trunk/lib to the same path on local repository (there default repository-tree already exist) implies to me

>svnrdump dump URL/trunk/lib > full.dmp
>svndumpfilter include --pattern "*lib*" --drop-empty-revs --renumber-revs < full.dmp > filtered3.dmp

(include --pattern just because plain include lib produced worse result, but it can be hands-related only problem)

and this filtered dump can be easy loaded

>svnadmin load Repo --parent-dir / < filtered3.dmp
<<< Started new transaction, based on original revision 1
     * adding path : trunk/lib ... done.
     * adding path : trunk/lib/lib01.txt ... done.

------- Committed new rev 2 (loaded from original rev 1) >>>

whereas "dumb" dump

>svnrdump dump URL/trunk/lib > dump.dmp

give error on load-attempt

>svnadmin load repo2 < dump.dmp
<<< Started new transaction, based on original revision 1
     * adding path : trunk ...svnadmin: E160020: File already exists: filesystem 'bcf62090-928b-9f49-8008-455204e6d81f', transaction '1-1', path '/trunk'