Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subversion - Move folder to another already existing repository

I have the following SVN structure:

  • ExistingRepository1

    • ...
    • MyFolder
      • FolderToMove
      • ...
  • ExistingRepository2

    • ...
    • AnotherFolder
      • FolderToMove <- moved here
      • ...

So I already read this question: How do I move a single folder from one Subversion repository to another repository? But in my case ExistingRepository2 already exists. So how can I do it? I want to have all revisions in the new project.

I have for example the revision number 1000 in ExistingRepository1 -> MyFolder -> FolderToMove, but in the ExistingRepository1there is already a revision with number 1000. So, what will the svn load do? Will it automatically move the revision numbers?

These would be the commands:

svnadmin dump /svn/ExistingRepository1 > ./repository.dump
svndumpfilter include MyFolder/FolderToMove --drop-empty-revs --renumber-revs --preserve-revprops < ./repository.dump > ./folderToMove_only.dump
svnadmin load /svn/ExistingRepository2 < ./folderToMove_only.dump

Thank you in advance for your help, Best Regards, Tim.

like image 207
Tim Avatar asked Jan 24 '11 15:01

Tim


1 Answers

Here is somebody who claims to have moved a directory across existing repositories (with some blog comments that indicate success). Apparently it creates the whole path in the destination repository, but I imagine that once the directory is in the destination repository you can easily move it to where you want it (while maintaining its history).

[Edit]

I successfully tested this. Here are the commands I used:

svnadmin dump /path/to/source/repo | svndumpfilter --drop-empty-revs --renumber-revs include /folder/to/transfer/ > dumpfile
svnadmin load /path/to/destination/repo < dumpfile

I then moved the transferred file (using TortoiseSVN's Repo-browser).

like image 62
shaunmartin Avatar answered Oct 08 '22 20:10

shaunmartin