You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Stefan Sperling <st...@elego.de> on 2010/05/18 21:57:21 UTC

2-URL merges incorrectly reverse-merge mergeinfo for merge target?

Given the subject line, I guess most of you realised that this mail
is intended for Paul and any other merge-tracking nerds on this list :)

Attached is a script that shows a merge which removes mergeinfo for
the merge target for no explicable reason (at least I can't see a
reason for removing it).

The output of the script is below.
The part I don't understand is why mergeinfo for trunk shows up
as reverse-merged in the last diff shown in the output:

  Property changes on: trunk-mergeinfo-reverted/feature2
  ___________________________________________________________________
  Modified: svn:mergeinfo
     Reverse-merged /trunk:r10-13
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The problem is that feature sync merges from trunk to feature2
will not work as intended after this change is committed.
feature2 has already had changes of trunk merged into it in
the past, and with the mergeinfo for trunk removed, all those
changes will be merged again.

See the comments in the script for more information.

This problem can be reproduced with trunk and 1.6.x.
Can someone explain this behaviour?
Is this correct or do we have a bug?

The people who ran into this are helping themselves for now
by restoring the reverted mergeinfo with a --record-only merge
prior to syncing feature2 to trunk again. This is not ideal though...

Thanks,
Stefan

Output:

+ rm -rf trunk-mergeinfo-reverted
+ mkdir -p trunk-mergeinfo-reverted
+ mkdir -p trunk-mergeinfo-reverted/trunk
+ echo alpha
+ > trunk-mergeinfo-reverted/trunk/alpha 
+ echo beta
+ > trunk-mergeinfo-reverted/trunk/beta 
+ mkdir trunk-mergeinfo-reverted/trunk/gamma
+ echo delta
+ > trunk-mergeinfo-reverted/trunk/gamma/delta 
+ mkdir trunk-mergeinfo-reverted/trunk/epsilon
+ echo zeta
+ > trunk-mergeinfo-reverted/trunk/epsilon/zeta 
+ svnadmin create /tmp/trunk-mergeinfo-reverted/repos
+ svn import trunk-mergeinfo-reverted/trunk file:////tmp/trunk-mergeinfo-reverted/repos/trunk -m importing project tree
Adding         trunk-mergeinfo-reverted/trunk/gamma
Adding         trunk-mergeinfo-reverted/trunk/gamma/delta
Adding         trunk-mergeinfo-reverted/trunk/alpha
Adding         trunk-mergeinfo-reverted/trunk/epsilon
Adding         trunk-mergeinfo-reverted/trunk/epsilon/zeta
Adding         trunk-mergeinfo-reverted/trunk/beta

Committed revision 1.
+ svn copy --parents file:////tmp/trunk-mergeinfo-reverted/repos/trunk file:////tmp/trunk-mergeinfo-reverted/repos/branches/firstbranch -m creating branch

Committed revision 2.
+ rm -rf trunk-mergeinfo-reverted/trunk
+ svn checkout file:////tmp/trunk-mergeinfo-reverted/repos/trunk trunk-mergeinfo-reverted/trunk
A    trunk-mergeinfo-reverted/trunk/gamma
A    trunk-mergeinfo-reverted/trunk/gamma/delta
A    trunk-mergeinfo-reverted/trunk/alpha
A    trunk-mergeinfo-reverted/trunk/epsilon
A    trunk-mergeinfo-reverted/trunk/epsilon/zeta
A    trunk-mergeinfo-reverted/trunk/beta
Checked out revision 2.
+ svn checkout file:////tmp/trunk-mergeinfo-reverted/repos/trunk trunk-mergeinfo-reverted/trunk2
A    trunk-mergeinfo-reverted/trunk2/gamma
A    trunk-mergeinfo-reverted/trunk2/gamma/delta
A    trunk-mergeinfo-reverted/trunk2/alpha
A    trunk-mergeinfo-reverted/trunk2/epsilon
A    trunk-mergeinfo-reverted/trunk2/epsilon/zeta
A    trunk-mergeinfo-reverted/trunk2/beta
Checked out revision 2.
+ svn checkout file:////tmp/trunk-mergeinfo-reverted/repos/branches/firstbranch trunk-mergeinfo-reverted/branch
A    trunk-mergeinfo-reverted/branch/gamma
A    trunk-mergeinfo-reverted/branch/gamma/delta
A    trunk-mergeinfo-reverted/branch/alpha
A    trunk-mergeinfo-reverted/branch/epsilon
A    trunk-mergeinfo-reverted/branch/epsilon/zeta
A    trunk-mergeinfo-reverted/branch/beta
Checked out revision 2.
+ echo aaa
+ >> trunk-mergeinfo-reverted/branch/alpha 
+ svn ci trunk-mergeinfo-reverted/branch -m change branch
Sending        trunk-mergeinfo-reverted/branch/alpha
Transmitting file data .
Committed revision 3.
+ svn up trunk-mergeinfo-reverted/trunk
At revision 3.
+ svn merge --reintegrate file:////tmp/trunk-mergeinfo-reverted/repos/branches/firstbranch trunk-mergeinfo-reverted/trunk
--- Merging differences between repository URLs into 'trunk-mergeinfo-reverted/trunk':
U    trunk-mergeinfo-reverted/trunk/alpha
--- Recording mergeinfo for merge between repository URLs into 'trunk-mergeinfo-reverted/trunk':
 U   trunk-mergeinfo-reverted/trunk
