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

Re: Account for reflected revisions when performing cyclic merges

From: Folker Schamel <schamel23_at_spinor.com>
Date: 2007-06-15 08:06:05 CEST

Daniel Rall wrote:
> On Thu, 14 Jun 2007, Folker Schamel wrote:
>
>> Folker Schamel wrote:
>>> Daniel Berlin wrote:
>>>> ...
>>>>
>>>> The initial merge tracking implementation was not meant to handle
>>>> repeated bidirectional merging, at least, as designed.
>>>>
>>>> ...
>>>>
>>>> The original goal was to provide much the same functionality as
>>>> svnmerge.py on a per-file basis.
>>>>
>>>> ...
>>> Just a note:
>>> svnmerge provides repeated bidirectional merging by the --bidirectional flag.
>> See also http://svn.haxx.se/dev/archive-2007-03/0234.shtml
>
> In the A -> B -> A case, neither Subversion nor svnmerge.py can readily
> support bi-directional merging correctly, since Subversion does not track
> multiple parents for a change (it only tracks one).
>
> We'd have to change Subversion's FS schema to make this possible.

svnmerge supports bi-directional merge in the following way,
see log below.

Note that after merging c8 from branch -> trunk as new c9,
the "svnmerge merge --bidirectional" does not merge c9 back
from trunk -> branch, but only the trunk change c7 as new r10,

This is what I meant by handling A -> B -> A correctly.
This is B -> A in http://svn.haxx.se/dev/archive-2007-03/0234.shtml
I don't think you need a FS schemata change for that,
you just have to check for reflected revision during merge.

Will svn merge-tracking support this particular scenario, too?
Would be cool! :-)

Cheers, Folker

C:\temp\svntest>setlocal
C:\temp\svntest>rmdir /S /Q repo
C:\temp\svntest>rmdir /S /Q wc
C:\temp\svntest>svnadmin create repo

C:\temp\svntest>rem Create trunk:
C:\temp\svntest>svn mkdir file:///temp/svntest/repo/trunk -m "test"
Committed revision 1.
C:\temp\svntest>svn checkout file:///temp/svntest/repo/trunk wc\trunk
Checked out revision 1.

C:\temp\svntest>rem Create file in trunk:
C:\temp\svntest>cd wc\trunk
C:\temp\svntest\wc\trunk>echo old1 1>myfile.txt
C:\temp\svntest\wc\trunk>echo old2 1>>myfile.txt
C:\temp\svntest\wc\trunk>echo old3 1>>myfile.txt
C:\temp\svntest\wc\trunk>svn add myfile.txt
A myfile.txt
C:\temp\svntest\wc\trunk>svn commit -m "test"
Adding myfile.txt
Transmitting file data .
Committed revision 2.

C:\temp\svntest\wc\trunk>rem Create branch:
C:\temp\svntest\wc\trunk>svn mkdir file:///temp/svntest/repo/branches -m "test"
Committed revision 3.
C:\temp\svntest\wc\trunk>svn copy file:///temp/svntest/repo/trunk file:///temp/svntest/repo/branches/testbranch -m "test"
Committed revision 4.
C:\temp\svntest\wc\trunk>svn checkout file:///temp/svntest/repo/branches/testbranch ..\testbranch
A ..\testbranch\myfile.txt
Checked out revision 4.

C:\temp\svntest\wc\trunk>rem Init svnmerge in branch:
C:\temp\svntest\wc\trunk>cd ..\testbranch
C:\temp\svntest\wc\testbranch>svn update
At revision 4.
C:\temp\svntest\wc\testbranch>call svnmerge init
property 'svnmerge-integrated' set on '.'
C:\temp\svntest\wc\testbranch>svn commit -m "test"
Sending .
Committed revision 5.

