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

Re: How does 'merge' work?

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-10-21 18:33:25 CEST

Dmitry Kulagin <craft095@mail.ru> writes:

> I took the following actions:
> 1. svn cp dir dir_branch
>
> 2. svn ci
>
> 3. then edit existing files in order
> to make conflict:
> dir/a.txt
> dir_branch/a.txt
>
> 4. svn ci
> ---> M dir/a.txt
> ---> M dir_branch/a.txt
>
> and then I ran 'merge':
> 5a. svn merge dir dir_branch dir_branch
> ---> _ dir/a.txt

This has come up before :)

The first two arguments, dir and dir_branch, define the merge source,
the third argument, dir_branch, defines the merge target. Although
you have used working copy paths to specify the merge source, merge
always uses URLs, so the working copy paths are used only to extract
an URL, the contents are ignored. The current Subversion now gives
an error and requires you to specify URLs in this case.

The merge command above gets a patch representing the difference that
will convert the first URL (dir) into the second URL (dir_branch), and
then applies that patch using a three-way diff to dir_branch. If you
have no local changes to dir_branch, then the three-way diff will
determine that the patch has already been applied and so you see the
above output.

>
> 5b. svn merge dir_branch dir dir_branch
> ---> U dir/a.txt

In this case merge gets a patch representing the difference that will
convert dir_branch into dir, and applies that using a three-way diff
to dir_branch. If you have no local changes this will apply without
conflict and your dir_branch working copy will now look like dir.

My guess is what you really want to run something like

$ vi dir/a.txt
$ svn ci dir
Sending dir/a.txt
Committed revision 423.
$ svn merge -r422:423 dir dir_branch

This merge gets a patch that represents the changes made to dir and
then uses a three-way diff to apply the patch to dir_branch. Whether
you get conflicts depends on what you have done to dir_branch since
you copied it.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Oct 21 18:34:13 2002

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.