+ svn ci trunk-mergeinfo-reverted/trunk -m reintegrated branch
Sending        trunk-mergeinfo-reverted/trunk
Sending        trunk-mergeinfo-reverted/trunk/alpha
Transmitting file data .
Committed revision 4.
+ svn rm file:////tmp/trunk-mergeinfo-reverted/repos/branches/firstbranch -m remove branch

Committed revision 5.
+ rm -rf trunk-mergeinfo-reverted/branch
+ svn cp file:////tmp/trunk-mergeinfo-reverted/repos/trunk file:////tmp/trunk-mergeinfo-reverted/repos/branches/feature1 -m create feature1 branch

Committed revision 6.
+ svn co file:////tmp/trunk-mergeinfo-reverted/repos/branches/feature1 trunk-mergeinfo-reverted/feature1
A    trunk-mergeinfo-reverted/feature1/gamma
A    trunk-mergeinfo-reverted/feature1/gamma/delta
A    trunk-mergeinfo-reverted/feature1/alpha
A    trunk-mergeinfo-reverted/feature1/epsilon
A    trunk-mergeinfo-reverted/feature1/epsilon/zeta
A    trunk-mergeinfo-reverted/feature1/beta
 U   trunk-mergeinfo-reverted/feature1
Checked out revision 6.
+ echo bbb
+ >> trunk-mergeinfo-reverted/feature1/beta 
+ svn ci trunk-mergeinfo-reverted/feature1 -m work on feature1
Sending        trunk-mergeinfo-reverted/feature1/beta
Transmitting file data .
Committed revision 7.
+ echo zzz
+ >> trunk-mergeinfo-reverted/trunk/epsilon/zeta 
+ svn ci trunk-mergeinfo-reverted/trunk -m some work on trunk
Sending        trunk-mergeinfo-reverted/trunk/epsilon/zeta
Transmitting file data .
Committed revision 8.
+ svn up trunk-mergeinfo-reverted/feature1
At revision 8.
+ svn merge file:////tmp/trunk-mergeinfo-reverted/repos/trunk trunk-mergeinfo-reverted/feature1
--- Merging r6 through r8 into 'trunk-mergeinfo-reverted/feature1':
U    trunk-mergeinfo-reverted/feature1/epsilon/zeta
--- Recording mergeinfo for merge of r6 through r8 into 'trunk-mergeinfo-reverted/feature1':
 U   trunk-mergeinfo-reverted/feature1
+ svn ci trunk-mergeinfo-reverted/feature1 -m sync with trunk
Sending        trunk-mergeinfo-reverted/feature1
Sending        trunk-mergeinfo-reverted/feature1/epsilon/zeta
Transmitting file data .
Committed revision 9.
+ svn cp file:////tmp/trunk-mergeinfo-reverted/repos/trunk file:////tmp/trunk-mergeinfo-reverted/repos/branches/feature2 -m create feature2 branch

