svn commit: r1925846 - in /subversion/branches/utf8-cmdline-prototype/subversion: include/svn_opt.h libsvn_subr/deprecated.c libsvn_subr/opt.c svn/svn.c svnbench/svnbench.c svnmucc/svnmucc.c tests/libsvn_subr/opt-test.c

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <[email protected]>
Author: rinrab
Date: Mon May 26 22:16:36 2025
New Revision: 1925846

URL: http://svn.apache.org/viewvc?rev=1925846&view=rev
Log:
On the 'utf8-cmdline-prototype' branch: deprecate non-utf8 version of
svn_opt_parse_revprop() and rename the utf8 one to substitute it instead.

* subversion/include/svn_opt.h
  (svn_opt_parse_revprop,
   svn_opt_parse_revprop2,
   svn_opt_parse_revprop_utf8): Unexplainable magic to deprecate one, rename
   another, and make it the main one.
* subversion/libsvn_subr/deprecated.c
  (svn_opt_parse_revprop): Implement it here through svn_opt_parse_revprop2().
* subversion/libsvn_subr/opt.c
  (svn_opt_parse_revprop2): Adjust name.
  (svn_opt_parse_revprop): Move it away to deprecate.

* subversion/svn/svn.c,
* subversion/svnbench/svnbench.c,
* subversion/svnmucc/svnmucc.c,
* subversion/tests/libsvn_subr/opt-test.c: Adjust usages.

Modified:
    subversion/branches/utf8-cmdline-prototype/subversion/include/svn_opt.h
    subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/deprecated.c
    subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/opt.c
    subversion/branches/utf8-cmdline-prototype/subversion/svn/svn.c
    subversion/branches/utf8-cmdline-prototype/subversion/svnbench/svnbench.c
    subversion/branches/utf8-cmdline-prototype/subversion/svnmucc/svnmucc.c
    subversion/branches/utf8-cmdline-prototype/subversion/tests/libsvn_subr/opt-test.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=1925846&r1=1925845&r2=1925846&view=diff
