You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Noorul Islam K M <no...@collab.net> on 2011/05/30 12:16:36 UTC

Bug in exporting externals?

While working on issue 3799, in one of the review comments julianf said
the following about number 10 test in external_tests.py.

<quote>
A/B/gamma is only an external: it does not appear in the WC until
Subversion processes the external definitions.

It looks to me like that failure was showing us a bug.  If I run the
test, without your patch, in verbose mode, I see:

CMD: svn export svn-test-work/working_copies/externals_tests-10
svn-test-work/working_copies/externals_tests-10.export [...]
A    svn-test-work/working_copies/externals_tests-10.export/A
A    svn-test-work/working_copies/externals_tests-10.export/A/B
A    svn-test-work/working_copies/externals_tests-10.export/A/B/lambda
A    svn-test-work/working_copies/externals_tests-10.export/A/B/gamma
[...]
A    svn-test-work/working_copies/externals_tests-10.export/A/B/gamma
[...]
CMD: svn export --ignore-externals
svn-test-work/working_copies/externals_tests-10
svn-test-work/working_copies/externals_tests-10.export [...]
A    svn-test-work/working_copies/externals_tests-10.export/A
A    svn-test-work/working_copies/externals_tests-10.export/A/B
A    svn-test-work/working_copies/externals_tests-10.export/A/B/lambda
A    svn-test-work/working_copies/externals_tests-10.export/A/B/gamma
[...]

There is a comment in the test about --ignore-externals not ignoring
A/B/gamma.  That's a bug.  And the first export (without
--ignore-externals) is also buggy.  It shouldn't export A/B/gamma twice.

We shouldn't just quietly tweak the test to hide the bug.  We should
write a new test specifically to check for that bug, or fix the bug, or
file an issue, or write to the dev@ list about it.  Something.

- Julian
</quote>

I tried to re-create this out of test environment and I came up with a
reproduction script which is attached.

Here I have a repository with the following files 

A/B/lambda
A/D/gamma

Along with this I have an external set on A/B as 

"^/A/D/gamma gamma"

Now while exporting the working copy. A/B/gamma is exported twice which
looks like a bug and while exporting the WC with --ignore-externals
A/B/gamma is exported once which also seems to be a bug since A/B/gamma
is an external.

I can go ahead and create an issue for this if people can confirm this. 

Thanks and Regards
Noorul


Re: Bug in exporting externals?

Posted by Noorul Islam K M <no...@collab.net>.
"Bert Huijben" <be...@qqmail.nl> writes:

>> -----Original Message-----
>> From: Noorul Islam K M [mailto:noorul@collab.net]
>> Sent: maandag 30 mei 2011 12:17
>> To: Subversion
>> Subject: Bug in exporting externals?
>> 
>> 
>> While working on issue 3799, in one of the review comments julianf said
>> the following about number 10 test in external_tests.py.
>> 
>> <quote>
>> A/B/gamma is only an external: it does not appear in the WC until
>> Subversion processes the external definitions.
>> 
>> It looks to me like that failure was showing us a bug.  If I run the
>> test, without your patch, in verbose mode, I see:
>> 
>> CMD: svn export svn-test-work/working_copies/externals_tests-10
>> svn-test-work/working_copies/externals_tests-10.export [...]
>> A    svn-test-work/working_copies/externals_tests-10.export/A
>> A    svn-test-work/working_copies/externals_tests-10.export/A/B
>> A    svn-test-work/working_copies/externals_tests-10.export/A/B/lambda
>> A    svn-test-work/working_copies/externals_tests-10.export/A/B/gamma
>> [...]
>> A    svn-test-work/working_copies/externals_tests-10.export/A/B/gamma
>> [...]
>> CMD: svn export --ignore-externals
>> svn-test-work/working_copies/externals_tests-10
>> svn-test-work/working_copies/externals_tests-10.export [...]
>> A    svn-test-work/working_copies/externals_tests-10.export/A
>> A    svn-test-work/working_copies/externals_tests-10.export/A/B
>> A    svn-test-work/working_copies/externals_tests-10.export/A/B/lambda
>> A    svn-test-work/working_copies/externals_tests-10.export/A/B/gamma
>> [...]
>> 
>> There is a comment in the test about --ignore-externals not ignoring
>> A/B/gamma.  That's a bug.  And the first export (without
>> --ignore-externals) is also buggy.  It shouldn't export A/B/gamma twice.
>> 
>> We shouldn't just quietly tweak the test to hide the bug.  We should
>> write a new test specifically to check for that bug, or fix the bug, or
>> file an issue, or write to the dev@ list about it.  Something.
>> 
>> - Julian
>> </quote>
>> 
>> I tried to re-create this out of test environment and I came up with a
>> reproduction script which is attached.
>> 
>> Here I have a repository with the following files
>> 
>> A/B/lambda
>> A/D/gamma
>> 
>> Along with this I have an external set on A/B as
>> 
>> "^/A/D/gamma gamma"
>> 
>> Now while exporting the working copy. A/B/gamma is exported twice which
>> looks like a bug and while exporting the WC with --ignore-externals
>> A/B/gamma is exported once which also seems to be a bug since A/B/gamma
>> is an external.
>> 
>> I can go ahead and create an issue for this if people can confirm this.
>
> A/B/gamma is a file external. And as such it is also threated as part of the
> working copy itself.
>
> We export it again as an external later, but the original problem is that it
> is just a versioned file in a versioned directory.
>