Committed revision 10.
+ svn co file:////tmp/trunk-mergeinfo-reverted/repos/branches/feature2 trunk-mergeinfo-reverted/feature2
A    trunk-mergeinfo-reverted/feature2/gamma
A    trunk-mergeinfo-reverted/feature2/gamma/delta
A    trunk-mergeinfo-reverted/feature2/alpha
A    trunk-mergeinfo-reverted/feature2/epsilon
A    trunk-mergeinfo-reverted/feature2/epsilon/zeta
A    trunk-mergeinfo-reverted/feature2/beta
 U   trunk-mergeinfo-reverted/feature2
Checked out revision 10.
+ echo aaaa
+ >> trunk-mergeinfo-reverted/feature2/alpha 
+ svn ci trunk-mergeinfo-reverted/feature2 -m work on feature2
Sending        trunk-mergeinfo-reverted/feature2/alpha
Transmitting file data .
Committed revision 11.
+ svn up trunk-mergeinfo-reverted/trunk
At revision 11.
+ svn merge --reintegrate file:////tmp/trunk-mergeinfo-reverted/repos/branches/feature2 trunk-mergeinfo-reverted/trunk
--- Merging differences between repository URLs into 'trunk-mergeinfo-reverted/trunk':
U    trunk-mergeinfo-reverted/trunk/alpha
--- Recording mergeinfo for merge between repository URLs into 'trunk-mergeinfo-reverted/trunk':
 U   trunk-mergeinfo-reverted/trunk
+ svn ci trunk-mergeinfo-reverted/trunk -m reintegrate bugfix from feature2 branch
Sending        trunk-mergeinfo-reverted/trunk
Sending        trunk-mergeinfo-reverted/trunk/alpha
Transmitting file data .
Committed revision 12.
+ svn up trunk-mergeinfo-reverted/feature2
At revision 12.
+ svnlook youngest trunk-mergeinfo-reverted/repos
+ svn merge -c 12 --record-only file:////tmp/trunk-mergeinfo-reverted/repos/trunk trunk-mergeinfo-reverted/feature2
--- Merging r12 into 'trunk-mergeinfo-reverted/feature2':
 U   trunk-mergeinfo-reverted/feature2
--- Recording mergeinfo for merge of r12 into 'trunk-mergeinfo-reverted/feature2':
 U   trunk-mergeinfo-reverted/feature2
+ svn ci trunk-mergeinfo-reverted/feature2 -m block reintegration revision
Sending        trunk-mergeinfo-reverted/feature2

Committed revision 13.
+ svn up trunk-mergeinfo-reverted/feature2
At revision 13.
+ svn merge file:////tmp/trunk-mergeinfo-reverted/repos/trunk trunk-mergeinfo-reverted/feature2
--- Recording mergeinfo for merge of r10 through r13 into 'trunk-mergeinfo-reverted/feature2':
 U   trunk-mergeinfo-reverted/feature2
+ svn ci trunk-mergeinfo-reverted/feature2 -m sync with trunk
Sending        trunk-mergeinfo-reverted/feature2

Committed revision 14.
+ svn up trunk-mergeinfo-reverted/feature1
At revision 14.
+ svn merge file:////tmp/trunk-mergeinfo-reverted/repos/trunk trunk-mergeinfo-reverted/feature1
--- Merging r9 through r14 into 'trunk-mergeinfo-reverted/feature1':
U    trunk-mergeinfo-reverted/feature1/alpha
 G   trunk-mergeinfo-reverted/feature1
--- Recording mergeinfo for merge of r9 through r14 into 'trunk-mergeinfo-reverted/feature1':
 G   trunk-mergeinfo-reverted/feature1
+ svn ci trunk-mergeinfo-reverted/feature1 -m sync with trunk
Sending        trunk-mergeinfo-reverted/feature1
Sending        trunk-mergeinfo-reverted/feature1/alpha
Transmitting file data .
Committed revision 15.
+ svnlook youngest trunk-mergeinfo-reverted/repos
+ rebase_rev=15
+ svn up trunk-mergeinfo-reverted/feature2
At revision 15.
+ svn merge file:////tmp/trunk-mergeinfo-reverted/repos/trunk@15 file:////tmp/trunk-mergeinfo-reverted/repos/branches/feature1 trunk-mergeinfo-reverted/feature2
--- Merging differences between repository URLs into 'trunk-mergeinfo-reverted/feature2':
U    trunk-mergeinfo-reverted/feature2/beta
 G   trunk-mergeinfo-reverted/feature2
