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 2010/11/11 17:04:12 UTC

Inconsistent behavior in cat command

When I was trying to come up with a patch for issue 3713, I observed the
following.

For example I have two files 1.txt and 2.txt in a repository located at
file:///tmp/testrepo

svn cat behaves differently for local paths and URLs. See the
illustration below.

noorul@noorul:/tmp/wc/testrepo$ svn cat 1.txt 2.txt
1
2

A) Local non-existent target followed by existing target

noorul@noorul:/tmp/wc/testrepo$ svn cat 3.txt 1.txt
svn: warning: '/tmp/wc/testrepo/3.txt' is not under version control
1

B) Non-existent URL followed by existing URL

noorul@noorul:/tmp/wc/testrepo$ svn cat ^/3.txt ^/1.txt

svn: File not found: revision 1, path '/3.txt'


In case A, even though the first target was non-existent it performs cat
operation on the second target but in the case of B, svn errors out at
the first failure itself.

I am not sure about behavior of other svn commands which accepts
multiple targets. When I discussed this Julian in IRC, he said a
discussion is needed to come up with standardized behavior across svn
commands. Any thoughts?

Thanks and Regards
Noorul

Re: [PATCH] Inconsistent behavior in cat command

Posted by Noorul Islam K M <no...@collab.net>.
Gavin Beau Baumanis <ga...@thespidernet.com> writes:

> Ping. This submission has received no new comments.
>

I will be re-submitting this patch once the discussion going on in the
following thread concludes.

http://svn.haxx.se/dev/archive-2011-01/0210.shtml

I think you can remove this patch from your watch list because this will
be combined with some more changes to cat command.

Thanks and Regards
Noorul

>
> On 06/01/2011, at 1:17 AM, Noorul Islam K M wrote:
>
>> Noorul Islam K M <no...@collab.net> writes:
>> 
>>> Julian Foad <ju...@wandisco.com> writes:
>>> 
>>>> On Thu, 2010-12-02, Noorul Islam K M wrote:
>>>> 
>>>>> Noorul Islam K M <no...@collab.net> writes:
>>>>> 
>>>>>> When I was trying to come up with a patch for issue 3713, I observed the
>>>>>> following.
>>>>>> 
>>>>>> For example I have two files 1.txt and 2.txt in a repository located at
>>>>>> file:///tmp/testrepo
>>>>>> 
>>>>>> svn cat behaves differently for local paths and URLs. See the
>>>>>> illustration below.
>>>>>> 
>>>>>> noorul@noorul:/tmp/wc/testrepo$ svn cat 1.txt 2.txt
>>>>>> 1
>>>>>> 2
>>>>>> 
>>>>>> A) Local non-existent target followed by existing target
>>>>>> 
>>>>>> noorul@noorul:/tmp/wc/testrepo$ svn cat 3.txt 1.txt
>>>>>> svn: warning: '/tmp/wc/testrepo/3.txt' is not under version control
>>>>>> 1
>>>>>> 
>>>>>> B) Non-existent URL followed by existing URL
>>>>>> 
>>>>>> noorul@noorul:/tmp/wc/testrepo$ svn cat ^/3.txt ^/1.txt
>>>>>> 
>>>>>> svn: File not found: revision 1, path '/3.txt'
>>>>>> 
>>>>>> 
>>>>>> In case A, even though the first target was non-existent it performs cat
>>>>>> operation on the second target but in the case of B, svn errors out at
>>>>>> the first failure itself.
>>>>>> 
>>>>>> I am not sure about behavior of other svn commands which accepts
>>>>>> multiple targets. When I discussed this Julian in IRC, he said a
>>>>>> discussion is needed to come up with standardized behavior across svn
>>>>>> commands. Any thoughts?
>>>>>> 
>>>>> 
>>>>> Any updates?
>>>> 
>>>> Hi Noorul.
>>>> 
>>>> A good way to start a discussion of this sort is to:
>>>> 
>>>>  list the possible solutions;
>>>>  find out and describe how the other subcommands behave;
>>> 
>>> I checked 'svn info' and it behaves the same way for both wc and URL.
>>> 
>>>>  say what you think is good and bad about each possible solution;
>>>>  say which solution you think we should choose.
>>>> 
>>>> That will make it much easier for readers to respond.
>>> 
>>> I figured out that for non-existent URL path, svn_client_cat2 returns
>>> SVN_ERR_FS_NOT_FOUND which needs to be caught by svn_cl__try. Therefore
>>> I passed this code as one the arguments.
>>> 
>>> Attached is the patch. All tests pass with this patch.
>>> 
>>> Log
>>> 
>>> [[[
>>> Make 'svn cat' not to error out when one of the URL targets do not
>>> exist.
>>> 
>>> * subversion/svn/cat-cmd.c
>>>  (svn_cl__cat): Pass SVN_ERR_FS_NOT_FOUND to svn_cl__try in order to
>>>  catch the error, print warning and proceed with other targets.
>>> 
>>> Patch by: Noorul Islam K M <noorul{_AT_}collab.net>
>>> ]]]
>>> 
>>> Thanks and Regards
>>> Noorul
>>> 
>>> Index: subversion/svn/cat-cmd.c
>>> ===================================================================
>>> --- subversion/svn/cat-cmd.c	(revision 1053010)
>>> +++ subversion/svn/cat-cmd.c	(working copy)
>>> @@ -78,6 +78,7 @@
>>>                            SVN_ERR_UNVERSIONED_RESOURCE,
>>>                            SVN_ERR_ENTRY_NOT_FOUND,
>>>                            SVN_ERR_CLIENT_IS_DIRECTORY,
>>> +                           SVN_ERR_FS_NOT_FOUND,
>>>                            SVN_NO_ERROR));
>>>     }
>>>   svn_pool_destroy(subpool);
>> 
>> Initially this thread was monitored by Julian and now I found out that
>> he is busy. It will be great if someone else can take a look at this
>> one.
>> 
>> Thanks and Regards
>> Noorul

