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

Re: Re: [PATCH] Warn when attempting to reverse merge range from target's future history

From: Paul Burba <ptburba_at_gmail.com>
Date: Tue, 19 Feb 2008 16:38:15 -0500

On Feb 19, 2008 1:21 PM, Kamesh Jayachandran <kamesh_at_collab.net> wrote:
>
>
>
>
> >> Comment2:
> >>
> >> Why should we use 'svn_client__repos_locations' to get the URL of
> >> ulr1_at_revision1 at entry->revision? Is it needed?
>
> >Keep in mind that this warning is only intended to show up when the
> >merge target described by entry->revision is on the *same* line of
> >history as URL1_at_REVISION1 (due to merge source normalization we
> >already know that URL2_at_REVISION2 is on the same line of history as
> >URL1_at_REVISION1). So the call to svn_client__repos_locations() is
> >needed to answer the question of whether or not we are merging from a
> >target's future history. If we are not, then there shouldn't be a
> >warning...
>
> >...or are you suggesting that we should warn even when merging from an
> >unrelated source?
>
> No.
> IIUC we do merges on each location segments separately. I am having a
> tough time to visualize the case when this patch would be exercised with
> url1_at_entry->revision being different from entry->url.

url1_at_entry->revision could be from an entirely different line of
history than the WC path represented by entry and hence different from
entry->url.

For example, starting with a vanilla greek tree, make a directory
identical but unrelated to 'A':

>svn export merge_tests-87\A merge_tests-87\UNRELATED_A
Export complete.

>svn add merge_tests-87\UNRELATED_A
A merge_tests-87\UNRELATED_A
A merge_tests-87\UNRELATED_A\B
A merge_tests-87\UNRELATED_A\B\E
A merge_tests-87\UNRELATED_A\B\E\alpha
A merge_tests-87\UNRELATED_A\B\E\beta
A merge_tests-87\UNRELATED_A\B\F
A merge_tests-87\UNRELATED_A\B\lambda
A merge_tests-87\UNRELATED_A\C
A merge_tests-87\UNRELATED_A\D
A merge_tests-87\UNRELATED_A\D\G
A merge_tests-87\UNRELATED_A\D\G\pi
A merge_tests-87\UNRELATED_A\D\G\rho
A merge_tests-87\UNRELATED_A\D\G\tau
A merge_tests-87\UNRELATED_A\D\gamma
A merge_tests-87\UNRELATED_A\D\H
A merge_tests-87\UNRELATED_A\D\H\chi
A merge_tests-87\UNRELATED_A\D\H\omega
A merge_tests-87\UNRELATED_A\D\H\psi
A merge_tests-87\UNRELATED_A\mu

>svn ci -m "" merge_tests-87
Adding merge_tests-87\UNRELATED_A
Adding merge_tests-87\UNRELATED_A\B
Adding merge_tests-87\UNRELATED_A\B\E
Adding merge_tests-87\UNRELATED_A\B\E\alpha
Adding merge_tests-87\UNRELATED_A\B\E\beta
Adding merge_tests-87\UNRELATED_A\B\F
Adding merge_tests-87\UNRELATED_A\B\lambda
Adding merge_tests-87\UNRELATED_A\C
Adding merge_tests-87\UNRELATED_A\D
Adding merge_tests-87\UNRELATED_A\D\G
Adding merge_tests-87\UNRELATED_A\D\G\pi
Adding merge_tests-87\UNRELATED_A\D\G\rho
Adding merge_tests-87\UNRELATED_A\D\G\tau
Adding merge_tests-87\UNRELATED_A\D\H
Adding merge_tests-87\UNRELATED_A\D\H\chi
Adding merge_tests-87\UNRELATED_A\D\H\omega
Adding merge_tests-87\UNRELATED_A\D\H\psi
Adding merge_tests-87\UNRELATED_A\D\gamma
Adding merge_tests-87\UNRELATED_A\mu
Transmitting file data ...........
Committed revision 2.

Update everything to r2"

>svn up merge_tests-87
At revision 2.

Make a change on under 'A' om r3 and the same change under 'UNRELATED_A' in r4:

>echo new content > merge_tests-87\A\mu

>svn ci -m "" merge_tests-87
Sending merge_tests-87\A\mu
Transmitting file data .
Committed revision 3.

>echo new content > merge_tests-87\UNRELATED_A\mu

>svn ci -m "" merge_tests-87
Sending merge_tests-87\UNRELATED_A\mu
Transmitting file data .
Committed revision 4.