--- Recording mergeinfo for merge between repository URLs into 'trunk-mergeinfo-reverted/feature2':
 G   trunk-mergeinfo-reverted/feature2
 G   trunk-mergeinfo-reverted/feature2
+ svn diff trunk-mergeinfo-reverted/feature2

Property changes on: trunk-mergeinfo-reverted/feature2
___________________________________________________________________
Modified: svn:mergeinfo
   Reverse-merged /trunk:r10-13
   Merged /branches/feature1:r6-15
Index: trunk-mergeinfo-reverted/feature2/beta
===================================================================
--- trunk-mergeinfo-reverted/feature2/beta	(revision 15)
+++ trunk-mergeinfo-reverted/feature2/beta	(working copy)
@@ -1 +1,2 @@
 beta
+bbb
+ svn pg -v -R svn:mergeinfo trunk-mergeinfo-reverted/feature2
Properties on 'trunk-mergeinfo-reverted/feature2':
  svn:mergeinfo
    /branches/feature1:6-15
    /branches/firstbranch:2-3

Re: 2-URL merges incorrectly reverse-merge mergeinfo for merge target?

Posted by Stefan Sperling <st...@elego.de>.
On Wed, May 19, 2010 at 10:11:57AM -0400, C. Michael Pilato wrote:
> Note that if we change the order of operations a bit -- if we calculate the
> merge-driven mergeinfo diff first, and then apply it to the target, we're in
> better shape:
> 
>    {trunk:6-14, feature1:6-15} - {feature2:10-11 -trunk:6-15} =
>         {-trunk:15, feature1:6-15, -feature2:10-11}
> 
>    {-trunk:15, feature1:6-15, -feature2:10-11} + {trunk:10-13} =
>         {trunk:10-13, -trunk:15, feature1:6-15, -feature2:10-11}
> 
>    With all the unrecordable negative mergeinfo removed, that's
>         {trunk:10-13, feature1:6-15}
> 
> Making the final mergeinfo diff for the operation simply:
> 
>     Merged /branches/feature1:6-15
> 
> Does that make sense?


This is now tracked as issue #3648:
http://subversion.tigris.org/issues/show_bug.cgi?id=3648

Stefan

Re: 2-URL merges incorrectly reverse-merge mergeinfo for merge target?

Posted by "C. Michael Pilato" <cm...@collab.net>.
Stefan Sperling wrote:
> You said the algorithm was:
> 
>      the reverse-merge of the diff between "ancestor" and "left"
>    + the merge of the diff between "ancestor" and "right"
> 
> Unless I'm mistaken, in this case ancestor is trunk@6,
> left is trunk@15, and right is feature1@15.

trunk@5 is actually the ancestor, since it was the copy source for
branches/feature1.

> The mergeinfo diffs are as follows (omitting other changes svn diff prints):
> 
>   $ svn diff ^/trunk@15 ^/trunk@6                             
>   Property changes on: .
>   ___________________________________________________________________
>   Modified: svn:mergeinfo
>      Reverse-merged /branches/feature2:r10-11

Oops!  You've overlooked (or I've failed to correctly describe) a key part
of this algorithm.  Yes, the mergeinfo diff between trunk@15 and trunk@5 is
{ -branches/feature2:10-11 } (note the minus sign at the head of that).  But
there's also the natural history of that leg of the merge to be considered.
 So the full bit of mergeinfo changes applied per that leg of the 2-URL
merge is { -branches/feature2:10-11, -trunk:6-15 }.

>   $ svn diff ^/trunk@15 ^/branches/feature1@15
>   Property changes on: .
>   ___________________________________________________________________
>   Modified: svn:mergeinfo
>      Merged /trunk:r6-14
> 
> The second mergeinfo diff looks correct, and is a superset of the
> current trunk mergeinfo on feature2 (/trunk:10-13).

Well, here again, it's really { +trunk:6-14, +branches/feature1:6-15 }.

Today we do the real merge (directly between "left" and "right", applied to
the target).  Then we do a pair of --record-only merges for the mergeinfo
bit:  b/w "ancestor" and "right" applied to target (this tends to be
additive), then b/w "left" and "ancestor" applied to targe (which is
subtractive).  And we do things in that order.