Re: [PATCH] Inconsistent behavior in cat command

Posted by Gavin Beau Baumanis <ga...@thespidernet.com>.
Ping. This submission has received no new comments.


On 06/01/2011, at 1:17 AM, Noorul Islam K M wrote:

> Noorul Islam K M <no...@collab.net> writes:
> 
>> Julian Foad <ju...@wandisco.com> writes:
>> 
>>> On Thu, 2010-12-02, Noorul Islam K M wrote:
>>> 
>>>> Noorul Islam K M <no...@collab.net> writes:
>>>> 
>>>>> When I was trying to come up with a patch for issue 3713, I observed the
>>>>> following.
>>>>> 
>>>>> For example I have two files 1.txt and 2.txt in a repository located at
>>>>> file:///tmp/testrepo
>>>>> 
>>>>> svn cat behaves differently for local paths and URLs. See the
>>>>> illustration below.
>>>>> 
>>>>> noorul@noorul:/tmp/wc/testrepo$ svn cat 1.txt 2.txt
>>>>> 1
>>>>> 2
>>>>> 
>>>>> A) Local non-existent target followed by existing target
>>>>> 
>>>>> noorul@noorul:/tmp/wc/testrepo$ svn cat 3.txt 1.txt
>>>>> svn: warning: '/tmp/wc/testrepo/3.txt' is not under version control
>>>>> 1
>>>>> 
>>>>> B) Non-existent URL followed by existing URL
>>>>> 
>>>>> noorul@noorul:/tmp/wc/testrepo$ svn cat ^/3.txt ^/1.txt
>>>>> 
>>>>> svn: File not found: revision 1, path '/3.txt'
>>>>> 
>>>>> 
>>>>> In case A, even though the first target was non-existent it performs cat
>>>>> operation on the second target but in the case of B, svn errors out at
>>>>> the first failure itself.
>>>>> 
>>>>> I am not sure about behavior of other svn commands which accepts
>>>>> multiple targets. When I discussed this Julian in IRC, he said a
>>>>> discussion is needed to come up with standardized behavior across svn
>>>>> commands. Any thoughts?
>>>>> 
>>>> 
>>>> Any updates?
>>> 
>>> Hi Noorul.
>>> 
>>> A good way to start a discussion of this sort is to:
>>> 
>>>  list the possible solutions;
>>>  find out and describe how the other subcommands behave;
>> 
>> I checked 'svn info' and it behaves the same way for both wc and URL.
>> 
>>>  say what you think is good and bad about each possible solution;
>>>  say which solution you think we should choose.
>>> 
>>> That will make it much easier for readers to respond.
>> 
>> I figured out that for non-existent URL path, svn_client_cat2 returns
>> SVN_ERR_FS_NOT_FOUND which needs to be caught by svn_cl__try. Therefore
>> I passed this code as one the arguments.
>> 
>> Attached is the patch. All tests pass with this patch.
>> 
>> Log
>> 
>> [[[
>> Make 'svn cat' not to error out when one of the URL targets do not
>> exist.
>> 
>> * subversion/svn/cat-cmd.c
>>  (svn_cl__cat): Pass SVN_ERR_FS_NOT_FOUND to svn_cl__try in order to
>>  catch the error, print warning and proceed with other targets.
>> 
>> Patch by: Noorul Islam K M <noorul{_AT_}collab.net>
>> ]]]
>> 
>> Thanks and Regards
>> Noorul
>> 
>> Index: subversion/svn/cat-cmd.c
>> ===================================================================
>> --- subversion/svn/cat-cmd.c	(revision 1053010)
>> +++ subversion/svn/cat-cmd.c	(working copy)
>> @@ -78,6 +78,7 @@
>>                            SVN_ERR_UNVERSIONED_RESOURCE,
>>                            SVN_ERR_ENTRY_NOT_FOUND,
>>                            SVN_ERR_CLIENT_IS_DIRECTORY,
>> +                           SVN_ERR_FS_NOT_FOUND,
>>                            SVN_NO_ERROR));
>>     }
>>   svn_pool_destroy(subpool);
> 
> Initially this thread was monitored by Julian and now I found out that
> he is busy. It will be great if someone else can take a look at this
> one.
> 
> Thanks and Regards
> Noorul

