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

Re: Problem understanding merging in SVN

From: <cmpilato_at_collab.net>
Date: 2003-04-23 16:25:44 CEST

"Mats Nilsson" <mats.nilsson@xware.se> writes:

> Hi
>
> You fall into a little trap with this use of "svn merge":
>
>
> $ cd trunk
> $ svn merge file:///repos/trunk file:///repos/branches/B .
> This merges the changes from "current HEAD of trunk" to "current HEAD of
> B" into the "HEAD of trunk", which is by definition exactly equivalent
> to replacing trunk with B.
>
> Remember, before this command "HEAD of trunk" now contains "changes made
> to A", and "HEAD of B" contains "changes made to B". You need to specify
> a earlier version as the left source.
>
> Try either of these:
>
> $ cd trunk
> $ svn merge file:///repos/trunk_at_2 file:///repos/branches/B .
> C filea
>
> $ cd trunk
> $ svn merge -r 2:4 file:///repos/branches/B .
> C filea
>
> This merges only the changes that happened on branch B (given that B was
> born in revision 2)

Right. It's easy to forget that file:///repos/trunk is a moving
target. :-) I personally would recommend that folks use the latter
form of the merge command the Mats provided. It more accurately
represents the operation you are trying to perform:

   $ svn merge -r N:M file:///repos/branches/B

where N is the revision at which your branch was created (something
you can determine by running 'svn log --strict file:///repos/branches/B'),
and M is the last interesting revision at which your branch was
changed (for a branch-per-task development model, this is typically
'HEAD'). This form of the command semantically matches what you are
trying to do -- merge all of the changes that have occured on the
branch since its inception, into the trunk.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Apr 23 16:29:30 2003

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

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