So what is probably happening here is that your superset of trunk mergeinfo
additions is being applied first, swallowing the original trunk:10-13 and
making it trunk:6-14, then in that second --record-only step the nasty
-trunk:6-15 is being applied, leaving a net diff of the removal of the
original trunk:10-13 mergeinfo.  The -branches/feature2 portion goes nowhere
(because we can't record negative mergeinfo).  And the branches/feature1
stuff remains.

Note that if we change the order of operations a bit -- if we calculate the
merge-driven mergeinfo diff first, and then apply it to the target, we're in
better shape:

   {trunk:6-14, feature1:6-15} - {feature2:10-11 -trunk:6-15} =
        {-trunk:15, feature1:6-15, -feature2:10-11}

   {-trunk:15, feature1:6-15, -feature2:10-11} + {trunk:10-13} =
        {trunk:10-13, -trunk:15, feature1:6-15, -feature2:10-11}

   With all the unrecordable negative mergeinfo removed, that's
        {trunk:10-13, feature1:6-15}

Making the final mergeinfo diff for the operation simply:

    Merged /branches/feature1:6-15

Does that make sense?

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: 2-URL merges incorrectly reverse-merge mergeinfo for merge target?

Posted by Stefan Sperling <st...@elego.de>.
On Tue, May 18, 2010 at 09:34:37PM -0400, C. Michael Pilato wrote:
> Stefan Sperling wrote:
> > Given the subject line, I guess most of you realised that this mail
> > is intended for Paul and any other merge-tracking nerds on this list :)
> > 
> > Attached is a script that shows a merge which removes mergeinfo for
> > the merge target for no explicable reason (at least I can't see a
> > reason for removing it).
> 
> The 2-URL merge algorithm determines if the two URLs ("left" and "right")
> are ancestrally related.  If so (that is, if there exists a common ancestor
> "ancestor"), merge recording is enabled for the merge.  The recorded
> mergeinfo is as follows:
> 
>       the reverse-merge of the diff between "ancestor" and "left"
>     + the merge of the diff between "ancestor" and "right"
> 
> So let's start with:  "Does this match what you see in your scenario?"
> (I've not yet read your extensive script or its output yet.)
> 
> From there, we can move on to:  "Is this expected-but-still-braindead?"

I've tried to follow my example based on your assumption about
Subversion's behaviour. I think I found that Subversion does
not do what you describe. So the answer would be "No, this does
not match what I see in my scenario."

Take a couple of minutes and bear with me.
Here's what happens in my example:

r6 creates the feature1 branch:

  ------------------------------------------------------------------------
  r6 | stsp | 2010-05-19 09:51:05 +0200 (Wed, 19 May 2010) | 1 line
  Changed paths:
     A /branches/feature1 (from /trunk:5)
  
  create feature1 branch
  
r7 does original work on feature1:

  ------------------------------------------------------------------------
  r7 | stsp | 2010-05-19 09:51:05 +0200 (Wed, 19 May 2010) | 1 line
  Changed paths:
     M /branches/feature1/beta
  
  work on feature1
  
  Index: branches/feature1/beta
  ===================================================================
  --- branches/feature1/beta	(revision 6)
  +++ branches/feature1/beta	(revision 7)
  @@ -1 +1,2 @@
   beta
  +bbb

r10 creates the feature2 branch:

  ------------------------------------------------------------------------
  r10 | stsp | 2010-05-19 09:51:06 +0200 (Wed, 19 May 2010) | 1 line
  Changed paths:
     A /branches/feature2 (from /trunk:9)
  
  create feature2 branch
  
r11 does original work on feature2:

  ------------------------------------------------------------------------
  r11 | stsp | 2010-05-19 09:51:06 +0200 (Wed, 19 May 2010) | 1 line
  Changed paths:
     M /branches/feature2/alpha
  
  work on feature2
  
  Index: branches/feature2/alpha
  ===================================================================
  --- branches/feature2/alpha	(revision 10)
  +++ branches/feature2/alpha	(revision 11)
  @@ -1,2 +1,3 @@
   alpha
   aaa
  +aaaa

r12 reintegrates this work into trunk:

  ------------------------------------------------------------------------
  r12 | stsp | 2010-05-19 09:51:07 +0200 (Wed, 19 May 2010) | 1 line
  Changed paths:
     M /trunk
     M /trunk/alpha
  
  reintegrate from feature2 branch
  
  Index: trunk/alpha
  ===================================================================
  --- trunk/alpha	(revision 11)
  +++ trunk/alpha	(revision 12)
  @@ -1,2 +1,3 @@
   alpha
   aaa
  +aaaa
  
  Property changes on: trunk
  ___________________________________________________________________
  Modified: svn:mergeinfo
     Merged /branches/feature2:r10-11

r13 blocks the reingration revision so we can continue
to use the feature2 branch and reintegrate it again later:

  ------------------------------------------------------------------------
  r13 | stsp | 2010-05-19 09:51:07 +0200 (Wed, 19 May 2010) | 1 line
  Changed paths:
     M /branches/feature2
  
  block reintegration revision
  
  
  Property changes on: branches/feature2
  ___________________________________________________________________
  Modified: svn:mergeinfo
     Merged /trunk:r12

r14 syncs feature2 with the trunk:

  ------------------------------------------------------------------------
  r14 | stsp | 2010-05-19 09:51:08 +0200 (Wed, 19 May 2010) | 1 line
  Changed paths:
     M /branches/feature2
  
  sync with trunk
  
  
  Property changes on: branches/feature2
  ___________________________________________________________________
  Modified: svn:mergeinfo
     Merged /trunk:r10-11,13
  
We can see that r12 was correctly skipped during the merge.

In r15, feature1 is synced with trunk, which brings the r12 state
of feature2 work into feature1:

  ------------------------------------------------------------------------
  r15 | stsp | 2010-05-19 09:51:08 +0200 (Wed, 19 May 2010) | 1 line
  Changed paths:
     M /branches/feature1
     M /branches/feature1/alpha
  
  sync with trunk
  
  Index: branches/feature1/alpha
  ===================================================================
  --- branches/feature1/alpha	(revision 14)
  +++ branches/feature1/alpha	(revision 15)
  @@ -1,2 +1,3 @@
   alpha
   aaa
  +aaaa
  
  Property changes on: branches/feature1
  ___________________________________________________________________
  Modified: svn:mergeinfo
     Merged /branches/feature2:r10-11
     Merged /trunk:r9-14


Here's a small graph of the above, omitting the merge done in r13 
since it was only done so that the merge in r14 would succeed:

feature1 +--r7---------------------+--
        /r6                       /r15
trunk -+------+----------+--+----+----
               \r10     /r12 \r14
      feature2  +--r11-+------+-------


At this point, we have the following mergeinfo (I replaced the repos
URL with ^/):

Properties on '^/branches/feature1':
  svn:mergeinfo
    /branches/feature2:10-11
    /branches/firstbranch:2-3
    /trunk:6-14
Properties on '^/branches/feature2':
  svn:mergeinfo
    /branches/firstbranch:2-3
    /trunk:10-13
Properties on '^/trunk':
  svn:mergeinfo
    /branches/feature2:10-11
    /branches/firstbranch:2-3

We see mergeinfo for "firstbranch". This is a historic branch
which was merged into trunk and delete before feature1 and feature2 existed.
I didn't mention it so far, and I don't think it's relevant.

We now do the following merge into a working copy of feature2:

  svn merge ^/trunk@15 ^/branches/feature1@HEAD  (HEAD happens to be 15)

This brings the original work done on feature1 into feature2,
originally committed in r7:

  Index: beta
  ===================================================================
  --- beta	(revision 15)
  +++ beta	(working copy)
  @@ -1 +1,2 @@
   beta
  +bbb

But it nukes the mergeinfo for trunk from feature2:

  Property changes on: .
  ___________________________________________________________________
  Modified: svn:mergeinfo
     Reverse-merged /trunk:r10-13
     Merged /branches/feature1:r6-15

If we commit this, feature2 loses important mergeinfo.
It looks as if we had never merged from trunk into feature2, which is wrong.
Revisions r10 to r16 are merged from trunk to feature2 again upon the
next sync merge (the merge only changes mergeinfo in this example,
but in reality this can cause conflicts to occur again):

  $ svn ci -m "commit merge result"
  Sending        .
  Sending        beta
  Transmitting file data .
  Committed revision 16.
  $ svn up
  At revision 16.
  $ svn merge ^/trunk
  --- Merging r10 through r16 into '.':
   G   .
  --- Recording mergeinfo for merge of r10 through r16 into '.':
   U   .
  $ svn diff
  
  Property changes on: .
  ___________________________________________________________________
  Modified: svn:mergeinfo
     Merged /trunk:r10-16


You said the algorithm was:

     the reverse-merge of the diff between "ancestor" and "left"
   + the merge of the diff between "ancestor" and "right"

Unless I'm mistaken, in this case ancestor is trunk@6,
left is trunk@15, and right is feature1@15.

The mergeinfo diffs are as follows (omitting other changes svn diff prints):

  $ svn diff ^/trunk@15 ^/trunk@6                             
  Property changes on: .
  ___________________________________________________________________
  Modified: svn:mergeinfo
     Reverse-merged /branches/feature2:r10-11

The first mergeinfo diff reverts mergeinfo created on trunk during
the reintegration of feature2. I'm not sure if our plan of applying
this mergeinfo diff to feature2 is correct, but since reverse-merging
from natural history does not create mergeinfo and we do not actually
revert r10 and r11, this change is probably inoperative.
  
  $ svn diff ^/trunk@15 ^/branches/feature1@15
  Property changes on: .
  ___________________________________________________________________
  Modified: svn:mergeinfo
     Merged /trunk:r6-14

The second mergeinfo diff looks correct, and is a superset of the
current trunk mergeinfo on feature2 (/trunk:10-13).
So I'd expect the following mergeinfo on feature2 after the merge:

  Properties on '^/branches/feature2':
    svn:mergeinfo
      /branches/firstbranch:2-3
      /trunk:6-14

Which is evidently not what is happening.
So is this a bug?

Stefan

Re: 2-URL merges incorrectly reverse-merge mergeinfo for merge target?

Posted by "C. Michael Pilato" <cm...@collab.net>.
Stefan Sperling wrote:
> Given the subject line, I guess most of you realised that this mail
> is intended for Paul and any other merge-tracking nerds on this list :)
> 
> Attached is a script that shows a merge which removes mergeinfo for
> the merge target for no explicable reason (at least I can't see a
> reason for removing it).