Re: [PATCH] Inconsistent behavior in cat command

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

> Julian Foad <ju...@wandisco.com> writes:
>
>> On Thu, 2010-12-02, Noorul Islam K M wrote:
>>
>>> Noorul Islam K M <no...@collab.net> writes:
>>> 
>>> > When I was trying to come up with a patch for issue 3713, I observed the
>>> > following.
>>> >
>>> > For example I have two files 1.txt and 2.txt in a repository located at
>>> > file:///tmp/testrepo
>>> >
>>> > svn cat behaves differently for local paths and URLs. See the
>>> > illustration below.
>>> >
>>> > noorul@noorul:/tmp/wc/testrepo$ svn cat 1.txt 2.txt
>>> > 1
>>> > 2
>>> >
>>> > A) Local non-existent target followed by existing target
>>> >
>>> > noorul@noorul:/tmp/wc/testrepo$ svn cat 3.txt 1.txt
>>> > svn: warning: '/tmp/wc/testrepo/3.txt' is not under version control
>>> > 1
>>> >
>>> > B) Non-existent URL followed by existing URL
>>> >
>>> > noorul@noorul:/tmp/wc/testrepo$ svn cat ^/3.txt ^/1.txt
>>> >
>>> > svn: File not found: revision 1, path '/3.txt'
>>> >
>>> >
>>> > In case A, even though the first target was non-existent it performs cat
>>> > operation on the second target but in the case of B, svn errors out at
>>> > the first failure itself.
>>> >
>>> > I am not sure about behavior of other svn commands which accepts
>>> > multiple targets. When I discussed this Julian in IRC, he said a
>>> > discussion is needed to come up with standardized behavior across svn
>>> > commands. Any thoughts?
>>> >
>>> 
>>> Any updates?
>>
>> Hi Noorul.
>>
>> A good way to start a discussion of this sort is to:
>>
>>   list the possible solutions;
>>   find out and describe how the other subcommands behave;
>
> I checked 'svn info' and it behaves the same way for both wc and URL.
>
>>   say what you think is good and bad about each possible solution;
>>   say which solution you think we should choose.
>>
>> That will make it much easier for readers to respond.
>
> I figured out that for non-existent URL path, svn_client_cat2 returns
> SVN_ERR_FS_NOT_FOUND which needs to be caught by svn_cl__try. Therefore
> I passed this code as one the arguments.
>
> Attached is the patch. All tests pass with this patch.
>
> Log
>
> [[[
> Make 'svn cat' not to error out when one of the URL targets do not
> exist.
>
> * subversion/svn/cat-cmd.c
>   (svn_cl__cat): Pass SVN_ERR_FS_NOT_FOUND to svn_cl__try in order to
>   catch the error, print warning and proceed with other targets.
>
> Patch by: Noorul Islam K M <noorul{_AT_}collab.net>
> ]]]
>
> Thanks and Regards
> Noorul
>
> Index: subversion/svn/cat-cmd.c
> ===================================================================
> --- subversion/svn/cat-cmd.c	(revision 1053010)
> +++ subversion/svn/cat-cmd.c	(working copy)
> @@ -78,6 +78,7 @@
>                             SVN_ERR_UNVERSIONED_RESOURCE,
>                             SVN_ERR_ENTRY_NOT_FOUND,
>                             SVN_ERR_CLIENT_IS_DIRECTORY,
> +                           SVN_ERR_FS_NOT_FOUND,
>                             SVN_NO_ERROR));
>      }
>    svn_pool_destroy(subpool);