Is this the expected behaviour? 

Thanks and Regards
Noorul

RE: Bug in exporting externals?

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Noorul Islam K M [mailto:noorul@collab.net]
> Sent: maandag 30 mei 2011 12:17
> To: Subversion
> Subject: Bug in exporting externals?
> 
> 
> While working on issue 3799, in one of the review comments julianf said
> the following about number 10 test in external_tests.py.
> 
> <quote>
> A/B/gamma is only an external: it does not appear in the WC until
> Subversion processes the external definitions.
> 
> It looks to me like that failure was showing us a bug.  If I run the
> test, without your patch, in verbose mode, I see:
> 
> CMD: svn export svn-test-work/working_copies/externals_tests-10
> svn-test-work/working_copies/externals_tests-10.export [...]
> A    svn-test-work/working_copies/externals_tests-10.export/A
> A    svn-test-work/working_copies/externals_tests-10.export/A/B
> A    svn-test-work/working_copies/externals_tests-10.export/A/B/lambda
> A    svn-test-work/working_copies/externals_tests-10.export/A/B/gamma
> [...]
> A    svn-test-work/working_copies/externals_tests-10.export/A/B/gamma
> [...]
> CMD: svn export --ignore-externals
> svn-test-work/working_copies/externals_tests-10
> svn-test-work/working_copies/externals_tests-10.export [...]
> A    svn-test-work/working_copies/externals_tests-10.export/A
> A    svn-test-work/working_copies/externals_tests-10.export/A/B
> A    svn-test-work/working_copies/externals_tests-10.export/A/B/lambda
> A    svn-test-work/working_copies/externals_tests-10.export/A/B/gamma
> [...]
> 
> There is a comment in the test about --ignore-externals not ignoring
> A/B/gamma.  That's a bug.  And the first export (without
> --ignore-externals) is also buggy.  It shouldn't export A/B/gamma twice.
> 
> We shouldn't just quietly tweak the test to hide the bug.  We should
> write a new test specifically to check for that bug, or fix the bug, or
> file an issue, or write to the dev@ list about it.  Something.
> 
> - Julian
> </quote>
> 
> I tried to re-create this out of test environment and I came up with a
> reproduction script which is attached.
> 
> Here I have a repository with the following files
> 
> A/B/lambda
> A/D/gamma
> 
> Along with this I have an external set on A/B as
> 
> "^/A/D/gamma gamma"
> 
> Now while exporting the working copy. A/B/gamma is exported twice which
> looks like a bug and while exporting the WC with --ignore-externals
> A/B/gamma is exported once which also seems to be a bug since A/B/gamma
> is an external.
> 
> I can go ahead and create an issue for this if people can confirm this.

A/B/gamma is a file external. And as such it is also threated as part of the
working copy itself.

We export it again as an external later, but the original problem is that it
is just a versioned file in a versioned directory.

	Bert



Re: [PATCH] Re: Bug in exporting externals?

Posted by Stefan Sperling <st...@elego.de>.
On Wed, Jun 01, 2011 at 02:56:04PM +0530, Noorul Islam K M wrote:
> [[[
> 
> Fix a bug in 'svn export' because of which externals are exported twice
> when exporting a working copy having externals.
> 
> * subversion/libsvn_client/export.c
>   (copy_versioned_files): Do not copy an external file here. This is
>     done down the line in the function.
> 
> * subversion/tests/cmdline/externals_tests.py
>   (export_wc_with_externals): Remove XFail marker.
> 
> Patch by: Noorul Islam K M <noorul{_AT_}collab.net>
> ]]]
> 
> Thanks and Regards
> Noorul
> 

Thank you! Committed in r1132678.

[PATCH] Re: Bug in exporting externals?

