On Mon, Jan 30, 2012 at 10:37:51PM +0100, Johan Corveleyn wrote:
> On Mon, Jan 30, 2012 at 10:19 PM, Stefan Sperling <stsp_at_elego.de> wrote:
> > But you cannot use the last-synced revision as left anchor either:
> > svn co b
> > svn merge b_at_r4 a_at_r6 b
> > Because applying this delta reverts b_at_r5 (this change appears reversed
> > in the diff between b_at_r4 and a_at_r6 since it isn't present on branch a).
>
> No, I don't think it does. The change b_at_r5 doesn't appear in this
> diff, neither forward nor reversed. Say b_at_r5 adds a line in file b/X,
> I see no reason this change (forward or reversed) would be part of the
> difference between b_at_r4 and a_at_r6.
Sorry, I made an error while transferring my experiment into an example.
The problem happens if a non-merge commit (b_at_r4) happens prior to
the first merge commit (b_at_r5), like this:
+b_at_r2---b@r4---b_at_r5--b@r6---b_at_r8--
(branch) / ^ ^ (merge 2)
/ | (merge 1) |
--- a_at_r1---a@r3--------+-------a_at_r7--+-------
b_at_r4 appears reversed in 'svn diff b_at_5 a_at_7' -- not good
a_at_r3 appears in 'svn diff b_at_2 a_at_7' -- not good either, applied twice
But 'svn merge a_at_r5 a_at_r7' works fine.
Full transcript below.
+ rm -rf merge-test
+ mkdir -p merge-test
+ mkdir -p merge-test/a
+ echo alpha
+ > merge-test/a/alpha
+ echo beta
+ > merge-test/a/beta
+ svnadmin create /tmp/merge-test/repos
+ svn import merge-test/a file:////tmp/merge-test/repos/a -m importing project tree
Adding merge-test/a/alpha
Adding merge-test/a/beta
Committed revision 1.
+ svn copy file:////tmp/merge-test/repos/a file:////tmp/merge-test/repos/b -m creating b
Committed revision 2.
+ rm -rf merge-test/a
+ svn checkout file:////tmp/merge-test/repos/a merge-test/a
A merge-test/a/alpha
A merge-test/a/beta
Checked out revision 2.
+ svn checkout file:////tmp/merge-test/repos/b merge-test/b
A merge-test/b/alpha
A merge-test/b/beta
Checked out revision 2.
+ echo foo
+ >> merge-test/a/alpha
+ svn commit merge-test/a -mm
Sending merge-test/a/alpha
Transmitting file data .
Committed revision 3.
+ echo bar
+ >> merge-test/b/beta
+ svn commit merge-test/b -mm
Sending merge-test/b/beta
Transmitting file data .
Committed revision 4.
+ svn up merge-test/b
Updating 'merge-test/b':
At revision 4.
+ svn merge file:////tmp/merge-test/repos/b_at_2 file:////tmp/merge-test/repos/a_at_3 merge-test/b
--- Merging differences between repository URLs into 'merge-test/b':
U merge-test/b/alpha
--- Recording mergeinfo for merge between repository URLs into 'merge-test/b':
U merge-test/b
+ svn commit merge-test/b -mm
Sending merge-test/b
Sending merge-test/b/alpha
Transmitting file data .
Committed revision 5.
+ echo bar2
+ >> merge-test/b/beta
+ svn commit merge-test/b -mm
Sending merge-test/b/beta
Transmitting file data .
Committed revision 6.
+ echo foo2
+ >> merge-test/a/alpha
+ svn commit merge-test/a -mm
Sending merge-test/a/alpha
Transmitting file data .
Committed revision 7.
+ svn diff file:////tmp/merge-test/repos/b_at_2 file:////tmp/merge-test/repos/a_at_7
Index: alpha
===================================================================
--- alpha (.../b) (revision 2)
+++ alpha (.../a) (revision 7)
@@ -1 +1,3 @@
alpha
+foo
+foo2
+ svn up merge-test/b
Updating 'merge-test/b':
At revision 7.
+ svn merge --accept=postpone file:////tmp/merge-test/repos/b_at_2 file:////tmp/merge-test/repos/a_at_7 merge-test/b
--- Merging differences between repository URLs into 'merge-test/b':
C merge-test/b/alpha
--- Recording mergeinfo for merge between repository URLs into 'merge-test/b':
U merge-test/b
Summary of conflicts:
Text conflicts: 1
+ svn diff merge-test/b
Index: merge-test/b
===================================================================
--- merge-test/b (revision 7)
+++ merge-test/b (working copy)
Property changes on: merge-test/b
___________________________________________________________________
Modified: svn:mergeinfo
Merged /a:r4-7
Index: merge-test/b/alpha
===================================================================
--- merge-test/b/alpha (revision 7)
+++ merge-test/b/alpha (working copy)
@@ -1,2 +1,7 @@
alpha
+<<<<<<< .working
foo
+=======
+foo
+foo2
+>>>>>>> .merge-right.r7
+ svn revert -R merge-test/b
Reverted 'merge-test/b'
Reverted 'merge-test/b/alpha'
+ svn diff file:////tmp/merge-test/repos/b_at_5 file:////tmp/merge-test/repos/a_at_7
Index: alpha
===================================================================
--- alpha (.../b) (revision 5)
+++ alpha (.../a) (revision 7)
@@ -1,2 +1,3 @@
alpha
foo
+foo2
Index: beta
===================================================================
--- beta (.../b) (revision 5)
+++ beta (.../a) (revision 7)
@@ -1,2 +1 @@
beta
-bar
Index: .
===================================================================
--- . (.../b) (revision 5)
+++ . (.../a) (revision 7)
Property changes on: .
___________________________________________________________________
Deleted: svn:mergeinfo
Reverse-merged /a:r2-3
+ svn merge --accept=postpone file:////tmp/merge-test/repos/b_at_5 file:////tmp/merge-test/repos/a_at_7 merge-test/b
--- Merging differences between repository URLs into 'merge-test/b':
U merge-test/b/alpha
C merge-test/b/beta
U merge-test/b
--- Recording mergeinfo for merge between repository URLs into 'merge-test/b':
G merge-test/b
Summary of conflicts:
Text conflicts: 1
+ svn diff merge-test/b
Index: merge-test/b
===================================================================
--- merge-test/b (revision 7)
+++ merge-test/b (working copy)
Property changes on: merge-test/b
___________________________________________________________________
Modified: svn:mergeinfo
Merged /a:r4-7
Index: merge-test/b/alpha
===================================================================
--- merge-test/b/alpha (revision 7)
+++ merge-test/b/alpha (working copy)
@@ -1,2 +1,3 @@
alpha
foo
+foo2
Index: merge-test/b/beta
===================================================================
--- merge-test/b/beta (revision 7)
+++ merge-test/b/beta (working copy)
@@ -1,3 +1,6 @@
beta
+<<<<<<< .working
bar
bar2
+=======
+>>>>>>> .merge-right.r7
+ svn revert -R merge-test/b
Reverted 'merge-test/b'
Reverted 'merge-test/b/alpha'
Reverted 'merge-test/b/beta'
+ svn merge file:////tmp/merge-test/repos/a_at_5 file:////tmp/merge-test/repos/a_at_7 merge-test/b
--- Merging r6 through r7 into 'merge-test/b':
U merge-test/b/alpha
--- Recording mergeinfo for merge of r6 through r7 into 'merge-test/b':
U merge-test/b
+ svn diff merge-test/b
Index: merge-test/b
===================================================================
--- merge-test/b (revision 7)
+++ merge-test/b (working copy)
Property changes on: merge-test/b
___________________________________________________________________
Modified: svn:mergeinfo
Merged /a:r6-7
Index: merge-test/b/alpha
===================================================================
--- merge-test/b/alpha (revision 7)
+++ merge-test/b/alpha (working copy)
@@ -1,2 +1,3 @@
alpha
foo
+foo2
Received on 2012-01-30 23:17:10 CET