You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Becroft <dj...@gmail.com> on 2011/04/22 23:15:59 UTC

'svn switch' now requires --ignore-ancestry?

Hi,

I've just updated to trunk@1096029, and have noticed the following change in
behavior.

Previously, any reproduction script I write has the following pattern:

svn checkout <url> workingcopy
> pushd workingcopy
> svn mkdir trunk
> svn commit
> svn switch <url>/trunk .
>

This used to work fine. But now I'm getting the following error messages:

subversion/svn/switch-cmd.c:184: (apr_err=195012)
> svn: E195012: Path '.' does not share common version control ancestry with
> the requested switch location.  Use --ignore-ancestry to disable this check.
> subversion/libsvn_client/switch.c:201: (apr_err=195012)
> svn: E195012: 'file:///home/djcbecroft/dev/sandpit/repository/trunk' shares
> no common ancestry with '/home/djcbecroft/dev/sandpit/workingcopy'
>

As the error message suggests, using --ignore-ancestry works fine. I don't
think this is required, though, as the paths share a common ancestry
already.

Cheers,
---
Daniel Becroft

Re: 'svn switch' now requires --ignore-ancestry?

Posted by Daniel Becroft <dj...@gmail.com>.
On Sat, Apr 23, 2011 at 2:13 PM, C. Michael Pilato <cm...@collab.net>wrote:

> On 04/22/2011 11:40 PM, Daniel Becroft wrote:
> >     But then you're
> >     asking to switch a working copy which reflects trunk's *parent
> directory* to
> >     trunk's URL.
> >
> >
> > Once trunk is committed, shouldn't trunk share ancestry with it's parent?
> (I
> > know I certainly share ancestry with my father).
>
> Wrong "ancestry" concept.  This is version control ancestry, not directory
> hierarchy.  Trunk has a unique "line of history".  Later, if you make a
> copy
> of trunk and call it, say, "branches/my-branch", that is a fork in trunk's
> line of history.  It may be said of "branches/my-branch" that it shares
> version control ancestry with "trunk".
>

Ah, gotcha. My bad.


