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

Re: merging

From: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2006-02-17 00:10:33 CET

On 2/16/06, Kevin Aubuchon <Kevin.Aubuchon@reuters.com> wrote:
>
> Just to confirm what how we are merging…
>
> To merge my branch to trunk: svn merge trunk_url @ rev# branch_url @ rev#.
> No, I didn't type that backwards. The directory to receive the changes is
> my trunk working copy directory.
>
>
>
> Is this how others are merging , or do I misunderstand?

It depends exactly what you're trying to merge. The command you described:

$ svn merge $REPOS/trunk@REV1 $REPOS/branches/mybranch@REV2 .

Will take the difference between the trunk at REV1 and the branch at
REV2 and apply it to your working copy. This might be what you want,
but odds are it is not. For example, if changes were made on the
trunk between the time you branched and now, this would blow them away
as part of the merge.

What you probably want is something like this:

$ svn merge -r REV1:REV2 $REPOS/branches/mybranch .

When executed inside a trunk working copy, this will take the
difference between the branch at REV1 and the branch at REV2 and merge
it into your working copy. If you're trying to merge all your branch
changes into the trunk, then REV1 is either the revision in which the
branch was created, or the last revision you'd merged from the branch
into the trunk, and REV2 is HEAD.

The general idea is that you're giving merge two trees, and telling it
"merge the difference between these trees into my working copy".
Usually, those two trees are the same location in the repository, and
they differ only in revision number.

Hope that helps,

-garrett
Received on Fri Feb 17 00:25:18 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.