==============================================================================
--- subversion/branches/utf8-cmdline-prototype/subversion/include/svn_opt.h (original)
+++ subversion/branches/utf8-cmdline-prototype/subversion/include/svn_opt.h Mon May 26 22:16:36 2025
@@ -674,19 +674,22 @@ svn_opt_args_to_target_array(apr_array_h
  * @since New in 1.6.
  */
 svn_error_t *
-svn_opt_parse_revprop(apr_hash_t **revprops, const char *revprop_spec,
-                      apr_pool_t *pool);
+svn_opt_parse_revprop2(apr_hash_t **revprops,
+                       const char *revprop_spec_utf8,
+                       apr_pool_t *pool);
 
 /**
- * Similar to svn_opt_parse_revprop() but assumes that revprop_spec_utf8 is
- * already utf8 encoded.
+ * Similar to svn_opt_parse_revprop2() but also converts @a revprop_spec
+ * to UTF-8 before parsing it.
  *
- * @since New in 1.15.
+ * @since New in 1.6.
+ * @deprecated Provided for backward compatibility with the 1.14 API.
  */
+SVN_DEPRECATED
 svn_error_t *
-svn_opt_parse_revprop_utf8(apr_hash_t **revprop_table_p,
-                           const char *revprop_spec_utf8,
-                           apr_pool_t *pool);
+svn_opt_parse_revprop(apr_hash_t **revprop_table_p,
+                      const char *revprop_spec,
+                      apr_pool_t *pool);
 
 /**
  * If no targets exist in @a *targets, add `.' as the lone target.

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=1925846&r1=1925845&r2=1925846&view=diff
==============================================================================
--- subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/deprecated.c (original)
+++ subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/deprecated.c Mon May 26 22:16:36 2025
@@ -1071,6 +1071,19 @@ svn_opt_print_generic_help(const char *h
   svn_error_clear(err);
 }
 
+svn_error_t *
+svn_opt_parse_revprop(apr_hash_t **revprop_table_p,
+                      const char *revprop_spec,
+                      apr_pool_t *pool)
+{
+  const char *revprop_spec_utf8;
+
+  SVN_ERR(svn_utf_cstring_to_utf8(&revprop_spec_utf8, revprop_spec, pool));
+
+  return svn_error_trace(svn_opt_parse_revprop2(revprop_table_p,
+                                                revprop_spec_utf8, pool));
+}
+
 /*** From io.c ***/
 svn_error_t *
 svn_io_open_unique_file2(apr_file_t **file,

Modified: subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/opt.c
URL: http://svn.apache.org/viewvc/subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/opt.c?rev=1925846&r1=1925845&r2=1925846&view=diff
==============================================================================
--- subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/opt.c (original)
+++ subversion/branches/utf8-cmdline-prototype/subversion/libsvn_subr/opt.c Mon May 26 22:16:36 2025
@@ -1068,20 +1068,9 @@ svn_opt__args_to_target_array(apr_array_
 }
 
 svn_error_t *
-svn_opt_parse_revprop(apr_hash_t **revprop_table_p, const char *revprop_spec,
-                      apr_pool_t *pool)
-{
-  const char *revprop_spec_utf8;
-
-  SVN_ERR(svn_utf_cstring_to_utf8(&revprop_spec_utf8, revprop_spec, pool));
-
-  return svn_error_trace(svn_opt_parse_revprop_utf8(revprop_table_p,
-                                                    revprop_spec_utf8, pool));
-}
-
-svn_error_t *
-svn_opt_parse_revprop_utf8(apr_hash_t **revprop_table_p,
-                           const char *revprop_spec_utf8, apr_pool_t *pool)
+svn_opt_parse_revprop2(apr_hash_t **revprop_table_p,
+                       const char *revprop_spec_utf8,
+                       apr_pool_t *pool)
 {
   const char *sep, *propname;
   svn_string_t *propval;

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=1925846&r1=1925845&r2=1925846&view=diff
==============================================================================
--- subversion/branches/utf8-cmdline-prototype/subversion/svn/svn.c (original)
+++ subversion/branches/utf8-cmdline-prototype/subversion/svn/svn.c Mon May 26 22:16:36 2025
@@ -2611,7 +2611,7 @@ sub_main(int *exit_code,
         opt_state.no_revprops = TRUE;
         break;
       case opt_with_revprop:
-        SVN_ERR(svn_opt_parse_revprop_utf8(&opt_state.revprop_table,
+        SVN_ERR(svn_opt_parse_revprop2(&opt_state.revprop_table,
                                            utf8_opt_arg, pool));
         break;
       case opt_parents:

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=1925846&r1=1925845&r2=1925846&view=diff
==============================================================================
--- subversion/branches/utf8-cmdline-prototype/subversion/svnbench/svnbench.c (original)
+++ subversion/branches/utf8-cmdline-prototype/subversion/svnbench/svnbench.c Mon May 26 22:16:36 2025
@@ -633,7 +633,7 @@ sub_main(int *exit_code,
         break;
       case opt_with_revprop:
         SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
-        SVN_ERR(svn_opt_parse_revprop_utf8(&opt_state.revprop_table,
+        SVN_ERR(svn_opt_parse_revprop2(&opt_state.revprop_table,
                                            utf8_opt_arg, pool));
         break;
       case 'g':

Modified: subversion/branches/utf8-cmdline-prototype/subversion/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/branches/utf8-cmdline-prototype/subversion/svnmucc/svnmucc.c?rev=1925846&r1=1925845&r2=1925846&view=diff
==============================================================================
--- subversion/branches/utf8-cmdline-prototype/subversion/svnmucc/svnmucc.c (original)
+++ subversion/branches/utf8-cmdline-prototype/subversion/svnmucc/svnmucc.c Mon May 26 22:16:36 2025
@@ -611,7 +611,7 @@ sub_main(int *exit_code,
           break;
         case with_revprop_opt:
           SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, arg, pool));
-          SVN_ERR(svn_opt_parse_revprop_utf8(&revprops, opt_arg, pool));
+          SVN_ERR(svn_opt_parse_revprop2(&revprops, opt_arg, pool));
           break;
         case 'X':
           SVN_ERR(svn_utf_cstring_to_utf8(&extra_args_file, arg, pool));

Modified: subversion/branches/utf8-cmdline-prototype/subversion/tests/libsvn_subr/opt-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/utf8-cmdline-prototype/subversion/tests/libsvn_subr/opt-test.c?rev=1925846&r1=1925845&r2=1925846&view=diff
==============================================================================
--- subversion/branches/utf8-cmdline-prototype/subversion/tests/libsvn_subr/opt-test.c (original)
+++ subversion/branches/utf8-cmdline-prototype/subversion/tests/libsvn_subr/opt-test.c Mon May 26 22:16:36 2025
@@ -273,17 +273,17 @@ test_svn_opt_parse_revprop(apr_pool_t *p
   svn_string_t *val;
 
   apr_hash_clear(hash);
-  SVN_ERR(svn_opt_parse_revprop(&hash, "name=val", pool));
+  SVN_ERR(svn_opt_parse_revprop2(&hash, "name=val", pool));
   val = apr_hash_get(hash, "name", APR_HASH_KEY_STRING);
   SVN_TEST_STRING_ASSERT(val->data, "val");
 
   apr_hash_clear(hash);
-  SVN_ERR(svn_opt_parse_revprop_utf8(&hash, "name=val", pool));
+  SVN_ERR(svn_opt_parse_revprop2(&hash, "name=val", pool));
   val = apr_hash_get(hash, "name", APR_HASH_KEY_STRING);
   SVN_TEST_STRING_ASSERT(val->data, "val");
 
   apr_hash_clear(hash);
-  SVN_ERR(svn_opt_parse_revprop_utf8(&hash, "name=" UNICODE_TEST_STRING, pool));
+  SVN_ERR(svn_opt_parse_revprop2(&hash, "name=" UNICODE_TEST_STRING, pool));
   val = apr_hash_get(hash, "name", APR_HASH_KEY_STRING);
   SVN_TEST_STRING_ASSERT(val->data, UNICODE_TEST_STRING);
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.