Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_subr/sysinfo.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_subr/sysinfo.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/libsvn_subr/sysinfo.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/libsvn_subr/sysinfo.c 
Fri Dec  6 13:59:05 2024
@@ -646,11 +646,16 @@ debian_release(apr_pool_t *pool)
 static const char *
 linux_release_name(apr_pool_t *pool)
 {
-  const char *uname_release = release_name_from_uname(pool);
+  const char *uname_release = NULL;
+  const char *release_name;
+
+#if HAVE_UNAME
+  uname_release = release_name_from_uname(pool);
+#endif
 
   /* Try anything that has /usr/bin/lsb_release.
      Covers, for example, Debian, Ubuntu and SuSE.  */
-  const char *release_name = lsb_release(pool);
+  release_name = lsb_release(pool);
 
   /* Try the systemd way (covers Arch). */
   if (!release_name)
@@ -1404,13 +1409,10 @@ release_name_from_version(int major, int
             }
           break;
 
-        case 11:
-          return "Big Sur";
-          break;
-
-        case 12:
-          return "Monterey";
-          break;
+        case 11: return "Big Sur";
+        case 12: return "Monterey";
+        case 13: return "Ventura";
+        case 14: return "Sonoma";
         }
     }
   return NULL;

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_subr/version.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_subr/version.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/libsvn_subr/version.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/libsvn_subr/version.c 
Fri Dec  6 13:59:05 2024
@@ -143,7 +143,7 @@ svn_version_extended(svn_boolean_t verbo
   info->build_time = __TIME__;
   info->build_host = SVN_BUILD_HOST;
   info->copyright = apr_pstrdup
-    (pool, _("Copyright (C) 2022 The Apache Software Foundation.\n"
+    (pool, _("Copyright (C) 2024 The Apache Software Foundation.\n"
              "This software consists of contributions made by many people;\n"
              "see the NOTICE file for more information.\n"
              "Subversion is open source software, see "

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/revert.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/revert.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/revert.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/revert.c 
Fri Dec  6 13:59:05 2024
@@ -263,6 +263,7 @@ revert_restore_handle_copied_dirs(svn_bo
 static svn_error_t *
 revert_wc_data(svn_boolean_t *run_wq,
                svn_boolean_t *notify_required,
+               svn_boolean_t *notify_noaccess,
                svn_wc__db_t *db,
                const char *local_abspath,
                svn_wc__db_status_t status,
@@ -309,6 +310,7 @@ revert_restore(svn_boolean_t *run_wq,
   svn_wc__db_status_t status;
   svn_node_kind_t kind;
   svn_boolean_t notify_required;
+  svn_boolean_t notify_noaccess;
   const apr_array_header_t *conflict_files;
   svn_filesize_t recorded_size;
   apr_time_t recorded_time;
@@ -398,7 +400,7 @@ revert_restore(svn_boolean_t *run_wq,
   if (!metadata_only)
     {
       SVN_ERR(revert_wc_data(run_wq,
-                             &notify_required,
+                             &notify_required, &notify_noaccess,
                              db, local_abspath, status, kind,
                              reverted_kind, recorded_size, recorded_time,
                              copied_here, use_commit_times,
@@ -419,12 +421,19 @@ revert_restore(svn_boolean_t *run_wq,
         }
     }
 
-  if (notify_func && notify_required)
-    notify_func(notify_baton,
-                svn_wc_create_notify(local_abspath, svn_wc_notify_revert,
-                                     scratch_pool),
-                scratch_pool);
-
+  if (notify_func)
+    {
+      if (notify_required)
+        notify_func(notify_baton,
+                    svn_wc_create_notify(local_abspath, svn_wc_notify_revert,
+                                         scratch_pool),
+                    scratch_pool);
+      else if (notify_noaccess)
+        notify_func(notify_baton,
+                    svn_wc_create_notify(local_abspath, 
svn_wc_notify_revert_noaccess,
+                                         scratch_pool),
+                    scratch_pool);
+    }
   if (depth == svn_depth_infinity && kind == svn_node_dir)
     {
       apr_pool_t *iterpool = svn_pool_create(scratch_pool);
@@ -482,6 +491,7 @@ revert_restore(svn_boolean_t *run_wq,
 static svn_error_t *
 revert_wc_data(svn_boolean_t *run_wq,
                svn_boolean_t *notify_required,
+               svn_boolean_t *notify_noaccess,
                svn_wc__db_t *db,
                const char *local_abspath,
                svn_wc__db_status_t status,
@@ -502,6 +512,8 @@ revert_wc_data(svn_boolean_t *run_wq,
   svn_boolean_t special;
 #endif
 
+  *notify_noaccess = FALSE; /* notify_required is reset elsewhere */
+  
   /* Would be nice to use svn_io_dirent2_t here, but the performance
      improvement that provides doesn't work, because we need the read
      only and executable bits later on, in the most likely code path */
@@ -661,11 +673,23 @@ revert_wc_data(svn_boolean_t *run_wq,
                         }
                       else if (!needs_lock_prop && read_only)
                         {
-                          SVN_ERR(svn_io_set_file_read_write(local_abspath,
-                                                             FALSE,
-                                                             scratch_pool));
-                          *notify_required = TRUE;
-                        }
+                          /* If there is already W on the file, it is owned by
+                          * some other user. Then svn_io_set_file_read_write
+                          * will return without making any changes and the 
+                          * user will get a spurious "Reverted" message.
+                          * Only checking for user's W since that is the only
+                          * one set by svn_io_set_file_read_write()
+                          * Issue #4622 */
+                          if (finfo.protection & APR_UWRITE)
+                            *notify_noaccess = TRUE;
+                          else
+                            {
+                              SVN_ERR(svn_io_set_file_read_write(local_abspath,
+                                                                 FALSE,
+                                                                 
scratch_pool));
+                              *notify_required = TRUE;
+                            }
+                       }
                     }
 
 #if !defined(WIN32) && !defined(__OS2__)

Modified: 
subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/workqueue.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/workqueue.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/workqueue.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/libsvn_wc/workqueue.c 
Fri Dec  6 13:59:05 2024
@@ -566,20 +566,6 @@ run_file_install(work_item_baton_t *wqb,
                                          db, wcroot_abspath,
                                          scratch_pool, scratch_pool));
 
-  SVN_ERR(svn_wc__db_read_info(&status, NULL, NULL, &repos_relpath,
-                               &repos_root_url, NULL, &changed_rev, NULL,
-                               &changed_author, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, &lock, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               db, local_abspath,
-                               scratch_pool, scratch_pool));
-  /* Handle special statuses (e.g. added) */
-  if (!repos_relpath)
-     SVN_ERR(svn_wc__db_read_repos_info(NULL, &repos_relpath,
-                                        &repos_root_url, NULL,
-                                        db, local_abspath,
-                                        scratch_pool, scratch_pool));
-
   is_special = svn_prop_get_value(props, SVN_PROP_SPECIAL) != NULL;
   is_executable = svn_prop_get_value(props, SVN_PROP_EXECUTABLE) != NULL;
   needs_lock = svn_prop_get_value(props, SVN_PROP_NEEDS_LOCK) != NULL;
@@ -588,10 +574,30 @@ run_file_install(work_item_baton_t *wqb,
   svn_subst_eol_style_from_value(&eol_style, &eol, eol_propval);
 
   keywords_propval = svn_prop_get_value(props, SVN_PROP_KEYWORDS);
+
+  /* Avoid this db work unless needed, in this hot codepath. */
+  if (keywords_propval || needs_lock)
+    SVN_ERR(svn_wc__db_read_info(&status, NULL, NULL, &repos_relpath,
+                                 &repos_root_url, NULL, &changed_rev, NULL,
+                                 &changed_author, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, &lock, NULL, NULL,
+                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
NULL,
+                                 db, local_abspath,
+                                 scratch_pool, scratch_pool));
+ 
   if (keywords_propval)
     {
-      const char *url =
-        svn_path_url_add_component2(repos_root_url, repos_relpath, 
scratch_pool);
+      const char *url;
+                                           
+      /* Handle special statuses (e.g. added) */
+      if (!repos_relpath)
+        SVN_ERR(svn_wc__db_read_repos_info(NULL, &repos_relpath,
+                                           &repos_root_url, NULL,
+                                           db, local_abspath,
+                                           scratch_pool, scratch_pool));
+
+      url = svn_path_url_add_component2(repos_root_url, repos_relpath,
+                                        scratch_pool);
 
       SVN_ERR(svn_subst_build_keywords3(&keywords, keywords_propval,
                                         apr_psprintf(scratch_pool, "%ld",

Modified: subversion/branches/pristine-checksum-kind/subversion/svn/cl.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svn/cl.h?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/svn/cl.h (original)
+++ subversion/branches/pristine-checksum-kind/subversion/svn/cl.h Fri Dec  6 
13:59:05 2024
@@ -881,7 +881,7 @@ typedef enum svn_cl__prop_use_e
 svn_cl__prop_use_t;
 
 /* If PROPNAME looks like but is not identical to one of the svn:
- * poperties, raise an error and suggest a better spelling. Names that
+ * properties, raise an error and suggest a better spelling. Names that
  * raise errors look like this:
  *
  *   - start with svn: but do not exactly match a known property; or,

Modified: subversion/branches/pristine-checksum-kind/subversion/svn/info-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svn/info-cmd.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/svn/info-cmd.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/svn/info-cmd.c Fri 
Dec  6 13:59:05 2024
@@ -1287,10 +1287,16 @@ print_info_item(void *baton,
       break;
 
     case info_item_wc_root:
-      SVN_ERR(print_info_item_string(
-                  (info->wc_info && info->wc_info->wcroot_abspath
-                   ? info->wc_info->wcroot_abspath : NULL),
-                  target_path, pool));
+      {
+        const char *wc_root;
+
+        if (info->wc_info && info->wc_info->wcroot_abspath)
+          wc_root = svn_dirent_local_style(info->wc_info->wcroot_abspath, 
pool);
+        else
+          wc_root = NULL;
+
+        SVN_ERR(print_info_item_string(wc_root, target_path, pool));
+      }
       break;
 
     case info_item_schedule:

Modified: subversion/branches/pristine-checksum-kind/subversion/svn/notify.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svn/notify.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/svn/notify.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/svn/notify.c Fri Dec  
6 13:59:05 2024
@@ -450,6 +450,11 @@ notify_body(struct notify_baton *nb,
                                  path_local));
       break;
 
+    case svn_wc_notify_revert_noaccess:
+      SVN_ERR(svn_cmdline_printf(pool, _("User doesn't have WRITE permissions 
to file '%s' and the file isn't svn:needslock. But the file is already 
writeable. Probably owned by another user."),
+                             path_local));
+      break;
+
     case svn_wc_notify_failed_revert:
       SVN_ERR(svn_cmdline_printf(pool, _("Failed to revert '%s' -- "
                                          "try updating instead.\n"),

Modified: 
subversion/branches/pristine-checksum-kind/subversion/svn/propget-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svn/propget-cmd.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/svn/propget-cmd.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/svn/propget-cmd.c Fri 
Dec  6 13:59:05 2024
@@ -272,14 +272,18 @@ print_properties(svn_stream_t *out,
 
   if (inherited_props)
     {
-      svn_pool_clear(iterpool);
-
       for (i = 0; i < inherited_props->nelts; i++)
         {
-          svn_prop_inherited_item_t *iprop =
-            APR_ARRAY_IDX(inherited_props, i, svn_prop_inherited_item_t *);
-          svn_string_t *propval = apr_hash_this_val(apr_hash_first(pool,
-                                                          iprop->prop_hash));
+          svn_prop_inherited_item_t *iprop;
+          svn_string_t *propval;
+
+          svn_pool_clear(iterpool);
+
+          iprop = APR_ARRAY_IDX(inherited_props, i,
+                                svn_prop_inherited_item_t *);
+          propval = apr_hash_this_val(apr_hash_first(iterpool,
+                                                     iprop->prop_hash));
+
           SVN_ERR(print_single_prop(propval, target_abspath_or_url,
                                     iprop->path_or_url,
                                     path_prefix, out, pname,

Modified: 
subversion/branches/pristine-checksum-kind/subversion/svn/proplist-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svn/proplist-cmd.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/svn/proplist-cmd.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/svn/proplist-cmd.c 
Fri Dec  6 13:59:05 2024
@@ -75,6 +75,8 @@ proplist_receiver_xml(void *baton,
           svn_prop_inherited_item_t *iprop =
             APR_ARRAY_IDX(inherited_props, i, svn_prop_inherited_item_t *);
 
+          svn_pool_clear(iterpool);
+
           sb = NULL;
 
           if (svn_path_is_url(iprop->path_or_url))

Modified: subversion/branches/pristine-checksum-kind/subversion/svn/shelf-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svn/shelf-cmd.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/svn/shelf-cmd.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/svn/shelf-cmd.c Fri 
Dec  6 13:59:05 2024
@@ -717,6 +717,7 @@ shelf_diff(const char *name,
   svn_client__shelf_version_t *shelf_version;
   svn_stream_t *stream, *errstream;
   svn_diff_tree_processor_t *diff_processor;
+  svn_client__diff_driver_info_t *ddi;
 
   SVN_ERR(svn_client__shelf_open_existing(&shelf, name, local_abspath,
                                          ctx, scratch_pool));
@@ -757,7 +758,7 @@ shelf_diff(const char *name,
   else
     {
       SVN_ERR(svn_client__get_diff_writer_svn(
-                &diff_processor,
+                &diff_processor, &ddi,
                 NULL /*anchor*/,
                 "", "", /*orig_path_1, orig_path_2,*/
                 NULL /*options*/,
@@ -769,6 +770,7 @@ shelf_diff(const char *name,
                 FALSE /*ignore_properties*/,
                 FALSE /*properties_only*/,
                 TRUE /*pretty_print_mergeinfo*/,
+                FALSE /*use_git_diff_format*/,
                 svn_cmdline_output_encoding(scratch_pool),
                 stream, errstream,
                 ctx, scratch_pool));

Modified: subversion/branches/pristine-checksum-kind/subversion/svn/shelf2-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svn/shelf2-cmd.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/svn/shelf2-cmd.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/svn/shelf2-cmd.c Fri 
Dec  6 13:59:05 2024
@@ -717,6 +717,7 @@ shelf_diff(const char *name,
   svn_client__shelf2_version_t *shelf_version;
   svn_stream_t *stream, *errstream;
   svn_diff_tree_processor_t *diff_processor;
+  svn_client__diff_driver_info_t *ddi;
 
   SVN_ERR(svn_client__shelf2_open_existing(&shelf, name, local_abspath,
                                          ctx, scratch_pool));
@@ -757,7 +758,7 @@ shelf_diff(const char *name,
   else
     {
       SVN_ERR(svn_client__get_diff_writer_svn(
-                &diff_processor,
+                &diff_processor, &ddi,
                 NULL /*anchor*/,
                 "", "", /*orig_path_1, orig_path_2,*/
                 NULL /*options*/,
@@ -769,6 +770,7 @@ shelf_diff(const char *name,
                 FALSE /*ignore_properties*/,
                 FALSE /*properties_only*/,
                 TRUE /*pretty_print_mergeinfo*/,
+                FALSE /*use_git_diff_format*/,
                 svn_cmdline_output_encoding(scratch_pool),
                 stream, errstream,
                 ctx, scratch_pool));

Modified: subversion/branches/pristine-checksum-kind/subversion/svn/svn.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svn/svn.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/svn/svn.c (original)
+++ subversion/branches/pristine-checksum-kind/subversion/svn/svn.c Fri Dec  6 
13:59:05 2024
@@ -55,7 +55,6 @@
 #include "shelf2-cmd.h"
 #include "shelf-cmd.h"
 
-#include "private/svn_opt_private.h"
 #include "private/svn_cmdline_private.h"
 #include "private/svn_subr_private.h"
 #include "private/svn_utf_private.h"
@@ -424,7 +423,7 @@ svn_cl__cmd_table_main[] =
 {
   { "add", svn_cl__add, {0}, {N_(
      "Put new files and directories under version control.\n"
-     "usage: add PATH...\n"
+     "usage: add PATH[@]...\n"
      "\n"), N_(
      "  Schedule unversioned PATHs for addition, so they will become versioned 
and\n"
      "  be added to the repository in the next commit. Recurse into 
directories by\n"
@@ -444,7 +443,9 @@ svn_cl__cmd_table_main[] =
      "\n"), N_(
      "  The selection of items to add may be influenced by the 'ignores' 
feature.\n"
      "  Properties may be attached to the items as configured by the 
'auto-props'\n"
-     "  feature.\n"
+     "  feature.\n"), N_(
+     "  If PATH contains an @ character, an additional @ must be specified at 
the\n"
+     "  end of PATH to avoid interpreting the first @ as a peg revision 
indicator.\n"
     )},
     {opt_targets, 'N', opt_depth, 'q', opt_force, opt_no_ignore, opt_autoprops,
      opt_no_autoprops, opt_parents },
@@ -516,8 +517,11 @@ svn_cl__cmd_table_main[] =
   { "changelist", svn_cl__changelist, {"cl"}, {N_(
      "Associate (or dissociate) changelist CLNAME with the named\n"
      "files.\n"
-     "usage: 1. changelist CLNAME PATH...\n"
-     "       2. changelist --remove PATH...\n"
+     "usage: 1. changelist CLNAME PATH[@]...\n"
+     "       2. changelist --remove PATH[@]...\n"
+    ), N_(
+     "  If PATH contains an @ character, an additional @ must be specified at 
the\n"
+     "  end of PATH to avoid interpreting the first @ as a peg revision 
indicator.\n"
     )},
     { 'q', 'R', opt_depth, opt_remove, opt_targets, opt_changelist} },
 
@@ -539,6 +543,8 @@ svn_cl__cmd_table_main[] =
      "  out into a sub-directory of PATH, with the name of the sub-directory\n"
      "  being the basename of the URL.\n"
      "\n"), N_(
+     "  If PATH contains an @ character, an additional @ must be specified at 
the\n"
+     "  end of PATH to avoid interpreting the first @ as a peg revision 
indicator.\n"), N_(
      "  If --force is used, unversioned obstructing paths in the working\n"
      "  copy destination do not automatically cause the check out to fail.\n"
      "  If the obstructing path is the same type (file or directory) as the\n"
@@ -560,10 +566,10 @@ svn_cl__cmd_table_main[] =
   { "cleanup", svn_cl__cleanup, {0}, {N_(
      "Either recover from an interrupted operation that left the working\n"
      "copy locked, or remove unwanted files.\n"
-     "usage: 1. cleanup [WCPATH...]\n"
-     "       2. cleanup --remove-unversioned [WCPATH...]\n"
-     "          cleanup --remove-ignored [WCPATH...]\n"
-     "       3. cleanup --vacuum-pristines [WCPATH...]\n"
+     "usage: 1. cleanup [WCPATH[@]...]\n"
+     "       2. cleanup --remove-unversioned [WCPATH[@]...]\n"
+     "          cleanup --remove-ignored [WCPATH[@]...]\n"
+     "       3. cleanup --vacuum-pristines [WCPATH[@]...]\n"
      "\n"), N_(
      "  1. When none of the options --remove-unversioned, --remove-ignored, 
and\n"
      "    --vacuum-pristines is specified, remove all write locks (shown as 
'L' by\n"
@@ -583,7 +589,9 @@ svn_cl__cmd_table_main[] =
      "\n"), N_(
      "  3. If the --vacuum-pristines option is given, remove pristine copies 
of\n"
      "    files which are stored inside the .svn directory and which are no 
longer\n"
-     "    referenced by any file in the working copy.\n"
+     "    referenced by any file in the working copy.\n"), N_(
+     "  If WCPATH contains an @ character, an additional @ must be specified 
at the\n"
+     "  end of WCPATH to avoid interpreting the first @ as a peg revision 
indicator.\n"
     )},
     { opt_remove_unversioned, opt_remove_ignored, opt_vacuum_pristines,
       opt_include_externals, 'q', opt_merge_cmd },
@@ -591,7 +599,7 @@ svn_cl__cmd_table_main[] =
 
   { "commit", svn_cl__commit, {"ci"}, {N_(
      "Send changes from your working copy to the repository.\n"
-     "usage: commit [PATH...]\n"
+     "usage: commit [PATH[@]...]\n"
      "\n"), N_(
      "  A log message must be provided, but it can be empty.  If it is not\n"
      "  given by a --message or --file option, an editor will be started.\n"
@@ -601,7 +609,9 @@ svn_cl__cmd_table_main[] =
      "\n"), N_(
      "  If --include-externals is given, also commit file and directory\n"
      "  externals reached by recursion. Do not commit externals with a\n"
-     "  fixed revision.\n"
+     "  fixed revision.\n"), N_(
+     "  If PATH contains an @ character, an additional @ must be specified at 
the\n"
+     "  end of PATH to avoid interpreting the first @ as a peg revision 
indicator.\n"
     )},
     {'q', 'N', opt_depth, opt_targets, opt_no_unlock, SVN_CL__LOG_MSG_OPTIONS,
      opt_changelist, opt_keep_changelists, opt_include_externals},
@@ -609,7 +619,7 @@ svn_cl__cmd_table_main[] =
 
   { "copy", svn_cl__copy, {"cp"}, {N_(
      "Copy files and directories in a working copy or repository.\n"
-     "usage: copy SRC[@REV]... DST\n"
+     "usage: copy SRC[@REV]... DST[@]\n"
      "\n"), N_(
      "  SRC and DST can each be either a working copy (WC) path or URL:\n"
      "    WC  -> WC:   copy and schedule for addition (with history)\n"
@@ -620,6 +630,8 @@ svn_cl__cmd_table_main[] =
      "  the sources will be added as children of DST. When copying multiple\n"
      "  sources, DST must be an existing directory.\n"
      "\n"), N_(
+     "  If DST contains an @ character, an additional @ must be specified at 
the\n"
+     "  end of DST to avoid interpreting the first @ as a peg revision 
indicator.\n"), N_(
      "  WARNING: For compatibility with previous versions of Subversion,\n"
      "  copies performed using two working copy paths (WC -> WC) will not\n"
      "  contact the repository.  As such, they may not, by default, be able\n"
@@ -631,8 +643,8 @@ svn_cl__cmd_table_main[] =
 
   { "delete", svn_cl__delete, {"del", "remove", "rm"}, {N_(
      "Remove files and directories from version control.\n"
-     "usage: 1. delete PATH...\n"
-     "       2. delete URL...\n"
+     "usage: 1. delete PATH[@]...\n"
+     "       2. delete URL[@]...\n"
      "\n"), N_(
      "  1. Each item specified by a PATH is scheduled for deletion upon\n"
      "    the next commit.  Files, and directories that have not been\n"
@@ -642,7 +654,10 @@ svn_cl__cmd_table_main[] =
      "    not be removed unless the --force or --keep-local option is given.\n"
      "\n"), N_(
      "  2. Each item specified by a URL is deleted from the repository\n"
-     "    via an immediate commit.\n"
+     "    via an immediate commit.\n"), N_(
+     "  If PATH or URL contains an @ character, an additional @ must be 
specified\n"
+     "  at the end of PATH to avoid interpreting the first @ as a peg 
revision\n"
+     "  indicator.\n"
     )},
     {opt_force, 'q', opt_targets, SVN_CL__LOG_MSG_OPTIONS, opt_keep_local} },
 
@@ -692,23 +707,26 @@ svn_cl__cmd_table_main[] =
 
   { "export", svn_cl__export, {0}, {N_(
      "Create an unversioned copy of a tree.\n"
-     "usage: 1. export [-r REV] URL[@PEGREV] [PATH]\n"
-     "       2. export [-r REV] PATH1[@PEGREV] [PATH2]\n"
+     "usage: 1. export [-r REV] URL[@PEGREV] [UNVERSIONED_PATH[@]]\n"
+     "       2. export [-r REV] WCPATH[@PEGREV] [UNVERSIONED_PATH[@]]\n"
      "\n"), N_(
      "  1. Exports a clean directory tree from the repository specified by\n"
      "     URL, at revision REV if it is given, otherwise at HEAD, into\n"
-     "     PATH. If PATH is omitted, the last component of the URL is used\n"
-     "     for the local directory name.\n"
+     "     UNVERSIONED_PATH. If UNVERSIONED_PATH is omitted, the last\n"
+     "     component of the URL is used for the local directory name.\n"
      "\n"), N_(
      "  2. Exports a clean directory tree from the working copy specified by\n"
-     "     PATH1, at revision REV if it is given, otherwise at WORKING, into\n"
-     "     PATH2.  If PATH2 is omitted, the last component of the PATH1 is 
used\n"
-     "     for the local directory name. If REV is not specified, all local\n"
-     "     changes will be preserved.  Files not under version control will\n"
-     "     not be copied.\n"
+     "     WCPATH, at revision REV if it is given, otherwise at WORKING, 
into\n"
+     "     UNVERSIONED_PATH. If UNVERSIONED_PATH is omitted, the last\n"
+     "     component of the WCPATH is used for the local directory name. If\n"
+     "     REV is not specified, all local changes will be preserved. Files\n"
+     "     not under version control will not be copied.\n"
      "\n"), N_(
      "  If specified, PEGREV determines in which revision the target is 
first\n"
-     "  looked up.\n"
+     "  looked up.\n"), N_(
+     "  If UNVERSIONED_PATH contains an @ character, an additional @ must be\n"
+     "  specified at the end of UNVERSIONED_PATH to avoid interpreting the\n"
+     "  first @ as a peg revision indicator.\n"
     )},
     {'r', 'q', 'N', opt_depth, opt_force, opt_native_eol, opt_ignore_externals,
      opt_ignore_keywords},
@@ -1356,8 +1374,8 @@ svn_cl__cmd_table_main[] =
 
   { "mkdir", svn_cl__mkdir, {0}, {N_(
      "Create a new directory under version control.\n"
-     "usage: 1. mkdir PATH...\n"
-     "       2. mkdir URL...\n"
+     "usage: 1. mkdir PATH[@]...\n"
+     "       2. mkdir URL[@]...\n"
      "\n"), N_(
      "  Create version controlled directories.\n"
      "\n"), N_(
@@ -1369,12 +1387,16 @@ svn_cl__cmd_table_main[] =
      "\n"), N_(
      "  In both cases, all the intermediate directories must already exist,\n"
      "  unless the --parents option is given.\n"
+    ), N_(
+     "  If PATH or URL contains an @ character, an additional @ must be\n"
+     "  specified at the end of PATH/URL to avoid interpreting the\n"
+     "  first @ as a peg revision indicator.\n"
     )},
     {'q', opt_parents, SVN_CL__LOG_MSG_OPTIONS} },
 
   { "move", svn_cl__move, {"mv", "rename", "ren"}, {N_(
      "Move (rename) an item in a working copy or repository.\n"
-     "usage: move SRC... DST\n"
+     "usage: move SRC[@]... DST\n"
      "\n"), N_(
      "  SRC and DST can both be working copy (WC) paths or URLs:\n"
      "    WC  -> WC:  move an item in a working copy, as a local change to\n"
@@ -1390,6 +1412,10 @@ svn_cl__cmd_table_main[] =
      "  To avoid unnecessary conflicts, it is recommended to run 'svn 
update'\n"
      "  to update the subtree to a single revision before moving it.\n"
      "  The --allow-mixed-revisions option is provided for backward 
compatibility.\n"
+    ), N_(
+     "  If any SRC contains an @ character, an additional @ must be\n"
+     "  specified at the end of that SRC to avoid interpreting the\n"
+     "  first @ as a peg revision indicator. This does not apply to DST.\n"
     )},
     {'q', opt_force, opt_parents, opt_allow_mixed_revisions,
      SVN_CL__LOG_MSG_OPTIONS, 'r'},
@@ -1397,7 +1423,7 @@ svn_cl__cmd_table_main[] =
 
   { "patch", svn_cl__patch, {0}, {N_(
      "Apply a patch to a working copy.\n"
-     "usage: patch PATCHFILE [WCPATH]\n"
+     "usage: patch PATCHFILE [WCPATH[@]]\n"
      "\n"), N_(
      "  Apply a unidiff patch in PATCHFILE to the working copy WCPATH.\n"
      "  If WCPATH is omitted, '.' is assumed.\n"
@@ -1439,40 +1465,52 @@ svn_cl__cmd_table_main[] =
      "        To avoid rejects, first update to the revision N using\n"
      "        'svn update -r N', apply the patch, and then update back to 
the\n"
      "        HEAD revision. This way, conflicts can be resolved 
interactively.\n"
+    ), N_(
+     "  If WCPATH contains an @ character, an additional @ must be\n"
+     "  specified at the end of WCPATH to avoid interpreting the\n"
+     "  first @ as a peg revision indicator.\n"
     )},
     {'q', opt_dry_run, opt_strip, opt_reverse_diff,
      opt_ignore_whitespace} },
 
   { "propdel", svn_cl__propdel, {"pdel", "pd"}, {N_(
      "Remove a property from files, dirs, or revisions.\n"
-     "usage: 1. propdel PROPNAME [PATH...]\n"
-     "       2. propdel PROPNAME --revprop -r REV [TARGET]\n"
+     "usage: 1. propdel PROPNAME [PATH[@]...]\n"
+     "       2. propdel PROPNAME --revprop -r REV [TARGET[@]]\n"
      "\n"), N_(
      "  1. Removes versioned props in working copy.\n"
      "  2. Removes unversioned remote prop on repos revision.\n"
      "     TARGET only determines which repository to access.\n"
      "\n"), N_(
      "  See 'svn help propset' for descriptions of the svn:* special 
properties.\n"
+    ), N_(
+     "  If PATH or TARGET contains an @ character, an additional @ must be\n"
+     "  specified at the end of PATH or TARGET to avoid interpreting the\n"
+     "  first @ as a peg revision indicator.\n"
     )},
     {'q', 'R', opt_depth, 'r', opt_revprop, opt_changelist} },
 
   { "propedit", svn_cl__propedit, {"pedit", "pe"}, {N_(
      "Edit a property with an external editor.\n"
-     "usage: 1. propedit PROPNAME TARGET...\n"
-     "       2. propedit PROPNAME --revprop -r REV [TARGET]\n"
+     "usage: 1. propedit PROPNAME TARGET[@]...\n"
+     "       2. propedit PROPNAME --revprop -r REV [TARGET[@]]\n"
      "\n"), N_(
      "  1. Edits versioned prop in working copy or repository.\n"
      "  2. Edits unversioned remote prop on repos revision.\n"
      "     TARGET only determines which repository to access.\n"
      "\n"), N_(
      "  See 'svn help propset' for descriptions of the svn:* special 
properties.\n"
+    ), N_(
+     "  If TARGET contains an @ character, an additional @ must be\n"
+     "  specified at the end of TARGET to avoid interpreting the\n"
+     "  first @ as a peg revision indicator.\n"
     )},
     {'r', opt_revprop, SVN_CL__LOG_MSG_OPTIONS, opt_force} },
 
   { "propget", svn_cl__propget, {"pget", "pg"}, {N_(
      "Print the value of a property on files, dirs, or revisions.\n"
      "usage: 1. propget PROPNAME [TARGET[@REV]...]\n"
-     "       2. propget PROPNAME --revprop -r REV [TARGET]\n"
+     "       2. propget PROPNAME --revprop -r REV [TARGET[@]]\n"
      "\n"), N_(
      "  1. Prints versioned props. If specified, REV determines in which\n"
      "     revision the target is first looked up.\n"
@@ -1490,6 +1528,10 @@ svn_cl__cmd_table_main[] =
      "  (useful when redirecting a binary property value to a file, for 
example).\n"
      "\n"), N_(
      "  See 'svn help propset' for descriptions of the svn:* special 
properties.\n"
+    ), N_(
+     "  If TARGET contains an @ character, an additional @ must be\n"
+     "  specified at the end of TARGET to avoid interpreting the\n"
+     "  first @ as a peg revision indicator.\n"
     )},
     {'v', 'R', opt_depth, 'r', opt_revprop, opt_strict, opt_no_newline, 
opt_xml,
      opt_changelist, opt_show_inherited_props },
@@ -1499,7 +1541,7 @@ svn_cl__cmd_table_main[] =
   { "proplist", svn_cl__proplist, {"plist", "pl"}, {N_(
      "List all properties on files, dirs, or revisions.\n"
      "usage: 1. proplist [TARGET[@REV]...]\n"
-     "       2. proplist --revprop -r REV [TARGET]\n"
+     "       2. proplist --revprop -r REV [TARGET[@]]\n"
      "\n"), N_(
      "  1. Lists versioned props. If specified, REV determines in which\n"
      "     revision the target is first looked up.\n"
@@ -1510,6 +1552,10 @@ svn_cl__cmd_table_main[] =
      "  --verbose'.  With --quiet, the paths are not printed.\n"
      "\n"), N_(
      "  See 'svn help propset' for descriptions of the svn:* special 
properties.\n"
+    ), N_(
+     "  If TARGET contains an @ character, an additional @ must be\n"
+     "  specified at the end of TARGET to avoid interpreting the\n"
+     "  first @ as a peg revision indicator.\n"
     )},
     {'v', 'R', opt_depth, 'r', 'q', opt_revprop, opt_xml, opt_changelist,
      opt_show_inherited_props },
@@ -1518,8 +1564,8 @@ svn_cl__cmd_table_main[] =
 
   { "propset", svn_cl__propset, {"pset", "ps"}, {N_(
      "Set the value of a property on files, dirs, or revisions.\n"
-     "usage: 1. propset PROPNAME PROPVAL PATH...\n"
-     "       2. propset PROPNAME --revprop -r REV PROPVAL [TARGET]\n"
+     "usage: 1. propset PROPNAME PROPVAL PATH[@]...\n"
+     "       2. propset PROPNAME --revprop -r REV PROPVAL [TARGET[@]]\n"
      "\n"), N_(
      "  1. Changes a versioned file or directory property in a working copy.\n"
      "  2. Changes an unversioned property on a repository revision.\n"
@@ -1602,6 +1648,10 @@ svn_cl__cmd_table_main[] =
      "      The ambiguous format 'relative_path relative_path' is taken as\n"
      "      'relative_url relative_path' with peg revision support.\n"
      "      Lines starting with a '#' character are ignored.\n"
+    ), N_(
+     "  If PATH or TARGET contains an @ character, an additional @ must be\n"
+     "  specified at the end of PATH or TARGET to avoid interpreting the\n"
+     "  first @ as a peg revision indicator.\n"
     )},
     {'F', opt_encoding, 'q', 'r', opt_targets, 'R', opt_depth, opt_revprop,
      opt_force, opt_changelist },
@@ -1633,7 +1683,7 @@ svn_cl__cmd_table_main[] =
 
   { "resolve", svn_cl__resolve, {0}, {N_(
      "Resolve conflicts on working copy files or directories.\n"
-     "usage: resolve [PATH...]\n"
+     "usage: resolve [PATH[@]...]\n"
      "\n"), N_(
      "  By default, perform interactive conflict resolution on PATH.\n"
      "  In this mode, the command is recursive by default (depth 
'infinity').\n"
@@ -1682,6 +1732,10 @@ svn_cl__cmd_table_main[] =
      "  files manually or with 'svn merge'. It may be necessary to discard 
some\n"
      "  local changes with 'svn revert'. Files or directories might have to 
be\n"
      "  copied, deleted, or moved.\n"
+    ), N_(
+     "  If PATH contains an @ character, an additional @ must be\n"
+     "  specified at the end of PATH to avoid interpreting the\n"
+     "  first @ as a peg revision indicator.\n"
     )},
     {opt_targets, 'R', opt_depth, 'q', opt_accept},
     {{opt_accept, N_("specify automatic conflict resolution source\n"
@@ -1692,18 +1746,22 @@ svn_cl__cmd_table_main[] =
 
   { "resolved", svn_cl__resolved, {0}, {N_(
      "Remove 'conflicted' state on working copy files or directories.\n"
-     "usage: resolved PATH...\n"
+     "usage: resolved PATH[@]...\n"
      "\n"), N_(
      "  Note:  this subcommand does not semantically resolve conflicts or\n"
      "  remove conflict markers; it merely removes the conflict-related\n"
      "  artifact files and allows PATH to be committed again.  It has been\n"
      "  deprecated in favor of running 'svn resolve --accept working'.\n"
+    ), N_(
+     "  If PATH contains an @ character, an additional @ must be\n"
+     "  specified at the end of PATH to avoid interpreting the\n"
+     "  first @ as a peg revision indicator.\n"
     )},
     {opt_targets, 'R', opt_depth, 'q'} },
 
   { "revert", svn_cl__revert, {0}, {N_(
      "Restore pristine working copy state (undo local changes).\n"
-     "usage: revert PATH...\n"
+     "usage: revert PATH[@]...\n"
      "\n"), N_(
      "  Revert changes in the working copy at or within PATH, and remove\n"
      "  conflict markers as well, if any.\n"
@@ -1711,13 +1769,17 @@ svn_cl__cmd_table_main[] =
      "  This subcommand does not revert already committed changes.\n"
      "  For information about undoing already committed changes, search\n"
      "  the output of 'svn help merge' for 'undo'.\n"
+    ), N_(
+     "  If PATH contains an @ character, an additional @ must be\n"
+     "  specified at the end of PATH to avoid interpreting the\n"
+     "  first @ as a peg revision indicator.\n"
     )},
     {opt_targets, 'R', opt_depth, 'q', opt_changelist,
      opt_remove_added} },
 
   { "status", svn_cl__status, {"stat", "st"}, {N_(
      "Print the status of working copy files and directories.\n"
-     "usage: status [PATH...]\n"
+     "usage: status [PATH[@]...]\n"
      "\n"), N_(
      "  With no args, print only locally modified items (no network access).\n"
      "  With -q, print only summary information about locally modified 
items.\n"
@@ -1807,6 +1869,10 @@ svn_cl__cmd_table_main[] =
      "    !     C wc/qaz.c\n"
      "          >   local missing, incoming edit upon update\n"
      "    D       wc/qax.c\n"
+    ), N_(
+     "  If PATH contains an @ character, an additional @ must be\n"
+     "  specified at the end of PATH to avoid interpreting the\n"
+     "  first @ as a peg revision indicator.\n"
     )},
     { 'u', 'v', 'N', opt_depth, 'r', 'q', opt_no_ignore, opt_incremental,
       opt_xml, opt_ignore_externals, opt_changelist},
@@ -1865,16 +1931,20 @@ svn_cl__cmd_table_main[] =
 
   { "unlock", svn_cl__unlock, {0}, {N_(
      "Unlock working copy paths or URLs.\n"
-     "usage: unlock TARGET...\n"
+     "usage: unlock TARGET[@]...\n"
      "\n"), N_(
      "  Use --force to break a lock held by another user or working copy.\n"
+    ), N_(
+     "  If TARGET contains an @ character, an additional @ must be\n"
+     "  specified at the end of TARGET to avoid interpreting the\n"
+     "  first @ as a peg revision indicator.\n"
     )},
     { opt_targets, opt_force, 'q' },
     {{opt_force, N_("break locks")}} },
 
   { "update", svn_cl__update, {"up"},  {N_(
      "Bring changes from the repository into the working copy.\n"
-     "usage: update [PATH...]\n"
+     "usage: update [PATH[@]...]\n"
      "\n"), N_(
      "  If no revision is given, bring working copy up-to-date with HEAD 
rev.\n"
      "  Else synchronize working copy to revision given by -r.\n"
@@ -1918,6 +1988,10 @@ svn_cl__cmd_table_main[] =
      "\n"), N_(
      "  Use the --set-depth option to set a new working copy depth on the\n"
      "  targets of this operation.\n"
+    ), N_(
+     "  If PATH contains an @ character, an additional @ must be\n"
+     "  specified at the end of PATH to avoid interpreting the\n"
+     "  first @ as a peg revision indicator.\n"
     )},
     {'r', 'N', opt_depth, opt_set_depth, 'q', opt_merge_cmd, opt_force,
      opt_ignore_externals, opt_changelist, opt_editor_cmd, opt_accept,
@@ -1928,7 +2002,7 @@ svn_cl__cmd_table_main[] =
 
   { "upgrade", svn_cl__upgrade, {0}, {N_(
      "Upgrade the metadata storage format for a working copy.\n"
-     "usage: upgrade [WCPATH...]\n"
+     "usage: upgrade [WCPATH[@]...]\n"
      "\n"), N_(
      "  The upgraded working copy will be compatible with Subversion 1.8 and\n"
      "  newer (this default may change in the future). To upgrade to a 
different\n"
@@ -1939,6 +2013,10 @@ svn_cl__cmd_table_main[] =
      "  Only upgrades are supported, not downgrades.\n"
      "\n"), N_(
      "  Local modifications are preserved.\n"
+    ), N_(
+     "  If WCPATH contains an @ character, an additional @ must be\n"
+     "  specified at the end of WCPATH to avoid interpreting the\n"
+     "  first @ as a peg revision indicator.\n"
     )},
     { 'q', opt_compatible_version } },
 
@@ -2122,7 +2200,10 @@ parse_compatible_version(svn_cl__opt_sta
  * return SVN_NO_ERROR.
  */
 static svn_error_t *
-sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
+sub_main(int *exit_code,
+         int argc,
+         const svn_cmdline__argv_char_t *cmdline_argv[],
+         apr_pool_t *pool)
 {
   svn_error_t *err;
   int opt_id;
@@ -2148,12 +2229,15 @@ sub_main(int *exit_code, int argc, const
   apr_hash_t *cfg_hash;
   svn_membuf_t buf;
   svn_boolean_t read_pass_from_stdin = FALSE;
+  const char **argv;
 
   received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int));
 
   /* Check library versions */
   SVN_ERR(check_lib_versions());
 
+  SVN_ERR(svn_cmdline__get_cstring_argv(&argv, argc, cmdline_argv, pool));
+
 #if defined(WIN32) || defined(__CYGWIN__)
   /* Set the working copy administrative directory name. */
   if (getenv("SVN_ASP_DOT_NET_HACK"))
@@ -2265,81 +2349,18 @@ sub_main(int *exit_code, int argc, const
 
           for (i = 0; i < change_revs->nelts; i++)
             {
-              char *end;
-              svn_revnum_t changeno, changeno_end;
               const char *change_str =
                 APR_ARRAY_IDX(change_revs, i, const char *);
-              const char *s = change_str;
-              svn_boolean_t is_negative;
 
-              /* Check for a leading minus to allow "-c -r42".
-               * The is_negative flag is used to handle "-c -42" and "-c -r42".
-               * The "-c r-42" case is handled by strtol() returning a
-               * negative number. */
-              is_negative = (*s == '-');
-              if (is_negative)
-                s++;
-
-              /* Allow any number of 'r's to prefix a revision number. */
-              while (*s == 'r')
-                s++;
-              changeno = changeno_end = strtol(s, &end, 10);
-              if (end != s && *end == '-')
-                {
-                  if (changeno < 0 || is_negative)
-                    {
-                      return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR,
-                                               NULL,
-                                               _("Negative number in range 
(%s)"
-                                                 " not supported with -c"),
-                                               change_str);
-                    }
-                  s = end + 1;
-                  while (*s == 'r')
-                    s++;
-                  changeno_end = strtol(s, &end, 10);
-                }
-              if (end == change_str || *end != '\0')
+              if (svn_opt_parse_change_to_range(opt_state.revision_ranges,
+                                                change_str, pool) != 0)
                 {
                   return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                                           _("Non-numeric change argument (%s) 
"
-                                             "given to -c"), change_str);
-                }
-
-              if (changeno == 0)
-                {
-                  return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                                          _("There is no change 0"));
-                }
-
-              if (is_negative)
-                changeno = -changeno;
-
-              /* Figure out the range:
-                    -c N  -> -r N-1:N
-                    -c -N -> -r N:N-1
-                    -c M-N -> -r M-1:N for M < N
-                    -c M-N -> -r M:N-1 for M > N
-                    -c -M-N -> error (too confusing/no valid use case)
-              */
-              if (changeno > 0)
-                {
-                  if (changeno <= changeno_end)
-                    changeno--;
-                  else
-                    changeno_end--;
-                }
-              else
-                {
-                  changeno = -changeno;
-                  changeno_end = changeno - 1;
+                                           _("Syntax error in change argument "
+                                             "'%s'"), change_str);
                 }
 
               opt_state.used_change_arg = TRUE;
-              APR_ARRAY_PUSH(opt_state.revision_ranges,
-                             svn_opt_revision_range_t *)
-                = svn_opt__revision_range_from_revnums(changeno, changeno_end,
-                                                       pool);
             }
         }
         break;
@@ -3429,7 +3450,7 @@ sub_main(int *exit_code, int argc, const
 }
 
 int
-main(int argc, const char *argv[])
+SVN_CMDLINE__MAIN(int argc, const svn_cmdline__argv_char_t *argv[])
 {
   apr_pool_t *pool;
   int exit_code = EXIT_SUCCESS;

Modified: 
subversion/branches/pristine-checksum-kind/subversion/svnadmin/svnadmin.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svnadmin/svnadmin.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/svnadmin/svnadmin.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/svnadmin/svnadmin.c 
Fri Dec  6 13:59:05 2024
@@ -3053,7 +3053,10 @@ subcommand_build_repcache(apr_getopt_t *
  * return SVN_NO_ERROR.
  */
 static svn_error_t *
-sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
+sub_main(int *exit_code,
+         int argc,
+         const svn_cmdline__argv_char_t *cmdline_argv[],
+         apr_pool_t *pool)
 {
   svn_error_t *err;
   apr_status_t apr_err;
@@ -3065,12 +3068,15 @@ sub_main(int *exit_code, int argc, const
   apr_array_header_t *received_opts;
   int i;
   svn_boolean_t dash_F_arg = FALSE;
+  const char **argv;
 
   received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int));
 
   /* Check library versions */
   SVN_ERR(check_lib_versions());
 
+  SVN_ERR(svn_cmdline__get_cstring_argv(&argv, argc, cmdline_argv, pool));
+
   /* Initialize the FS library. */
   SVN_ERR(svn_fs_initialize(pool));
 
@@ -3450,7 +3456,7 @@ sub_main(int *exit_code, int argc, const
 }
 
 int
-main(int argc, const char *argv[])
+SVN_CMDLINE__MAIN(int argc, const svn_cmdline__argv_char_t *argv[])
 {
   apr_pool_t *pool;
   int exit_code = EXIT_SUCCESS;

Modified: 
subversion/branches/pristine-checksum-kind/subversion/svnbench/notify.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svnbench/notify.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/svnbench/notify.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/svnbench/notify.c Fri 
Dec  6 13:59:05 2024
@@ -241,6 +241,12 @@ notify(void *baton, const svn_wc_notify_
         goto print_error;
       break;
 
+    case svn_wc_notify_revert_noaccess:
+      if ((err = svn_cmdline_printf(pool, _("User doesn't have WRITE 
permissions to file '%s' and the file isn't svn:needslock. But the file is 
already writeable. Probably owned by another user."),
+                                    path_local)))
+        goto print_error;
+      break;
+
     case svn_wc_notify_failed_revert:
       if (( err = svn_cmdline_printf(pool, _("Failed to revert '%s' -- "
                                              "try updating instead.\n"),

Modified: 
subversion/branches/pristine-checksum-kind/subversion/svnbench/svnbench.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svnbench/svnbench.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/svnbench/svnbench.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/svnbench/svnbench.c 
Fri Dec  6 13:59:05 2024
@@ -386,7 +386,10 @@ add_search_pattern_group(svn_cl__opt_sta
  * return SVN_NO_ERROR.
  */
 static svn_error_t *
-sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
+sub_main(int *exit_code,
+         int argc,
+         const svn_cmdline__argv_char_t *cmdline_argv[],
+         apr_pool_t *pool)
 {
   svn_error_t *err;
   int opt_id;
@@ -405,6 +408,7 @@ sub_main(int *exit_code, int argc, const
   ra_progress_baton_t ra_progress_baton = {0};
   svn_membuf_t buf;
   svn_boolean_t read_pass_from_stdin = FALSE;
+  const char **argv;
 
   received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int));
 
@@ -414,6 +418,8 @@ sub_main(int *exit_code, int argc, const
   /* Check library versions */
   SVN_ERR(check_lib_versions());
 
+  SVN_ERR(svn_cmdline__get_cstring_argv(&argv, argc, cmdline_argv, pool));
+
 #if defined(WIN32) || defined(__CYGWIN__)
   /* Set the working copy administrative directory name. */
   if (getenv("SVN_ASP_DOT_NET_HACK"))
@@ -482,86 +488,26 @@ sub_main(int *exit_code, int argc, const
         break;
       case 'c':
         {
-          apr_array_header_t *change_revs =
-            svn_cstring_split(opt_arg, ", \n\r\t\v", TRUE, pool);
+          apr_array_header_t *change_revs;
+
+          SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+          change_revs = svn_cstring_split(utf8_opt_arg, ", \n\r\t\v", TRUE,
+                                          pool);
 
           for (i = 0; i < change_revs->nelts; i++)
             {
-              char *end;
-              svn_revnum_t changeno, changeno_end;
               const char *change_str =
                 APR_ARRAY_IDX(change_revs, i, const char *);
-              const char *s = change_str;
-              svn_boolean_t is_negative;
 
-              /* Check for a leading minus to allow "-c -r42".
-               * The is_negative flag is used to handle "-c -42" and "-c -r42".
-               * The "-c r-42" case is handled by strtol() returning a
-               * negative number. */
-              is_negative = (*s == '-');
-              if (is_negative)
-                s++;
-
-              /* Allow any number of 'r's to prefix a revision number. */
-              while (*s == 'r')
-                s++;
-              changeno = changeno_end = strtol(s, &end, 10);
-              if (end != s && *end == '-')
-                {
-                  if (changeno < 0 || is_negative)
-                    {
-                      return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR,
-                                               NULL,
-                                               _("Negative number in range 
(%s)"
-                                                 " not supported with -c"),
-                                               change_str);
-                    }
-                  s = end + 1;
-                  while (*s == 'r')
-                    s++;
-                  changeno_end = strtol(s, &end, 10);
-                }
-              if (end == change_str || *end != '\0')
+              if (svn_opt_parse_change_to_range(opt_state.revision_ranges,
+                                                change_str, pool) != 0)
                 {
                   return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                                           _("Non-numeric change argument (%s) 
"
-                                             "given to -c"), change_str);
-                }
-
-              if (changeno == 0)
-                {
-                  return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                                          _("There is no change 0"));
-                }
-
-              if (is_negative)
-                changeno = -changeno;
-
-              /* Figure out the range:
-                    -c N  -> -r N-1:N
-                    -c -N -> -r N:N-1
-                    -c M-N -> -r M-1:N for M < N
-                    -c M-N -> -r M:N-1 for M > N
-                    -c -M-N -> error (too confusing/no valid use case)
-              */
-              if (changeno > 0)
-                {
-                  if (changeno <= changeno_end)
-                    changeno--;
-                  else
-                    changeno_end--;
-                }
-              else
-                {
-                  changeno = -changeno;
-                  changeno_end = changeno - 1;
+                                           _("Syntax error in change argument "
+                                             "'%s'"), change_str);
                 }
 
               opt_state.used_change_arg = TRUE;
-              APR_ARRAY_PUSH(opt_state.revision_ranges,
-                             svn_opt_revision_range_t *)
-                = svn_opt__revision_range_from_revnums(changeno, changeno_end,
-                                                       pool);
             }
         }
         break;
@@ -1039,7 +985,7 @@ sub_main(int *exit_code, int argc, const
 }
 
 int
-main(int argc, const char *argv[])
+SVN_CMDLINE__MAIN(int argc, const svn_cmdline__argv_char_t *argv[])
 {
   apr_pool_t *pool;
   int exit_code = EXIT_SUCCESS;

Modified: 
subversion/branches/pristine-checksum-kind/subversion/svndumpfilter/svndumpfilter.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svndumpfilter/svndumpfilter.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- 
subversion/branches/pristine-checksum-kind/subversion/svndumpfilter/svndumpfilter.c
 (original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/svndumpfilter/svndumpfilter.c
 Fri Dec  6 13:59:05 2024
@@ -1291,7 +1291,10 @@ subcommand_include(apr_getopt_t *os, voi
  * return SVN_NO_ERROR.
  */
 static svn_error_t *
-sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
+sub_main(int *exit_code,
+         int argc,
+         const svn_cmdline__argv_char_t *cmdline_argv[],
+         apr_pool_t *pool)
 {
   svn_error_t *err;
   apr_status_t apr_err;
@@ -1302,10 +1305,13 @@ sub_main(int *exit_code, int argc, const
   int opt_id;
   apr_array_header_t *received_opts;
   int i;
+  const char **argv;
 
   /* Check library versions */
   SVN_ERR(check_lib_versions());
 
+  SVN_ERR(svn_cmdline__get_cstring_argv(&argv, argc, cmdline_argv, pool));
+
   received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int));
 
   /* Initialize the FS library. */
@@ -1564,7 +1570,7 @@ sub_main(int *exit_code, int argc, const
 }
 
 int
-main(int argc, const char *argv[])
+SVN_CMDLINE__MAIN(int argc, const svn_cmdline__argv_char_t *argv[])
 {
   apr_pool_t *pool;
   int exit_code = EXIT_SUCCESS;

Modified: 
subversion/branches/pristine-checksum-kind/subversion/svnfsfs/svnfsfs.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svnfsfs/svnfsfs.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/svnfsfs/svnfsfs.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/svnfsfs/svnfsfs.c Fri 
Dec  6 13:59:05 2024
@@ -228,7 +228,10 @@ subcommand__help(apr_getopt_t *os, void
  * return SVN_NO_ERROR.
  */
 static svn_error_t *
-sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
+sub_main(int *exit_code,
+         int argc,
+         const svn_cmdline__argv_char_t *cmdline_argv[],
+         apr_pool_t *pool)
 {
   svn_error_t *err;
   apr_status_t apr_err;
@@ -239,12 +242,15 @@ sub_main(int *exit_code, int argc, const
   int opt_id;
   apr_array_header_t *received_opts;
   int i;
+  const char **argv;
 
   received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int));
 
   /* Check library versions */
   SVN_ERR(check_lib_versions());
 
+  SVN_ERR(svn_cmdline__get_cstring_argv(&argv, argc, cmdline_argv, pool));
+
   /* Initialize the FS library. */
   SVN_ERR(svn_fs_initialize(pool));
 
@@ -473,7 +479,7 @@ sub_main(int *exit_code, int argc, const
 }
 
 int
-main(int argc, const char *argv[])
+SVN_CMDLINE__MAIN(int argc, const svn_cmdline__argv_char_t *argv[])
 {
   apr_pool_t *pool;
   int exit_code = EXIT_SUCCESS;

Modified: 
subversion/branches/pristine-checksum-kind/subversion/svnlook/svnlook.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svnlook/svnlook.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/svnlook/svnlook.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/svnlook/svnlook.c Fri 
Dec  6 13:59:05 2024
@@ -363,7 +363,7 @@ struct svnlook_opt_state
   const char *txn;
   svn_boolean_t version;          /* --version */
   svn_boolean_t show_ids;         /* --show-ids */
-  apr_size_t limit;               /* --limit */
+  int limit;                      /* --limit */
   svn_boolean_t help;             /* --help */
   svn_boolean_t no_diff_deleted;  /* --no-diff-deleted */
   svn_boolean_t no_diff_added;    /* --no-diff-added */
@@ -391,7 +391,7 @@ typedef struct svnlook_ctxt_t
   svn_fs_t *fs;
   svn_boolean_t is_revision;
   svn_boolean_t show_ids;
-  apr_size_t limit;
+  int limit;
   svn_boolean_t no_diff_deleted;
   svn_boolean_t no_diff_added;
   svn_boolean_t diff_copy_from;
@@ -1579,7 +1579,7 @@ struct print_history_baton
 {
   svn_fs_t *fs;
   svn_boolean_t show_ids;    /* whether to show node IDs */
-  apr_size_t limit;          /* max number of history items */
+  int limit;                 /* max number of history items */
   apr_size_t count;          /* number of history items processed */
 };
 
@@ -2466,7 +2466,10 @@ subcommand_uuid(apr_getopt_t *os, void *
  * return SVN_NO_ERROR.
  */
 static svn_error_t *
-sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
+sub_main(int *exit_code,
+         int argc,
+         const svn_cmdline__argv_char_t *cmdline_argv[],
+         apr_pool_t *pool)
 {
   svn_error_t *err;
   apr_status_t apr_err;
@@ -2477,12 +2480,15 @@ sub_main(int *exit_code, int argc, const
   int opt_id;
   apr_array_header_t *received_opts;
   int i;
+  const char **argv;
 
   received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int));
 
   /* Check library versions */
   SVN_ERR(check_lib_versions());
 
+  SVN_ERR(svn_cmdline__get_cstring_argv(&argv, argc, cmdline_argv, pool));
+
   /* Initialize the FS library. */
   SVN_ERR(svn_fs_initialize(pool));
 
@@ -2582,11 +2588,12 @@ sub_main(int *exit_code, int argc, const
 
         case 'l':
           {
-            char *end;
-            opt_state.limit = strtol(opt_arg, &end, 10);
-            if (end == opt_arg || *end != '\0')
+            const char *utf8_opt_arg;
+            SVN_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+            err = svn_cstring_atoi(&opt_state.limit, utf8_opt_arg);
+            if (err)
               {
-                return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, err ,
                                         _("Non-numeric limit argument given"));
               }
             if (opt_state.limit <= 0)
@@ -2849,7 +2856,7 @@ sub_main(int *exit_code, int argc, const
 }
 
 int
-main(int argc, const char *argv[])
+SVN_CMDLINE__MAIN(int argc, const svn_cmdline__argv_char_t *argv[])
 {
   apr_pool_t *pool;
   int exit_code = EXIT_SUCCESS;

Modified: 
subversion/branches/pristine-checksum-kind/subversion/svnmucc/svnmucc.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svnmucc/svnmucc.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/svnmucc/svnmucc.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/svnmucc/svnmucc.c Fri 
Dec  6 13:59:05 2024
@@ -286,7 +286,9 @@ help(FILE *stream, apr_pool_t *pool)
       "  mv SRC-URL DST-URL     : move SRC-URL to DST-URL\n"
       "  rm URL                 : delete URL\n"
       "  put SRC-FILE URL       : add or modify file URL with contents copied 
from\n"
-      "                           SRC-FILE (use \"-\" to read from standard 
input)\n"
+      "                           SRC-FILE (to read from standard input, use 
\"--\"\n"
+      "                           to stop option processing followed by \"-\" 
to\n"
+      "                           indicate standard input)\n"
       "  propset NAME VALUE URL : set property NAME on URL to VALUE\n"
       "  propsetf NAME FILE URL : set property NAME on URL to value read from 
FILE\n"
       "  propdel NAME URL       : delete property NAME from URL\n"
@@ -465,7 +467,10 @@ log_message_func(const char **log_msg,
  * return SVN_NO_ERROR.
  */
 static svn_error_t *
-sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
+sub_main(int *exit_code,
+         int argc,
+         const svn_cmdline__argv_char_t *cmdline_argv[],
+         apr_pool_t *pool)
 {
   apr_array_header_t *actions = apr_array_make(pool, 1,
                                                sizeof(struct action *));
@@ -531,10 +536,13 @@ sub_main(int *exit_code, int argc, const
   struct log_message_baton lmb;
   int i;
   svn_boolean_t read_pass_from_stdin = FALSE;
+  const char **argv;
 
   /* Check library versions */
   SVN_ERR(check_lib_versions());
 
+  SVN_ERR(svn_cmdline__get_cstring_argv(&argv, argc, cmdline_argv, pool));
+
   /* Initialize the RA library. */
   SVN_ERR(svn_ra_initialize(pool));
 
@@ -978,7 +986,7 @@ sub_main(int *exit_code, int argc, const
 }
 
 int
-main(int argc, const char *argv[])
+SVN_CMDLINE__MAIN(int argc, const svn_cmdline__argv_char_t *argv[])
 {
   apr_pool_t *pool;
   int exit_code = EXIT_SUCCESS;

Modified: 
subversion/branches/pristine-checksum-kind/subversion/svnrdump/svnrdump.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svnrdump/svnrdump.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/svnrdump/svnrdump.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/svnrdump/svnrdump.c 
Fri Dec  6 13:59:05 2024
@@ -784,7 +784,10 @@ validate_and_resolve_revisions(opt_baton
  * return SVN_NO_ERROR.
  */
 static svn_error_t *
-sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
+sub_main(int *exit_code,
+         int argc,
+         const svn_cmdline__argv_char_t *cmdline_argv[],
+         apr_pool_t *pool)
 {
   svn_error_t *err = SVN_NO_ERROR;
   const svn_opt_subcommand_desc3_t *subcommand = NULL;
@@ -806,6 +809,9 @@ sub_main(int *exit_code, int argc, const
   apr_array_header_t *received_opts;
   int i;
   svn_boolean_t read_pass_from_stdin = FALSE;
+  const char **argv;
+
+  SVN_ERR(svn_cmdline__get_cstring_argv(&argv, argc, cmdline_argv, pool));
 
   opt_baton = apr_pcalloc(pool, sizeof(*opt_baton));
   opt_baton->start_revision.kind = svn_opt_revision_unspecified;
@@ -1155,7 +1161,7 @@ sub_main(int *exit_code, int argc, const
 }
 
 int
-main(int argc, const char *argv[])
+SVN_CMDLINE__MAIN(int argc, const svn_cmdline__argv_char_t *argv[])
 {
   apr_pool_t *pool;
   int exit_code = EXIT_SUCCESS;

Modified: 
subversion/branches/pristine-checksum-kind/subversion/svnserve/svnserve.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svnserve/svnserve.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/svnserve/svnserve.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/svnserve/svnserve.c 
Fri Dec  6 13:59:05 2024
@@ -191,7 +191,7 @@ void winservice_notify_stop(void)
   if (winservice_svnserve_accept_socket != INVALID_SOCKET)
     closesocket(winservice_svnserve_accept_socket);
 }
-#endif /* _WIN32 */
+#endif /* WIN32 */
 
 
 /* Option codes and descriptions for svnserve.
@@ -574,9 +574,14 @@ accept_connection(connection_t **connect
     || APR_STATUS_IS_ECONNABORTED(status)
     || APR_STATUS_IS_ECONNRESET(status));
 
-  return status
-       ? svn_error_wrap_apr(status, _("Can't accept client connection"))
-       : SVN_NO_ERROR;
+  if (!status)
+    return SVN_NO_ERROR;
+#if APR_HAVE_SIGACTION
+  else if (sigtermint_seen)
+    return SVN_NO_ERROR;
+#endif
+  else
+    return svn_error_wrap_apr(status, _("Can't accept client connection"));
 }
 
 /* Add a reference to CONNECTION, i.e. keep it and it's pool valid unless
@@ -716,7 +721,10 @@ check_lib_versions(void)
  * return SVN_NO_ERROR.
  */
 static svn_error_t *
-sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
+sub_main(int *exit_code,
+         int argc,
+         const svn_cmdline__argv_char_t *cmdline_argv[],
+         apr_pool_t *pool)
 {
   enum run_mode run_mode = run_mode_unspecified;
   svn_boolean_t foreground = FALSE;
@@ -755,6 +763,8 @@ sub_main(int *exit_code, int argc, const
   svn_node_kind_t kind;
   apr_size_t min_thread_count = THREADPOOL_MIN_SIZE;
   apr_size_t max_thread_count = THREADPOOL_MAX_SIZE;
+  const char **argv;
+
 #ifdef SVN_HAVE_SASL
   SVN_ERR(cyrus_init(pool));
 #endif
@@ -762,6 +772,8 @@ sub_main(int *exit_code, int argc, const
   /* Check library versions */
   SVN_ERR(check_lib_versions());
 
+  SVN_ERR(svn_cmdline__get_cstring_argv(&argv, argc, cmdline_argv, pool));
+
   /* Initialize the FS library. */
   SVN_ERR(svn_fs_initialize(pool));
 
@@ -1417,7 +1429,7 @@ sub_main(int *exit_code, int argc, const
 }
 
 int
-main(int argc, const char *argv[])
+SVN_CMDLINE__MAIN(int argc, const svn_cmdline__argv_char_t *argv[])
 {
   apr_pool_t *pool;
   int exit_code = EXIT_SUCCESS;

Modified: 
subversion/branches/pristine-checksum-kind/subversion/svnsync/svnsync.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svnsync/svnsync.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- subversion/branches/pristine-checksum-kind/subversion/svnsync/svnsync.c 
(original)
+++ subversion/branches/pristine-checksum-kind/subversion/svnsync/svnsync.c Fri 
Dec  6 13:59:05 2024
@@ -1963,7 +1963,10 @@ help_cmd(apr_getopt_t *os, void *baton,
  * return SVN_NO_ERROR.
  */
 static svn_error_t *
-sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
+sub_main(int *exit_code,
+         int argc,
+         const svn_cmdline__argv_char_t *cmdline_argv[],
+         apr_pool_t *pool)
 {
   const svn_opt_subcommand_desc3_t *subcommand = NULL;
   apr_array_header_t *received_opts;
@@ -1978,10 +1981,13 @@ sub_main(int *exit_code, int argc, const
   apr_array_header_t *config_options = NULL;
   const char *source_prop_encoding = NULL;
   svn_boolean_t force_interactive = FALSE;
+  const char **argv;
 
   /* Check library versions */
   SVN_ERR(check_lib_versions());
 
+  SVN_ERR(svn_cmdline__get_cstring_argv(&argv, argc, cmdline_argv, pool));
+
   SVN_ERR(svn_ra_initialize(pool));
 
   /* Initialize the option baton. */
@@ -2402,7 +2408,7 @@ sub_main(int *exit_code, int argc, const
 }
 
 int
-main(int argc, const char *argv[])
+SVN_CMDLINE__MAIN(int argc, const svn_cmdline__argv_char_t *argv[])
 {
   apr_pool_t *pool;
   int exit_code = EXIT_SUCCESS;

Modified: 
subversion/branches/pristine-checksum-kind/subversion/svnversion/svnversion.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/svnversion/svnversion.c?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- 
subversion/branches/pristine-checksum-kind/subversion/svnversion/svnversion.c 
(original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/svnversion/svnversion.c 
Fri Dec  6 13:59:05 2024
@@ -124,7 +124,10 @@ check_lib_versions(void)
  * program.  Obviously we don't want to have to run svn when building svn.
  */
 static svn_error_t *
-sub_main(int *exit_code, int argc, const char *argv[], apr_pool_t *pool)
+sub_main(int *exit_code,
+         int argc,
+         const svn_cmdline__argv_char_t *cmdline_argv[],
+         apr_pool_t *pool)
 {
   const char *wc_path, *trail_url;
   const char *local_abspath;
@@ -146,10 +149,13 @@ sub_main(int *exit_code, int argc, const
        N_("no progress (only errors) to stderr")},
       {0,             0,  0,  0}
     };
+  const char **argv;
 
   /* Check library versions */
   SVN_ERR(check_lib_versions());
 
+  SVN_ERR(svn_cmdline__get_cstring_argv(&argv, argc, cmdline_argv, pool));
+
 #if defined(WIN32) || defined(__CYGWIN__)
   /* Set the working copy administrative directory name. */
   if (getenv("SVN_ASP_DOT_NET_HACK"))
@@ -289,7 +295,7 @@ sub_main(int *exit_code, int argc, const
 }
 
 int
-main(int argc, const char *argv[])
+SVN_CMDLINE__MAIN(int argc, const svn_cmdline__argv_char_t *argv[])
 {
   apr_pool_t *pool;
   int exit_code = EXIT_SUCCESS;

Propchange: subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec  6 13:59:05 2024
@@ -11,4 +11,3 @@ atomic-ra-revprop-change
 .libs
 .davautocheck.sh.stop
 lock-helper
-svneditor.sh

Modified: 
subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/basic_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/basic_tests.py?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- 
subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/basic_tests.py
 (original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/basic_tests.py
 Fri Dec  6 13:59:05 2024
@@ -705,8 +705,8 @@ def basic_conflict(sbox):
 
   # "Extra" files that we expect to result from the conflicts.
   # These are expressed as list of regexps.  What a cool system!  :-)
-  extra_files = ['mu.*\.r1', 'mu.*\.r2', 'mu.*\.mine',
-                 'rho.*\.r1', 'rho.*\.r2', 'rho.*\.mine',]
+  extra_files = [r'mu.*\.r1', r'mu.*\.r2', r'mu.*\.mine',
+                 r'rho.*\.r1', r'rho.*\.r2', r'rho.*\.mine',]
 
   # Do the update and check the results in three ways.
   # All "extra" files are passed to detect_conflict_files().
@@ -2267,11 +2267,11 @@ def automatic_conflict_resolution(sbox):
 
   # "Extra" files that we expect to result from the conflicts.
   # These are expressed as list of regexps.  What a cool system!  :-)
-  extra_files = ['mu.*\.r1', 'mu.*\.r2', 'mu.*\.mine',
-                 'lambda.*\.r1', 'lambda.*\.r2', 'lambda.*\.mine',
-                 'omega.*\.r1', 'omega.*\.r2', 'omega.*\.mine',
-                 'rho.*\.r1', 'rho.*\.r2', 'rho.*\.mine',
-                 'tau.*\.r1', 'tau.*\.r2', 'tau.*\.mine',
+  extra_files = [r'mu.*\.r1', r'mu.*\.r2', r'mu.*\.mine',
+                 r'lambda.*\.r1', r'lambda.*\.r2', r'lambda.*\.mine',
+                 r'omega.*\.r1', r'omega.*\.r2', r'omega.*\.mine',
+                 r'rho.*\.r1', r'rho.*\.r2', r'rho.*\.mine',
+                 r'tau.*\.r1', r'tau.*\.r2', r'tau.*\.mine',
                  ]
 
   # Do the update and check the results in three ways.
@@ -2347,7 +2347,7 @@ def automatic_conflict_resolution(sbox):
                                           ""]))
 
   # Set the expected extra files for the test
-  extra_files = ['omega.*\.r1', 'omega.*\.r2', 'omega.*\.mine',]
+  extra_files = [r'omega.*\.r1', r'omega.*\.r2', r'omega.*\.mine',]
 
   # Set the expected status for the test
   expected_status = svntest.actions.get_virginal_state(wc_backup, 2)
@@ -3293,6 +3293,60 @@ def keep_local_reverted_properly(sbox):
   svntest.actions.run_and_verify_status(wc_dir, expected_output)
 
 
+@SkipUnless(svntest.main.is_os_windows)
+def argv_with_best_fit_chars(sbox):
+  """argv with best fit chars"""
+
+  import ctypes
+  from ctypes import windll, wintypes
+
+  CP_ACP = 0
+  kernel32 = windll.kernel32
+  WideCharToMultiByte = kernel32.WideCharToMultiByte
+  WideCharToMultiByte.argtypes = [
+    wintypes.UINT, wintypes.DWORD, wintypes.LPCWSTR, ctypes.c_int,
+    wintypes.LPSTR, ctypes.c_int, wintypes.LPCSTR, wintypes.LPBOOL,
+  ]
+  WideCharToMultiByte.restype = ctypes.c_int
+  codepage = kernel32.GetACP()
+
+  def regexlines(*patterns):
+    return svntest.verify.RegexListOutput(list(patterns), match_all=True)
+
+  def iter_bestfit_chars():
+    chars = {b'"': 0, b'\\': 0, b' ': 0}
+    for c in range(0x80, 0x10000):
+      wcs = ctypes.create_unicode_buffer(chr(c))
+      mbcs = ctypes.create_string_buffer(8)
+      rc = WideCharToMultiByte(CP_ACP, 0, wcs, len(wcs), mbcs, len(mbcs), None,
+                               None)
+      if rc == 0:
+        continue
+      mbcs = mbcs.value
+      if chars.get(mbcs) != 0:
+        continue
+      chars[mbcs] = c
+      yield chr(c), mbcs
+
+  count = 0
+  expected_stderr = svntest.verify.RegexListOutput(
+    [r'^"foo.+bar": unknown command\.\n$', '\n'], match_all=True)
+  for wc, mbcs in iter_bestfit_chars():
+    count += 1
+    logger.info('Code page %r - U+%04x -> 0x%s', codepage, ord(wc), mbcs.hex())
+    if mbcs == b'"':
+      svntest.actions.run_and_verify_svn2(None, expected_stderr, 0, 'help',
+                                          'foo{0} {0}bar'.format(wc))
+    elif mbcs == b'\\':
+      svntest.actions.run_and_verify_svn2(None, expected_stderr, 0, 'help',
+                                          'foo{0}" {0}"bar'.format(wc))
+    elif mbcs == b' ':
+      svntest.actions.run_and_verify_svn2(None, expected_stderr, 0, 'help',
+                                          'foo{0}bar'.format(wc))
+  if count == 0:
+    raise svntest.Skip('No best fit characters in code page %r' % codepage)
+
+
 ########################################################################
 # Run the tests
 
@@ -3369,6 +3423,7 @@ test_list = [ None,
               null_prop_update_last_changed_revision,
               filtered_ls_top_level_path,
               keep_local_reverted_properly,
+              argv_with_best_fit_chars,
              ]
 
 if __name__ == '__main__':

Modified: 
subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/changelist_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/changelist_tests.py?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- 
subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/changelist_tests.py
 (original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/changelist_tests.py
 Fri Dec  6 13:59:05 2024
@@ -130,9 +130,9 @@ def clname_from_lastchar_cb(full_path):
 
 
 # Regular expressions for 'svn changelist' output.
-_re_cl_rem_pattern = "^D \[(.*)\] (.*)"
-_re_cl_skip = re.compile("Skipped '(.*)'")
-_re_cl_add  = re.compile("^A \[(.*)\] (.*)")
+_re_cl_rem_pattern = r"^D \[(.*)\] (.*)"
+_re_cl_skip = re.compile(r"Skipped '(.*)'")
+_re_cl_add  = re.compile(r"^A \[(.*)\] (.*)")
 _re_cl_rem  = re.compile(_re_cl_rem_pattern)
 
 def verify_changelist_output(output, expected_adds=None,

Modified: 
subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/checkout_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/checkout_tests.py?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- 
subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/checkout_tests.py
 (original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/checkout_tests.py
 Fri Dec  6 13:59:05 2024
@@ -882,8 +882,8 @@ def co_with_obstructing_local_adds(sbox)
     })
 
   # "Extra" files that we expect to result from the conflicts.
-  extra_files = ['eta\.r0', 'eta\.r2', 'eta\.mine',
-                 'kappa\.r0', 'kappa\.r2', 'kappa\.mine']
+  extra_files = [r'eta\.r0', r'eta\.r2', r'eta\.mine',
+                 r'kappa\.r0', r'kappa\.r2', r'kappa\.mine']
 
   # Perform the checkout and check the results in three ways.
   # We use --force here because run_and_verify_checkout() will delete

Modified: 
subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/copy_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/copy_tests.py?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- 
subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/copy_tests.py
 (original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/copy_tests.py
 Fri Dec  6 13:59:05 2024
@@ -1252,6 +1252,55 @@ def wc_copy_parent_into_child(sbox):
                                         expected_status)
 
 #----------------------------------------------------------------------
+@Issue(4913)
+def url_move_parent_into_child(sbox):
+  "move URL URL/subdir"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  B_url = sbox.repo_url + "/A/B"
+  F_url = sbox.repo_url + "/A/B/F"
+
+  expected_error = "svn: E200007: Cannot move path '.*%s' into its own " \
+                   "child '.*%s'" % (re.escape(B_url),
+                                     re.escape(F_url))
+  svntest.actions.run_and_verify_svn(None, expected_error,
+                                     'mv',
+                                     '-m', 'a can of worms',
+                                     B_url, F_url)
+
+#----------------------------------------------------------------------
+@Issue(4913)
+def wc_move_parent_into_child(sbox):
+  "move WC WC/subdir"
+
+  sbox.build(create_wc = False)
+  wc_dir = sbox.wc_dir
+
+  B_url = sbox.repo_url + "/A/B"
+  F_B_url = sbox.repo_url + "/A/B/F/B"
+
+  # Want a smaller WC
+  svntest.main.safe_rmtree(wc_dir)
+  svntest.actions.run_and_verify_svn(None, [],
+                                     'checkout',
+                                     B_url, wc_dir)
+
+  was_cwd = os.getcwd()
+  from_path = os.path.abspath(sbox.ospath(''))
+  to_path = os.path.abspath(sbox.ospath('F/B'))
+  os.chdir(wc_dir)
+  
+  expected_error = "svn: E200007: Cannot move path '%s' into its own " \
+                   "child '%s'" % (re.escape(from_path), re.escape(to_path))
+  svntest.actions.run_and_verify_svn(None, expected_error,
+                                     'mv',
+                                     from_path, to_path)
+
+  os.chdir(was_cwd)
+
+#----------------------------------------------------------------------
 # Issue 1419: at one point ra_neon->get_uuid() was failing on a
 # non-existent public URL, which prevented us from resurrecting files
 # (svn cp -rOLD URL wc).
@@ -1370,7 +1419,7 @@ def repos_to_wc_copy_eol_keywords(sbox):
   if re.match(b'[^\\r]\\n', raw_contents):
     raise svntest.Failure
 
-  if not re.match(b'.*\$LastChangedRevision:\s*\d+\s*\$', line_contents[3]):
+  if not re.match(b'.*\\$LastChangedRevision:\\s*\\d+\\s*\\$', 
line_contents[3]):
     raise svntest.Failure
 
 #-------------------------------------------------------------
@@ -5991,6 +6040,8 @@ test_list = [ None,
               copy_to_root,
               url_copy_parent_into_child,
               wc_copy_parent_into_child,
+              url_move_parent_into_child,
+              wc_move_parent_into_child,
               resurrect_deleted_file,
               diff_repos_to_wc_copy,
               repos_to_wc_copy_eol_keywords,

Modified: 
subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/diff_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/diff_tests.py?rev=1922345&r1=1922344&r2=1922345&view=diff
==============================================================================
--- 
subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/diff_tests.py
 (original)
+++ 
subversion/branches/pristine-checksum-kind/subversion/tests/cmdline/diff_tests.py
 Fri Dec  6 13:59:05 2024
@@ -833,7 +833,7 @@ def diff_head_of_moved_file(sbox):
     ' This is the file \'mu\'.\n',
     '+\n',
     '+Actually, it\'s a new mu.\n',
-    '\ No newline at end of file\n',
+    '\\ No newline at end of file\n',
   ]
 
   svntest.actions.run_and_verify_svn(expected_output, [],
@@ -1024,7 +1024,7 @@ def diff_base_to_repos(sbox):
     None, [], 'diff', '-r', 'BASE:2', wc_dir)
 
   # to do the comparison, remove all output lines starting with +++ or ---
-  re_infoline = re.compile('^(\+\+\+|---).*$')
+  re_infoline = re.compile(r'^(\+\+\+|---).*$')
   list1 = []
   list2 = []
 
@@ -4256,7 +4256,7 @@ def diff_dir_replaced_by_file(sbox):
     '+++ %s\t(working copy)\n' % sbox.path('A/B/E'),
     '@@ -0,0 +1 @@\n',
     '+text\n',
-    '\ No newline at end of file\n',
+    '\\ No newline at end of file\n',
   ]
 
   svntest.actions.run_and_verify_svn(expected_output, [],
@@ -4464,7 +4464,7 @@ def diff_local_missing_obstruction(sbox)
     'Added: K\n',
     '## -0,0 +1 ##\n',
     '+V\n',
-    '\ No newline at end of property\n',
+    '\\ No newline at end of property\n',
     'Index: %s\n' % (sbox.path('iota'),),
     '===================================================================\n',
     '--- %s\t(revision 1)\n' % (sbox.path('iota'),),
@@ -4475,7 +4475,7 @@ def diff_local_missing_obstruction(sbox)
     'Added: K\n',
     '## -0,0 +1 ##\n',
     '+V\n',
-    '\ No newline at end of property\n',
+    '\\ No newline at end of property\n',
   ]
   svntest.actions.run_and_verify_svn(expected_output, [], 'diff', wc_dir)
 
@@ -4639,7 +4639,7 @@ def diff_repo_repo_added_file_mime_type(
                         'Deleted: svn:mime-type\n',
                         '## -1 +0,0 ##\n',
                         '-text/plain\n',
-                        '\ No newline at end of property\n']
+                        '\\ No newline at end of property\n']
     svntest.actions.run_and_verify_svn(expected_output, [], 'diff',
                                        '-r2:1', newfile)
 
@@ -4661,7 +4661,7 @@ def diff_switched_file(sbox):
     '@@ -1 +1,2 @@\n',
     ' This is the file \'mu\'.\n',
     '+Mu????\n',
-    '\ No newline at end of file\n',
+    '\\ No newline at end of file\n',
   ]
   svntest.actions.run_and_verify_svn(expected_output, [],
                                      'diff', '-r', '1', sbox.ospath('iota'))
@@ -4676,7 +4676,7 @@ def diff_switched_file(sbox):
     '-This is the file \'iota\'.\n',
     '+This is the file \'mu\'.\n',
     '+Mu????\n',
-    '\ No newline at end of file\n',
+    '\\ No newline at end of file\n',
   ]
   svntest.actions.run_and_verify_svn(expected_output, [],
                                      'diff', '-r', '1', sbox.ospath(''))
@@ -4709,7 +4709,7 @@ def diff_parent_dir(sbox):
       'Deleted: A\n',
       '## -1 +0,0 ##\n',
       '-B\n',
-      '\ No newline at end of property\n',
+      '\\ No newline at end of property\n',
     ]
 
     svntest.actions.run_and_verify_svn(expected_output, [],
@@ -4726,7 +4726,7 @@ def diff_parent_dir(sbox):
       'Deleted: A\n',
       '## -1 +0,0 ##\n',
       '-B\n',
-      '\ No newline at end of property\n',
+      '\\ No newline at end of property\n',
     ]
 
     svntest.actions.run_and_verify_svn(expected_output, [],
@@ -4823,7 +4823,7 @@ def diff_local_copied_dir(sbox):
       'Added: p2\n',
       '## -0,0 +1 ##\n',
       '+v2\n',
-      '\ No newline at end of property\n',
+      '\\ No newline at end of property\n',
     ]
 
     svntest.actions.run_and_verify_svn(expected_output_C2, [],
@@ -5036,14 +5036,14 @@ def diff_symlinks(sbox):
     '+++ %s\t(working copy)\n' % sbox.path('to-iota'),
     '@@ -0,0 +1 @@\n',
     '+link iota\n',
-    '\ No newline at end of file\n',
+    '\\ No newline at end of file\n',
     '\n',
     'Property changes on: %s\n' % sbox.path('to-iota'),
     '___________________________________________________________________\n',
     'Added: svn:special\n',
     '## -0,0 +1 ##\n',
     '+*\n',
-    '\ No newline at end of property\n',
+    '\\ No newline at end of property\n',
   ], [], 'diff', wc_dir)
 
   svntest.actions.run_and_verify_svn([
@@ -5055,14 +5055,14 @@ def diff_symlinks(sbox):
     '+++ b/to-iota\t(working copy)\n',
     '@@ -0,0 +1 @@\n',
     '+iota\n',
-    '\ No newline at end of file\n',
+    '\\ No newline at end of file\n',
     '\n',
     'Property changes on: to-iota\n',
     '___________________________________________________________________\n',
     'Added: svn:special\n',
     '## -0,0 +1 ##\n',
     '+*\n',
-    '\ No newline at end of property\n',
+    '\\ No newline at end of property\n',
   ], [], 'diff', wc_dir, '--git')
 
   sbox.simple_commit()
@@ -5076,9 +5076,9 @@ def diff_symlinks(sbox):
     '+++ %s\t(working copy)\n' % sbox.path('to-iota'),
     '@@ -1 +1 @@\n',
     '-link iota\n',
-    '\ No newline at end of file\n',
+    '\\ No newline at end of file\n',
     '+link A/B/E/alpha\n',
-    '\ No newline at end of file\n',
+    '\\ No newline at end of file\n',
   ], [], 'diff', wc_dir)
 
   svntest.actions.run_and_verify_svn([
@@ -5090,9 +5090,9 @@ def diff_symlinks(sbox):
     '+++ b/to-iota\t(working copy)\n',
     '@@ -1 +1 @@\n',
     '-iota\n',
-    '\ No newline at end of file\n',
+    '\\ No newline at end of file\n',
     '+A/B/E/alpha\n',
-    '\ No newline at end of file\n',
+    '\\ No newline at end of file\n',
   ], [], 'diff', wc_dir, '--git')
 
 
@@ -5329,6 +5329,41 @@ def diff_nonexistent_in_wc(sbox):
   svntest.actions.run_and_verify_svn(expected_output_head_base, [],
                                      'diff', '-r', '1')
 
+def diff_invalid_change_arg(sbox):
+  "invalid change argument"
+
+  sbox.build()
+
+  svntest.actions.run_and_verify_svn(
+    None,
+    (r'.*svn: E205000: Syntax error in change argument \'--1\''),
+    'diff', sbox.wc_dir, '-c', '--1')
+
+  svntest.actions.run_and_verify_svn(
+    None,
+    (r'.*svn: E205000: Syntax error in change argument \'-r-1\''),
+    'diff', sbox.wc_dir, '-c', '-r-1')
+
+  svntest.actions.run_and_verify_svn(
+    None,
+    (r'.*svn: E205000: Syntax error in change argument \'1--3\''),
+    'diff', sbox.wc_dir, '-c', '1--3')
+
+  # 'r' is not a number
+  svntest.actions.run_and_verify_svn(
+    None,
+    (r'.*svn: E205000: Syntax error in change argument \'r1--r3\''),
+    'diff', sbox.wc_dir, '-c', 'r1--r3')
+
+  svntest.actions.run_and_verify_svn(
+    None,
+    (r'.*svn: E205000: Syntax error in change argument \'r1-r-3\''),
+    'diff', sbox.wc_dir, '-c', 'r1-r-3')
+
+  svntest.actions.run_and_verify_svn(
+    None,
+    (r'.*svn: E205000: Syntax error in change argument \'1-0\''),
+    'diff', sbox.wc_dir, '-c', '1-0')
 
 ########################################################################
 #Run the tests
@@ -5431,6 +5466,7 @@ test_list = [ None,
               diff_file_replaced_by_symlink,
               diff_git_format_copy,
               diff_nonexistent_in_wc,
+              diff_invalid_change_arg,
               ]
 
 if __name__ == '__main__':



Reply via email to