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

Re: [Fwd: Re: incorrect result of merge]

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-12-21 01:59:42 CET

Michael Colefax <MichaelCo@resmed.com.au> writes:

> ## 6. merge in the changes made on the branch in step 2
> svn merge -r2:3 file:///c:/svn/repo/branch/b work1

This merge adds a directory and a file:

A work1/folder
A work1/folder/file1.cpp

> ## 7. merge in the changes made on the branch in revision 4
> svn merge -r4:5 file:///c:/svn/repo/branch/b work1

This merge adds a file, but skips deleting the file added by the
previous merge:

A wc/file1.cpp
Skipped 'wc/folder/file1.cpp'

> ## 8. commit the merges to the main trunk
> svn ci work1 -m"merge in changes from the branch"

This commits the directory and both files:

Adding wc/file1.cpp
Adding wc/folder
Adding wc/folder/file1.cpp

> ## now to see the problem:
> svn co file:///c:/svn/repo/main work2
> svn log -v file:///c:/svn/repo/main
>
> The file moved in step(4) appears in both locations! (ie work2/file1.cpp and
> work2/folder/file1.cpp).

It's possible that the second merge should delete the file added by
the first merge rather than skipping it. In general we don't know
that the file has been added by a previous merge, it might have been
added manually as a local modification, so it's not entirely clear
what we should do.

Should merge tree changes (adds/deletes) simply overwrite local tree
changes? If we look at text changes then merge can overwrite any
local text changes, should tree changes be different? On the other
hand text changes can generate conflicts and we don't really have a
mechanism for representing tree conflicts. Note that deleting a
schedule add file can destroy information--any properties will be
lost.

> But the log for the main trunk doesnt show this -
> although the output during the commit in step(8) did!

That looks like a misunderstanding on your part. The log doesn't show
the folder/file1.cpp add explicitly:

$ svn log -vqr6 file://`pwd`/repo/main
------------------------------------------------------------------------
r6 | pm | 2005-12-21 00:35:23 +0000 (Wed, 21 Dec 2005)
Changed paths:
   A /main/file1.cpp (from /branch/b/file1.cpp:5)
   A /main/folder (from /branch/b/folder:3)
------------------------------------------------------------------------

but that's because it's included implicitly since /main/folder is an
exact copy of /branch/b/folder and that includes all the files and
sub-directories of folder. Had you made changes so that /main/folder
was not an exact copy of /branch/b/folder then those changes would
appear in the log.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Dec 25 05:59:57 2005

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.