Posted by Noorul Islam K M <no...@collab.net>.
Noorul Islam K M <no...@collab.net> writes:

> Noorul Islam K M <no...@collab.net> writes:
>
>> Noorul Islam K M <no...@collab.net> writes:
>>
>>> While working on issue 3799, in one of the review comments julianf said
>>> the following about number 10 test in external_tests.py.
>>>
>>> <quote>
>>> A/B/gamma is only an external: it does not appear in the WC until
>>> Subversion processes the external definitions.
>>>
>>> It looks to me like that failure was showing us a bug.  If I run the
>>> test, without your patch, in verbose mode, I see:
>>>
>>> CMD: svn export svn-test-work/working_copies/externals_tests-10
>>> svn-test-work/working_copies/externals_tests-10.export [...]
>>> A    svn-test-work/working_copies/externals_tests-10.export/A
>>> A    svn-test-work/working_copies/externals_tests-10.export/A/B
>>> A    svn-test-work/working_copies/externals_tests-10.export/A/B/lambda
>>> A    svn-test-work/working_copies/externals_tests-10.export/A/B/gamma
>>> [...]
>>> A    svn-test-work/working_copies/externals_tests-10.export/A/B/gamma
>>> [...]
>>> CMD: svn export --ignore-externals
>>> svn-test-work/working_copies/externals_tests-10
>>> svn-test-work/working_copies/externals_tests-10.export [...]
>>> A    svn-test-work/working_copies/externals_tests-10.export/A
>>> A    svn-test-work/working_copies/externals_tests-10.export/A/B
>>> A    svn-test-work/working_copies/externals_tests-10.export/A/B/lambda
>>> A    svn-test-work/working_copies/externals_tests-10.export/A/B/gamma
>>> [...]
>>>
>>> There is a comment in the test about --ignore-externals not ignoring
>>> A/B/gamma.  That's a bug.  And the first export (without
>>> --ignore-externals) is also buggy.  It shouldn't export A/B/gamma twice.
>>>
>>> We shouldn't just quietly tweak the test to hide the bug.  We should
>>> write a new test specifically to check for that bug, or fix the bug, or
>>> file an issue, or write to the dev@ list about it.  Something.
>>>
>>> - Julian
>>> </quote>
>>>
>>> I tried to re-create this out of test environment and I came up with a
>>> reproduction script which is attached.
>>>
>>> Here I have a repository with the following files 
>>>
>>> A/B/lambda
>>> A/D/gamma
>>>
>>> Along with this I have an external set on A/B as 
>>>
>>> "^/A/D/gamma gamma"
>>>
>>> Now while exporting the working copy. A/B/gamma is exported twice which
>>> looks like a bug and while exporting the WC with --ignore-externals
>>> A/B/gamma is exported once which also seems to be a bug since A/B/gamma
>>> is an external.
>>>
>>> I can go ahead and create an issue for this if people can confirm this. 
>>>
>>
>> Somehow I missed the attachment. Here is it.
>>
>> Thanks and Regards
>> Noorul
>>
>
> Really sorry about the previous mail in which I attached the script
> inline and also script had some issues. Please find attached the correct
> one.
>

Attached is the patch which fixes this issue.

Log

[[[

Fix a bug in 'svn export' because of which externals are exported twice
when exporting a working copy having externals.

* subversion/libsvn_client/export.c
  (copy_versioned_files): Do not copy an external file here. This is
    done down the line in the function.

* subversion/tests/cmdline/externals_tests.py
  (export_wc_with_externals): Remove XFail marker.

Patch by: Noorul Islam K M <noorul{_AT_}collab.net>
]]]

Thanks and Regards
Noorul


Re: Bug in exporting externals?

Posted by Noorul Islam K M <no...@collab.net>.
Noorul Islam K M <no...@collab.net> writes:

