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

Re: URGENT : Merge help requested.

From: Ryan Schmidt <subversion-2006c_at_ryandesign.com>
Date: 2006-09-01 00:38:00 CEST

On Sep 1, 2006, at 00:24, Santhosh Raghunath wrote:

> We are facing an issue with ‘svn merge’ at our project.
>
> VERISIGN_MIDAS_2 is a copy of VERISIGN_MIDAS below. Both are
> branches. When doing a svn merge from VERISIGN_MIDAS to
> VERISIGN_MIDAS_2 we are noticing that all ‘new’ changes (added
> files and folders) under VERISIGN_MIDAS_2 are getting ‘wiped
> out’. The merge is exactly synchronizing the ‘source’ with the
> ‘target’ directory and not ‘concatenating’ changes from source into
> the target.
>
> To confirm this I ran a small test below.
>
> Example 1:
> Added folder ‘BLACK’ into VERISIGN_MIDAS - merge from MIDAS_2 to
> MIDAS
>
> [build_at_build temp]$ svn merge http://svn:81/svn/midas/branches/
> VERISIGN_MIDAS http://svn:81/svn/midas/branches/VERISIGN_MIDAS_2/
> VERISIGN_MIDAS
>
> [snip]
>
> OR are we doing something wrong here?

You are doing something wrong here. :-) The command you executed told
Subversion to synchronize the one branch with the other, which is why
Subversion synchronized them.

A merge is a diff and a patch. It operates on three locations, let's
say A, B and C. You tell Subversion "Please construct a diff that
changes A into B, and apply it to C." If you do not specify C, it is
taken as the current working directory.

So when you said...

svn merge http://svn:81/svn/midas/branches/VERISIGN_MIDAS http://svn:
81/svn/midas/branches/VERISIGN_MIDAS_2/ VERISIGN_MIDAS

...you asked Subversion to construct a diff that converts
VERISIGN_MIDAS into VERISIGN_MIDAS_2 and to apply it to the working
copy of VERISIGN_MIDAS, thereby wiping out any changes that were in
VERISIGN_MIDAS but not in VERISIGN_MIDAS_2. Not what you wanted.

You say you want to "merge from VERISIGN_MIDAS to VERISIGN_MIDAS_2".
Presumably you mean you want to take all the changes that occurred on
VERISIGN_MIDAS between the time it was created and now, and apply
those same changes to VERISIGN_MIDAS_2. If so, then you need to
determine the revision at which you created VERISIGN_MIDAS. Look in
the log. Let's say it was 123. Then you need to get the HEAD revision
of the repository. Let's say it's 234. Then you need to merge those
revisions of VERISIGN_MIDAS into a working copy of VERISIGN_MIDAS_2.

svn merge -r123:234 http://svn:81/svn/midas/branches/VERISIGN_MIDAS
VERISIGN_MIDAS_2

When you commit these changes to the working copy of
VERISIGN_MIDAS_2, your log message should state that you merged
revisions 123 thru 234 of VERISIGN_MIDAS into VERISIGN_MIDAS_2,
because you will need that information later if you want to merge
again. Because the next time you merge, you will need to start at
revision 234, not 123. This is because Subversion does not yet do
merge tracking. The svnmerge.py script can help here -- but of course
you need to first understand how Subversion does merging to be able
to make use of it properly.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Sep 1 00:40: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.