>  > This process worked under 1.6.x (and 1.7.x prior to the last svn update
> -
> > couldn't tell you the revision prior to that).
>
> Yes, your very simplistic use-case would have "worked" in every release
> back
> to 1.0, even.  But as we continue to bring Subversion into maturity, we're
> trying to shut down default behaviors that have a history of causing people
> alot of grief.  This is one such area.  I can't tell you how many times
> I've
> seen someone (including myself) do:
>
>   $ cd /path/to/trunk-working-copy
>   $ svn switch ^/branches
>
> when what was *intended* was:
>
>   $ cd /path/to/trunk-working-copy
>   $ svn switch ^/branches/SOME-SPECIFIC-BRANCH
>

The result is disastrous, as Subversion tries to transform a trunk working
> copy to reflect the branches directory -- deleting all of trunk's content,
> and then trying to add every branch in the whole project to that working
> copy.
>


> 'svn switch' was conceived to be Subversion's answer to 'cvs up
> -rBRANCH_NAME' -- Subversion's way to switch between branches -- not just
> some generic point-the-working-copy-wherever-you'd-like mechanism.  We now
> have the power to enforce that in ways that were impractical years ago, so
> recently (after another fat-fingered-then-interrupted 'svn switch' left me
> with a corrupt working copy) I added that enforcement, but, as you noted,
> with the ability to disable that safety mechanism via the --ignore-ancestry
> switch.
>

I guess I can understand the reason behind the change. It was just a tad
weird seeing it pop up for a case that has always worked.

Apologies for the noise.

Cheers,
Daniel B.

Re: 'svn switch' now requires --ignore-ancestry?

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 04/22/2011 11:40 PM, Daniel Becroft wrote:
>     But then you're
>     asking to switch a working copy which reflects trunk's *parent directory* to
>     trunk's URL.
> 
> 
> Once trunk is committed, shouldn't trunk share ancestry with it's parent? (I
> know I certainly share ancestry with my father).

Wrong "ancestry" concept.  This is version control ancestry, not directory
hierarchy.  Trunk has a unique "line of history".  Later, if you make a copy
of trunk and call it, say, "branches/my-branch", that is a fork in trunk's
line of history.  It may be said of "branches/my-branch" that it shares
version control ancestry with "trunk".

> This process worked under 1.6.x (and 1.7.x prior to the last svn update -
> couldn't tell you the revision prior to that).

Yes, your very simplistic use-case would have "worked" in every release back
to 1.0, even.  But as we continue to bring Subversion into maturity, we're
trying to shut down default behaviors that have a history of causing people
alot of grief.  This is one such area.  I can't tell you how many times I've
seen someone (including myself) do:

   $ cd /path/to/trunk-working-copy
   $ svn switch ^/branches

when what was *intended* was:

   $ cd /path/to/trunk-working-copy
   $ svn switch ^/branches/SOME-SPECIFIC-BRANCH

The result is disastrous, as Subversion tries to transform a trunk working
copy to reflect the branches directory -- deleting all of trunk's content,
and then trying to add every branch in the whole project to that working copy.

'svn switch' was conceived to be Subversion's answer to 'cvs up
-rBRANCH_NAME' -- Subversion's way to switch between branches -- not just
some generic point-the-working-copy-wherever-you'd-like mechanism.  We now
have the power to enforce that in ways that were impractical years ago, so
recently (after another fat-fingered-then-interrupted 'svn switch' left me
with a corrupt working copy) I added that enforcement, but, as you noted,
with the ability to disable that safety mechanism via the --ignore-ancestry
switch.

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


Re: 'svn switch' now requires --ignore-ancestry?

Posted by Daniel Becroft <dj...@gmail.com>.
On Sat, Apr 23, 2011 at 1:02 PM, C. Michael Pilato <cm...@collab.net>wrote:

> On 04/22/2011 05:15 PM, Daniel Becroft wrote:
> > Hi,
> >
> > I've just updated to trunk@1096029, and have noticed the following
> change in
> > behavior.
> >
> > Previously, any reproduction script I write has the following pattern:
> >
> > svn checkout <url> workingcopy
> >> pushd workingcopy
> >> svn mkdir trunk
> >> svn commit
> >> svn switch <url>/trunk .
> >>
> >
> > This used to work fine. But now I'm getting the following error messages:
> >
> > subversion/svn/switch-cmd.c:184: (apr_err=195012)
> >> svn: E195012: Path '.' does not share common version control ancestry
> with
> >> the requested switch location.  Use --ignore-ancestry to disable this
> check.
> >> subversion/libsvn_client/switch.c:201: (apr_err=195012)
> >> svn: E195012: 'file:///home/djcbecroft/dev/sandpit/repository/trunk'
> shares
> >> no common ancestry with '/home/djcbecroft/dev/sandpit/workingcopy'
> >>
> >
> > As the error message suggests, using --ignore-ancestry works fine. I
> don't
> > think this is required, though, as the paths share a common ancestry
> > already.
>
> Ummm... not if I'm following your recipe correctly.  You just created trunk
> as a new directory -- it shares ancestry with *nothing*.


Created trunk *and* committed it (sorry if that wasn't clear from the
example).


> But then you're
> asking to switch a working copy which reflects trunk's *parent directory*
> to
> trunk's URL.
>

Once trunk is committed, shouldn't trunk share ancestry with it's parent? (I
know I certainly share ancestry with my father).

This process worked under 1.6.x (and 1.7.x prior to the last svn update -
couldn't tell you the revision prior to that).

$ svn switch file:////home/djcbecroft/dev/sandpit/repository//trunk .
> D    trunk
> Updated to revision 1.
>

Cheers,
Daniel B.

Re: 'svn switch' now requires --ignore-ancestry?

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 04/22/2011 05:15 PM, Daniel Becroft wrote:
> Hi,
> 
> I've just updated to trunk@1096029, and have noticed the following change in
> behavior.
> 
> Previously, any reproduction script I write has the following pattern:
> 
> svn checkout <url> workingcopy
>> pushd workingcopy
>> svn mkdir trunk
>> svn commit
>> svn switch <url>/trunk .
>>
> 
> This used to work fine. But now I'm getting the following error messages:
> 
> subversion/svn/switch-cmd.c:184: (apr_err=195012)
>> svn: E195012: Path '.' does not share common version control ancestry with
>> the requested switch location.  Use --ignore-ancestry to disable this check.
>> subversion/libsvn_client/switch.c:201: (apr_err=195012)
>> svn: E195012: 'file:///home/djcbecroft/dev/sandpit/repository/trunk' shares
>> no common ancestry with '/home/djcbecroft/dev/sandpit/workingcopy'
>>
> 
> As the error message suggests, using --ignore-ancestry works fine. I don't
> think this is required, though, as the paths share a common ancestry
> already.

Ummm... not if I'm following your recipe correctly.  You just created trunk
as a new directory -- it shares ancestry with *nothing*.  But then you're
asking to switch a working copy which reflects trunk's *parent directory* to
trunk's URL.

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


Re: mergeinfo assertion in trunk Re: 'svn switch' now requires --ignore-ancestry?

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Good morning Paul,

Paul Burba wrote on Mon, Apr 25, 2011 at 14:55:02 -0400:
> On Mon, Apr 25, 2011 at 11:56 AM, Paul Burba <pt...@gmail.com> wrote:
> > On Sat, Apr 23, 2011 at 5:21 AM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> >> On Sat, 23 Apr 2011 07:15 +1000, "Daniel Becroft" <dj...@gmail.com> wrote:
> >> [[[
> >> % rm -rf wc1 r1
> >> % $svnadmin create r1
> >> % $svn co file://$PWD/r1 wc1
> >> Checked out revision 0.
> >> % cd wc1
> >> % $svn cp . trunk
> >> svn: E200007: Cannot copy path '/tmp/svn/wc1' into its own child '/tmp/svn/wc1/trunk'
> >> % $svn cp ^/ ^/trunk -mm
> >
> > Hi Daniel,
> >
> > Should we even allow a copy of r0?  What exactly does it mean and how
> > is it useful?
> >
> > The assert you see here happens because mergeinfo has no concept of r0
> > as a valid change.  When we try this switch without using
> > --ignore-ancestry, switch.c:switch_internal() calls
> > svn_client__get_youngest_common_ancestor looking for common ancestor
> > of ^/trunk@1 and ^/@0.  svn_client__get_youngest_common_ancestor()
> > uses svn_client__get_history_as_mergeinfo() to convert ^/trunk@1 and
> > /^@0 to svn_mergeinfo_t.
> >
> > Unfortunately svn_client__get_history_as_mergeinfo() does this
> > conversion by using svn_mergeinfo__mergeinfo_from_segments() to covert
> > svn_location_segment_t's into mergeinfo.
> > svn_location_segment_t.range_start can be the same as
> > svn_location_segment_t.range_end, but when
> > svn_mergeinfo__mergeinfo_from_segments converts these to
> > svn_merge_range_t, it enforces the rule that svn_merge_range_t.start <
> > svn_merge_range_t.end (see
> > http://svn.apache.org/viewvc?view=revision&revision=924201).
> >
> > So we end up with a bogus rangelist that later trips the assert when
> > svn_client__get_youngest_common_ancestor() sends it to the
> > svn_rangelist_intersect API.
> >
> > Unsure how to address this.  We could tweak
> > svn_client__get_youngest_common_ancestor() to handle this edge case,
> > but I wonder if preventing copies of r0 in the first place is
> > something to consider too.
> 
> We allowed this in 1.6, so I made a few changes in r1096561 and
> r1906562 to continue supporting it.
> 

Thanks for the detailed explanation.

I agree that copying r0 should be allowed.

> Paul

Daniel

Re: mergeinfo assertion in trunk Re: 'svn switch' now requires --ignore-ancestry?

Posted by Paul Burba <pt...@gmail.com>.
On Mon, Apr 25, 2011 at 11:56 AM, Paul Burba <pt...@gmail.com> wrote:
> On Sat, Apr 23, 2011 at 5:21 AM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
>> On Sat, 23 Apr 2011 07:15 +1000, "Daniel Becroft" <dj...@gmail.com> wrote:
>>> Hi,
>>>
>>> I've just updated to trunk@1096029, and have noticed the following change in
>>> behavior.
>>>
>>> Previously, any reproduction script I write has the following pattern:
>>>
>>> svn checkout <url> workingcopy
>>> > pushd workingcopy
>>> > svn mkdir trunk
>>> > svn commit
>>> > svn switch <url>/trunk .
>>> >
>>>
>>> This used to work fine. But now I'm getting the following error messages:
>>>
>>> subversion/svn/switch-cmd.c:184: (apr_err=195012)
>>> > svn: E195012: Path '.' does not share common version control ancestry with
>>> > the requested switch location.  Use --ignore-ancestry to disable this check.
>>> > subversion/libsvn_client/switch.c:201: (apr_err=195012)
>>> > svn: E195012: 'file:///home/djcbecroft/dev/sandpit/repository/trunk' shares
>>> > no common ancestry with '/home/djcbecroft/dev/sandpit/workingcopy'
>>> >
>>>
>>> As the error message suggests, using --ignore-ancestry works fine. I don't
>>> think this is required, though, as the paths share a common ancestry
>>> already.
>>>
>>
>> I've not read the whole thread, but tweaking your recipe I've just run into an assertion in a case I expected to work:
>>
>> [[[
>> % rm -rf wc1 r1
>> % $svnadmin create r1
>> % $svn co file://$PWD/r1 wc1
>> Checked out revision 0.
>> % cd wc1
>> % $svn cp . trunk
>> svn: E200007: Cannot copy path '/tmp/svn/wc1' into its own child '/tmp/svn/wc1/trunk'
>> % $svn cp ^/ ^/trunk -mm
>
> Hi Daniel,
>
> Should we even allow a copy of r0?  What exactly does it mean and how
> is it useful?
>
> The assert you see here happens because mergeinfo has no concept of r0
> as a valid change.  When we try this switch without using
> --ignore-ancestry, switch.c:switch_internal() calls
> svn_client__get_youngest_common_ancestor looking for common ancestor
> of ^/trunk@1 and ^/@0.  svn_client__get_youngest_common_ancestor()
> uses svn_client__get_history_as_mergeinfo() to convert ^/trunk@1 and
> /^@0 to svn_mergeinfo_t.
>
> Unfortunately svn_client__get_history_as_mergeinfo() does this
> conversion by using svn_mergeinfo__mergeinfo_from_segments() to covert
> svn_location_segment_t's into mergeinfo.
> svn_location_segment_t.range_start can be the same as
> svn_location_segment_t.range_end, but when
> svn_mergeinfo__mergeinfo_from_segments converts these to
> svn_merge_range_t, it enforces the rule that svn_merge_range_t.start <
> svn_merge_range_t.end (see
> http://svn.apache.org/viewvc?view=revision&revision=924201).
>
> So we end up with a bogus rangelist that later trips the assert when
> svn_client__get_youngest_common_ancestor() sends it to the
> svn_rangelist_intersect API.
>
> Unsure how to address this.  We could tweak
> svn_client__get_youngest_common_ancestor() to handle this edge case,
> but I wonder if preventing copies of r0 in the first place is
> something to consider too.

We allowed this in 1.6, so I made a few changes in r1096561 and
r1906562 to continue supporting it.

Paul

Re: mergeinfo assertion in trunk Re: 'svn switch' now requires --ignore-ancestry?

Posted by Paul Burba <pt...@gmail.com>.
On Sat, Apr 23, 2011 at 5:21 AM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> On Sat, 23 Apr 2011 07:15 +1000, "Daniel Becroft" <dj...@gmail.com> wrote:
>> Hi,
>>
>> I've just updated to trunk@1096029, and have noticed the following change in
>> behavior.
>>
>> Previously, any reproduction script I write has the following pattern:
>>
>> svn checkout <url> workingcopy
>> > pushd workingcopy
>> > svn mkdir trunk
>> > svn commit
>> > svn switch <url>/trunk .
>> >
>>
>> This used to work fine. But now I'm getting the following error messages:
>>
>> subversion/svn/switch-cmd.c:184: (apr_err=195012)
>> > svn: E195012: Path '.' does not share common version control ancestry with
>> > the requested switch location.  Use --ignore-ancestry to disable this check.
>> > subversion/libsvn_client/switch.c:201: (apr_err=195012)
>> > svn: E195012: 'file:///home/djcbecroft/dev/sandpit/repository/trunk' shares
>> > no common ancestry with '/home/djcbecroft/dev/sandpit/workingcopy'
>> >
>>
>> As the error message suggests, using --ignore-ancestry works fine. I don't
>> think this is required, though, as the paths share a common ancestry
>> already.
>>
>
> I've not read the whole thread, but tweaking your recipe I've just run into an assertion in a case I expected to work:
>
> [[[
> % rm -rf wc1 r1
> % $svnadmin create r1
> % $svn co file://$PWD/r1 wc1
> Checked out revision 0.
> % cd wc1
> % $svn cp . trunk
> svn: E200007: Cannot copy path '/tmp/svn/wc1' into its own child '/tmp/svn/wc1/trunk'
> % $svn cp ^/ ^/trunk -mm

Hi Daniel,

Should we even allow a copy of r0?  What exactly does it mean and how
is it useful?

The assert you see here happens because mergeinfo has no concept of r0
as a valid change.  When we try this switch without using
--ignore-ancestry, switch.c:switch_internal() calls
svn_client__get_youngest_common_ancestor looking for common ancestor
of ^/trunk@1 and ^/@0.  svn_client__get_youngest_common_ancestor()
uses svn_client__get_history_as_mergeinfo() to convert ^/trunk@1 and
/^@0 to svn_mergeinfo_t.

Unfortunately svn_client__get_history_as_mergeinfo() does this
conversion by using svn_mergeinfo__mergeinfo_from_segments() to covert
svn_location_segment_t's into mergeinfo.
svn_location_segment_t.range_start can be the same as
svn_location_segment_t.range_end, but when
svn_mergeinfo__mergeinfo_from_segments converts these to
svn_merge_range_t, it enforces the rule that svn_merge_range_t.start <
svn_merge_range_t.end (see
http://svn.apache.org/viewvc?view=revision&revision=924201).

So we end up with a bogus rangelist that later trips the assert when
svn_client__get_youngest_common_ancestor() sends it to the
svn_rangelist_intersect API.

Unsure how to address this.  We could tweak
svn_client__get_youngest_common_ancestor() to handle this edge case,
but I wonder if preventing copies of r0 in the first place is
something to consider too.

Paul

> Committed revision 1.
> % $svn sw ^/trunk
> subversion/libsvn_subr/mergeinfo.c:800: (apr_err=235000)
> svn: E235000: In file 'subversion/libsvn_subr/mergeinfo.c' line 800: assertion failed (IS_VALID_FORWARD_RANGE(first))
> zsh: abort      $svn sw ^/trunk
> ]]]

mergeinfo assertion in trunk Re: 'svn switch' now requires --ignore-ancestry?

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
On Sat, 23 Apr 2011 07:15 +1000, "Daniel Becroft" <dj...@gmail.com> wrote:
> Hi,
> 
> I've just updated to trunk@1096029, and have noticed the following change in
> behavior.
> 
> Previously, any reproduction script I write has the following pattern:
> 
> svn checkout <url> workingcopy
> > pushd workingcopy
> > svn mkdir trunk
> > svn commit
> > svn switch <url>/trunk .
> >
> 
> This used to work fine. But now I'm getting the following error messages:
> 
> subversion/svn/switch-cmd.c:184: (apr_err=195012)
> > svn: E195012: Path '.' does not share common version control ancestry with
> > the requested switch location.  Use --ignore-ancestry to disable this check.
> > subversion/libsvn_client/switch.c:201: (apr_err=195012)
> > svn: E195012: 'file:///home/djcbecroft/dev/sandpit/repository/trunk' shares
> > no common ancestry with '/home/djcbecroft/dev/sandpit/workingcopy'
> >
> 
> As the error message suggests, using --ignore-ancestry works fine. I don't
> think this is required, though, as the paths share a common ancestry
> already.
> 

I've not read the whole thread, but tweaking your recipe I've just run into an assertion in a case I expected to work:

[[[
% rm -rf wc1 r1
% $svnadmin create r1
% $svn co file://$PWD/r1 wc1
Checked out revision 0.
% cd wc1
% $svn cp . trunk
svn: E200007: Cannot copy path '/tmp/svn/wc1' into its own child '/tmp/svn/wc1/trunk'
% $svn cp ^/ ^/trunk -mm

Committed revision 1.
% $svn sw ^/trunk
subversion/libsvn_subr/mergeinfo.c:800: (apr_err=235000)
svn: E235000: In file 'subversion/libsvn_subr/mergeinfo.c' line 800: assertion failed (IS_VALID_FORWARD_RANGE(first))
zsh: abort      $svn sw ^/trunk
]]]