Author: rinrab Date: Mon May 26 14:15:41 2025 New Revision: 1925824 URL: http://svn.apache.org/viewvc?rev=1925824&view=rev Log: On the 'utf8-cmdline-prototype' branch: use standard error handling using SVN_ERR() macro for depth and set_depth arguments instead of throwing a custom error message in all executables which accepts this arguments.
There is no need for that custom message, and later on we will normalize arguments once, and couldn't do this handling. * subversion/svn/svn.c subversion/svnbench/svnbench.c tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c (sub_main::depth,set_depth): Ditto. Modified: subversion/branches/utf8-cmdline-prototype/subversion/svn/svn.c subversion/branches/utf8-cmdline-prototype/subversion/svnbench/svnbench.c subversion/branches/utf8-cmdline-prototype/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c Modified: subversion/branches/utf8-cmdline-prototype/subversion/svn/svn.c URL: http://svn.apache.org/viewvc/subversion/branches/utf8-cmdline-prototype/subversion/svn/svn.c?rev=1925824&r1=1925823&r2=1925824&view=diff ============================================================================== --- subversion/branches/utf8-cmdline-prototype/subversion/svn/svn.c (original) +++ subversion/branches/utf8-cmdline-prototype/subversion/svn/svn.c Mon May 26 14:15:41 2025 @@ -2434,11 +2434,7 @@ sub_main(int *exit_code, opt_state.file_size_unit = SVN_CL__SIZE_UNIT_BASE_2; break; case opt_depth: - err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool); - if (err) - return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, err, - _("Error converting depth " - "from locale to UTF-8")); + SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool)); opt_state.depth = svn_depth_from_word(utf8_opt_arg); if (opt_state.depth == svn_depth_unknown || opt_state.depth == svn_depth_exclude) @@ -2451,11 +2447,7 @@ sub_main(int *exit_code, } break; case opt_set_depth: - err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool); - if (err) - return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, err, - _("Error converting depth " - "from locale to UTF-8")); + SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool)); opt_state.set_depth = svn_depth_from_word(utf8_opt_arg); /* svn_depth_exclude is okay for --set-depth. */ if (opt_state.set_depth == svn_depth_unknown) Modified: subversion/branches/utf8-cmdline-prototype/subversion/svnbench/svnbench.c URL: http://svn.apache.org/viewvc/subversion/branches/utf8-cmdline-prototype/subversion/svnbench/svnbench.c?rev=1925824&r1=1925823&r2=1925824&view=diff ============================================================================== --- subversion/branches/utf8-cmdline-prototype/subversion/svnbench/svnbench.c (original) +++ subversion/branches/utf8-cmdline-prototype/subversion/svnbench/svnbench.c Mon May 26 14:15:41 2025 @@ -555,11 +555,7 @@ sub_main(int *exit_code, descend = FALSE; break; case opt_depth: - err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool); - if (err) - return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, err, - _("Error converting depth " - "from locale to UTF-8")); + SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool)); opt_state.depth = svn_depth_from_word(utf8_opt_arg); if (opt_state.depth == svn_depth_unknown || opt_state.depth == svn_depth_exclude) Modified: subversion/branches/utf8-cmdline-prototype/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c URL: http://svn.apache.org/viewvc/subversion/branches/utf8-cmdline-prototype/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c?rev=1925824&r1=1925823&r2=1925824&view=diff ============================================================================== --- subversion/branches/utf8-cmdline-prototype/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c (original) +++ subversion/branches/utf8-cmdline-prototype/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c Mon May 26 14:15:41 2025 @@ -512,11 +512,7 @@ sub_main(int *exit_code, } break; case opt_depth: - err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool); - if (err) - return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, err, - _("Error converting depth " - "from locale to UTF-8")); + SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool)); opt_state.depth = svn_depth_from_word(utf8_opt_arg); if (opt_state.depth == svn_depth_unknown || opt_state.depth == svn_depth_exclude)