On Sun, Apr 5, 2026 at 1:29 PM <[email protected]> wrote:
>
> Author: rinrab
> Date: Sun Apr  5 09:44:54 2026
> New Revision: 1932855
>
> Log:
> Export a function for parsing a single opt_revision into the public API. We'll
> probably use it in svnbrowse. Neither of other tools need it because they
> primarly operate over a revision range for which there is a separate function
> in the API.
>
> * subversion/include/svn_error_codes.h
>   (SVN_ERR_OPT_REVISION_PARSE_ERROR): Define new error code.
> * subversion/include/svn_opt.h
>   (svn_opt_parse_one_revision): Define function.
> * subversion/libsvn_subr/opt_revision.c
>   (svn_opt_parse_one_revision): New function; forward most of the logic into
>    parse_one_rev() + error handling and dup string.
> * subversion/tests/libsvn_subr/opt-test.c
>   (test_parse_one_rev): New stupid test to cover up the fact that this 
> function
>    has zero usages (yet).
>   (test_funcs): Run new test.
>
> Modified:
>    subversion/trunk/subversion/include/svn_error_codes.h
>    subversion/trunk/subversion/include/svn_opt.h
>    subversion/trunk/subversion/libsvn_subr/opt_revision.c
>    subversion/trunk/subversion/tests/libsvn_subr/opt-test.c
>
> Modified: subversion/trunk/subversion/include/svn_error_codes.h
> ==============================================================================
> --- subversion/trunk/subversion/include/svn_error_codes.h       Sun Apr  5 
> 08:30:18 2026        (r1932854)
> +++ subversion/trunk/subversion/include/svn_error_codes.h       Sun Apr  5 
> 09:44:54 2026        (r1932855)
> @@ -1435,6 +1435,11 @@ SVN_ERROR_START
>               SVN_ERR_MISC_CATEGORY_START + 31,
>               "Attempted to write to readonly SQLite db")
>
> +  /** @since New in 1.16. */
> +  SVN_ERRDEF(SVN_ERR_OPT_REVISION_PARSE_ERROR,
> +             SVN_ERR_MISC_CATEGORY_START + 32,
> +             "Error parsing revision argument")
> +

The majority of opt_revision routines currently work with integer
status code as errors. I decided to use svn_error for the new one and
added a new error code for that. I also think to switch the rest of
those functions to svn_error.

--
Timofei Zhakov

Reply via email to