Initially this thread was monitored by Julian and now I found out that
he is busy. It will be great if someone else can take a look at this
one.

Thanks and Regards
Noorul

[PATCH] Inconsistent behavior in cat command

Posted by Noorul Islam K M <no...@collab.net>.
Julian Foad <ju...@wandisco.com> writes:

> On Thu, 2010-12-02, Noorul Islam K M wrote:
>
>> Noorul Islam K M <no...@collab.net> writes:
>> 
>> > When I was trying to come up with a patch for issue 3713, I observed the
>> > following.
>> >
>> > For example I have two files 1.txt and 2.txt in a repository located at
>> > file:///tmp/testrepo
>> >
>> > svn cat behaves differently for local paths and URLs. See the
>> > illustration below.
>> >
>> > noorul@noorul:/tmp/wc/testrepo$ svn cat 1.txt 2.txt
>> > 1
>> > 2
>> >
>> > A) Local non-existent target followed by existing target
>> >
>> > noorul@noorul:/tmp/wc/testrepo$ svn cat 3.txt 1.txt
>> > svn: warning: '/tmp/wc/testrepo/3.txt' is not under version control
>> > 1
>> >
>> > B) Non-existent URL followed by existing URL
>> >
>> > noorul@noorul:/tmp/wc/testrepo$ svn cat ^/3.txt ^/1.txt
>> >
>> > svn: File not found: revision 1, path '/3.txt'
>> >
>> >
>> > In case A, even though the first target was non-existent it performs cat
>> > operation on the second target but in the case of B, svn errors out at
>> > the first failure itself.
>> >
>> > I am not sure about behavior of other svn commands which accepts
>> > multiple targets. When I discussed this Julian in IRC, he said a
>> > discussion is needed to come up with standardized behavior across svn
>> > commands. Any thoughts?
>> >
>> 
>> Any updates?
>
> Hi Noorul.
>
> A good way to start a discussion of this sort is to:
>
>   list the possible solutions;
>   find out and describe how the other subcommands behave;

