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

RE: [RFC] Merge Tracking: svn:mergeinfo and svn switch

From: Paul Burba <pburba_at_collab.net>
Date: 2007-05-04 18:32:11 CEST

> -----Original Message-----
> From: Paul Burba [mailto:pburba@collab.net]
> Sent: Tuesday, April 17, 2007 11:04 AM
> To: dev@subversion.tigris.org
> Cc: Daniel Rall; Peter N. Lundblad; Kamesh Jayachandran;
> Hyrum K. Wright
> Subject: [RFC] Merge Tracking: svn:mergeinfo and svn switch
>
> > -----Original Message-----
> > From: Peter Lundblad [mailto:plundblad@google.com]
> > Sent: Wednesday, March 14, 2007 6:11 PM
> > To: Daniel Rall
> > Cc: dev@subversion.tigris.org; Daniel Berlin
> > Subject: Re: [merge tracking] Prop changes to the "svn:mergeinfo"
> > property

<snip>

> So I thought a bit (well a lot actually) on switch and merge
> tracking and see three cases where the current behavior is
> broken and we need to agree on the appropriate behavior:
>
> ----------------------------
> A) MERGE TO A SWITCHED PATH:
>
> PATH's working copy parent PATH_P has explicit mergeinfo for rev Y.
> PATH is then switched to URL2. svn merge -cX URL1 PATH.
>
> Current behavior: PATH gets mergeinfo set for rX,Y.
>
> Correct behavior: PATH gets mergeinfo set *only* for rX as a
> local modification. PATH shouldn't inherit mergeinfo from
> PATH_P, the inheritance code needs to stop climbing the WC
> looking for inherited mergeinfo when it hits a switched path.

Closely related to C) below, I should have added the following to
'correct behavior': mergeinfo set on PATH as a result of the merge is
never elided.

Added test r24708

Implemented new behavior in r24730, 24731, 24739, 24748, 24749 (The meat
is in the first change, the others are fixes of stupid mistakes).

> ----------------------------------------
> B) MERGE TO A PATH WITH SWITCHED CHILD:
>
> svn merge -cX URL PATH where PATH has a switched child PATH_C
> with no explicit mergeinfo.
>
> Current behavior: PATH_C has no mergeinfo recorded. PATH_C
> has rX merged into it, though this information is never
> getting into the repos.
> If this merge is committed and another user checks out URL
> and tries to merge in rX, a repeat merge is allowed.
>
> Correct behavior: PATH_C has mergeinfo added for rev X as a
> local modification.
>
> Note: If PATH_C has explicit mergeinfo prior to the merge
> then everything is ok, PATH_C gets mergeinfo for rX.

Test added r24868.

Putting the finishing touches on the fix for this.

> ----------------------------------------
> C) SWITCH PATH ELISION
> (http://svn.haxx.se/dev/archive-2007-04/0653.shtml):
>
> svn sw URL PATH where PATH's parent PATH_P has identical
> mergeinfo to that added to PATH from URL/PATH.
>
> Current (patch) behavior: PATH's mergeinfo elides to PATH_C.
                                                       ^^^^
                                               I meant PATH_P
  
> Again this sets up the potential for a repeat merge.
>
> Correct behavior: Never elide the target of a switch (the
> switch target is effectively the root of the WC in terms of
> elision). The only exception is when the switch is reversing
> an earlier switch and leaving PATH in an unswitched state.

Fixed r24730, r24807.

> ----------------------------------------
>
>
> If A and B are implemented, I don't see any problems with
> switch itself (other than elision):
>
> ----------------------------------------
> D) svn switch URL PATH
>
> Current behavior: PATH's mergeinfo is replaced by the
> mergeinfo from URL (if any) regardless of whether PATH had
> explicit mergeinfo prior to the switch or not.

I keep thinking I see lots of problems here, but in the end there is
only one I can put my finger on: when PATH or PATH's parent has *local*
mergeinfo. The problems are pretty much the same, so here is an example
when PATH's parent has local mergeinfo:

# Starting with the greek tree we make 3 copies of A and commit as r2
>svn copy %URL%/A merge_tests-1\A_BRANCH_1
A merge_tests-1\A_BRANCH_1\B
...<snip>...
A merge_tests-1\A_BRANCH_1\D\H\psi
Checked out revision 1.
A merge_tests-1\A_BRANCH_1

>svn copy %URL%/A merge_tests-1\A_BRANCH_2
A merge_tests-1\A_BRANCH_2\B
...<snip>...
A merge_tests-1\A_BRANCH_2\D\H\psi
Checked out revision 1.
A merge_tests-1\A_BRANCH_2

>svn copy %URL%/A merge_tests-1\A_BRANCH_3
A merge_tests-1\A_BRANCH_3\B
...<snip>...
A merge_tests-1\A_BRANCH_3\D\H\psi
Checked out revision 1.
A merge_tests-1\A_BRANCH_3

>svn ci -m "" merge_tests-1
Adding merge_tests-1\A_BRANCH_1
Adding merge_tests-1\A_BRANCH_2
Adding merge_tests-1\A_BRANCH_3

Committed revision 2.

# That gives us the expected mergeinfo.
>svn pl -vR merge_tests-1
Properties on 'merge_tests-1\A_BRANCH_3':
  svn:mergeinfo : /A:1
