You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gb...@apache.org on 2013/10/24 17:11:08 UTC

svn commit: r1535404 [2/3] - in /subversion/branches/invoke-diff-cmd-feature: ./ build/generator/ notes/http-and-webdav/ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/org/apache/subversion/javahl/types/ subversion/bindings/swig/ruby...

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_repos/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_repos/log.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_repos/log.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_repos/log.c Thu Oct 24 15:11:06 2013
@@ -42,7 +42,6 @@
 #include "private/svn_mergeinfo_private.h"
 #include "private/svn_subr_private.h"
 
-
 
 svn_error_t *
 svn_repos_check_revision_access(svn_repos_revision_access_level_t *access_level,
@@ -69,8 +68,7 @@ svn_repos_check_revision_access(svn_repo
 
   /* Fetch the changes associated with REVISION. */
   SVN_ERR(svn_fs_revision_root(&rev_root, fs, revision, pool));
-  SVN_ERR(svn_fs_paths_changed3(&changes, rev_root,
-                                svn_move_behavior_explicit_moves, pool));
+  SVN_ERR(svn_fs_paths_changed2(&changes, rev_root, pool));
 
   /* No changed paths?  We're done. */
   if (apr_hash_count(changes) == 0)
@@ -155,6 +153,147 @@ svn_repos_check_revision_access(svn_repo
   return SVN_NO_ERROR;
 }
 
+/* Return TRUE, if CHANGE deleted the node previously found at its target
+   path. */
+static svn_boolean_t
+is_deletion(svn_log_changed_path2_t *change)
+{
+  /* We need a 'N' action here ... */
+  return change->action == 'E'
+      || change->action == 'R'
+      || change->action == 'D';
+}
+
+/* Change all moves in CHANGES to ADD.  Use POOL for temporary allocations.
+ */
+static void
+turn_moves_into_copies(apr_hash_t *changes,
+                       apr_pool_t *pool)
+{
+  apr_hash_index_t *hi;
+  for (hi = apr_hash_first(pool, changes); hi; hi = apr_hash_next(hi))
+    {
+      const char *key;
+      apr_ssize_t klen;
+      svn_log_changed_path2_t *change;
+      apr_hash_this(hi, (const void **)&key, &klen, (void**)&change);
+
+      switch (change->action)
+        {
+          case 'V':
+            change->action = 'A';
+            break;
+
+          case 'E':
+            change->action = 'R';
+            break;
+
+          default:
+            break;
+        }
+    }
+}
+
+/* Replace ADDs with MOVes, if they are unique, have a matching deletion
+ * and if the copy-from revision is REVISION-1.  Use POOL for temporary
+ * allocations.
+ */
+static void
+turn_unique_copies_into_moves(apr_hash_t *changes,
+                              svn_revnum_t revision,
+                              apr_pool_t *pool)
+{
+  apr_hash_index_t *hi;
+  apr_hash_t *unique_copy_sources;
+  const char **sources;
+  int i;
+
+  /* find all copy-from paths (ADD and MOV alike) */
+
+  svn_boolean_t any_deletion = FALSE;
+  apr_array_header_t *copy_sources
+    = apr_array_make(pool, apr_hash_count(changes), sizeof(const char*));
+
+  for (hi = apr_hash_first(pool, changes); hi; hi = apr_hash_next(hi))
+    {
+      svn_log_changed_path2_t *change;
+      apr_hash_this(hi, NULL, NULL, (void**)&change);
+
+      if (change->copyfrom_path && change->copyfrom_rev == revision-1)
+        APR_ARRAY_PUSH(copy_sources, const char *)
+          = change->copyfrom_path;
+
+      any_deletion |= is_deletion(change);
+    }
+
+  /* no suitable copy-from or no deletion -> no moves */
+
+  if (!copy_sources->nelts || !any_deletion)
+    return;
+
+  /* identify copy-from paths that have been mentioned exactly once */
+
+  sources = (const char **)copy_sources->elts;
+  qsort(sources, copy_sources->nelts, copy_sources->elt_size,
+        (int (*)(const void *, const void *))svn_sort_compare_paths);
+
+  unique_copy_sources = apr_hash_make(pool);
+  for (i = 0; i < copy_sources->nelts; ++i)
+    if (   (i == 0 || strcmp(sources[i-1], sources[i]))
+        && (i == copy_sources->nelts-1 || strcmp(sources[i+1], sources[i])))
+      {
+        apr_hash_set(unique_copy_sources, sources[i],
+                     APR_HASH_KEY_STRING, sources[i]);
+      }
+
+  /* no unique copy-from paths -> no moves */
+
+  if (!apr_hash_count(unique_copy_sources))
+    return;
+
+  /* Replace all additions, replacements with a unique copy-from path,
+     the correct copy-from rev and a matching deletion in this revision,
+     with moves and move-replacements, respectively. */
+
+  for (hi = apr_hash_first(pool, changes); hi; hi = apr_hash_next(hi))
+    {
+      const char *key;
+      apr_ssize_t klen;
+      svn_log_changed_path2_t *change, *copy_from_change;
+
+      apr_hash_this(hi, (const void **)&key, &klen, (void**)&change);
+      if (   change->copyfrom_rev != revision-1
+          || !change->copyfrom_path
+          || !apr_hash_get(unique_copy_sources, change->copyfrom_path,
+                           APR_HASH_KEY_STRING))
+        continue;
+
+      copy_from_change = apr_hash_get(changes, change->copyfrom_path,
+                                      APR_HASH_KEY_STRING);
+      if (!copy_from_change || !is_deletion(copy_from_change))
+        continue;
+
+      /* There is a deletion of the ADD's copy-from path in *REVISION*.
+         This can either be the same as in REVISION-1 (o.k.) or must have
+         been replaced by some other node.  However, that would imply that
+         it still got deleted as part of the replacement, i.e. both cases
+         are o.k. */
+
+      switch (change->action)
+        {
+          case 'A':
+            change->action = 'V';
+            break;
+
+          case 'R':
+            change->action = 'E';
+            break;
+
+          default:
+            break;
+        }
+    }
+}
 
 /* Store as keys in CHANGED the paths of all node in ROOT that show a
  * significant change.  "Significant" means that the text or
@@ -201,7 +340,7 @@ detect_changed(apr_hash_t **changed,
 
   *changed = svn_hash__make(pool);
   if (changes == NULL)
-    SVN_ERR(svn_fs_paths_changed3(&changes, root, move_behavior, pool));
+    SVN_ERR(svn_fs_paths_changed2(&changes, root, pool));
 
   if (apr_hash_count(changes) == 0)
     /* No paths changed in this revision?  Uh, sure, I guess the
@@ -368,6 +507,23 @@ detect_changed(apr_hash_t **changed,
     return svn_error_create(SVN_ERR_AUTHZ_UNREADABLE,
                             NULL, NULL);
 
+  /* at least some paths are readable.  Post-process them. */
+  switch(move_behavior)
+    {
+      case svn_move_behavior_no_moves:
+        turn_moves_into_copies(*changed, pool);
+        break;
+
+      case svn_move_behavior_auto_moves:
+        turn_unique_copies_into_moves(*changed,
+                                      svn_fs_revision_root_revision(root),
+                                      pool);
+        break;
+
+      default:
+        break;
+    }
+
   if (found_unreadable)
     /* At least one changed-path was unreadable. */
     return svn_error_create(SVN_ERR_AUTHZ_PARTIALLY_READABLE,
@@ -577,9 +733,7 @@ next_history_rev(const apr_array_header_
    catalogs describing how mergeinfo values on paths (which are the
    keys of those catalogs) were changed in REV.  If *PREFETCHED_CAHNGES
    already contains the changed paths for REV, use that.  Otherwise,
-   request that data and return it in *PREFETCHED_CHANGES.
-   MOVE_BEHAVIOR is a simple pass-through parameter that tells the FS
-   layer which changes to report as moves instead of additions. */
+   request that data and return it in *PREFETCHED_CHANGES. */
 /* ### TODO: This would make a *great*, useful public function,
    ### svn_repos_fs_mergeinfo_changed()!  -- cmpilato  */
 static svn_error_t *
@@ -588,7 +742,6 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
                      apr_hash_t **prefetched_changes,
                      svn_fs_t *fs,
                      svn_revnum_t rev,
-                     svn_move_behavior_t move_behavior,
                      apr_pool_t *result_pool,
                      apr_pool_t *scratch_pool)
 
@@ -609,8 +762,7 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
      narrow down our search. */
   SVN_ERR(svn_fs_revision_root(&root, fs, rev, scratch_pool));
   if (*prefetched_changes == NULL)
-    SVN_ERR(svn_fs_paths_changed3(prefetched_changes, root, move_behavior,
-                                  scratch_pool));
+    SVN_ERR(svn_fs_paths_changed2(prefetched_changes, root, scratch_pool));
 
   /* No changed paths?  We're done. */
   if (apr_hash_count(*prefetched_changes) == 0)
@@ -802,9 +954,7 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
    *ADDED_MERGEINFO and deleted mergeinfo in *DELETED_MERGEINFO.
    If *PREFETCHED_CAHNGES already contains the changed paths for
    REV, use that.  Otherwise, request that data and return it in
-   *PREFETCHED_CHANGES.  MOVE_BEHAVIOR tells the FS layer which
-   changes to report as moves instead of additions.
-   Use POOL for all allocations. */
+   *PREFETCHED_CHANGES.  Use POOL for all allocations. */
 static svn_error_t *
 get_combined_mergeinfo_changes(svn_mergeinfo_t *added_mergeinfo,
                                svn_mergeinfo_t *deleted_mergeinfo,
@@ -812,7 +962,6 @@ get_combined_mergeinfo_changes(svn_merge
                                svn_fs_t *fs,
                                const apr_array_header_t *paths,
                                svn_revnum_t rev,
-                               svn_move_behavior_t move_behavior,
                                apr_pool_t *result_pool,
                                apr_pool_t *scratch_pool)
 {
@@ -842,7 +991,7 @@ get_combined_mergeinfo_changes(svn_merge
   err = fs_mergeinfo_changed(&deleted_mergeinfo_catalog,
                              &added_mergeinfo_catalog,
                              prefetched_changes,
-                             fs, rev, move_behavior,
+                             fs, rev,
                              scratch_pool, scratch_pool);
   if (err)
     {
@@ -2050,7 +2199,7 @@ do_logs(svn_fs_t *fs,
                                                      &deleted_mergeinfo,
                                                      &changes,
                                                      fs, cur_paths,
-                                                     current, move_behavior,
+                                                     current,
                                                      iterpool, iterpool));
               has_children = (apr_hash_count(added_mergeinfo) > 0
                               || apr_hash_count(deleted_mergeinfo) > 0);

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/auth.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/auth.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/auth.c Thu Oct 24 15:11:06 2013
@@ -35,6 +35,7 @@
 #include "svn_config.h"
 #include "svn_dso.h"
 #include "svn_version.h"
+#include "private/svn_auth_private.h"
 #include "private/svn_dep_compat.h"
 
 #include "auth.h"
@@ -542,6 +543,11 @@ svn_auth_get_platform_specific_provider(
         {
           svn_auth_get_windows_ssl_server_trust_provider(provider, pool);
         }
+      else if (strcmp(provider_name, "windows") == 0 &&
+               strcmp(provider_type, "ssl_server_authority") == 0)
+        {
+          svn_auth__get_windows_ssl_server_authority_provider(provider, pool);
+        }
 #endif
     }
 
@@ -652,5 +658,22 @@ svn_auth_get_platform_specific_client_pr
         }
     }
 
+  /* Windows has two providers without a store to allow easy access to
+     SSL servers. We enable these unconditionally.
+     (This behavior was moved here from svn_cmdline_create_auth_baton()) */
+  SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
+                                                  "windows",
+                                                  "ssl_server_trust",
+                                                  pool));
+  SVN__MAYBE_ADD_PROVIDER(*providers, provider);
+
+  /* The windows ssl authority certificate CRYPTOAPI provider. */
+  SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
+                                                  "windows",
+                                                  "ssl_server_authority",
+                                                  pool));
+
+  SVN__MAYBE_ADD_PROVIDER(*providers, provider);
+
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/cmdline.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/cmdline.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/cmdline.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/cmdline.c Thu Oct 24 15:11:06 2013
@@ -34,6 +34,7 @@
 #else
 #include <crtdbg.h>
 #include <io.h>