I checked 'svn info' and it behaves the same way for both wc and URL.

>   say what you think is good and bad about each possible solution;
>   say which solution you think we should choose.
>
> That will make it much easier for readers to respond.

I figured out that for non-existent URL path, svn_client_cat2 returns
SVN_ERR_FS_NOT_FOUND which needs to be caught by svn_cl__try. Therefore
I passed this code as one the arguments.

Attached is the patch. All tests pass with this patch.

Log

[[[
Make 'svn cat' not to error out when one of the URL targets do not
exist.

* subversion/svn/cat-cmd.c
  (svn_cl__cat): Pass SVN_ERR_FS_NOT_FOUND to svn_cl__try in order to
  catch the error, print warning and proceed with other targets.

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

Thanks and Regards
Noorul


Re: Inconsistent behavior in cat command

Posted by Julian Foad <ju...@wandisco.com>.
On Thu, 2010-12-02, Noorul Islam K M wrote:
> Noorul Islam K M <no...@collab.net> writes:
> 
> > When I was trying to come up with a patch for issue 3713, I observed the
> > following.
> >
> > For example I have two files 1.txt and 2.txt in a repository located at
> > file:///tmp/testrepo
> >
> > svn cat behaves differently for local paths and URLs. See the
> > illustration below.
> >
> > noorul@noorul:/tmp/wc/testrepo$ svn cat 1.txt 2.txt
> > 1
> > 2
> >
> > A) Local non-existent target followed by existing target
> >
> > noorul@noorul:/tmp/wc/testrepo$ svn cat 3.txt 1.txt
> > svn: warning: '/tmp/wc/testrepo/3.txt' is not under version control
> > 1
> >
> > B) Non-existent URL followed by existing URL
> >
> > noorul@noorul:/tmp/wc/testrepo$ svn cat ^/3.txt ^/1.txt
> >
> > svn: File not found: revision 1, path '/3.txt'
> >
> >
> > In case A, even though the first target was non-existent it performs cat
> > operation on the second target but in the case of B, svn errors out at
> > the first failure itself.
> >
> > I am not sure about behavior of other svn commands which accepts
> > multiple targets. When I discussed this Julian in IRC, he said a
> > discussion is needed to come up with standardized behavior across svn
> > commands. Any thoughts?
> >
> 
> Any updates?

Hi Noorul.

A good way to start a discussion of this sort is to:

  list the possible solutions;
  find out and describe how the other subcommands behave;
  say what you think is good and bad about each possible solution;
  say which solution you think we should choose.

That will make it much easier for readers to respond.

- Julian


Re: Inconsistent behavior in cat command

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

> When I was trying to come up with a patch for issue 3713, I observed the
> following.
>
> For example I have two files 1.txt and 2.txt in a repository located at
> file:///tmp/testrepo
>
> svn cat behaves differently for local paths and URLs. See the
> illustration below.
>
> noorul@noorul:/tmp/wc/testrepo$ svn cat 1.txt 2.txt
> 1
> 2
>
> A) Local non-existent target followed by existing target
>
> noorul@noorul:/tmp/wc/testrepo$ svn cat 3.txt 1.txt
> svn: warning: '/tmp/wc/testrepo/3.txt' is not under version control
> 1
>
> B) Non-existent URL followed by existing URL
>
> noorul@noorul:/tmp/wc/testrepo$ svn cat ^/3.txt ^/1.txt
>
> svn: File not found: revision 1, path '/3.txt'
>
>
> In case A, even though the first target was non-existent it performs cat
> operation on the second target but in the case of B, svn errors out at
> the first failure itself.
>
> I am not sure about behavior of other svn commands which accepts
> multiple targets. When I discussed this Julian in IRC, he said a
> discussion is needed to come up with standardized behavior across svn
> commands. Any thoughts?
>

Any updates?

Thanks and Regard
Noorul