C:\temp\svntest\wc\testbranch>rem Init svnmerge in trunk:
C:\temp\svntest\wc\testbranch>cd ..\trunk
C:\temp\svntest\wc\trunk>svn update
At revision 5.
C:\temp\svntest\wc\trunk>call svnmerge init file:///temp/svntest/repo/branches/testbranch
property 'svnmerge-integrated' set on '.'
C:\temp\svntest\wc\trunk>svn commit -m "test"
Sending .
Committed revision 6.

C:\temp\svntest\wc\trunk>rem CHange file in trunk:
C:\temp\svntest\wc\trunk>cd ..\trunk
C:\temp\svntest\wc\trunk>echo trunk1 1>myfile.txt
C:\temp\svntest\wc\trunk>echo old2 1>>myfile.txt
C:\temp\svntest\wc\trunk>echo old3 1>>myfile.txt
C:\temp\svntest\wc\trunk>svn commit -m "test"
Sending myfile.txt
Transmitting file data .
Committed revision 7.

C:\temp\svntest\wc\trunk>rem Change file in branch:
C:\temp\svntest\wc\trunk>cd ..\testbranch
C:\temp\svntest\wc\testbranch>echo old1 1>myfile.txt
C:\temp\svntest\wc\testbranch>echo old2 1>>myfile.txt
C:\temp\svntest\wc\testbranch>echo testbranch3 1>>myfile.txt
C:\temp\svntest\wc\testbranch>svn commit -m "test"
Sending myfile.txt
Transmitting file data .
Committed revision 8.

C:\temp\svntest\wc\testbranch>rem Merge branch to trunk:
C:\temp\svntest\wc\testbranch>cd ..\trunk
C:\temp\svntest\wc\trunk>svn update
At revision 8.
C:\temp\svntest\wc\trunk>call svnmerge merge --bidirectional --show-changes
svn propset "svnmerge-integrated" -F "c:\dokume~1\folker\lokale~1\temp\tmpvajgtw" "."
property 'svnmerge-integrated' set on '.'
svn merge -r 7:8 file:///temp/svntest/repo/branches/testbranch .
U myfile.txt
svn propset "svnmerge-integrated" -F "c:\dokume~1\folker\lokale~1\temp\tmpao0cyc" "."
property 'svnmerge-integrated' set on '.'
C:\temp\svntest\wc\trunk>svn commit -m "test"
Sending .
Sending myfile.txt
Transmitting file data .
Committed revision 9.

C:\temp\svntest\wc\trunk>rem Merge trunk to branch:
C:\temp\svntest\wc\trunk>cd ..\testbranch
C:\temp\svntest\wc\testbranch>svn update
At revision 9.
C:\temp\svntest\wc\testbranch>call svnmerge merge --bidirectional --show-changes
svn propset "svnmerge-integrated" -F "c:\dokume~1\folker\lokale~1\temp\tmpbo3yib" "."
property 'svnmerge-integrated' set on '.'
svn merge -r 6:7 file:///temp/svntest/repo/trunk .
U myfile.txt
svn propset "svnmerge-integrated" -F "c:\dokume~1\folker\lokale~1\temp\tmp-gkrb7" "."
property 'svnmerge-integrated' set on '.'
C:\temp\svntest\wc\testbranch>svn commit -m "test"
Sending .
Sending myfile.txt
Transmitting file data .
Committed revision 10.

C:\temp\svntest\wc\testbranch>rem Merge branch to trunk:
C:\temp\svntest\wc\testbranch>cd ..\trunk
C:\temp\svntest\wc\trunk>svn update
At revision 10.
C:\temp\svntest\wc\trunk>call svnmerge merge --bidirectional --show-changes
C:\temp\svntest\wc\trunk>svn commit -m "test"

C:\temp\svntest\wc\trunk>rem Merge trunk to branch:
C:\temp\svntest\wc\trunk>cd ..\testbranch
C:\temp\svntest\wc\testbranch>svn update
At revision 10.
C:\temp\svntest\wc\testbranch>call svnmerge merge --bidirectional --show-changes
C:\temp\svntest\wc\testbranch>svn commit -m "test"

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jun 15 08:07:07 2007

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.