+#include <conio.h>
 #endif
 
 #include <apr.h>                /* for STDIN_FILENO */
@@ -77,6 +78,14 @@ static const char *input_encoding = NULL
 
 /* The stdout encoding. If null, it's the same as the native encoding. */
 static const char *output_encoding = NULL;
+#elif defined(WIN32) && defined(_MSC_VER)
+/* For now limit this code to Visual C++, as the result is highly dependent
+   on the CRT implementation */
+#define USE_WIN32_CONSOLE_SHORTCUT
+
+/* When TRUE, stdout/stderr is directly connected to a console */
+static svn_boolean_t shortcut_stdout_to_console = FALSE;
+static svn_boolean_t shortcut_stderr_to_console = FALSE;
 #endif
 
 
@@ -254,6 +263,31 @@ svn_cmdline_init(const char *progname, F
       return EXIT_FAILURE;
     }
 
+#ifdef USE_WIN32_CONSOLE_SHORTCUT
+  if (_isatty(STDOUT_FILENO))
+    {
+      DWORD ignored;
+      HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
+
+       /* stdout is a char device handle, but is it the console? */
+       if (GetConsoleMode(stdout_handle, &ignored))
+        shortcut_stdout_to_console = TRUE;
+
+       /* Don't close stdout_handle */
+    }
+  if (_isatty(STDERR_FILENO))
+    {
+      DWORD ignored;
+      HANDLE stderr_handle = GetStdHandle(STD_ERROR_HANDLE);
+
+       /* stderr is a char device handle, but is it the console? */
+      if (GetConsoleMode(stderr_handle, &ignored))
+          shortcut_stderr_to_console = TRUE;
+
+      /* Don't close stderr_handle */
+    }
+#endif
+
   return EXIT_SUCCESS;
 }
 
@@ -347,6 +381,45 @@ svn_cmdline_fputs(const char *string, FI
   svn_error_t *err;
   const char *out;
 
+#ifdef USE_WIN32_CONSOLE_SHORTCUT
+  /* For legacy reasons the Visual C++ runtime converts output to the console
+     from the native 'ansi' encoding, to unicode, then back to 'ansi' and then
+     onwards to the console which is implemented as unicode.
+
+     For operations like 'svn status -v' this may cause about 70% of the total
+     processing time, with absolutely no gain.
+
+     For this specific scenario this shortcut exists. It has the nice side
+     effect of allowing full unicode output to the console.
+
+     Note that this shortcut is not used when the output is redirected, as in
+     that case the data is put on the pipe/file after the first conversion to
+     ansi. In this case the most expensive conversion is already avoided.
+   */
+  if ((stream == stdout && shortcut_stdout_to_console)
+      || (stream == stderr && shortcut_stderr_to_console))
+    {
+      WCHAR *result;
+
+      if (string[0] == '\0')
+        return SVN_NO_ERROR;
+
+      SVN_ERR(svn_cmdline_fflush(stream)); /* Flush existing output */
+
+      SVN_ERR(svn_utf__win32_utf8_to_utf16(&result, string, NULL, pool));
+
+      if (_cputws(result))
+        {
+          if (apr_get_os_error())
+          {
+            return svn_error_wrap_apr(apr_get_os_error(), _("Write error"));
+          }
+        }
+
+      return SVN_NO_ERROR;
+    }
+#endif
+
   err = svn_cmdline_cstring_from_utf8(&out, string, pool);
 
   if (err)
@@ -518,15 +591,6 @@ svn_cmdline_create_auth_baton(svn_auth_b
   svn_auth_get_username_provider(&provider, pool);
   APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
 
-  /* The server-cert, client-cert, and client-cert-password providers. */
-  SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
-                                                  "windows",
-                                                  "ssl_server_trust",
-                                                  pool));
-
-  if (provider)
-    APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
-
   svn_auth_get_ssl_server_trust_file_provider(&provider, pool);
   APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
   svn_auth_get_ssl_client_cert_file_provider(&provider, pool);

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/config.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/config.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/config.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/config.c Thu Oct 24 15:11:06 2013
@@ -264,9 +264,9 @@ get_category_config(svn_config_t **cfg,
     {
 #ifdef WIN32
       sys_reg_path = apr_pstrcat(pool, SVN_REGISTRY_SYS_CONFIG_PATH,
-                                 category, NULL);
+                                 category, (char *)NULL);
       usr_reg_path = apr_pstrcat(pool, SVN_REGISTRY_USR_CONFIG_PATH,
-                                 category, NULL);
+                                 category, (char *)NULL);
 #endif /* WIN32 */
 
       err = svn_config__sys_config_path(&sys_cfg_path, category, pool);
@@ -701,7 +701,9 @@ svn_config_set(svn_config_t *cfg,
    * Since we should never try to modify r/o data, trigger an assertion
    * in debug mode.
    */
-  assert(!cfg->read_only);
+#ifdef SVN_DEBUG
+  SVN_ERR_ASSERT_NO_RETURN(!cfg->read_only);
+#endif
   if (cfg->read_only)
     return;
 

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/config_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/config_file.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/config_file.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/config_file.c Thu Oct 24 15:11:06 2013
@@ -395,7 +395,8 @@ svn_config__sys_config_path(const char *
     const char *folder;
     SVN_ERR(svn_config__win_config_path(&folder, TRUE, pool));
     *path_p = svn_dirent_join_many(pool, folder,
-                                   SVN_CONFIG__SUBDIRECTORY, fname, NULL);
+                                   SVN_CONFIG__SUBDIRECTORY, fname,
+                                   (char *)NULL);
   }
 
 #elif defined(__HAIKU__)
@@ -408,11 +409,13 @@ svn_config__sys_config_path(const char *
       return SVN_NO_ERROR;
 
     *path_p = svn_dirent_join_many(pool, folder,
-                                   SVN_CONFIG__SYS_DIRECTORY, fname, NULL);
+                                   SVN_CONFIG__SYS_DIRECTORY, fname,
+                                   (char *)NULL);
   }
 #else  /* ! WIN32 && !__HAIKU__ */
 
-  *path_p = svn_dirent_join_many(pool, SVN_CONFIG__SYS_DIRECTORY, fname, NULL);
+  *path_p = svn_dirent_join_many(pool, SVN_CONFIG__SYS_DIRECTORY, fname,
+                                 (char *) NULL);
 
 #endif /* WIN32 */
 
@@ -1308,7 +1311,7 @@ svn_config_get_user_config_path(const ch
 
   if (config_dir)
     {
-      *path = svn_dirent_join_many(pool, config_dir, fname, NULL);
+      *path = svn_dirent_join_many(pool, config_dir, fname, (char *)NULL);
       return SVN_NO_ERROR;
     }
 
@@ -1317,7 +1320,7 @@ svn_config_get_user_config_path(const ch
     const char *folder;
     SVN_ERR(svn_config__win_config_path(&folder, FALSE, pool));
     *path = svn_dirent_join_many(pool, folder,
-                                 SVN_CONFIG__SUBDIRECTORY, fname, NULL);
+                                 SVN_CONFIG__SUBDIRECTORY, fname, (char *)NULL);
   }
 
 #elif defined(__HAIKU__)
@@ -1330,7 +1333,8 @@ svn_config_get_user_config_path(const ch
       return SVN_NO_ERROR;
 
     *path = svn_dirent_join_many(pool, folder,
-                                 SVN_CONFIG__USR_DIRECTORY, fname, NULL);
+                                 SVN_CONFIG__USR_DIRECTORY, fname,
+                                 (char *)NULL);
   }
 #else  /* ! WIN32 && !__HAIKU__ */
 
