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

Re: Branch management. Merge tracking.

From: Stefan Haller <haller_at_ableton.com>
Date: 2004-12-08 16:56:54 CET

Nick Patavalis <npat@inaccessnetworks.com> wrote:

> Several days pass by, the restructuring of my-mod0 progresses, and at
> the same time others commit minor changes to mod0 at the trunk. From
> time to time, I check these trunk-changes and merge them in my branch:
> svn merge -r r7:r8 svn://host/repo/proj/trunk/mod0
> svn merge -r r12:r13 svn://host/repo/proj/trunk/mod0
> (assuming of course a working copy on the branch)
> As far as I understand, once I've merged from the trunk to the branch,
> I can no longer hope for a way to merge from the branch back to the
> trunk; at least not without risking conflicts from the changes merged
> earlier from the trunk. So practically it's "one-way" merges only:
> Either you merge from branch to trunk, or the other way arround, but
> not both. Am I getting something fundamentally wrong?

Yes, this is wrong. You can merge both ways without problems provided
that you have a way to remember which revision ranges you have merged
from trunk to branch; then you merge everything *except* those ranges
back from the branch to the trunk. In your example:

   cd trunk-wc
   svn merge -r r1:r7 svn://host/repo/proj/branches/my-mod0
   svn merge -r r8:r12 svn://host/repo/proj/branches/my-mod0
   svn merge -r r13:HEAD svn://host/repo/proj/branches/my-mod0

However, this is inconvenient and error-prone. In my experience, it is
much easier to keep the range of revisions that you merge from trunk to
branch contiguous, like this:

   cd branch-wc
   svn merge -r r1:r8 svn://host/repo/proj/trunk/mod0
   # a week later:
   svn merge -r r8:r13 svn://host/repo/proj/trunk/mod0
   # yet another week later:
   svn merge -r r13:r27 svn://host/repo/proj/trunk/mod0

At the end, you have a branch that consists of trunk plus changes on
branch, which means that the final merge back is a single merge like

   cd trunk-wc
   svn merge svn://host/repo/proj/trunk/mod0_at_r27 \
        svn://host/repo/proj/branches/my-mod0 .

Stefan Haller
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Dec 8 17:01:22 2004

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.