Reputation: 3158
I have two repositories which live on separate servers, call them repo-1 and repo-2.
To start both "trunks" were equal:
repo-1/trunk == repo-2/trunk
Meanwhile changes were being commited to repo-1/trunk and I was working on and commiting changes to repo-2/trunk.
Now I need to merge changes from repo-1/trunk into repo-2/trunk.
I thought I would copy repo-1/trunk into repo-2/tags/r1_20090224, then merge that tag into my local working copy of repo-2/trunk (i.e. c:\dev\repo2-trunk).
Any suggestions on how to do this? I'm trying to use TortoiseSVN and performing "Merge two different trees", I used the following settings:
From: repo-2/trunk To: repo-2/tags/r1_20090224 Working Copy: c:\dev\repo2-trunk
I also tried swapping the "from" and "to"...but no luck. By trying either of those two merge options I either end up with the following outcome:
If I merge from trunk to tag (into my local copy of repo-2/trunk) I lose my trunk changes and get the tag changes.
If I merge from tag to trunk (into my local copy of repo-2/trunk) I lose my tag changes and keep my trunk changes.
Any suggestions on to do this??
Upvotes: 5
Views: 4793
Reputation: 66721
If svn merge
were to fail you across the two sites/servers:
svn: Unusable URI: it does not refer to this repository
Then use the following approach:
repo-2
started diverge from repo-1
, say 123, then:svn co http://server1/repo-1/trunk
svn diff -r123:HEAD http://server2/repo-2/trunk >repo2.patches
patch -p0 -i repo2.patches
svn ci --message "merged from repo-2"
Upvotes: 1
Reputation: 9775
It's not entirely clear, but you need to merge from the base of the two trees, i.e. the point at which the two trunks were the same.
Sander beat me to it, so credit to him, but here are a couple more tips:
Upvotes: 1
Reputation: 76153
SVK might be able to help if you find yourself constantly managing multiple repositories over time that need to be synced every once in a while.
Upvotes: 0
Reputation: 21615
First figure out the revision where the trees were the same. Then merge that from that revision to HEAD of the repo-1 repository to your repo-2 working copy.
Using the commandline client it's similar to this, if you want to merge changes between r123 and r456
svn merge http://domain.tld/repos1@123 http://domain.tld/repos1@456 repos2-workingcopy
Upvotes: 1