svn commit: r1925877 - in /subversion/branches/utf8-cmdline-prototype/subversion: include/svn_opt.h libsvn_subr/deprecated.c

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <[email protected]>
Author: rinrab
Date: Tue May 27 21:11:08 2025
New Revision: 1925877

URL: http://svn.apache.org/viewvc?rev=1925877&view=rev
Log:
On the 'utf8-cmdline-prototype' branch: Add svn_opt_args_to_target_array4()
function that does the same thing as svn_opt_args_to_target_array3(), but
doesn't perform UTF8 conversion.

* subversion/include/svn_opt.h
  (svn_opt_args_to_target_array3): Deprecate, finally.
  (svn_opt_args_to_target_array4): Declare.
* subversion/libsvn_subr/deprecated.c
  (svn_opt_args_to_target_array4): Implement.

Note: the new function is not currently deprecated, but the old one was. This
would be next task to somehow merge the opt's one and client's one.

Modified:
    subversion/branches/utf8-cmdline-prototype/subversion/include/svn_opt.h
    subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/deprecated.c

Modified: subversion/branches/utf8-cmdline-prototype/subversion/include/svn_opt.h
URL: http://svn.apache.org/viewvc/subversion/branches/utf8-cmdline-prototype/subversion/include/svn_opt.h?rev=1925877&r1=1925876&r2=1925877&view=diff
==============================================================================
--- subversion/branches/utf8-cmdline-prototype/subversion/include/svn_opt.h (original)
+++ subversion/branches/utf8-cmdline-prototype/subversion/include/svn_opt.h Tue May 27 21:11:08 2025
@@ -594,9 +594,8 @@ svn_opt_resolve_revisions(svn_opt_revisi
 
 /**
  * Pull remaining target arguments from @a os into @a *targets_p,
- * converting them to UTF-8, followed by targets from @a known_targets
- * (which might come from, for example, the "--targets" command line
- * option), which are already in UTF-8.
+ * followed by targets from @a known_targets (which might come from,
+ * for example, the "--targets" command line option).
  *
  * On each URL target, do some IRI-to-URI encoding and some
  * auto-escaping.  On each local path, canonicalize case and path
@@ -612,9 +611,22 @@ svn_opt_resolve_revisions(svn_opt_revisi
  * error, and if this is the only type of error encountered, complete
  * the operation before returning the error(s).
  *
- * @deprecated Provided for backward compatibility with the 1.5 API.
+ * @since New in 1.15.
  * @see svn_client_args_to_target_array()
  */
+svn_error_t *
+svn_opt_args_to_target_array4(apr_array_header_t **targets_p,
+                              apr_getopt_t *os,
+                              const apr_array_header_t *known_targets,
+                              apr_pool_t *pool);
+
+/**
+ * Similar to svn_opt_args_to_target_array4() except that it also performs
+ * conversion of the targets to UTF-8.
+ *
+ * @since New in 1.5.
+ * @deprecated Provided for backward compatibility with the 1.5 API.
+ */
 SVN_DEPRECATED
 svn_error_t *
 svn_opt_args_to_target_array3(apr_array_header_t **targets_p,

Modified: subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/deprecated.c?rev=1925877&r1=1925876&r2=1925877&view=diff
==============================================================================
--- subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/deprecated.c (original)
+++ subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/deprecated.c Tue May 27 21:11:08 2025
@@ -809,6 +809,24 @@ svn_opt_subcommand_help(const char *subc
 }
 
 svn_error_t *
+svn_opt_args_to_target_array4(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++)
+    {
+      APR_ARRAY_PUSH(utf8_input_targets, const char *) = os->argv[os->ind];
+    }
+
+  return svn_error_trace(svn_opt__process_target_array(targets_p, os,
+                                                       known_targets, pool));
+}
+
+svn_error_t *
 svn_opt_args_to_target_array3(apr_array_header_t **targets_p,
                               apr_getopt_t *os,
                               const apr_array_header_t *known_targets,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.