> Noorul Islam K M <no...@collab.net> writes:
>
>> While working on issue 3799, in one of the review comments julianf said
>> the following about number 10 test in external_tests.py.
>>
>> <quote>
>> A/B/gamma is only an external: it does not appear in the WC until
>> Subversion processes the external definitions.
>>
>> It looks to me like that failure was showing us a bug.  If I run the
>> test, without your patch, in verbose mode, I see:
>>
>> CMD: svn export svn-test-work/working_copies/externals_tests-10
>> svn-test-work/working_copies/externals_tests-10.export [...]
>> A    svn-test-work/working_copies/externals_tests-10.export/A
>> A    svn-test-work/working_copies/externals_tests-10.export/A/B
>> A    svn-test-work/working_copies/externals_tests-10.export/A/B/lambda
>> A    svn-test-work/working_copies/externals_tests-10.export/A/B/gamma
>> [...]
>> A    svn-test-work/working_copies/externals_tests-10.export/A/B/gamma
>> [...]
>> CMD: svn export --ignore-externals
>> svn-test-work/working_copies/externals_tests-10
>> svn-test-work/working_copies/externals_tests-10.export [...]
>> A    svn-test-work/working_copies/externals_tests-10.export/A
>> A    svn-test-work/working_copies/externals_tests-10.export/A/B
>> A    svn-test-work/working_copies/externals_tests-10.export/A/B/lambda
>> A    svn-test-work/working_copies/externals_tests-10.export/A/B/gamma
>> [...]
>>
>> There is a comment in the test about --ignore-externals not ignoring
>> A/B/gamma.  That's a bug.  And the first export (without
>> --ignore-externals) is also buggy.  It shouldn't export A/B/gamma twice.
>>
>> We shouldn't just quietly tweak the test to hide the bug.  We should
>> write a new test specifically to check for that bug, or fix the bug, or
>> file an issue, or write to the dev@ list about it.  Something.
>>
>> - Julian
>> </quote>
>>
>> I tried to re-create this out of test environment and I came up with a
>> reproduction script which is attached.
>>
>> Here I have a repository with the following files 
>>
>> A/B/lambda
>> A/D/gamma
>>
>> Along with this I have an external set on A/B as 
>>
>> "^/A/D/gamma gamma"
>>
>> Now while exporting the working copy. A/B/gamma is exported twice which
>> looks like a bug and while exporting the WC with --ignore-externals
>> A/B/gamma is exported once which also seems to be a bug since A/B/gamma
>> is an external.
>>
>> I can go ahead and create an issue for this if people can confirm this. 
>>
>
> Somehow I missed the attachment. Here is it.
>
> Thanks and Regards
> Noorul
>

Really sorry about the previous mail in which I attached the script
inline and also script had some issues. Please find attached the correct
one.

Thanks and Regards
Noorul


Re: Bug in exporting externals?

Posted by Noorul Islam K M <no...@collab.net>.
Noorul Islam K M <no...@collab.net> writes:

> While working on issue 3799, in one of the review comments julianf said
> the following about number 10 test in external_tests.py.
>
> <quote>
> A/B/gamma is only an external: it does not appear in the WC until
> Subversion processes the external definitions.
>
> It looks to me like that failure was showing us a bug.  If I run the
> test, without your patch, in verbose mode, I see:
>
> CMD: svn export svn-test-work/working_copies/externals_tests-10
> svn-test-work/working_copies/externals_tests-10.export [...]
> A    svn-test-work/working_copies/externals_tests-10.export/A
> A    svn-test-work/working_copies/externals_tests-10.export/A/B
> A    svn-test-work/working_copies/externals_tests-10.export/A/B/lambda
> A    svn-test-work/working_copies/externals_tests-10.export/A/B/gamma
> [...]
> A    svn-test-work/working_copies/externals_tests-10.export/A/B/gamma
> [...]
> CMD: svn export --ignore-externals
> svn-test-work/working_copies/externals_tests-10
> svn-test-work/working_copies/externals_tests-10.export [...]
> A    svn-test-work/working_copies/externals_tests-10.export/A
> A    svn-test-work/working_copies/externals_tests-10.export/A/B
> A    svn-test-work/working_copies/externals_tests-10.export/A/B/lambda
> A    svn-test-work/working_copies/externals_tests-10.export/A/B/gamma
> [...]
>
> There is a comment in the test about --ignore-externals not ignoring
> A/B/gamma.  That's a bug.  And the first export (without
> --ignore-externals) is also buggy.  It shouldn't export A/B/gamma twice.
>
> We shouldn't just quietly tweak the test to hide the bug.  We should
> write a new test specifically to check for that bug, or fix the bug, or
> file an issue, or write to the dev@ list about it.  Something.
>
> - Julian
> </quote>
>
> I tried to re-create this out of test environment and I came up with a
> reproduction script which is attached.
>
> Here I have a repository with the following files 
>
> A/B/lambda
> A/D/gamma
>
> Along with this I have an external set on A/B as 
>
> "^/A/D/gamma gamma"
>
> Now while exporting the working copy. A/B/gamma is exported twice which
> looks like a bug and while exporting the WC with --ignore-externals
> A/B/gamma is exported once which also seems to be a bug since A/B/gamma
> is an external.
>
> I can go ahead and create an issue for this if people can confirm this. 
>

Somehow I missed the attachment. Here is it.

Thanks and Regards
Noorul