Use svn_opt_args_to_target_array3() instead of svn_opt__args_to_target_array()
and drop it.
* subversion/include/private/svn_opt_private.h
(svn_opt__args_to_target_array): Remove.
(svn_opt__process_target_array): Use description of svn_opt__args_to_target_array().
* subversion/libsvn_client/cmdline.c
(svn_client_args_to_target_array2): Adjust description.
* subversion/libsvn_subr/opt.c
(svn_opt__args_to_target_array): Remove.
* subversion/libsvn_wc/adm_files.c
(svn_wc_set_adm_dir): Adjust comment to reference new function.
* subversion/svnadmin/svnadmin.c
* subversion/svnsync/svnsync.c
(...): Use the public func and adjust comments.
git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1926277 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/subversion/include/private/svn_opt_private.h b/subversion/include/private/svn_opt_private.h
index 1630759..50aaea8 100644
--- a/subversion/include/private/svn_opt_private.h
+++ b/subversion/include/private/svn_opt_private.h
@@ -90,16 +90,13 @@
apr_pool_t *pool);
/*
- * Pull remaining target arguments from OS into *TARGETS_P,
- * converting them to UTF-8, followed by targets from KNOWN_TARGETS
- * (which might come from, for example, the "--targets" command line
- * option), which are already in UTF-8.
+ * Processes arguments from from @a utf8_input_targets into @a targets_p.
*
* On each URL target, do some IRI-to-URI encoding and some
* auto-escaping. On each local path, canonicalize case and path
* separators.
*
- * Allocate *TARGETS_P and its elements in POOL.
+ * Allocate @a targets_p and its elements in @a pool.
*
* If a path has the same name as a Subversion working copy
* administrative directory, return SVN_ERR_RESERVED_FILENAME_SPECIFIED;
@@ -110,12 +107,6 @@
* the operation before returning the error(s).
*/
svn_error_t *
-svn_opt__args_to_target_array(apr_array_header_t **targets_p,
- apr_getopt_t *os,
- const apr_array_header_t *known_targets,
- apr_pool_t *pool);
-
-svn_error_t *
svn_opt__process_target_array(apr_array_header_t **targets_p,
apr_array_header_t *utf8_input_targets,
const apr_array_header_t *known_targets,
diff --git a/subversion/libsvn_client/cmdline.c b/subversion/libsvn_client/cmdline.c
index a850b4e..7f8043d 100644
--- a/subversion/libsvn_client/cmdline.c
+++ b/subversion/libsvn_client/cmdline.c
@@ -110,7 +110,7 @@
return SVN_NO_ERROR;
}
-/* Note: This is substantially copied from svn_opt__args_to_target_array() in
+/* Note: This is substantially copied from svn_opt__process_target_array() in
* order to move to libsvn_client while maintaining backward compatibility. */
svn_error_t *
svn_client_args_to_target_array2(apr_array_header_t **targets_p,
diff --git a/subversion/libsvn_subr/opt.c b/subversion/libsvn_subr/opt.c
index f02eddc..635f92e 100644
--- a/subversion/libsvn_subr/opt.c
+++ b/subversion/libsvn_subr/opt.c
@@ -218,30 +218,6 @@
return SVN_NO_ERROR;
}
-svn_error_t *
-svn_opt__args_to_target_array(apr_array_header_t **targets_p,
- apr_getopt_t *os,
- const apr_array_header_t *known_targets,
- apr_pool_t *pool)
-{
- apr_array_header_t *utf8_input_targets =
- apr_array_make(pool, os->argc - os->ind, sizeof(const char *));
-
- for (; os->ind < os->argc; os->ind++)
- {
- /* The apr_getopt targets are still in native encoding. */
- const char *raw_target = os->argv[os->ind];
- const char *utf8_target;
-
- SVN_ERR(svn_utf_cstring_to_utf8(&utf8_target, raw_target, pool));
-
- APR_ARRAY_PUSH(utf8_input_targets, const char *) = utf8_target;
- }
-
- return svn_error_trace(svn_opt__process_target_array(
- targets_p, utf8_input_targets, known_targets, pool));
-}
-
/* Note: This is substantially copied into svn_client_args_to_target_array() in
* order to move to libsvn_client while maintaining backward compatibility. */
svn_error_t *
diff --git a/subversion/libsvn_wc/adm_files.c b/subversion/libsvn_wc/adm_files.c
index ac58aa9..e299113 100644
--- a/subversion/libsvn_wc/adm_files.c
+++ b/subversion/libsvn_wc/adm_files.c
@@ -83,7 +83,7 @@
FIXME:
An identical list is used in
- libsvn_subr/opt.c:svn_opt__args_to_target_array(),
+ libsvn_subr/opt.c:svn_opt__process_target_array(),
but that function can't use this list, because that use would
create a circular dependency between libsvn_wc and libsvn_subr.
Make sure changes to the lists are always synchronized! */
diff --git a/subversion/svnadmin/svnadmin.c b/subversion/svnadmin/svnadmin.c
index d54d392..fd7a1e1 100644
--- a/subversion/svnadmin/svnadmin.c
+++ b/subversion/svnadmin/svnadmin.c
@@ -2595,7 +2595,7 @@
apr_hash_index_t *hi;
apr_pool_t *iterpool = svn_pool_create(pool);
- SVN_ERR(svn_opt__args_to_target_array(&targets, os,
+ SVN_ERR(svn_opt_args_to_target_array3(&targets, os,
apr_array_make(pool, 0,
sizeof(const char *)),
pool));
diff --git a/subversion/svnsync/svnsync.c b/subversion/svnsync/svnsync.c
index a8592b8..bd3a10d 100644
--- a/subversion/svnsync/svnsync.c
+++ b/subversion/svnsync/svnsync.c
@@ -902,7 +902,7 @@
apr_array_header_t *targets;
subcommand_baton_t *baton;
- SVN_ERR(svn_opt__args_to_target_array(&targets, os,
+ SVN_ERR(svn_opt_args_to_target_array3(&targets, os,
apr_array_make(pool, 0,
sizeof(const char *)),
pool));
@@ -1580,7 +1580,7 @@
subcommand_baton_t *baton;
const char *to_url, *from_url;
- SVN_ERR(svn_opt__args_to_target_array(&targets, os,
+ SVN_ERR(svn_opt_args_to_target_array3(&targets, os,
apr_array_make(pool, 0,
sizeof(const char *)),
pool));
@@ -1785,7 +1785,7 @@
/* This is the old "... TO_URL REV[:REV2]" syntax.
Revisions come only from this argument. (We effectively
pop that last argument from the end of the argument list
- so svn_opt__args_to_target_array() can do its thang.) */
+ so svn_opt_args_to_target_array() can do its thang.) */
os->argc--;
if ((opt_baton->start_rev.kind != svn_opt_revision_unspecified)
@@ -1806,7 +1806,7 @@
SVN_ERR(resolve_revnums(&start_rev, &end_rev,
start_revision, end_revision));
- SVN_ERR(svn_opt__args_to_target_array(
+ SVN_ERR(svn_opt_args_to_target_array3(
&targets, os,
apr_array_make(pool, 1, sizeof(const char *)), pool));
if (targets->nelts != 1)
@@ -1823,7 +1823,7 @@
SVN_ERR(resolve_revnums(&start_rev, &end_rev,
opt_baton->start_rev, opt_baton->end_rev));
- SVN_ERR(svn_opt__args_to_target_array(
+ SVN_ERR(svn_opt_args_to_target_array3(
&targets, os,
apr_array_make(pool, 2, sizeof(const char *)), pool));
if (targets->nelts < 1)
@@ -1873,7 +1873,7 @@
apr_hash_t *props;
svn_string_t *from_url, *from_uuid, *last_merged_rev;
- SVN_ERR(svn_opt__args_to_target_array(&targets, os,
+ SVN_ERR(svn_opt_args_to_target_array3(&targets, os,
apr_array_make(pool, 0,
sizeof(const char *)),
pool));