>svn st merge_tests-87 -v
                2 2 pburba merge_tests-87
                2 1 jrandom merge_tests-87\A
                2 1 jrandom merge_tests-87\A\B
                2 1 jrandom merge_tests-87\A\B\lambda
                2 1 jrandom merge_tests-87\A\B\E
                2 1 jrandom merge_tests-87\A\B\E\alpha
                2 1 jrandom merge_tests-87\A\B\E\beta
                2 1 jrandom merge_tests-87\A\B\F
                3 3 pburba merge_tests-87\A\mu
                2 1 jrandom merge_tests-87\A\C
                2 1 jrandom merge_tests-87\A\D
                2 1 jrandom merge_tests-87\A\D\gamma
                2 1 jrandom merge_tests-87\A\D\G
                2 1 jrandom merge_tests-87\A\D\G\pi
                2 1 jrandom merge_tests-87\A\D\G\rho
                2 1 jrandom merge_tests-87\A\D\G\tau
                2 1 jrandom merge_tests-87\A\D\H
                2 1 jrandom merge_tests-87\A\D\H\chi
                2 1 jrandom merge_tests-87\A\D\H\omega
                2 1 jrandom merge_tests-87\A\D\H\psi
                2 2 pburba merge_tests-87\UNRELATED_A
                2 2 pburba merge_tests-87\UNRELATED_A\B
                2 2 pburba merge_tests-87\UNRELATED_A\B\lambda
                2 2 pburba merge_tests-87\UNRELATED_A\B\E
                2 2 pburba merge_tests-87\UNRELATED_A\B\E\alpha
                2 2 pburba merge_tests-87\UNRELATED_A\B\E\beta
                2 2 pburba merge_tests-87\UNRELATED_A\B\F
                4 4 pburba merge_tests-87\UNRELATED_A\mu
                2 2 pburba merge_tests-87\UNRELATED_A\C
                2 2 pburba merge_tests-87\UNRELATED_A\D
                2 2 pburba merge_tests-87\UNRELATED_A\D\gamma
                2 2 pburba merge_tests-87\UNRELATED_A\D\G
                2 2 pburba merge_tests-87\UNRELATED_A\D\G\pi
                2 2 pburba merge_tests-87\UNRELATED_A\D\G\rho
                2 2 pburba merge_tests-87\UNRELATED_A\D\G\tau
                2 2 pburba merge_tests-87\UNRELATED_A\D\H
                2 2 pburba merge_tests-87\UNRELATED_A\D\H\chi
                2 2 pburba merge_tests-87\UNRELATED_A\D\H\omega
                2 2 pburba merge_tests-87\UNRELATED_A\D\H\psi
                2 1 jrandom merge_tests-87\iota

Now reverse merge r4 from 'UNRELATED_A' back to 'A':
>svn merge %url%/UNRELATED_A merge_tests-87\A -c-4

>

This is a no-op, a reverse merge, and the merge target 'A's working
revision 2 is less than or equal to REVISION2, all the criteria for
this patch to be "excercised" and svn_client__repos_locations() to be
called (if I'm understanding correctly what you mean by "excercised"):

if (((*remaining_ranges)->nelts == 0)
    && (revision2 < revision1)
    && (entry->revision <= revision2))
  {
    ...
    err = svn_client__repos_locations(&start_url, &start_revision,
                                      NULL, NULL, ra_session, url1,
                                      &pegrev, &requested,
                                      &unspec, ctx, pool);
    ...
  }

In the above example we now have a case where url1_at_entry->revision is
different from entry->url, specifically:

url1: file:///C:/SVN/src-branch/Release/subversion/tests/cmdline/svn-test-work/repositories/merge_tests-87/UNRELATED_A

entry->revision: 2

url1_at_entry->revision:
file:///C:/SVN/src-branch/Release/subversion/tests/cmdline/svn-test-work/repositories/merge_tests-87/UNRELATED_A

entry->url: file:///C:/SVN/src-branch/Release/subversion/tests/cmdline/svn-test-work/repositories/merge_tests-87/A

We don't want to give the warning "Cannot reverse merge a range from a
path's own future history; try updating first" because the range is
not from the merge target's future (or past) history and updating
still won't help here. FWIW, all that will help is using
--ignore-ancestry.

Does that answer your question?

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-02-19 22:38:28 CET

This is an archived mail posted to the Subversion Dev mailing list.