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.
This merges r1925824 from the 'utf8-cmdline-prototype' branch.
git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1925916 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/subversion/svn/svn.c b/subversion/svn/svn.c
index 46c6327..60f65a1 100644
--- a/subversion/svn/svn.c
+++ b/subversion/svn/svn.c
@@ -2434,11 +2434,7 @@
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 @@
}
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)
diff --git a/subversion/svnbench/svnbench.c b/subversion/svnbench/svnbench.c
index 3be98eea..45d0392 100644
--- a/subversion/svnbench/svnbench.c
+++ b/subversion/svnbench/svnbench.c
@@ -555,11 +555,7 @@
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)
diff --git a/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c b/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c
index 1973c6e..aeffd6a 100644
--- a/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c
+++ b/tools/client-side/svn-mergeinfo-normalizer/svn-mergeinfo-normalizer.c
@@ -512,11 +512,7 @@
}
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)