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

RE: Re: Question on branching the right way

From: Michael Swanson <mswanson_at_ruralins.com>
Date: 2006-04-05 16:17:48 CEST

The answer to both of those questions is this: Subversion doesn't care what direction you're going, the case of trying to merge two branches in which changes have taken place in both since they diverged is the same regardless of whether you're trying to merge trunk into branch or vice-versa.

The issue is this: You're trying to merge the head revision of directory A(I use "directory" because it doesn't matter whether it's a trunk or branch directory) onto the head revision of directory B. Subversion sees all the changes you made to A since the branches diverged. However, it also sees the removal of any changes you've made in B since they diverged, since all SVN does is do a diff. In this case, it sees A as the "master" or "left" side that is being moved into the other directory. The exact passage from the book I'm referring to is this:

:Quote: (from SVNBook)
...
But which two trees should be compared? At first glance, the answer may seem obvious: just compare the latest trunk tree with your latest branch tree. But beware-this assumption is wrong, and has burned many a new user! Since svn merge operates like svn diff, comparing the latest trunk and branch trees will not merely describe the set of changes you made to your branch. Such a comparison shows too many changes: it would not only show the addition of your branch changes, but also the removal of trunk changes that never happened on your branch.

:EndQuote:

To get around this, you need to create a working copy of B and apply only the changes made to A since you either last branched or, in your case, last applied changes from A to B. So, assume A and B were last merged in r 5. Right now, A is at revision 10. You need to merge A r5:10 onto a working copy of B. This will correctly apply only the new changes made in A since you last merged. You then take that working copy and commit it back onto the repository side of B. This whole process is laid out on the page I sent before, in the command listing just below the Blue "Tip" box.

Michael Swanson
Application Developer
Rural Mutual Insurance
Work: 608-828-5615
mswanson@ruralins.com

-----Original Message-----
From: Sascha Herpers [mailto:herpers@wiso.uni-koeln.de]
Sent: Wednesday, April 05, 2006 8:58 AM
To: users@tortoisesvn.tigris.org
Subject: Re: Question on branching the right way

Hello,

> It sounds like you're having the problem described in this part of the
> book. Have a look at this and see if it fixes your problem:
> http://svnbook.red-bean.com/nightly/en/svn.branchmerge.commonuses.html#svn.branchmerge.commonuses.wholebr
if I understood that chapter correctly, it describes the opposite situation, where the private branch (which is my custom version) is merged into the trunk.

That situation differs from mine in two ways:
1) I want to merge the trunk into the branch (main version --merge
into-> custom version)
2) The described version of the above chapter assumes, that the branched out version exists only for a certain amount of time until the bugfix or feature testing is done. At that point the versions are merged and the branch ceases to exist. In my setting the branch will exist until the end of time (so to say). You can picture it this way, that the main version is a product version for every customer and the custom (branched) version has an additional feature, that has been implemented for only one single customer. All I want to accomplish is, that the parts of these versions, that are the same, stay in sync.

Regards,
        Sascha

-- 
_____________________________________________________________
    Sascha Herpers
    Universität zu Köln
    Seminar für Supply Chain Management und Produktion
    Albertus-Magnus-Platz
    50923 Köln
    E-Mail: herpers@wiso.uni-koeln.de
    Tel.:   (0221) 4 70 - 37 40
    Fax:    (0221) 4 70 - 51 40
    WWW:    http://www.scmp.uni-koeln.de
_____________________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: users-help@tortoisesvn.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: users-help@tortoisesvn.tigris.org
Received on Wed Apr 5 16:18:07 2006

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

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