The 2-URL merge algorithm determines if the two URLs ("left" and "right")
are ancestrally related.  If so (that is, if there exists a common ancestor
"ancestor"), merge recording is enabled for the merge.  The recorded
mergeinfo is as follows:

      the reverse-merge of the diff between "ancestor" and "left"
    + the merge of the diff between "ancestor" and "right"

So let's start with:  "Does this match what you see in your scenario?"
(I've not yet read your extensive script or its output yet.)

Re: 2-URL merges incorrectly reverse-merge mergeinfo for merge target?

Posted by "C. Michael Pilato" <cm...@collab.net>.
Stefan Sperling wrote:
> Given the subject line, I guess most of you realised that this mail
> is intended for Paul and any other merge-tracking nerds on this list :)
> 
> Attached is a script that shows a merge which removes mergeinfo for
> the merge target for no explicable reason (at least I can't see a
> reason for removing it).

The 2-URL merge algorithm determines if the two URLs ("left" and "right")
are ancestrally related.  If so (that is, if there exists a common ancestor
"ancestor"), merge recording is enabled for the merge.  The recorded
mergeinfo is as follows:

      the reverse-merge of the diff between "ancestor" and "left"
    + the merge of the diff between "ancestor" and "right"

So let's start with:  "Does this match what you see in your scenario?"
(I've not yet read your extensive script or its output yet.)

>From there, we can move on to:  "Is this expected-but-still-braindead?"

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Re: 2-URL merges incorrectly reverse-merge mergeinfo for merge target?

Posted by Stefan Sperling <st...@elego.de>.
On Tue, May 18, 2010 at 11:57:21PM +0200, Stefan Sperling wrote:
> # Reintegrate the feature2 branch
> svn up $trunk
> svn merge --reintegrate $feature2_url $trunk
> svn ci $trunk -m "reintegrate bugfix from feature2 branch"

In case that "bugfix" comment confuses you, this should have read:

svn ci $trunk -m "reintegrate feature2 branch into trunk"

Stefan