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

Re: Help understanding branch merges

From: Ryan Schmidt <subversion-2006q2_at_ryandesign.com>
Date: 2006-06-13 10:49:07 CEST

On Jun 13, 2006, at 00:40, Craig Mills wrote:

> Working from a current directory with my up-top-date HEAD in it,

Presumably you mean the up-to-date HEAD *of trunk*

> I ran the command:
>
> svn merge --dry-run svn://host/app
> svn://host/app/branches/7Branches/060606Branch

Why svn://host/app? Is that the URL of your trunk? If so, that's odd;
it means that your branches are inside your trunk, which could
certainly be problematic for you later. Most people put their trunk
in a separate directory, à la this structure:

svn://host/
        app/
                trunk/
                branches/
                        somebranch/
                        ...
                tags/
                        sometag/
                        ...

> The files listed for changing looked somewhat like what I was
> expecting,
> so went ahead and did the whole merge (without the --dry-run).
>
> BUT: what appears to have happened is that
> a) the newest files in the branch were all moved into the main trunk:
> that is, newer files which had bug fixes in the branch, were brought
> into the trunk. This was what I expected.
>
> b) some files (which had been added to the trunk AFTER the branch was
> made) were deleted in the trunk as a result of the merge
> c) some trunk files were over-written with the (older) files from the
> branch which were in place when the branch was
>
> Parts b) and c) were NOT what I was expecting at all from merging.
>
> It appears that my problem is a flavor of something I saw mentioned in
> the list archives: "If you compare the tips of branch and trunk,
> you're
> going to get a diff that you don't want: you'll be specifying "all
> branch changes, plus removal of all trunk changes that took place
> since
> the branch was made."
>
> But what I am wondering, is what exactly is the syntax I *should* have
> used? Is merging a two-step process? I don't understand how to
> get the
> "diff" before I merge.
>
>
> My branch was created with revision 99. So maybe I should have used
> something more like:
>
> svn merge --dry-run svn://host/app_at_99
> svn://host/app/branches/7Branches/060606Branch_at_153

Your branch was created from trunk revision 99, and you have never
merged any changes from the branch into the trunk? Then the command
you want, in an up-to-date working copy of the trunk, is:

svn merge -r99:153 svn://host/app/branches/7Branches/060606Branch .

This means: take the changes that occurred between revisions 99 and
153 on the indicated branch, and repeat them in the current working
copy ("."). Then you test the changes. Then you commit them, being
careful to indicate in the commit message that you have merged
revisions 99 to 153 of that branch into the trunk. This is so that,
if the branch continues to be used and changed, and you later want to
merge those additional changes into the trunk, you'll know that your
next merge command needs to start at revision 153.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Jun 13 10:50:39 2006

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.