[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

AW: RE: unexpected conflict merging branch into trunk (after merging trunk into branch)

From: Felix Gilcher <felix.gilcher_at_exozet.com>
Date: 2007-03-22 15:11:40 CET

Hi Darin,

You're doing a wrong merge in the last step.

--------

## Finally, I went back to trunk, to merge the branch back into it:
training/trunk> svn merge -r 223:227 \
                    svn+ssh://mldev/TRAINING/branches/test_merge
C myNewFile

--------

You're asking to merge all changes that happened in the branch to a trunk working copy. But before, you merged changes from the trunk to the branch, these changes are included in the changesets that you're asking svn to merge, thats where the conflict comes from (these changes are already in the trunk). What you want to do is not "merge all changes from rX to rY that happend in the branch" but "merge all differences that are between the trunk and the branch" (after having merged all changes in the time from branch creation up to now in the branch). So your last command should be something like that:

merge svn+ssh://mldev/TRAINING/branches/test_merge svn+ssh://mldev/TRAINING/trunk /path/to/trunk/working/copy

I might be wrong on the order of the urls, always have to try wether it's trunk first or branch first :). You might want to use --dry-run :)

good luck, hope that clears things up a little.

felix

Darin Kelkhoff <mailto:dkelkhoff@materialogic.com> schrieb am Donnerstag, 22. März 2007 15:01:

> So what I have done here that svn doesn't know how to handle? It
> seems like a pretty simple use case, and one that will come up a lot.
>
> Is the answer just that svn's merge capabilities aren't yet strong
> enough to handle this?
>
>
>> -----Original Message-----
>> From: Darin Kelkhoff [mailto:dkelkhoff@materialogic.com]
>> Sent: Thursday, March 22, 2007 9:49 AM
>> To: users@subversion.tigris.org
>> Subject: unexpected conflict merging branch into trunk (after
>> merging trunk into branch)
>>
>> I'm getting an unexpected conflict when trying to merge from
>> trunk into a branch, then back into trunk again. I'll accept
>> that perhaps I'm not using my branches quite correctly, though
>> I'm following the examples I've seen as well as I can understand
>> them.
>>
>> To summarize (a transcript of shell session is below), I've
>> created a branch as a copy of trunk, then added a file in
>> trunk, then modified and commited the file in trunk, then
>> merged trunk into the branch, modified the file in the branch,
>> then tried to merge the branch back into trunk. This branch
>> into trunk merger is where the conflict happens.
>>
>> Maybe there's something obvious that I'm missing, or like I
>> said, maybe I'm missing some key point in how to manage
>> branches. Either way, any help would be greatly appreciated.
>>
>>
>>> svn --version
>> svn, version 1.4.2 (r22196)
>> ...
>>
>>
>> Transcript which should be able to reproduce this issue:
>>
>> ## First I created a new branch:
>>> svn copy -m "Creating test branch"
> svn+ssh://mldev/TRAINING/trunk/ \
>> svn+ssh://mldev/TRAINING/branches/test_merge/
>> Committed revision 223.
>>
>>
>>
>> ## Then, in a working-copy of trunk, I added a new file,
>> training/trunk> touch myNewFile training/trunk> svn add myNewFile
>> A myNewFile
>> training/trunk> svn commit -m "Initial checkin" myNewFile
>> Adding myNewFile
>> Transmitting file data .
>> Committed revision 224.
>>
>>
>>
>> ## Then in trunk I edited that file, and commited it again:
>> training/trunk> echo "This is added in trunk" >> myNewFile
>> training/trunk> svn commit -m "Updated in trunk" myNewFile
>> Sending myNewFile
>> Transmitting file data .
>> Committed revision 225.
>>
>>
>>
>> ## Then, I merged trunk into the new branch:
>> training/test_merge> svn merge -r 223:225
>> svn+ssh://mldev/TRAINING/trunk
>> A myNewFile
>> training/test_merge> svn commit -m "Merging trunk r223:225 into
>> branches/test_merge" Adding myNewFile
>> Committed revision 226.
>>
>>
>>
>> ## Next, I edited the file in the branch, and commited it there:
>> training/test_merge> echo " added in branches/test_merge "
>>> myNewFile
>> training/test_merge> svn commit -m "updated in branch" myNewFile
>> Sending myNewFile Transmitting file data .
>> Committed revision 227.
>>
>>
>>
>> ## Finally, I went back to trunk, to merge the branch back into it:
>> training/trunk> svn merge -r 223:227 \
>> svn+ssh://mldev/TRAINING/branches/test_merge
>> C myNewFile
>>
>>
>>
>> ## As noted there, I got a conflict, which seems incorrect. ##
>> Here's what it looks like: training/trunk> ls -l myNewFile*
>> -rw-rw-r-- 1 dkelkhof group 134 Mar 21 14:26 myNewFile
>> -rw-rw-r-- 1 dkelkhof group 0 Mar 21 14:26 myNewFile.merge-left.r0
>> -rw-rw-r-- 1 dkelkhof group 57 Mar 21 14:26
>> myNewFile.merge-right.r227
>> -rw-rw-r-- 1 dkelkhof group 26 Mar 21 14:26 myNewFile.working
>> training/trunk> more myNewFile*
>>>>>>>>>>>>>>>>
>> myNewFile
>>>>>>>>>>>>>>>>
>> <<<<<<< .working
>> This is added in trunk
>> =======
>> This is added in trunk
>> added in branches/test_merge
>>>>>>>>> .merge-right.r227
>>>>>>>>>>>>>>>>
>> myNewFile.merge-left.r0
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>> myNewFile.merge-right.r227
>>>>>>>>>>>>>>>>
>> This is added in trunk
>> added in branches/test_merge
>>>>>>>>>>>>>>>>
>> myNewFile.working
>>>>>>>>>>>>>>>>
>> This is added in trunk
>>
>>
>>
>> Thanks.
>>
>> --
>> Darin Kelkhoff
>> Programmer/Web Developer
>> Materialogic
>> PH: 800-333-7144
>> PH: 314-997-4342 Ext 3426
>> FX: 314-997-7814
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
>> For additional commands, e-mail: users-help@subversion.tigris.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org

-- 
Felix Gilcher
Head of IT Development
Exozet Berlin GmbH
Rotherstraße 20
10245 Berlin
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Mar 22 15:12:10 2007

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.