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/02/14 16:42:57 UTC
[PATCH] Improve svn cat/info error messages.
Log
[[[
Improve error message displayed by info/cat for consistency.
* subversion/svn/info-cmd.c,
* subversion/svn/cat-cmd.c
(svn_cl__info, svn_cl__cat): Improve error message. Use meaningful
variable.
* subversion/tests/cmdline/cat_tests.py
(cat_skip_uncattable): Modify test
Patch by: Noorul Islam K M <noorul{_AT_}collab.net>
]]]
Thanks and Regards
Noorul
Re: [PATCH] Improve svn cat/info error messages.
Posted by Gavin Beau Baumanis <ga...@thespidernet.com>.
<snip>
>
> This is committed by stsp in r1070969.
>
> Thanks and Regards
> Noorul
Thanks Noorul,
I will remove it from my list.
Re: [PATCH] Improve svn cat/info error messages.
Posted by Noorul Islam K M <no...@collab.net>.
Gavin Beau Baumanis <ga...@thespidernet.com> writes:
> Ping. This submission has received no comments.
>
>
>
> On 15/02/2011, at 2:42 AM, Noorul Islam K M wrote:
>
>>
>> Log
>> [[[
>>
>> Improve error message displayed by info/cat for consistency.
>>
>> * subversion/svn/info-cmd.c,
>> * subversion/svn/cat-cmd.c
>> (svn_cl__info, svn_cl__cat): Improve error message. Use meaningful
>> variable.
>>
>> * subversion/tests/cmdline/cat_tests.py
>> (cat_skip_uncattable): Modify test
>>
>> Patch by: Noorul Islam K M <noorul{_AT_}collab.net>
>> ]]]
>>
>> Thanks and Regards
>> Noorul
>>
>> Index: subversion/tests/cmdline/cat_tests.py
>> ===================================================================
>> --- subversion/tests/cmdline/cat_tests.py (revision 1070514)
>> +++ subversion/tests/cmdline/cat_tests.py (working copy)
>> @@ -158,8 +158,9 @@
>> svntest.actions.run_and_verify_svn2(None, expected_out, expected_err2, 1,
>> 'cat', rho_path, new_file_path)
>>
>> - expected_err3 = expected_err1 + expected_err2 + ".*\n" + \
>> - "svn: E200000: A problem occurred; see other errors for details\n"
>> + expected_err3 = expected_err1 + expected_err2 + \
>> + ".*\nsvn: E200009: Could not cat all targets because some targets " + \
>> + "don't exist\n"
>> expected_err_re = re.compile(expected_err3)
>>
>> exit_code, output, error = svntest.main.run_svn(1, 'cat', rho_path, G_path, new_file_path)
>> Index: subversion/svn/cat-cmd.c
>> ===================================================================
>> --- subversion/svn/cat-cmd.c (revision 1070514)
>> +++ subversion/svn/cat-cmd.c (working copy)
>> @@ -32,6 +32,8 @@
>> #include "svn_error.h"
>> #include "cl.h"
>>
>> +#include "svn_private_config.h"
>> +
>>
>> /*** Code. ***/
>>
>> @@ -47,7 +49,7 @@
>> int i;
>> svn_stream_t *out;
>> apr_pool_t *subpool = svn_pool_create(pool);
>> - svn_boolean_t saw_a_problem = FALSE;
>> + svn_boolean_t seen_nonexistent_target = FALSE;
>>
>> SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
>> opt_state->targets,
>> @@ -83,12 +85,14 @@
>> SVN_ERR_FS_NOT_FOUND,
>> SVN_NO_ERROR));
>> if (! success)
>> - saw_a_problem = TRUE;
>> + seen_nonexistent_target = TRUE;
>> }
>> svn_pool_destroy(subpool);
>>
>> - if (saw_a_problem)
>> - return svn_error_create(SVN_ERR_BASE, NULL, NULL);
>> + if (seen_nonexistent_target)
>> + return svn_error_create(
>> + SVN_ERR_ILLEGAL_TARGET, NULL,
>> + _("Could not cat all targets because some targets don't exist"));
>> else
>> return SVN_NO_ERROR;
>> }
>> Index: subversion/svn/info-cmd.c
>> ===================================================================
>> --- subversion/svn/info-cmd.c (revision 1070514)
>> +++ subversion/svn/info-cmd.c (working copy)
>> @@ -494,7 +494,7 @@
>> apr_pool_t *subpool = svn_pool_create(pool);
>> int i;
>> svn_error_t *err;
>> - svn_boolean_t saw_a_problem = FALSE;
>> + svn_boolean_t seen_nonexistent_target = FALSE;
>> svn_opt_revision_t peg_revision;
>> svn_info_receiver_t receiver;
>> const char *path_prefix;
>> @@ -579,7 +579,7 @@
>>
>> svn_error_clear(err);
>> err = NULL;
>> - saw_a_problem = TRUE;
>> + seen_nonexistent_target = TRUE;
>> }
>> }
>> svn_pool_destroy(subpool);
>> @@ -587,8 +587,11 @@
>> if (opt_state->xml && (! opt_state->incremental))
>> SVN_ERR(svn_cl__xml_print_footer("info", pool));
>>
>> - if (saw_a_problem)
>> - return svn_error_create(SVN_ERR_BASE, NULL, NULL);
>> + if (seen_nonexistent_target)
>> + return svn_error_create(
>> + SVN_ERR_ILLEGAL_TARGET, NULL,
>> + _("Could not display info for all targets because some "
>> + "targets don't exist"));
>> else
>> return SVN_NO_ERROR;
>> }
This is committed by stsp in r1070969.
Thanks and Regards
Noorul
Re: [PATCH] Improve svn cat/info error messages.
Posted by Gavin Beau Baumanis <ga...@thespidernet.com>.
Ping. This submission has received no comments.
On 15/02/2011, at 2:42 AM, Noorul Islam K M wrote:
>
> Log
> [[[
>
> Improve error message displayed by info/cat for consistency.
>
> * subversion/svn/info-cmd.c,
> * subversion/svn/cat-cmd.c
> (svn_cl__info, svn_cl__cat): Improve error message. Use meaningful
> variable.
>
> * subversion/tests/cmdline/cat_tests.py
> (cat_skip_uncattable): Modify test
>
> Patch by: Noorul Islam K M <noorul{_AT_}collab.net>
> ]]]
>
> Thanks and Regards
> Noorul
>
> Index: subversion/tests/cmdline/cat_tests.py
> ===================================================================
> --- subversion/tests/cmdline/cat_tests.py (revision 1070514)
> +++ subversion/tests/cmdline/cat_tests.py (working copy)
> @@ -158,8 +158,9 @@
> svntest.actions.run_and_verify_svn2(None, expected_out, expected_err2, 1,
> 'cat', rho_path, new_file_path)
>
> - expected_err3 = expected_err1 + expected_err2 + ".*\n" + \
> - "svn: E200000: A problem occurred; see other errors for details\n"
> + expected_err3 = expected_err1 + expected_err2 + \
> + ".*\nsvn: E200009: Could not cat all targets because some targets " + \
> + "don't exist\n"
> expected_err_re = re.compile(expected_err3)
>
> exit_code, output, error = svntest.main.run_svn(1, 'cat', rho_path, G_path, new_file_path)
> Index: subversion/svn/cat-cmd.c
> ===================================================================
> --- subversion/svn/cat-cmd.c (revision 1070514)
> +++ subversion/svn/cat-cmd.c (working copy)
> @@ -32,6 +32,8 @@
> #include "svn_error.h"
> #include "cl.h"
>
> +#include "svn_private_config.h"
> +
>
> /*** Code. ***/
>
> @@ -47,7 +49,7 @@
> int i;
> svn_stream_t *out;
> apr_pool_t *subpool = svn_pool_create(pool);
> - svn_boolean_t saw_a_problem = FALSE;
> + svn_boolean_t seen_nonexistent_target = FALSE;
>
> SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
> opt_state->targets,
> @@ -83,12 +85,14 @@
> SVN_ERR_FS_NOT_FOUND,
> SVN_NO_ERROR));
> if (! success)
> - saw_a_problem = TRUE;
> + seen_nonexistent_target = TRUE;
> }
> svn_pool_destroy(subpool);
>
> - if (saw_a_problem)
> - return svn_error_create(SVN_ERR_BASE, NULL, NULL);
> + if (seen_nonexistent_target)
> + return svn_error_create(
> + SVN_ERR_ILLEGAL_TARGET, NULL,
> + _("Could not cat all targets because some targets don't exist"));
> else
> return SVN_NO_ERROR;
> }
> Index: subversion/svn/info-cmd.c
> ===================================================================
> --- subversion/svn/info-cmd.c (revision 1070514)
> +++ subversion/svn/info-cmd.c (working copy)
> @@ -494,7 +494,7 @@
> apr_pool_t *subpool = svn_pool_create(pool);
> int i;
> svn_error_t *err;
> - svn_boolean_t saw_a_problem = FALSE;
> + svn_boolean_t seen_nonexistent_target = FALSE;
> svn_opt_revision_t peg_revision;
> svn_info_receiver_t receiver;
> const char *path_prefix;
> @@ -579,7 +579,7 @@
>
> svn_error_clear(err);
> err = NULL;
> - saw_a_problem = TRUE;
> + seen_nonexistent_target = TRUE;
> }
> }
> svn_pool_destroy(subpool);
> @@ -587,8 +587,11 @@
> if (opt_state->xml && (! opt_state->incremental))
> SVN_ERR(svn_cl__xml_print_footer("info", pool));
>
> - if (saw_a_problem)
> - return svn_error_create(SVN_ERR_BASE, NULL, NULL);
> + if (seen_nonexistent_target)
> + return svn_error_create(
> + SVN_ERR_ILLEGAL_TARGET, NULL,
> + _("Could not display info for all targets because some "
> + "targets don't exist"));
> else
> return SVN_NO_ERROR;
> }