@@ -1340,7 +1344,7 @@ svn_config_get_user_config_path(const ch
       return SVN_NO_ERROR;
     *path = svn_dirent_join_many(pool,
                                svn_dirent_canonicalize(homedir, pool),
-                               SVN_CONFIG__USR_DIRECTORY, fname, NULL);
+                               SVN_CONFIG__USR_DIRECTORY, fname, (char*)NULL);
   }
 #endif /* WIN32 */
 

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/config_win.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/config_win.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/config_win.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/config_win.c Thu Oct 24 15:11:06 2013
@@ -44,10 +44,11 @@
 #include "svn_path.h"
 #include "svn_pools.h"
 #include "svn_utf.h"
+#include "private/svn_utf_private.h"
 
 svn_error_t *
 svn_config__win_config_path(const char **folder, int system_path,
-                            apr_pool_t *pool)
+                            apr_pool_t *result_pool)
 {
   /* ### Adding CSIDL_FLAG_CREATE here, because those folders really
      must exist.  I'm not too sure about the SHGFP_TYPE_CURRENT
@@ -56,8 +57,6 @@ svn_config__win_config_path(const char *
                      | CSIDL_FLAG_CREATE);
 
   WCHAR folder_ucs2[MAX_PATH];
-  int inwords, outbytes, outlength;
-  char *folder_utf8;
 
   if (S_OK != SHGetFolderPathW(NULL, csidl, NULL, SHGFP_TYPE_CURRENT,
                                folder_ucs2))
@@ -66,26 +65,8 @@ svn_config__win_config_path(const char *
                            ? "Can't determine the system config path"
                            : "Can't determine the user's config path"));
 
-  /* ### When mapping from UCS-2 to UTF-8, we need at most 3 bytes
-         per wide char, plus extra space for the nul terminator. */
-  inwords = lstrlenW(folder_ucs2);
-  outbytes = outlength = 3 * (inwords + 1);
-
-  folder_utf8 = apr_palloc(pool, outlength);
-
-  outbytes = WideCharToMultiByte(CP_UTF8, 0, folder_ucs2, inwords,
-                                 folder_utf8, outbytes, NULL, NULL);
-
-  if (outbytes == 0)
-    return svn_error_wrap_apr(apr_get_os_error(),
-                              "Can't convert config path to UTF-8");
-
-  /* Note that WideCharToMultiByte does _not_ terminate the
-     outgoing buffer. */
-  folder_utf8[outbytes] = '\0';
-  *folder = folder_utf8;
-
-  return SVN_NO_ERROR;
+  return svn_error_trace(svn_utf__win32_utf16_to_utf8(folder, folder_ucs2,
+                                                      NULL, result_pool));
 }
 
 
@@ -97,6 +78,8 @@ svn_config__win_config_path(const char *
 #define SVN_REG_DEFAULT_NAME_SIZE  2048
 #define SVN_REG_DEFAULT_VALUE_SIZE 8192
 
+/* ### This function should be converted to use the unicode functions
+   ### instead of the ansi functions */
 static svn_error_t *
 parse_section(svn_config_t *cfg, HKEY hkey, const char *section,
               svn_stringbuf_t *option, svn_stringbuf_t *value)

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/dirent_uri.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/dirent_uri.c Thu Oct 24 15:11:06 2013
@@ -2398,7 +2398,7 @@ svn_uri_get_dirent_from_file_url(const c
                                      "no path"), url);
 
         /* We still know that the path starts with a slash. */
-        *dirent = apr_pstrcat(pool, "//", hostname, dup_path, NULL);
+        *dirent = apr_pstrcat(pool, "//", hostname, dup_path, (char *)NULL);
       }
     else
       *dirent = dup_path;