Properties on 'merge_tests-1\A_BRANCH_1':
  svn:mergeinfo : /A:1
Properties on 'merge_tests-1\A_BRANCH_2':
  svn:mergeinfo : /A:1

# Make a change to a file in branch 3 and commit as r3.
>echo new branch 3 line >> merge_tests-1\A_BRANCH_3\B\lambda

>svn ci -m "" merge_tests-1
Sending merge_tests-1\A_BRANCH_3\B\lambda
Transmitting file data .
Committed revision 3.

# Merge r3 into the branch copy source and commit as r4
>svn merge %URL%/A_BRANCH_3/B merge_tests-1\A\B -c3
U merge_tests-1\A\B\lambda

>svn ci -m "" merge_tests-1
Sending merge_tests-1\A\B
Sending merge_tests-1\A\B\lambda
Transmitting file data .
Committed revision 4.

>svn pl -vR merge_tests-1
Properties on 'merge_tests-1\A_BRANCH_3':
  svn:mergeinfo : /A:1
Properties on 'merge_tests-1\A\B':
  svn:mergeinfo : /A_BRANCH_3/B:3
Properties on 'merge_tests-1\A_BRANCH_1':
  svn:mergeinfo : /A:1
Properties on 'merge_tests-1\A_BRANCH_2':
  svn:mergeinfo : /A:1

# Make a change to a file in branch 2 and commit as r5.
>echo new branch 2 line >> merge_tests-1\A_BRANCH_2\B\lambda

>svn ci -m "" merge_tests-1
Sending merge_tests-1\A_BRANCH_2\B\lambda
Transmitting file data .
Committed revision 5.

# Merge r5 into the branch 1 but leave it as a local modification.
>svn merge %URL%/A_BRANCH_2/B merge_tests-1\A_BRANCH_1\B -c5
U merge_tests-1\A_BRANCH_1\B\lambda

# Everything looks right up to here
>svn pl -vR merge_tests-1
Properties on 'merge_tests-1\A_BRANCH_3':
  svn:mergeinfo : /A:1
Properties on 'merge_tests-1\A\B':
  svn:mergeinfo : /A_BRANCH_3/B:3
Properties on 'merge_tests-1\A_BRANCH_1':
  svn:mergeinfo : /A:1
Properties on 'merge_tests-1\A_BRANCH_1\B':
  svn:mergeinfo : /A/B:1
/A_BRANCH_2/B:5
Properties on 'merge_tests-1\A_BRANCH_2':
  svn:mergeinfo : /A:1

# switch a path which has no explicit mergeinfo of it's own but has a
parent with local mergeinfo:
>svn sw %URL%/A/B/lambda merge_tests-1\A_BRANCH_1\B\lambda
C merge_tests-1\A_BRANCH_1\B\lambda
Updated to revision 5.

C:\SVN\src-trunk\Release\subversion\tests\cmdline\svn-test-work\working_
copies>svn pl -vR merge_tests-1
Properties on 'merge_tests-1\A_BRANCH_3':
  svn:mergeinfo : /A:1
Properties on 'merge_tests-1\A\B':
  svn:mergeinfo : /A_BRANCH_3/B:3
Properties on 'merge_tests-1\A_BRANCH_1':
  svn:mergeinfo : /A:1
Properties on 'merge_tests-1\A_BRANCH_1\B':
  svn:mergeinfo : /A/B:1
/A_BRANCH_2/B:5
Properties on 'merge_tests-1\A_BRANCH_2':
  svn:mergeinfo : /A:1

So there is no mergeinfo on 'merge_tests-1\A_BRANCH_1\B\lambda', but
doesn't it effectively have the following mergeinfo?

* The inherited mergeinfo of the switched source:
'/A_BRANCH_3/B/lambda:3'

* The inherited local mergeinfo from it's unswitched parent:
'/A_BRANCH_2/B/lambda:5'.

This example is a bit poor because lambda is conflicted, but if that was
a clean switch and we commit 'merge_tests-1\A_BRANCH_1\B\lambda' then
%URL%/A/B/lambda has '/A_BRANCH_2/B/lambda:5' merged into it, but this
isn't recorded anywhere.

And setting the inherited local mergeinfo isn't enough either, mergeinfo
on a path must be complete, so we need to set the inherited mergeinfo
from the switch source too. So I think the correct behavior would be:

Properties on 'merge_tests-1\A_BRANCH_1\B\lambda':
  svn:mergeinfo : /A_BRANCH_3/B/lambda:3'
/A_BRANCH_2/B/lambda:5

Does that sound right?

The example where PATH itself has local mergeinfo is prtty much the
same, we end up with only the pre-existing local mergeinfo on PATH,
inherited or explicit mergeinfo from the switch source is missing.

> ----------------------------------------
> E) svn switch URL PATH where PATH has a child PATH_C with
> explicit mergeinfo prior to the switch
>
> Current behavior: PATH_C's mergeinfo is replaced by the
> mergeinfo from URL/PATH_C (if any).

Similar problem here if PATH_C has local mergeinfo. After the switch
PATH_C still has the same local mergeinfo.

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

  • application/octet-stream attachment: lambda
Received on Fri May 4 18:33:25 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.