tags:

views:

62

answers:

4

I am somewhat lost in merges. I develop in a single branch and merge it into the trunk when a piece of code is done. Somehow, there are still differences between the trunk and branch, which means every time I switch from the branch to the trunk or the otherway around, several files are updated, added and deleted.

As said, I am somewhat lost and think there must be a pretty easy solution to this; I just don't see it.

Any help or pointers are appreciated. If there's more information you need, please ask.

UPDATE:

I have now manually edited all files to be identical and have commit them several times. All files are now technically the same, but for some reason, when switching from branch to trunk or the other way around, they still appear as updated files.

UPDATE 2:

When switching still 4 files and 1 directory appear as updated, even though they are EXACTLY the same across the branch/trunk. Is there any way to fix this and why could it be happening?

Any ideas?

+1  A: 

One of the frequent confusions I see (deservedly so) in merging from one branch to another is that you try to compare the head of both branches and apply the diff to the target branch.

What you actually want to do is get a diff of all of the changes you've made in the Source branch and apply that diff to the Target branch.

Don't, except in exceptional circumstances, try to compare the heads of two branches...

I don't know if that's what's tripping you up, but it's something to consider.

Update:

I also forgot about merging changes on the trunk back into the branch first... thanks to the other posters who reminded me :)

John Weldon
+2  A: 

In order to successfully reintegrate a branch, you first have to merge all revisions from the trunk to the branch. This will put the branch in perfect sync with the trunk (in theory). Once this is done then you should be able to reintegrate the branch into the trunk.

Also, I just had to reintegrate a branch myself and messed it up the first time. What I eventually did was check out a fresh copy of the branch from prior to the botched merger, then I ran the merge on the clean copy and updated and was finally able to make it go through.

If when you try to reintegrate the branch you receive an error about missing revisions, these will be revisions that you need to specifically merge from the trunk to the branch and then try again.

Noah Goodrich
+2  A: 

Hi Aron, doing a merge from trunk to branch won't necessarily synchronize them together. After merging changes from branch to trunk, commit trunk, then do a merge back from trunk to branch and then everything should be in sync.

Dave Paroulek
A: 

You seem to be using svn switch to reuse the same working directory for both repositories. Why do you do that? Simply maintain two working directories and call svn update on each as needed to pull down changes made by other people.

Ether
I use a single development branch for developing on the project and merge all changes to trunk when done.
Aron Rotteveel