Reputation: 7302
This post might be a bit long, but if you think you can help, please read it because it would in literal terms be a lifesaver.
Here's the scenario. I am working on a project [for KDE], whose trunk is hosted at, lets say: http://ubersvn.org/home/uber/trunk/myapp. Also, I'm working on a branch, lets say: http://ubersvn.org/home/uber/branches/work/myapp-mod. This is what I've been doing:
After creating a branch, I worked throughout on my local working copy of the branch, and I frequently used to pull changes from the trunk. I was told that it would help in preventing a load of conflicts when it came to finally merging back to the trunk. So, quite frequently, I used to do:
svnmerge.py merge
svn commit -F svnmerge-commit-message.txt
After the work was done, it was time to merge the branch back to the trunk. I first checked out a working copy of the trunk:
svn co svn+ssh://ubersvn.org/home/uber/trunk/myapp
cd myapp
Then, I followed the documentation for merging back:
svnmerge init svn+ssh://ubersvn.org/home/uber/branches/work/myapp-mod
And to merge back and forth:
svnmerge merge --bidirectional -S svn+ssh://ubersvn.org/home/uber/branches/work/myapp-mod
And here is where the problem starts. Firstly, from the looks of it, it is merging every single revision since I branched. If it is doing this, I don't see the point in me frequently pulling from trunk and keeping my branch up to date. However, I'm just assuming svnmerge somehow uses it to resolve conflicts throughout the merge. So far, so good.
Secondly, it ended abruptly with an error that sounded something like:
Attempt to add tree conflict that already exists
A little search online told me the problem could be solved by:
svn resolve --accept working -R .
And then it shows that some resolves were cleared and all. However, now when I do this:
svnmerge merge --bidirectional -S [BRANCH_URL]
it says, 'no svnmerge info found'. I tried using svnmerge init BRANCH_URL
, but it says that '.' has local modifications. It must be clean
.
So, now the problems I am facing are:
So, how do I proceed from here? One solution seems to be to just diff from the branch, apply to the trunk and then commit. But according to the policies of the organization I work for, it is not acceptable. Any help is greatly appreciated and I'd be really grateful.
Thanks, rohan
Upvotes: 3
Views: 1095
Reputation: 26873
I don't really have a solution for you but I hope this helps.
Before merging your branch back to trunk your branch needs to have every commit from trunk from the time you created your branch. This is important because otherwise merging your changes back to trunk would erase other peoples changes from the trunk.
rev 5: created my-branch
rev 6: change 1 in my-branch
rev 7: change somefile.h in trunk
rev 8: change 2 in my-branch
Now if you just merge my-branch back to trunk, the change from rev 7 will be lost! This is why you need to update your branch with all changes from the trunk. Whenever you merge changes SVN adds a mergeinfo property (SVN 1.5) to the top-level directory (the one that you are doing the merge on). This looks something like this:
svn:mergeinfo /trunk:7, 10-13, 14 (it means that you have merged these revisions from trunk to your branch)
The message about tree conflict is usually related to file and directory moves and renames. If you deleted a file but didn't use svn delete
, or somefile.h was changed in trunk but this file is moved somewhere else in your branch.
Here's what I would try:
I can't help you with the command line since I'm not using a command line client. What you're trying to do is something people using SVN do every day, it must work.
Upvotes: 2