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

RE: Re: Merge problem

From: Gale, David <David.Gale_at_Hypertherm.com>
Date: 2005-09-15 19:00:27 CEST

Christopher Ness wrote:
> On Thu, 2005-09-15 at 17:27 +0200, Ryan Schmidt wrote:
>> On Sep 15, 2005, at 14:43, Christopher Ness wrote:
>>> If you add a new file to a branch you have to copy the new file
>>> over to the trunk. The merge will not copy it over for you if I
>>> recall correctly.
>>
>> Um.... sure it will. "svn merge $A $B $C" will take the changes that
>> occurred between $A and $B and apply them to $C. These could be
>> modifications to existing files, deletions of files, additions of
>> files, property changes-doesn't matter.
>
> Opps. Of course you are correct Ryan.
> I don't know why I thought this, my mistake.
>
> Here is a working copy merge that compares the trunk with the branch
> and applies the diff to trunk.
>
> svn merge ./trunk/@HEAD ./branches/bugfix1/@HEAD ./trunk
>
> Cheers,
> Chris

According to the book
(http://svnbook.red-bean.com/nightly/en/svn.branchmerge.commonuses.html#
svn.branchmerge.commonuses.wholebr), this is wrong, as it will not only
get the changes you've made to your branch, but will also remove any
changes that have been done on the trunk since the branch was created.
Which is (obviously) not what you want.

You need to get the revision the branch was created at (or, rather, the
last revision at which the branch was in sync with the trunk--either
when it was created, or the last time it was merged), and then do a
merge of the changes on the branch since then:

svn merge -r 14:HEAD ./branches/bugfix1/ ./trunk

(assuming that the branch was created/last merged at revision 14).

Incidentally, I found the examples in this section of the book (and the
later reference listing for svn merge) to be somewhat confusing, as they
assume that you're in a working copy of the trunk, without stating that
that's where you need to be. Perhaps these could be revisited and made
clearer?

-David

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Sep 15 19:03:26 2005

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