You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "C. Michael Pilato" <cm...@collab.net> on 2010/12/14 02:16:17 UTC

Re: svn commit: r1045385 - in /subversion/trunk/subversion: libsvn_client/status.c tests/cmdline/stat_tests.py

On 12/13/2010 04:43 PM, hwright@apache.org wrote:
> Modified: subversion/trunk/subversion/libsvn_client/status.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/status.c?rev=1045385&r1=1045384&r2=1045385&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_client/status.c (original)
> +++ subversion/trunk/subversion/libsvn_client/status.c Mon Dec 13 21:43:57 2010
> @@ -292,17 +292,16 @@ svn_client_status5(svn_revnum_t *result_
>      SVN_ERR(svn_io_check_path(target_abspath, &disk_kind, pool));
>      err = svn_wc_read_kind(&kind, ctx->wc_ctx, target_abspath, FALSE, pool);
>  
> -    if (err && ((err->apr_err == SVN_ERR_WC_MISSING) ||
> -                (err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY)))
> -    {
> -      /* This error code is checked for in svn to continue after an error */
> -      svn_error_clear(err);
> -      return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
> -                               _("'%s' is not a working copy"),
> -                               svn_dirent_local_style(path, pool));
> -    }
> -
> -    SVN_ERR(err);
> +    if (err && (err->apr_err == SVN_ERR_WC_MISSING))
> +      {
> +        /* Calling code expects SVN_ERR_WC_NOT_WORKING_COPY. */
> +        svn_error_clear(err);
> +        return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
> +                                 _("'%s' is not a working copy"),
> +                                 svn_dirent_local_style(path, pool));
> +      }

You might not be able to answer this, Hyrum, but:  why do we clear 'err'
instead of feeding it into the svn_error_createf() as the child error?  Are
we losing any useful information with the current approach?

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

Re: svn commit: r1045385 - in /subversion/trunk/subversion: libsvn_client/status.c tests/cmdline/stat_tests.py

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
On Mon, Dec 13, 2010 at 8:16 PM, C. Michael Pilato <cm...@collab.net> wrote:
> On 12/13/2010 04:43 PM, hwright@apache.org wrote:
>> Modified: subversion/trunk/subversion/libsvn_client/status.c
>> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/status.c?rev=1045385&r1=1045384&r2=1045385&view=diff
>> ==============================================================================
>> --- subversion/trunk/subversion/libsvn_client/status.c (original)
>> +++ subversion/trunk/subversion/libsvn_client/status.c Mon Dec 13 21:43:57 2010
>> @@ -292,17 +292,16 @@ svn_client_status5(svn_revnum_t *result_
>>      SVN_ERR(svn_io_check_path(target_abspath, &disk_kind, pool));
>>      err = svn_wc_read_kind(&kind, ctx->wc_ctx, target_abspath, FALSE, pool);
>>
>> -    if (err && ((err->apr_err == SVN_ERR_WC_MISSING) ||
>> -                (err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY)))
>> -    {
>> -      /* This error code is checked for in svn to continue after an error */
>> -      svn_error_clear(err);
>> -      return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
>> -                               _("'%s' is not a working copy"),
>> -                               svn_dirent_local_style(path, pool));
>> -    }
>> -
>> -    SVN_ERR(err);
>> +    if (err && (err->apr_err == SVN_ERR_WC_MISSING))
>> +      {
>> +        /* Calling code expects SVN_ERR_WC_NOT_WORKING_COPY. */
>> +        svn_error_clear(err);
>> +        return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
>> +                                 _("'%s' is not a working copy"),
>> +                                 svn_dirent_local_style(path, pool));
>> +      }
>
> You might not be able to answer this, Hyrum, but:  why do we clear 'err'
> instead of feeding it into the svn_error_createf() as the child error?  Are
> we losing any useful information with the current approach?

I can't answer, but the same thought did occur to me.  I just forgot
to make it a composition call before committing.  +1 to the idea,
though.

-Hyrum