@@ -2438,11 +2438,11 @@ svn_uri_get_file_url_from_dirent(const c
       /* Handle UNC paths //server/share -> file://server/share */
       assert(dirent[1] == '/'); /* Expect UNC, not non-absolute */
 
-      *url = apr_pstrcat(pool, "file:", dirent, NULL);
+      *url = apr_pstrcat(pool, "file:", dirent, (char *)NULL);
     }
   else
     {
-      char *uri = apr_pstrcat(pool, "file:///", dirent, NULL);
+      char *uri = apr_pstrcat(pool, "file:///", dirent, (char *)NULL);
       apr_size_t len = 8 /* strlen("file:///") */ + strlen(dirent);
 
       /* "C:/" is a canonical dirent on Windows,

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/error.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/error.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/error.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/error.c Thu Oct 24 15:11:06 2013
@@ -202,7 +202,8 @@ svn_error_wrap_apr(apr_status_t status,
       va_end(ap);
       if (msg_apr)
         {
-          err->message = apr_pstrcat(err->pool, msg, ": ", msg_apr, NULL);
+          err->message = apr_pstrcat(err->pool, msg, ": ", msg_apr,
+                                     (char *)NULL);
         }
       else
         {

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/io.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/io.c Thu Oct 24 15:11:06 2013
@@ -47,10 +47,6 @@
 #include <apr_portable.h>
 #include <apr_md5.h>
 
-#ifdef WIN32
-#include <arch/win32/apr_arch_file_io.h>
-#endif
-
 #if APR_HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
@@ -70,6 +66,8 @@
 
 #include "private/svn_atomic.h"
 #include "private/svn_io_private.h"
+#include "private/svn_utf_private.h"
+#include "private/svn_dep_compat.h"
 
 #define SVN_SLEEP_ENV_VAR "SVN_I_LOVE_CORRUPTED_WORKING_COPIES_SO_DISABLE_SLEEP_FOR_TIMESTAMPS"
 
@@ -150,7 +148,7 @@ static volatile svn_atomic_t win_dynamic
 /* Pointer to GetFinalPathNameByHandleW function from kernel32.dll. */
 typedef DWORD (WINAPI *GETFINALPATHNAMEBYHANDLE)(
                HANDLE hFile,
-               apr_wchar_t *lpszFilePath,
+               WCHAR *lpszFilePath,
                DWORD cchFilePath,
                DWORD dwFlags);
 
@@ -1693,27 +1691,13 @@ io_set_file_perms(const char *path,
 #endif /* !WIN32 && !__OS2__ */
 
 #ifdef WIN32
-#if APR_HAS_UNICODE_FS
-/* copy of the apr function utf8_to_unicode_path since apr doesn't export this one */
-static apr_status_t io_utf8_to_unicode_path(apr_wchar_t* retstr, apr_size_t retlen,
-                                            const char* srcstr)
-{
-    /* TODO: The computations could preconvert the string to determine
-     * the true size of the retstr, but that's a memory over speed
-     * tradeoff that isn't appropriate this early in development.
-     *
-     * Allocate the maximum string length based on leading 4
-     * characters of \\?\ (allowing nearly unlimited path lengths)
-     * plus the trailing null, then transform /'s into \\'s since
-     * the \\?\ form doesn't allow '/' path separators.
-     *
-     * Note that the \\?\ form only works for local drive paths, and
-     * \\?\UNC\ is needed UNC paths.
-     */
-    apr_size_t srcremains = strlen(srcstr) + 1;
-    apr_wchar_t *t = retstr;
-    apr_status_t rv;
-
+/* This is semantically the same as the APR utf8_to_unicode_path
+   function, but reimplemented here because APR does not export it. */
+static svn_error_t*
+io_utf8_to_unicode_path(const WCHAR **result,
+                        const char *source,
+                        apr_pool_t *result_pool)
+{
     /* This is correct, we don't twist the filename if it will
      * definitely be shorter than 248 characters.  It merits some
      * performance testing to see if this has any effect, but there
@@ -1728,132 +1712,119 @@ static apr_status_t io_utf8_to_unicode_p
      * Note that a utf-8 name can never result in more wide chars
      * than the original number of utf-8 narrow chars.
      */
-    if (srcremains > 248) {
-        if (srcstr[1] == ':' && (srcstr[2] == '/' || srcstr[2] == '\\')) {
-            wcscpy (retstr, L"\\\\?\\");
-            retlen -= 4;
-            t += 4;
-        }
-        else if ((srcstr[0] == '/' || srcstr[0] == '\\')
-              && (srcstr[1] == '/' || srcstr[1] == '\\')
-              && (srcstr[2] != '?')) {
-            /* Skip the slashes */
-            srcstr += 2;
-            srcremains -= 2;
-            wcscpy (retstr, L"\\\\?\\UNC\\");
-            retlen -= 8;
-            t += 8;
+    const WCHAR *prefix = NULL;
+    const int srclen = strlen(source);
+    WCHAR *buffer;
+
+    if (srclen > 248)
+    {
+        if (svn_ctype_isalpha(source[0]) && source[1] == ':'
+            && (source[2] == '/' || source[2] == '\\'))
+        {
+            /* This is an ordinary absolute path. */
+            prefix = L"\\\\?\\";
+        }
+        else if ((source[0] == '/' || source[0] == '\\')
+                 && (source[1] == '/' || source[1] == '\\')
+                 && source[2] != '?')
+        {
+            /* This is a UNC path */
+            source += 2;        /* Skip the leading slashes */
+            prefix = L"\\\\?\\UNC\\";
         }
     }
 
-    if (rv = apr_conv_utf8_to_ucs2(srcstr, &srcremains, t, &retlen)) {
-        return (rv == APR_INCOMPLETE) ? APR_EINVAL : rv;
-    }
-    if (srcremains) {
-        return APR_ENAMETOOLONG;
-    }
-    for (; *t; ++t)
-        if (*t == L'/')
-            *t = L'\\';
-    return APR_SUCCESS;
-}
-
-/* copy of the apr function unicode_to_utf8_path since apr doesn't export this
- * one */
-static apr_status_t io_unicode_to_utf8_path(char* retstr, apr_size_t retlen,
-                                            const apr_wchar_t* srcstr)
-{
+    SVN_ERR(svn_utf__win32_utf8_to_utf16(&(const WCHAR*)buffer, source,
+                                         prefix, result_pool));
+
+    /* Convert slashes to backslashes because the \\?\ path format
+       does not allow backslashes as path separators. */
+    *result = buffer;
+    for (; *buffer; ++buffer)
+    {
+        if (*buffer == '/')
+            *buffer = '\\';
+    }
+    return SVN_NO_ERROR;
+}
+
+/* This is semantically the same as the APR unicode_to_utf8_path
+   function, but reimplemented here because APR does not export it. */
+static svn_error_t *
+io_unicode_to_utf8_path(const char **result,
+                        const WCHAR *source,
+                        apr_pool_t *result_pool)
+{
+    const char *utf8_buffer;
+    char *buffer;
+
+    SVN_ERR(svn_utf__win32_utf16_to_utf8(&utf8_buffer, source,
+                                         NULL, result_pool));
+    if (!*utf8_buffer)
+      {
+        *result = utf8_buffer;
+        return SVN_NO_ERROR;
+      }
+
+    /* We know that the non-empty buffer returned from the UTF-16 to
+       UTF-8 conversion function is in fact writable. */
+    buffer = (char*)utf8_buffer;
+
     /* Skip the leading 4 characters if the path begins \\?\, or substitute
      * // for the \\?\UNC\ path prefix, allocating the maximum string
      * length based on the remaining string, plus the trailing null.
      * then transform \\'s back into /'s since the \\?\ form never
      * allows '/' path seperators, and APR always uses '/'s.
      */
-    apr_size_t srcremains = wcslen(srcstr) + 1;
-    apr_status_t rv;
-    char *t = retstr;
-    if (srcstr[0] == L'\\' && srcstr[1] == L'\\' && 
-        srcstr[2] == L'?'  && srcstr[3] == L'\\') {
-        if (srcstr[4] == L'U' && srcstr[5] == L'N' && 
-            srcstr[6] == L'C' && srcstr[7] == L'\\') {
-            srcremains -= 8;
-            srcstr += 8;
-            retstr[0] = '\\';
-            retstr[1] = '\\';
-            retlen -= 2;
-            t += 2;
-        }
-        else {
-            srcremains -= 4;
-            srcstr += 4;
-        }
-    }
-        
-    if ((rv = apr_conv_ucs2_to_utf8(srcstr, &srcremains, t, &retlen))) {
-        return rv;
-    }
-    if (srcremains) {
-        return APR_ENAMETOOLONG;
-    }
-    return APR_SUCCESS;
+    if (0 == strncmp(buffer, "\\\\?\\", 4))
+    {
+        buffer += 4;
+        if (0 == strncmp(buffer, "UNC\\", 4))
+        {
+            buffer += 2;
+            *buffer = '/';
+        }
+    }
+
+    *result = buffer;
+    for (; *buffer; ++buffer)
+    {
+        if (*buffer == '\\')
+            *buffer = '/';
+    }
+    return SVN_NO_ERROR;
 }
-#endif
 
-static apr_status_t io_win_file_attrs_set(const char *fname,
-                                          DWORD attributes,
-                                          DWORD attr_mask,
-                                          apr_pool_t *pool)
+static svn_error_t *
+io_win_file_attrs_set(const char *fname,
+                      DWORD attributes,
+                      DWORD attr_mask,
+                      apr_pool_t *pool)
 {
     /* this is an implementation of apr_file_attrs_set() but one
        that uses the proper Windows attributes instead of the apr
        attributes. This way, we can apply any Windows file and
        folder attributes even if apr doesn't implement them */
     DWORD flags;
-    apr_status_t rv;
-#if APR_HAS_UNICODE_FS
-    apr_wchar_t wfname[APR_PATH_MAX];
-#endif
+    const WCHAR *wfname;
 
-#if APR_HAS_UNICODE_FS
-    IF_WIN_OS_IS_UNICODE
-    {
-        if (rv = io_utf8_to_unicode_path(wfname,
-                                         sizeof(wfname) / sizeof(wfname[0]),
-                                         fname))
-            return rv;
-        flags = GetFileAttributesW(wfname);
-    }
-#endif
-#if APR_HAS_ANSI_FS
-    ELSE_WIN_OS_IS_ANSI
-    {
-        flags = GetFileAttributesA(fname);
-    }
-#endif
+    SVN_ERR(io_utf8_to_unicode_path(&wfname, fname, pool));
 
+    flags = GetFileAttributesW(wfname);
     if (flags == 0xFFFFFFFF)
-        return apr_get_os_error();
+        return svn_error_wrap_apr(apr_get_os_error(),
+                                  _("Can't get attributes of file '%s'"),
+                                  svn_dirent_local_style(fname, pool));
 
     flags &= ~attr_mask;
     flags |= (attributes & attr_mask);
 
-#if APR_HAS_UNICODE_FS
-    IF_WIN_OS_IS_UNICODE
-    {
-        rv = SetFileAttributesW(wfname, flags);
-    }
-#endif
-#if APR_HAS_ANSI_FS
-    ELSE_WIN_OS_IS_ANSI
-    {
-        rv = SetFileAttributesA(fname, flags);
-    }
-#endif
-
-    if (rv == 0)
-        return apr_get_os_error();
+    if (!SetFileAttributesW(wfname, flags))
+        return svn_error_wrap_apr(apr_get_os_error(),
+                                  _("Can't set attributes of file '%s'"),
+                                  svn_dirent_local_style(fname, pool));
 
-    return APR_SUCCESS;
+    return SVN_NO_ERROR;;
 }
 
 static svn_error_t *win_init_dynamic_imports(void *baton, apr_pool_t *pool)
@@ -1869,7 +1840,6 @@ static svn_error_t * io_win_read_link(sv
                                       const char *path,
                                       apr_pool_t *pool)
 {
-#if APR_HAS_UNICODE_FS
     SVN_ERR(svn_atomic__init_once(&win_dynamic_imports_state,
                                   win_init_dynamic_imports, NULL, pool));
 
@@ -1879,8 +1849,8 @@ static svn_error_t * io_win_read_link(sv
         apr_status_t status;
         apr_file_t *file;
         apr_os_file_t filehand;
-        apr_wchar_t wdest[APR_PATH_MAX];
-        char buf[APR_PATH_MAX];
+        WCHAR wdest[APR_PATH_MAX];
+        const char *data;
 
         /* reserve one char for terminating zero. */
         DWORD wdest_len = sizeof(wdest)/sizeof(wdest[0]) - 1;
@@ -1914,18 +1884,20 @@ static svn_error_t * io_win_read_link(sv
 
         /* GetFinaPathNameByHandleW doesn't add terminating NUL. */
         wdest[rv] = 0;
+        SVN_ERR(io_unicode_to_utf8_path(&data, wdest, pool));
 
-        status = io_unicode_to_utf8_path(buf, sizeof(buf), wdest);
-        if (status)
-          return svn_error_wrap_apr(status,
-                                    _("Can't read contents of link"));
-
-        *dest = svn_string_create(buf, pool);
+        /* The result is already in the correct pool, so avoid copying
+           it to create the string. */
+        *dest = svn_string_create_empty(pool);
+        if (*data)
+          {
+            (*dest)->data = data;
+            (*dest)->len = strlen(data);
+          }
 
         return SVN_NO_ERROR;
       }
     else
-#endif
       {
         return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
                                 _("Symbolic links are not supported on this "
@@ -1933,7 +1905,7 @@ static svn_error_t * io_win_read_link(sv
       }
 }
 
-#endif
+#endif /* WIN32 */
 
 svn_error_t *
 svn_io_set_file_read_write_carefully(const char *path,
@@ -3321,7 +3293,8 @@ svn_io_run_diff3_3(int *exitcode,
         svn_config_get(cfg, &diff_cmd, SVN_CONFIG_SECTION_HELPERS,
                        SVN_CONFIG_OPTION_DIFF_CMD, SVN_CLIENT_DIFF);
         SVN_ERR(cstring_to_utf8(&diff_utf8, diff_cmd, pool));
-        args[i++] = apr_pstrcat(pool, "--diff-program=", diff_utf8, NULL);
+        args[i++] = apr_pstrcat(pool, "--diff-program=", diff_utf8,
+                                (char *)NULL);
 #ifndef NDEBUG
         ++nargs;
 #endif
@@ -4203,22 +4176,26 @@ dir_make(const char *path, apr_fileperms
                                   APR_FILE_ATTR_HIDDEN,
                                   APR_FILE_ATTR_HIDDEN,
                                   pool);
-#else
-    /* on Windows, use our wrapper so we can also set the
-       FILE_ATTRIBUTE_NOT_CONTENT_INDEXED attribute */
-    status = io_win_file_attrs_set(path_apr,
-                                   FILE_ATTRIBUTE_HIDDEN |
-                                   FILE_ATTRIBUTE_NOT_CONTENT_INDEXED,
-                                   FILE_ATTRIBUTE_HIDDEN |
-                                   FILE_ATTRIBUTE_NOT_CONTENT_INDEXED,
-                                   pool);
-
-#endif
       if (status)
         return svn_error_wrap_apr(status, _("Can't hide directory '%s'"),
                                   svn_dirent_local_style(path, pool));
+#else
+    /* on Windows, use our wrapper so we can also set the
+       FILE_ATTRIBUTE_NOT_CONTENT_INDEXED attribute */
+      svn_error_t *err =
+          io_win_file_attrs_set(path_apr,
+                                FILE_ATTRIBUTE_HIDDEN |
+                                FILE_ATTRIBUTE_NOT_CONTENT_INDEXED,
+                                FILE_ATTRIBUTE_HIDDEN |
+                                FILE_ATTRIBUTE_NOT_CONTENT_INDEXED,
+                                pool);
+      if (err)
+        return svn_error_createf(err->apr_err, err,
+                                 _("Can't hide directory '%s'"),
+                                 svn_dirent_local_style(path, pool));
+#endif /* WIN32 */
     }
-#endif
+#endif /* APR_FILE_ATTR_HIDDEN */
 
 /* Windows does not implement sgid. Skip here because retrieving
    the file permissions via APR_FINFO_PROT | APR_FINFO_OWNER is documented

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/named_atomic.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/named_atomic.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/named_atomic.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/named_atomic.c Thu Oct 24 15:11:06 2013
@@ -413,8 +413,8 @@ svn_atomic_namespace__create(svn_atomic_
 
   /* construct the names of the system objects that we need
    */
-  shm_name = apr_pstrcat(subpool, name, SHM_NAME_SUFFIX, NULL);
-  lock_name = apr_pstrcat(subpool, name, MUTEX_NAME_SUFFIX, NULL);
+  shm_name = apr_pstrcat(subpool, name, SHM_NAME_SUFFIX, (char *)NULL);
+  lock_name = apr_pstrcat(subpool, name, MUTEX_NAME_SUFFIX, (char *)NULL);
 
   /* initialize the lock objects
    */
@@ -508,8 +508,8 @@ svn_atomic_namespace__cleanup(const char
   const char *shm_name, *lock_name;
 
   /* file names used for the specified namespace */
-  shm_name = apr_pstrcat(pool, name, SHM_NAME_SUFFIX, NULL);
-  lock_name = apr_pstrcat(pool, name, MUTEX_NAME_SUFFIX, NULL);
+  shm_name = apr_pstrcat(pool, name, SHM_NAME_SUFFIX, (char *)NULL);
+  lock_name = apr_pstrcat(pool, name, MUTEX_NAME_SUFFIX, (char *)NULL);
 
   /* remove these files if they exist */
   SVN_ERR(svn_io_remove_file2(shm_name, TRUE, pool));

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/nls.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/nls.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/nls.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/nls.c Thu Oct 24 15:11:06 2013
@@ -37,6 +37,8 @@
 #include "svn_pools.h"
 #include "svn_path.h"
 
+#include "private/svn_utf_private.h"
+
 #include "svn_private_config.h"
 
 svn_error_t *
@@ -53,69 +55,38 @@ svn_nls_init(void)
     {
 #ifdef WIN32
       WCHAR ucs2_path[MAX_PATH];
-      char* utf8_path;
+      const char* utf8_path;
       const char* internal_path;
-      apr_pool_t* pool;
-      apr_size_t inwords, outbytes, outlength;
+      apr_pool_t* scratch_pool;
 
-      pool = svn_pool_create(0);
+      scratch_pool = svn_pool_create(NULL);
       /* get exe name - our locale info will be in '../share/locale' */
-      inwords = GetModuleFileNameW(0, ucs2_path,
-                                   sizeof(ucs2_path) / sizeof(ucs2_path[0]));
-      if (! inwords)
+      GetModuleFileNameW(NULL, ucs2_path,
+          sizeof(ucs2_path) / sizeof(ucs2_path[0]))
+      if (apr_get_os_error())
         {
-          /* We must be on a Win9x machine, so attempt to get an ANSI path,
-             and convert it to Unicode. */
-          CHAR ansi_path[MAX_PATH];
-
-          if (GetModuleFileNameA(0, ansi_path, sizeof(ansi_path)))
-            {
-              inwords =
-                MultiByteToWideChar(CP_ACP, 0, ansi_path, -1, ucs2_path,
-                                    sizeof(ucs2_path) / sizeof(ucs2_path[0]));
-              if (! inwords)
-                {
-                err =
-                  svn_error_createf(APR_EINVAL, NULL,
-                                    _("Can't convert string to UCS-2: '%s'"),
-                                    ansi_path);
-                }
-            }
-          else
-            {
-              err = svn_error_create(APR_EINVAL, NULL,
-                                     _("Can't get module file name"));
-            }
+          err = svn_error_wrap_apr(apr_get_os_error()
+                                   _("Can't get module file name"));
         }
 
       if (! err)
-        {
-          outbytes = outlength = 3 * (inwords + 1);
-          utf8_path = apr_palloc(pool, outlength);
-
-          outbytes = WideCharToMultiByte(CP_UTF8, 0, ucs2_path, inwords,
-                                         utf8_path, outbytes, NULL, NULL);
+        err = svn_utf__win32_utf16_to_utf8(&utf8_path, ucs2_path,
+                                           NULL, scratch_pool);
 
-          if (outbytes == 0)
-            {
-              err = svn_error_wrap_apr(apr_get_os_error(),
-                                       _("Can't convert module path "
-                                         "to UTF-8 from UCS-2: '%s'"),
-                                       ucs2_path);
-            }
-          else
-            {
-              utf8_path[outlength - outbytes] = '\0';
-              internal_path = svn_dirent_internal_style(utf8_path, pool);
-              /* get base path name */
-              internal_path = svn_dirent_dirname(internal_path, pool);
-              internal_path = svn_dirent_join(internal_path,
-                                              SVN_LOCALE_RELATIVE_PATH,
-                                              pool);
-              bindtextdomain(PACKAGE_NAME, internal_path);
-            }
+      if (! err)
+        {
+          internal_path = svn_dirent_internal_style(utf8_path, scratch_pool);
+          /* get base path name */
+          internal_path = svn_dirent_dirname(internal_path, scratch_pool);
+          internal_path = svn_dirent_join(internal_path,
+                                          SVN_LOCALE_RELATIVE_PATH,
+                                          scratch_pool);
+          SVN_ERR(svn_dirent_get_absolute(&internal_path, internal_path,
+                                          scratch_pool));
+          bindtextdomain(PACKAGE_NAME, internal_path);
         }
-      svn_pool_destroy(pool);
+
+      svn_pool_destroy(scratch_pool);
     }
 #else /* ! WIN32 */
       bindtextdomain(PACKAGE_NAME, SVN_LOCALE_DIR);

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/sysinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/sysinfo.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/sysinfo.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/sysinfo.c Thu Oct 24 15:11:06 2013
@@ -23,14 +23,6 @@
 
 
 
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#define PSAPI_VERSION 1
-#include <windows.h>
-#include <psapi.h>
-#include <Ws2tcpip.h>
-#endif
-
 #define APR_WANT_STRFUNC
 #include <apr_want.h>
 
@@ -508,7 +500,7 @@ debian_release(apr_pool_t *pool)
       return NULL;
 
   stringbuf_first_line_only(buffer);
-  return apr_pstrcat(pool, "Debian ", buffer->data, NULL);
+  return apr_pstrcat(pool, "Debian ", buffer->data, (char *)NULL);
 }
 
 /* Try to find the Linux distribution name, or return info from uname. */
@@ -546,7 +538,7 @@ linux_release_name(apr_pool_t *pool)
 
 #ifdef WIN32
 typedef DWORD (WINAPI *FNGETNATIVESYSTEMINFO)(LPSYSTEM_INFO);
-typedef BOOL (WINAPI *FNENUMPROCESSMODULES) (HANDLE, HMODULE, DWORD, LPDWORD);
+typedef BOOL (WINAPI *FNENUMPROCESSMODULES) (HANDLE, HMODULE*, DWORD, LPDWORD);
 
 /* Get system and version info, and try to tell the difference
    between the native system type and the runtime environment of the
@@ -763,16 +755,36 @@ win32_release_name(apr_pool_t *pool)
 static HMODULE *
 enum_loaded_modules(apr_pool_t *pool)
 {
+  HMODULE psapi_dll = 0;
   HANDLE current = GetCurrentProcess();
   HMODULE dummy[1];
   HMODULE *handles;
   DWORD size;
+  FNENUMPROCESSMODULES EnumProcessModules_;
+
+  psapi_dll = GetModuleHandleA("psapi.dll");
+
+  if (!psapi_dll)
+    {
+      /* Load and never unload, just like static linking */
+      psapi_dll = LoadLibraryA("psapi.dll");
+    }
+
+  if (!psapi_dll)
+      return NULL;
+
+  EnumProcessModules_ = (FNENUMPROCESSMODULES)
+                              GetProcAddress(psapi_dll, "EnumProcessModules");
+
+  /* Before Windows XP psapi was an optional module */
+  if (! EnumProcessModules_)
+    return NULL;
 
-  if (!EnumProcessModules(current, dummy, sizeof(dummy), &size))
+  if (!EnumProcessModules_(current, dummy, sizeof(dummy), &size))
     return NULL;
 
   handles = apr_palloc(pool, size + sizeof *handles);
-  if (!EnumProcessModules(current, handles, size, &size))
+  if (! EnumProcessModules_(current, handles, size, &size))
     return NULL;
   handles[size / sizeof *handles] = NULL;
   return handles;

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/utf.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/utf.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/utf.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/utf.c Thu Oct 24 15:11:06 2013
@@ -1020,3 +1020,85 @@ svn_utf_cstring_from_utf8_string(const c
 
   return err;
 }
+
+
+#ifdef WIN32
+
+
+svn_error_t *
+svn_utf__win32_utf8_to_utf16(const WCHAR **result,
+                             const char *src,
+                             const WCHAR *prefix,
+                             apr_pool_t *result_pool)
+{
+  const int utf8_count = strlen(src);
+  const int prefix_len = (prefix ? lstrlenW(prefix) : 0);
+  WCHAR *wide_str;
+  int wide_count;
+
+  if (0 == prefix_len + utf8_count)
+    {
+      *result = L"";
+      return SVN_NO_ERROR;
+    }
+
+  wide_count = MultiByteToWideChar(CP_UTF8, 0, src, utf8_count, NULL, 0);
+  if (wide_count == 0)
+    return svn_error_wrap_apr(apr_get_os_error(),
+                              _("Conversion to UTF-16 failed"));
+
+  wide_str = apr_palloc(result_pool,
+                        (prefix_len + wide_count + 1) * sizeof(*wide_str));
+  if (prefix_len)
+    memcpy(wide_str, prefix, prefix_len * sizeof(*wide_str));
+  if (0 == MultiByteToWideChar(CP_UTF8, 0, src, utf8_count,
+                               wide_str + prefix_len, wide_count))
+    return svn_error_wrap_apr(apr_get_os_error(),
+                              _("Conversion to UTF-16 failed"));
+
+  wide_str[prefix_len + wide_count] = 0;
+  *result = wide_str;
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_utf__win32_utf16_to_utf8(const char **result,
+                             const WCHAR *src,
+                             const char *prefix,
+                             apr_pool_t *result_pool)
+{
+  const int wide_count = lstrlenW(src);
+  const int prefix_len = (prefix ? strlen(prefix) : 0);
+  char *utf8_str;
+  int utf8_count;
+
+  if (0 == prefix_len + wide_count)
+    {
+      *result = "";
+      return SVN_NO_ERROR;
+    }
+
+  utf8_count = WideCharToMultiByte(CP_UTF8, 0, src, wide_count,
+                                   NULL, 0, NULL, FALSE);
+  if (utf8_count == 0)
+    return svn_error_wrap_apr(apr_get_os_error(),
+                              _("Conversion from UTF-16 failed"));
+
+  utf8_str = apr_palloc(result_pool,
+                        (prefix_len + utf8_count + 1) * sizeof(*utf8_str));
+  if (prefix_len)
+    memcpy(utf8_str, prefix, prefix_len * sizeof(*utf8_str));
+  if (0 == WideCharToMultiByte(CP_UTF8, 0, src, wide_count,
+                               utf8_str + prefix_len, utf8_count,
+                               NULL, FALSE))
+    return svn_error_wrap_apr(apr_get_os_error(),
+                              _("Conversion from UTF-16 failed"));
+
+  utf8_str[prefix_len + utf8_count] = 0;
+  *result = utf8_str;
+
+  return SVN_NO_ERROR;
+}
+
+#endif /* WIN32 */

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/win32_crypto.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/win32_crypto.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/win32_crypto.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/win32_crypto.c Thu Oct 24 15:11:06 2013
@@ -436,8 +436,9 @@ windows_ssl_server_trust_first_credentia
                                            const char *realmstring,
                                            apr_pool_t *pool)
 {
-  apr_uint32_t *failures = svn_hash_gets(parameters,
-                                         SVN_AUTH_PARAM_SSL_SERVER_FAILURES);
+  apr_uint32_t *failure_ptr = svn_hash_gets(parameters,
+                                            SVN_AUTH_PARAM_SSL_SERVER_FAILURES);
+  apr_uint32_t failures = *failure_ptr;
   const svn_auth_ssl_server_cert_info_t *cert_info =
     svn_hash_gets(parameters, SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO);
 
@@ -445,7 +446,7 @@ windows_ssl_server_trust_first_credentia
   *iter_baton = NULL;
 
   /* We can accept only unknown certificate authority. */
-  if (*failures & SVN_AUTH_SSL_UNKNOWNCA)
+  if (failures & SVN_AUTH_SSL_UNKNOWNCA)
     {
       svn_boolean_t ok;
 
@@ -455,15 +456,16 @@ windows_ssl_server_trust_first_credentia
       if (ok)
         {
           /* Clear failure flag. */
-          *failures &= ~SVN_AUTH_SSL_UNKNOWNCA;
+          failures &= ~SVN_AUTH_SSL_UNKNOWNCA;
         }
     }
 
   /* If all failures are cleared now, we return the creds */
-  if (! *failures)
+  if (! failures)
     {
       svn_auth_cred_ssl_server_trust_t *creds =
         apr_pcalloc(pool, sizeof(*creds));
+      creds->accepted_failures = *failure_ptr & ~failures;
       creds->may_save = FALSE; /* No need to save it. */
       *credentials = creds;
     }
@@ -489,4 +491,24 @@ svn_auth_get_windows_ssl_server_trust_pr
   *provider = po;
 }
 
+static const svn_auth_provider_t windows_server_authority_provider = {
+    SVN_AUTH_CRED_SSL_SERVER_AUTHORITY,
+    windows_ssl_server_trust_first_credentials,
+    NULL,
+    NULL,
+};
+
+/* Public API */
+void
+svn_auth__get_windows_ssl_server_authority_provider(
+                            svn_auth_provider_object_t **provider,
+                            apr_pool_t *pool)
+{
+    svn_auth_provider_object_t *po = apr_pcalloc(pool, sizeof(*po));
+
+    po->vtable = &windows_server_authority_provider;
+    *provider = po;
+}
+
+
 #endif /* WIN32 */

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/win32_xlate.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/win32_xlate.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/win32_xlate.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_subr/win32_xlate.c Thu Oct 24 15:11:06 2013
@@ -47,9 +47,12 @@ typedef int win32_xlate__dummy;
 #include "svn_string.h"
 #include "svn_utf.h"
 #include "private/svn_atomic.h"
+#include "private/svn_subr_private.h"
 
 #include "win32_xlate.h"
 
+#include "svn_private_config.h"
+
 static svn_atomic_t com_initialized = 0;
 
 /* Initializes COM and keeps COM available until process exit.

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_wc/adm_files.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_wc/adm_files.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_wc/adm_files.c Thu Oct 24 15:11:06 2013
@@ -117,7 +117,7 @@ svn_wc__adm_child(const char *path,
                               path,
                               adm_dir_name,
                               child,
-                              NULL);
+                              (char *)NULL);
 }
 
 

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_wc/upgrade.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_wc/upgrade.c Thu Oct 24 15:11:06 2013
@@ -400,7 +400,7 @@ build_lockfile_path(const char *local_di
                               local_dir_abspath,
                               svn_wc_get_adm_dir(result_pool),
                               ADM_LOCK,
-                              NULL);
+                              (char *)NULL);
 }
 
 
@@ -1349,7 +1349,8 @@ bump_to_29(void *baton, svn_sqlite__db_t
   /* Rename all pristine files, adding a ".svn-base" suffix. */
   pristine_dir_abspath = svn_dirent_join_many(scratch_pool, wcroot_abspath,
                                               svn_wc_get_adm_dir(scratch_pool),
-                                              PRISTINE_STORAGE_RELPATH, NULL);
+                                              PRISTINE_STORAGE_RELPATH,
+                                              (char *)NULL);
   SVN_ERR(svn_io_dir_walk2(pristine_dir_abspath, APR_FINFO_MIN,
                            rename_pristine_file, NULL, scratch_pool));
 

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_wc/wc_db.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_wc/wc_db.c Thu Oct 24 15:11:06 2013
@@ -13456,7 +13456,7 @@ svn_wc__db_temp_wcroot_tempdir(const cha
                                            wcroot->abspath,
                                            svn_wc_get_adm_dir(scratch_pool),
                                            WCROOT_TEMPDIR_RELPATH,
-                                           NULL);
+                                           (char *)NULL);
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_wc/wc_db_pristine.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_wc/wc_db_pristine.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_wc/wc_db_pristine.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/libsvn_wc/wc_db_pristine.c Thu Oct 24 15:11:06 2013
@@ -67,7 +67,7 @@ get_pristine_fname(const char **pristine
                                           wcroot_abspath,
                                           svn_wc_get_adm_dir(scratch_pool),
                                           PRISTINE_STORAGE_RELPATH,
-                                          NULL);
+                                          (char *)NULL);
 
   /* We should have a valid checksum and (thus) a valid digest. */
   SVN_ERR_ASSERT(hexdigest != NULL);
@@ -85,7 +85,7 @@ get_pristine_fname(const char **pristine
                                            base_dir_abspath,
                                            subdir,
                                            hexdigest,
-                                           NULL);
+                                           (char *)NULL);
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/mod_authz_svn/mod_authz_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/mod_authz_svn/mod_authz_svn.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/mod_authz_svn/mod_authz_svn.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/mod_authz_svn/mod_authz_svn.c Thu Oct 24 15:11:06 2013
@@ -363,7 +363,7 @@ get_access_conf(request_rec *r, authz_sv
         {
           access_file = svn_dirent_join_many(scratch_pool, repos_path, "conf",
                                              conf->repo_relative_access_file,
-                                             NULL);
+                                             (char *)NULL);
         }
     }
   else

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/mod_dav_svn/authz.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/mod_dav_svn/authz.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/mod_dav_svn/authz.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/mod_dav_svn/authz.c Thu Oct 24 15:11:06 2013
@@ -57,7 +57,7 @@ dav_svn__allow_read(request_rec *r,
   /* Sometimes we get paths that do not start with '/' and
      hence below uri concatenation would lead to wrong uris .*/
   if (path && path[0] != '/')
-    path = apr_pstrcat(pool, "/", path, NULL);
+    path = apr_pstrcat(pool, "/", path, (char *)NULL);
 
   /* If bypass is specified and authz has exported the provider.
      Otherwise, we fall through to the full version.  This should be

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/mod_dav_svn/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/mod_dav_svn/merge.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/mod_dav_svn/merge.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/mod_dav_svn/merge.c Thu Oct 24 15:11:06 2013
@@ -115,7 +115,6 @@ static svn_error_t *
 do_resources(const dav_svn_repos *repos,
              svn_fs_root_t *root,
              svn_revnum_t revision,
-             svn_move_behavior_t move_behavior,
              ap_filter_t *output,
              apr_bucket_brigade *bb,
              apr_pool_t *pool)
@@ -130,7 +129,7 @@ do_resources(const dav_svn_repos *repos,
      and deleted things.  Also, note that deleted things don't merit
      responses of their own -- they are considered modifications to
      their parent.  */
-  SVN_ERR(svn_fs_paths_changed3(&changes, root, move_behavior, pool));
+  SVN_ERR(svn_fs_paths_changed2(&changes, root, pool));
 
   for (hi = apr_hash_first(pool, changes); hi; hi = apr_hash_next(hi))
     {
@@ -363,10 +362,7 @@ dav_svn__merge_response(ap_filter_t *out
          ### we can pass back the new version URL */
 
       /* and go make me proud, boy! */
-      serr = do_resources(repos, root, new_rev,
-                          /* report changes with no further interpretation */
-                          svn_move_behavior_explicit_moves,
-                          output, bb, pool);
+      serr = do_resources(repos, root, new_rev, output, bb, pool);
       if (serr != NULL)
         {
           return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/mod_dav_svn/reports/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/mod_dav_svn/reports/log.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/mod_dav_svn/reports/log.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/mod_dav_svn/reports/log.c Thu Oct 24 15:11:06 2013
@@ -87,6 +87,48 @@ maybe_send_header(struct log_receiver_ba
   return SVN_NO_ERROR;
 }
 
+/* Utility for log_receiver opening a new XML element in LRB's brigade
+   for LOG_ITEM and return the element's name in *ELEMENT.  Use POOL for
+   temporary allocations.
+
+   Call this function for items that may have a copy-from */
+static svn_error_t *
+start_path_with_copy_from(const char **element,
+                          struct log_receiver_baton *lrb,
+                          svn_log_changed_path2_t *log_item,
+                          apr_pool_t *pool)
+{
+  switch (log_item->action)
+    {
+      case 'A': *element = "S:added-path";
+                break;
+      case 'R': *element = "S:replaced-path";
+                break;
+      case 'V': *element = "S:moved-path";
+                break;
+      case 'E': *element = "S:replaced-by-moved-path";
+                break;
+
+      default:  /* Caller, you did wrong! */
+                SVN_ERR_MALFUNCTION();
+    }
+
+  if (log_item->copyfrom_path
+      && SVN_IS_VALID_REVNUM(log_item->copyfrom_rev))
+    SVN_ERR(dav_svn__brigade_printf
+            (lrb->bb, lrb->output,
+             "<%s copyfrom-path=\"%s\" copyfrom-rev=\"%ld\"",
+             *element,
+             apr_xml_quote_string(pool,
+                                  log_item->copyfrom_path,
+                                  1), /* escape quotes */
+             log_item->copyfrom_rev));
+  else
+    SVN_ERR(dav_svn__brigade_printf(lrb->bb, lrb->output, "<%s", *element));
+
+  return SVN_NO_ERROR;
+}
+
 
 /* This implements `svn_log_entry_receiver_t'.
    BATON is a `struct log_receiver_baton *'.  */
@@ -203,39 +245,11 @@ log_receiver(void *baton,
           switch (log_item->action)
             {
             case 'A':
-              if (log_item->copyfrom_path
-                  && SVN_IS_VALID_REVNUM(log_item->copyfrom_rev))
-                SVN_ERR(dav_svn__brigade_printf
-                        (lrb->bb, lrb->output,
-                         "<S:added-path copyfrom-path=\"%s\""
-                         " copyfrom-rev=\"%ld\"",
-                         apr_xml_quote_string(iterpool,
-                                              log_item->copyfrom_path,
-                                              1), /* escape quotes */
-                         log_item->copyfrom_rev));
-              else
-                SVN_ERR(dav_svn__brigade_puts(lrb->bb, lrb->output,
-                                              "<S:added-path"));
-
-              close_element = "S:added-path";
-              break;
-
             case 'R':
-              if (log_item->copyfrom_path
-                  && SVN_IS_VALID_REVNUM(log_item->copyfrom_rev))
-                SVN_ERR(dav_svn__brigade_printf
-                        (lrb->bb, lrb->output,
-                         "<S:replaced-path copyfrom-path=\"%s\""
-                         " copyfrom-rev=\"%ld\"",
-                         apr_xml_quote_string(iterpool,
-                                              log_item->copyfrom_path,
-                                              1), /* escape quotes */
-                         log_item->copyfrom_rev));
-              else
-                SVN_ERR(dav_svn__brigade_puts(lrb->bb, lrb->output,
-                                              "<S:replaced-path"));
-
-              close_element = "S:replaced-path";
+            case 'V':
+            case 'E':
+              SVN_ERR(start_path_with_copy_from(&close_element, lrb,
+                                                log_item, iterpool));
               break;
 
             case 'D':

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/mod_dav_svn/repos.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/mod_dav_svn/repos.c Thu Oct 24 15:11:06 2013
@@ -3618,11 +3618,11 @@ deliver(const dav_resource *resource, ap
                                     resource->info->repos->base_url,
                                     ap_escape_uri(resource->pool,
                                                   resource->info->r->uri),
-                                    NULL);
+                                    (char *)NULL);
               str_root = apr_pstrcat(resource->pool,
                                      resource->info->repos->base_url,
                                      resource->info->repos->root_path,
-                                     NULL);
+                                     (char *)NULL);
 
               serr = svn_subst_build_keywords3(&kw, keywords->data,
                                                str_cmt_rev, str_uri, str_root,

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/svn/info-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/svn/info-cmd.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/svn/info-cmd.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/svn/info-cmd.c Thu Oct 24 15:11:06 2013
@@ -115,7 +115,7 @@ print_info_xml(void *baton,
                                                    info->repos_root_URL,
                                                    info->URL, pool),
                                                pool),
-                                           NULL));
+                                           (char *)NULL));
     }
 
   if (info->repos_root_URL || info->repos_UUID)

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/svnauth/svnauth.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/svnauth/svnauth.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/svnauth/svnauth.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/svnauth/svnauth.c Thu Oct 24 15:11:06 2013
@@ -213,16 +213,16 @@ subcommand_help(apr_getopt_t *os, void *
                             footer, svn_dirent_local_style(config_path, pool));
 #endif
 #ifdef SVN_HAVE_GNOME_KEYRING
-      footer = apr_pstrcat(pool, footer, "  Gnome Keyring\n", NULL);
+      footer = apr_pstrcat(pool, footer, "  Gnome Keyring\n", (char *)NULL);
 #endif
 #ifdef SVN_HAVE_GPG_AGENT
-      footer = apr_pstrcat(pool, footer, "  GPG-Agent\n", NULL);
+      footer = apr_pstrcat(pool, footer, "  GPG-Agent\n", (char *)NULL);
 #endif
 #ifdef SVN_HAVE_KEYCHAIN_SERVICES
-      footer = apr_pstrcat(pool, footer, "  Mac OS X Keychain\n", NULL);
+      footer = apr_pstrcat(pool, footer, "  Mac OS X Keychain\n", (char *)NULL);
 #endif
 #ifdef SVN_HAVE_KWALLET
-      footer = apr_pstrcat(pool, footer, "  KWallet (KDE)\n", NULL);
+      footer = apr_pstrcat(pool, footer, "  KWallet (KDE)\n", (char *)NULL);
 #endif
     }
 

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/svnserve/serve.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/svnserve/serve.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/svnserve/serve.c Thu Oct 24 15:11:06 2013
@@ -2232,8 +2232,10 @@ static svn_error_t *log_cmd(svn_ra_svn_c
     move_behavior = (svn_move_behavior_t) move_behavior_param;
   else
     return svn_error_createf(SVN_ERR_RA_SVN_MALFORMED_DATA, NULL,
-                             _("Invalid move_behavior value %"
-                               APR_UINT64_T_FMT " in log command"),
+                             apr_psprintf(pool,
+                                          _("Invalid move_behavior value"
+                                            " %%%s in log command"),
+                                          APR_UINT64_T_FMT),
                              move_behavior_param);
 
   /* If we got an unspecified number then the user didn't send us anything,

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/entries-dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/entries-dump.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/entries-dump.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/entries-dump.c Thu Oct 24 15:11:06 2013
@@ -105,7 +105,7 @@ entries_dump(const char *dir_path, svn_w
       SVN_ERR(svn_wc__read_entries_old(&entries, dir_abspath, pool, pool));
       lockfile_path = svn_dirent_join_many(pool, dir_path,
                                            svn_wc_get_adm_dir(pool),
-                                           "lock", NULL);
+                                           "lock", (char *)NULL);
       SVN_ERR(svn_io_check_path(lockfile_path, &kind, pool));
       locked = (kind == svn_node_file);
     }

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/log_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/log_tests.py?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/log_tests.py (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/log_tests.py Thu Oct 24 15:11:06 2013
@@ -32,6 +32,7 @@ import svntest
 from svntest import wc
 
 from svntest.main import server_has_mergeinfo
+from svntest.main import server_has_auto_move
 from svntest.main import SVN_PROP_MERGEINFO
 from svntest.mergetrees import set_up_branch
 from diff_tests import make_diff_header, make_no_diff_deleted_header
@@ -407,7 +408,6 @@ def merge_history_repos(sbox):
   # Restore working directory
   os.chdir(was_cwd)
 
-
 # For errors seen while parsing log data.
 class SVNLogParseError(Exception):
   pass
@@ -2361,13 +2361,9 @@ def merge_sensitive_log_with_search(sbox
   }
   check_merge_results(log_chain, expected_merges)
 
-#----------------------------------------------------------------------
-# Test for issue #4355 'svn_client_log5 broken with multiple revisions
-# which span a rename'.
-@Issue(4355)
-@SkipUnless(server_has_mergeinfo)
-def log_multiple_revs_spanning_rename(sbox):
-  "log for multiple revs which span a rename"
+# Helper function for a few tests
+def create_renaming_history_repos(sbox):
+  "create a repository containing renames and a suitable working copy"
 
   sbox.build()
   wc_dir = sbox.wc_dir
@@ -2375,7 +2371,6 @@ def log_multiple_revs_spanning_rename(sb
   msg_file=os.path.abspath(msg_file)
   mu_path1 = os.path.join(wc_dir, 'A', 'mu')
   mu_path2 = os.path.join(wc_dir, 'trunk', 'mu')
-  trunk_path = os.path.join(wc_dir, 'trunk')
 
   # r2 - Change a file.
   msg=""" Log message for revision 2
@@ -2400,6 +2395,27 @@ def log_multiple_revs_spanning_rename(sb
   svntest.main.run_svn(None, 'ci', '-F', msg_file, wc_dir)
   svntest.main.run_svn(None, 'up', wc_dir)
 
+  # r5 - Cyclic exchange.
+  svntest.main.run_svn(None, 'up', wc_dir)
+  sbox.simple_move(os.path.join('trunk', 'D'), os.path.join('trunk', 'X'))
+  sbox.simple_move(os.path.join('trunk', 'C'), os.path.join('trunk', 'D'))
+  sbox.simple_move(os.path.join('trunk', 'X'), os.path.join('trunk', 'C'))
+  svntest.main.run_svn(None, 'ci', '-m', "Log message for revision 5",
+                       wc_dir)
+
+
+#----------------------------------------------------------------------
+# Test for issue #4355 'svn_client_log5 broken with multiple revisions
+# which span a rename'.
+@Issue(4355)
+@SkipUnless(server_has_mergeinfo)
+def log_multiple_revs_spanning_rename(sbox):
+  "log for multiple revs which span a rename"
+
+  trunk_path = sbox.ospath('trunk')
+
+  create_renaming_history_repos(sbox)
+
   # Check that log can handle a revision range that spans a rename.
   exit_code, output, err = svntest.actions.run_and_verify_svn(
     None, None, [], 'log', '-r2:4', sbox.repo_url + '/trunk/mu')
@@ -2440,6 +2456,8 @@ def log_multiple_revs_spanning_rename(sb
   log_chain = parse_log_output(output)
   check_log_chain(log_chain, [2,3,1])
 
+  mu_path2 = sbox.ospath('trunk/mu')
+
   # Should work with a WC target too.
   exit_code, output, err = svntest.actions.run_and_verify_svn(
     None, None, [], 'log', '-c2,3,1', mu_path2)
@@ -2489,6 +2507,54 @@ def log_multiple_revs_spanning_rename(sb
   log_chain = parse_log_output(output)
   check_log_chain(log_chain, [1,4])
 
+#----------------------------------------------------------------------
+def verify_move_log(sbox, flag, has_moves):
+  "result checker for log_auto_move"
+
+  trunk_path = os.path.join(sbox.wc_dir, 'trunk')
+
+  exit_code, output, err = svntest.actions.run_and_verify_svn(
+    None, None, [], 'log', '-r3', '-v', trunk_path, flag)
+  log_chain = parse_log_output(output)
+  check_log_chain(log_chain, [3], [2])
+
+  paths = log_chain[0]['paths']
+  if paths[0][0] != 'D' or paths[0][1] != '/A':
+    raise SVNLogParseError("Deletion of '/A' expected, %s of %s found" % paths[0])
+  if has_moves:
+    if paths[1][0] != 'V' or paths[1][1] != '/trunk (from /A:2)':
+      raise SVNLogParseError("Move of '/A' to '/trunk' expected, %s of %s found" % paths[1])
+  else:
+    if paths[1][0] != 'A' or paths[1][1] != '/trunk (from /A:2)':
+      raise SVNLogParseError("Addition of '/A' to '/trunk' expected, %s of %s found" % paths[1])
+
+  exit_code, output, err = svntest.actions.run_and_verify_svn(
+    None, None, [], 'log', '-r5', '-v', trunk_path, flag)
+  log_chain = parse_log_output(output)
+  check_log_chain(log_chain, [5], [2])
+
+  paths = log_chain[0]['paths']
+  if has_moves:
+    if paths[0][0] != 'E' or paths[0][1] != '/trunk/C (from /trunk/D:4)':
+      raise SVNLogParseError("Replacing move of '/trunk/C' with '/trunk/D' expected, %s of %s found" % paths[0])
+    if paths[1][0] != 'E' or paths[1][1] != '/trunk/D (from /trunk/C:4)':
+      raise SVNLogParseError("Replacing move of '/trunk/D' with '/trunk/C' expected, %s of %s found" % paths[1])
+  else:
+    if paths[0][0] != 'R' or paths[0][1] != '/trunk/C (from /trunk/D:4)':
+      raise SVNLogParseError("Replace of '/trunk/C' with '/trunk/D' expected, %s of %s found" % paths[0])
+    if paths[1][0] != 'R' or paths[1][1] != '/trunk/D (from /trunk/C:4)':
+      raise SVNLogParseError("Replace of '/trunk/D' with '/trunk/C' expected, %s of %s found" % paths[1])
+
+@Issue(4355)
+def log_auto_move(sbox):
+  "test --auto-moves flag"
+
+  create_renaming_history_repos(sbox)
+  verify_move_log(sbox, '--auto-moves', server_has_auto_move())
+  verify_move_log(sbox, '-v', 0)
+
+
+
 ########################################################################
 # Run the tests
 
@@ -2535,6 +2601,7 @@ test_list = [ None,
               log_search,
               merge_sensitive_log_with_search,
               log_multiple_revs_spanning_rename,
+              log_auto_move,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/svntest/main.py?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/cmdline/svntest/main.py Thu Oct 24 15:11:06 2013
@@ -1381,6 +1381,9 @@ def server_has_atomic_revprop():
 def server_has_reverse_get_file_revs():
   return options.server_minor_version >= 8
 
+def server_has_auto_move():
+  return options.server_minor_version >= 9
+
 def is_plaintext_password_storage_disabled():
   try:
     predicate = re.compile("^WARNING: Plaintext password storage is enabled!")

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/libsvn_client/client-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/libsvn_client/client-test.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/tests/libsvn_client/client-test.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/libsvn_client/client-test.c Thu Oct 24 15:11:06 2013
@@ -390,7 +390,8 @@ test_patch(const svn_test_opts_t *opts,
 
   /* Create the patch file. */
   patch_file_path = svn_dirent_join_many(pool, cwd,
-                                         "test-patch", "test-patch.diff", NULL);
+                                         "test-patch", "test-patch.diff",
+                                         (char *)NULL);
   SVN_ERR(svn_io_file_open(&patch_file, patch_file_path,
                            (APR_READ | APR_WRITE | APR_CREATE | APR_TRUNCATE),
                            APR_OS_DEFAULT, pool));

Modified: subversion/branches/invoke-diff-cmd-feature/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-cmd-feature/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c?rev=1535404&r1=1535403&r2=1535404&view=diff
==============================================================================
--- subversion/branches/invoke-diff-cmd-feature/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c (original)
+++ subversion/branches/invoke-diff-cmd-feature/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c Thu Oct 24 15:11:06 2013
@@ -304,7 +304,7 @@ pack_filesystem(const svn_test_opts_t *o
     {
       path = svn_dirent_join_many(pool, REPO_NAME, "revs",
                                   apr_psprintf(pool, "%d.pack", i / SHARD_SIZE),
-                                  "pack", NULL);
+                                  "pack", (char *)NULL);
 
       /* These files should exist. */
       SVN_ERR(svn_io_check_path(path, &kind, pool));
@@ -314,7 +314,7 @@ pack_filesystem(const svn_test_opts_t *o
 
       path = svn_dirent_join_many(pool, REPO_NAME, "revs",
                                   apr_psprintf(pool, "%d.pack", i / SHARD_SIZE),
-                                  "manifest", NULL);
+                                  "manifest", (char *)NULL);
       SVN_ERR(svn_io_check_path(path, &kind, pool));
       if (kind != svn_node_file)
         return svn_error_createf(SVN_ERR_FS_GENERAL, NULL,
@@ -324,7 +324,7 @@ pack_filesystem(const svn_test_opts_t *o
       /* This directory should not exist. */
       path = svn_dirent_join_many(pool, REPO_NAME, "revs",
                                   apr_psprintf(pool, "%d", i / SHARD_SIZE),
-                                  NULL);
+                                  (char *)NULL);
       SVN_ERR(svn_io_check_path(path, &kind, pool));
       if (kind != svn_node_none)
         return svn_error_createf(SVN_ERR_FS_GENERAL, NULL,
@@ -346,7 +346,7 @@ pack_filesystem(const svn_test_opts_t *o
   /* Finally, make sure the final revision directory does exist. */
   path = svn_dirent_join_many(pool, REPO_NAME, "revs",
                               apr_psprintf(pool, "%d", (i / SHARD_SIZE) + 1),
-                              NULL);
+                              (char *)NULL);
   SVN_ERR(svn_io_check_path(path, &kind, pool));
   if (kind != svn_node_none)
     return svn_error_createf(SVN_ERR_FS_GENERAL, NULL,
@@ -378,7 +378,7 @@ pack_even_filesystem(const svn_test_opts
   SVN_ERR(create_packed_filesystem(REPO_NAME, opts, MAX_REV, SHARD_SIZE,
                                    pool));
 
-  path = svn_dirent_join_many(pool, REPO_NAME, "revs", "2.pack", NULL);
+  path = svn_dirent_join_many(pool, REPO_NAME, "revs", "2.pack", (char *)NULL);
   SVN_ERR(svn_io_check_path(path, &kind, pool));
   if (kind != svn_node_dir)
     return svn_error_createf(SVN_ERR_FS_GENERAL, NULL,
@@ -692,7 +692,7 @@ recover_fully_packed(const svn_test_opts
                                    apr_psprintf(pool, "%ld/%ld",
                                                 after_rev / SHARD_SIZE,
                                                 after_rev),
-                                   NULL),
+                                   (char *)NULL),
               FALSE, pool));
   err = svn_fs_recover(REPO_NAME, NULL, NULL, pool);
   if (! err)

Propchange: subversion/branches/invoke-diff-cmd-feature/subversion/tests/libsvn_fs_x/
------------------------------------------------------------------------------
  Merged /subversion/trunk/subversion/tests/libsvn_fs_x:r1526469-1535403