You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/10/30 02:04:26 UTC

svn commit: r1536949 [4/6] - in /subversion/branches/fsfs-improvements: ./ build/ build/ac-macros/ build/generator/ notes/http-and-webdav/ subversion/bindings/javahl/ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/org/apache/subversi...

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_subr/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_subr/log.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_subr/log.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_subr/log.c Wed Oct 30 01:04:22 2013
@@ -45,7 +45,7 @@ log_depth(svn_depth_t depth, apr_pool_t 
 {
   if (depth == svn_depth_unknown)
     return "";
-  return apr_pstrcat(pool, " depth=", svn_depth_to_word(depth), (char *)NULL);
+  return apr_pstrcat(pool, " depth=", svn_depth_to_word(depth), SVN_VA_NULL);
 }
 
 static const char *

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_subr/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_subr/mergeinfo.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_subr/mergeinfo.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_subr/mergeinfo.c Wed Oct 30 01:04:22 2013
@@ -2566,7 +2566,7 @@ svn_mergeinfo__mergeinfo_from_segments(s
         continue;
 
       /* Prepend a leading slash to our path. */
-      source_path = apr_pstrcat(pool, "/", segment->path, (char *)NULL);
+      source_path = apr_pstrcat(pool, "/", segment->path, SVN_VA_NULL);
 
       /* See if we already stored ranges for this path.  If not, make
          a new list.  */

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_subr/named_atomic.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_subr/named_atomic.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_subr/named_atomic.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_subr/named_atomic.c Wed Oct 30 01:04:22 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, SVN_VA_NULL);
+  lock_name = apr_pstrcat(subpool, name, MUTEX_NAME_SUFFIX, SVN_VA_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, SVN_VA_NULL);
+  lock_name = apr_pstrcat(pool, name, MUTEX_NAME_SUFFIX, SVN_VA_NULL);
 
   /* remove these files if they exist */
   SVN_ERR(svn_io_remove_file2(shm_name, TRUE, pool));

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_subr/nls.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_subr/nls.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_subr/nls.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_subr/nls.c Wed Oct 30 01:04:22 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/fsfs-improvements/subversion/libsvn_subr/opt.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_subr/opt.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_subr/opt.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_subr/opt.c Wed Oct 30 01:04:22 2013
@@ -186,7 +186,7 @@ format_option(const char **string,
     opts = apr_psprintf(pool, "--%s", opt->name);
 
   if (opt->has_arg)
-    opts = apr_pstrcat(pool, opts, _(" ARG"), (char *)NULL);
+    opts = apr_pstrcat(pool, opts, _(" ARG"), SVN_VA_NULL);
 
   if (doc)
     opts = apr_psprintf(pool, "%-24s : %s", opts, _(opt->description));
@@ -933,7 +933,7 @@ svn_opt__args_to_target_array(apr_array_
             }
         }
 
-      target = apr_pstrcat(pool, true_target, peg_rev, (char *)NULL);
+      target = apr_pstrcat(pool, true_target, peg_rev, SVN_VA_NULL);
 
       APR_ARRAY_PUSH(output_targets, const char *) = target;
     }

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_subr/path.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_subr/path.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_subr/path.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_subr/path.c Wed Oct 30 01:04:22 2013
@@ -1304,7 +1304,7 @@ svn_path_resolve_repos_relative_url(cons
    * this function, which will remove any duplicate path separator.
    */
   *absolute_url = apr_pstrcat(pool, repos_root_url, relative_url + 1,
-                              (char *)NULL);
+                              SVN_VA_NULL);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_subr/sqlite.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_subr/sqlite.c Wed Oct 30 01:04:22 2013
@@ -707,9 +707,20 @@ svn_sqlite__finalize(svn_sqlite__stmt_t 
 svn_error_t *
 svn_sqlite__reset(svn_sqlite__stmt_t *stmt)
 {
-  SQLITE_ERR(sqlite3_reset(stmt->s3stmt), stmt->db);
-  SQLITE_ERR(sqlite3_clear_bindings(stmt->s3stmt), stmt->db);
+  /* No need to reset again after a first attempt */
   stmt->needs_reset = FALSE;
+
+  /* Clear bindings first, as there are no documented reasons
+     why this would ever fail, but keeping variable bindings
+     when reset is not what we expect. */
+  SQLITE_ERR(sqlite3_clear_bindings(stmt->s3stmt), stmt->db);
+
+  /* Reset last, as this *will* fail if the statement failed since
+     the last time it was reset, while reporting just the same failure.
+     (In this case the statement is also properly reset).
+
+     See the sqlite3_reset() documentation for more details. */
+  SQLITE_ERR(sqlite3_reset(stmt->s3stmt), stmt->db);
   return SVN_NO_ERROR;
 }
 
@@ -1426,3 +1437,9 @@ svn_sqlite__result_int64(svn_sqlite__con
 {
   sqlite3_result_int64(sctx->context, val);
 }
+
+void
+svn_sqlite__result_error(svn_sqlite__context_t *sctx, const char *msg, int num)
+{
+  sqlite3_result_error(sctx->context, msg, num);
+}

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_subr/sysinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_subr/sysinfo.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_subr/sysinfo.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_subr/sysinfo.c Wed Oct 30 01:04:22 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, SVN_VA_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/fsfs-improvements/subversion/libsvn_subr/time.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_subr/time.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_subr/time.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_subr/time.c Wed Oct 30 01:04:22 2013
@@ -34,6 +34,8 @@
 #include "svn_error.h"
 #include "svn_private_config.h"
 
+#include "private/svn_string_private.h"
+
 
 
 /*** Code. ***/
@@ -82,7 +84,7 @@
 /* Machine parseable part, generated by apr_snprintf. */
 #define HUMAN_TIMESTAMP_FORMAT "%.4d-%.2d-%.2d %.2d:%.2d:%.2d %+.2d%.2d"
 /* Human explanatory part, generated by apr_strftime as "Sat, 01 Jan 2000" */
-#define human_timestamp_format_suffix _(" (%a, %d %b %Y)")
+#define HUMAN_TIMESTAMP_FORMAT_SUFFIX _(" (%a, %d %b %Y)")
 
 const char *
 svn_time_to_cstring(apr_time_t when, apr_pool_t *pool)
@@ -135,24 +137,24 @@ svn_time_from_cstring(apr_time_t *when, 
   apr_time_exp_t exploded_time;
   apr_status_t apr_err;
   char wday[4], month[4];
-  char *c;
+  const char *c;
 
   /* Open-code parsing of the new timestamp format, as this
      is a hot path for reading the entries file.  This format looks
      like:  "2001-08-31T04:24:14.966996Z"  */
-  exploded_time.tm_year = (apr_int32_t) strtol(data, &c, 10);
+  exploded_time.tm_year = (apr_int32_t) svn__strtoul(data, &c);
   if (*c++ != '-') goto fail;
-  exploded_time.tm_mon = (apr_int32_t) strtol(c, &c, 10);
+  exploded_time.tm_mon = (apr_int32_t) svn__strtoul(c, &c);
   if (*c++ != '-') goto fail;
-  exploded_time.tm_mday = (apr_int32_t) strtol(c, &c, 10);
+  exploded_time.tm_mday = (apr_int32_t) svn__strtoul(c, &c);
   if (*c++ != 'T') goto fail;
-  exploded_time.tm_hour = (apr_int32_t) strtol(c, &c, 10);
+  exploded_time.tm_hour = (apr_int32_t) svn__strtoul(c, &c);
   if (*c++ != ':') goto fail;
-  exploded_time.tm_min = (apr_int32_t) strtol(c, &c, 10);
+  exploded_time.tm_min = (apr_int32_t) svn__strtoul(c, &c);
   if (*c++ != ':') goto fail;
-  exploded_time.tm_sec = (apr_int32_t) strtol(c, &c, 10);
+  exploded_time.tm_sec = (apr_int32_t) svn__strtoul(c, &c);
   if (*c++ != '.') goto fail;
-  exploded_time.tm_usec = (apr_int32_t) strtol(c, &c, 10);
+  exploded_time.tm_usec = (apr_int32_t) svn__strtoul(c, &c);
   if (*c++ != 'Z') goto fail;
 
   exploded_time.tm_year  -= 1900;
@@ -245,7 +247,7 @@ svn_time_to_human_cstring(apr_time_t whe
   ret = apr_strftime(human_datestr,
                      &retlen,
                      SVN_TIME__MAX_LENGTH - len,
-                     human_timestamp_format_suffix,
+                     HUMAN_TIMESTAMP_FORMAT_SUFFIX,
                      &exploded_time);
 
   /* If there was an error, ensure that the string is zero-terminated. */

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_subr/utf.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_subr/utf.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_subr/utf.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_subr/utf.c Wed Oct 30 01:04:22 2013
@@ -172,7 +172,7 @@ get_xlate_key(const char *topage,
     topage = "APR_DEFAULT_CHARSET";
 
   return apr_pstrcat(pool, "svn-utf-", frompage, "to", topage,
-                     "-xlate-handle", (char *)NULL);
+                     "-xlate-handle", SVN_VA_NULL);
 }
 
 /* Atomically replace the content in *MEM with NEW_VALUE and return
@@ -639,7 +639,7 @@ invalid_utf8(const char *data, apr_size_
     valid_txt = apr_pstrcat(pool, valid_txt,
                             apr_psprintf(pool, " %02x",
                                          (unsigned char)last[i-valid]),
-                                         (char *)NULL);
+                                         SVN_VA_NULL);
 
   /* 4 invalid octets will guarantee that the faulty octet is displayed */
   invalid = data + len - last;
@@ -649,7 +649,7 @@ invalid_utf8(const char *data, apr_size_
     invalid_txt = apr_pstrcat(pool, invalid_txt,
                               apr_psprintf(pool, " %02x",
                                            (unsigned char)last[i]),
-                                           (char *)NULL);
+                                           SVN_VA_NULL);
 
   return svn_error_createf(APR_EINVAL, NULL,
                            _("Valid UTF-8 data\n(hex:%s)\n"
@@ -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/fsfs-improvements/subversion/libsvn_subr/win32_crypto.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_subr/win32_crypto.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_subr/win32_crypto.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_subr/win32_crypto.c Wed Oct 30 01:04:22 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/fsfs-improvements/subversion/libsvn_subr/win32_xlate.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_subr/win32_xlate.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_subr/win32_xlate.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_subr/win32_xlate.c Wed Oct 30 01:04:22 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/fsfs-improvements/subversion/libsvn_wc/adm_files.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_wc/adm_files.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_wc/adm_files.c Wed Oct 30 01:04:22 2013
@@ -117,7 +117,7 @@ svn_wc__adm_child(const char *path,
                               path,
                               adm_dir_name,
                               child,
-                              NULL);
+                              SVN_VA_NULL);
 }
 
 

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_wc/externals.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_wc/externals.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_wc/externals.c Wed Oct 30 01:04:22 2013
@@ -1556,7 +1556,7 @@ svn_wc__resolve_relative_external_url(co
                         apr_pstrndup(scratch_pool, url, num_leading_slashes),
                         svn_relpath_canonicalize(url + num_leading_slashes,
                                                  scratch_pool),
-                        (char*)NULL);
+                        SVN_VA_NULL);
     }
   else
     {
@@ -1663,7 +1663,7 @@ svn_wc__resolve_relative_external_url(co
 
       SVN_ERR(uri_scheme(&scheme, repos_root_url, scratch_pool));
       *resolved_url = svn_uri_canonicalize(apr_pstrcat(scratch_pool, scheme,
-                                                       ":", url, (char *)NULL),
+                                                       ":", url, SVN_VA_NULL),
                                            result_pool);
       return SVN_NO_ERROR;
     }

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_wc/old-and-busted.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_wc/old-and-busted.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_wc/old-and-busted.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_wc/old-and-busted.c Wed Oct 30 01:04:22 2013
@@ -443,7 +443,7 @@ svn_wc__serialize_file_external(const ch
       SVN_ERR(opt_revision_to_string(&s1, path, peg_rev, pool));
       SVN_ERR(opt_revision_to_string(&s2, path, rev, pool));
 
-      s = apr_pstrcat(pool, s1, ":", s2, ":", path, (char *)NULL);
+      s = apr_pstrcat(pool, s1, ":", s2, ":", path, SVN_VA_NULL);
     }
   else
     s = NULL;

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_wc/relocate.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_wc/relocate.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_wc/relocate.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_wc/relocate.c Wed Oct 30 01:04:22 2013
@@ -148,7 +148,7 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct
   if (old_url_len == from_len)
     new_url = to;
   else
-    new_url = apr_pstrcat(scratch_pool, to, old_url + from_len, (char *)NULL);
+    new_url = apr_pstrcat(scratch_pool, to, old_url + from_len, SVN_VA_NULL);
   if (! svn_path_is_url(new_url))
     return svn_error_createf(SVN_ERR_WC_INVALID_RELOCATION, NULL,
                              _("Invalid relocation destination: '%s' "

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_wc/upgrade.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_wc/upgrade.c Wed Oct 30 01:04:22 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);
+                              SVN_VA_NULL);
 }
 
 
@@ -875,21 +875,21 @@ migrate_node_props(const char *dir_abspa
                                      apr_pstrcat(scratch_pool,
                                                  name,
                                                  SVN_WC__BASE_EXT,
-                                                 (char *)NULL),
+                                                 SVN_VA_NULL),
                                      scratch_pool);
 
       revert_abspath = svn_dirent_join(basedir_abspath,
                                        apr_pstrcat(scratch_pool,
                                                    name,
                                                    SVN_WC__REVERT_EXT,
-                                                   (char *)NULL),
+                                                   SVN_VA_NULL),
                                        scratch_pool);
 
       working_abspath = svn_dirent_join(propsdir_abspath,
                                         apr_pstrcat(scratch_pool,
                                                     name,
                                                     SVN_WC__WORK_EXT,
-                                                    (char *)NULL),
+                                                    SVN_VA_NULL),
                                         scratch_pool);
     }
 
@@ -1248,7 +1248,7 @@ rename_pristine_file(void *baton,
           == PRISTINE_BASENAME_OLD_LEN))
     {
       const char *new_abspath
-        = apr_pstrcat(pool, abspath, PRISTINE_STORAGE_EXT, (char *)NULL);
+        = apr_pstrcat(pool, abspath, PRISTINE_STORAGE_EXT, SVN_VA_NULL);
 
       SVN_ERR(svn_io_file_rename(abspath, new_abspath, pool));
     }
@@ -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,
+                                              SVN_VA_NULL);
   SVN_ERR(svn_io_dir_walk2(pristine_dir_abspath, APR_FINFO_MIN,
                            rename_pristine_file, NULL, scratch_pool));
 

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc-queries.sql?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc-queries.sql Wed Oct 30 01:04:22 2013
@@ -1503,7 +1503,6 @@ WHERE wc_id = ?1
   AND presence=MAP_NORMAL
   AND file_external IS NULL
 
-/* ### FIXME: op-depth?  What about multiple moves? */
 -- STMT_SELECT_MOVED_FROM_RELPATH
 SELECT local_relpath, op_depth FROM nodes
 WHERE wc_id = ?1 AND moved_to = ?2 AND op_depth > 0
@@ -1530,8 +1529,17 @@ SELECT moved_to, local_relpath FROM node
 WHERE wc_id = ?1 AND op_depth > 0
   AND IS_STRICT_DESCENDANT_OF(moved_to, ?2)
 
+/* If the node is moved here (r.moved_here = 1) we are really interested in
+   where the node was moved from. To obtain that we need the op_depth, but
+   this form of select only allows a single return value */
 -- STMT_SELECT_MOVED_FOR_DELETE
-SELECT local_relpath, moved_to, op_depth FROM nodes
+SELECT local_relpath, moved_to, op_depth,
+       (SELECT CASE WHEN r.moved_here THEN r.op_depth END FROM nodes r
+        WHERE r.wc_id = ?1
+          AND r.local_relpath = n.local_relpath
+          AND r.op_depth < n.op_depth
+        ORDER BY r.op_depth DESC LIMIT 1) AS moved_here_op_depth
+ FROM nodes n
 WHERE wc_id = ?1
   AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
   AND moved_to IS NOT NULL
@@ -1539,6 +1547,16 @@ WHERE wc_id = ?1
                     WHERE o.wc_id = ?1
                       AND o.local_relpath = ?2)
 
+-- STMT_SELECT_MOVED_FROM_FOR_DELETE
+SELECT local_relpath, op_depth,
+       (SELECT CASE WHEN r.moved_here THEN r.op_depth END FROM nodes r
+        WHERE r.wc_id = ?1
+          AND r.local_relpath = n.local_relpath
+          AND r.op_depth < n.op_depth
+        ORDER BY r.op_depth DESC LIMIT 1) AS moved_here_op_depth
+ FROM nodes n
+WHERE wc_id = ?1 AND moved_to = ?2 AND op_depth > 0
+
 -- STMT_UPDATE_MOVED_TO_DESCENDANTS
 UPDATE nodes SET moved_to = RELPATH_SKIP_JOIN(?2, ?3, moved_to)
  WHERE wc_id = ?1

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db.c Wed Oct 30 01:04:22 2013
@@ -7460,8 +7460,86 @@ struct moved_node_t {
 
   /* The op-depth of the deleted node at the source of the move. */
   int op_depth;
+
+  /* When >= 1 the op_depth at which local_relpath was moved to its
+     location. Used to find its original location outside the delete */
+  int moved_from_depth;
 };
 
+/* Helper function to resolve the original location of local_relpath at OP_DEPTH
+   before it was moved into the tree rooted at ROOT_RELPATH. */
+static svn_error_t *
+resolve_moved_from(const char **moved_from_relpath,
+                   int *moved_from_op_depth,
+                   svn_wc__db_wcroot_t *wcroot,
+                   const char *root_relpath,
+                   const char *local_relpath,
+                   int op_depth,
+                   apr_pool_t *result_pool,
+                   apr_pool_t *scratch_pool)
+{
+  const char *suffix = "";
+  svn_sqlite__stmt_t *stmt;
+  const char *m_from_relpath;
+  int m_from_op_depth;
+  int m_move_from_depth;
+  svn_boolean_t have_row;
+
+  while (relpath_depth(local_relpath) > op_depth)
+    {
+      const char *name;
+      svn_relpath_split(&local_relpath, &name, local_relpath, scratch_pool);
+      suffix = svn_relpath_join(suffix, name, scratch_pool);
+    }
+
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                    STMT_SELECT_MOVED_FROM_FOR_DELETE));
+  SVN_ERR(svn_sqlite__bindf(stmt, "is",
+                            wcroot->wc_id, local_relpath));
+  SVN_ERR(svn_sqlite__step(&have_row, stmt));
+
+  if (!have_row)
+    {
+      /* assert(have_row); */
+      *moved_from_relpath = NULL;
+      *moved_from_op_depth = -1;
+
+      SVN_ERR(svn_sqlite__reset(stmt));
+
+      return SVN_NO_ERROR;
+    }
+
+  m_from_relpath = svn_sqlite__column_text(stmt, 0, scratch_pool);
+  m_from_op_depth = svn_sqlite__column_int(stmt, 1);
+  m_move_from_depth = svn_sqlite__column_int(stmt, 2);
+
+  SVN_ERR(svn_sqlite__reset(stmt));
+
+  if (! svn_relpath_skip_ancestor(root_relpath, m_from_relpath))
+    {
+      *moved_from_relpath = svn_relpath_join(m_from_relpath, suffix,
+                                             result_pool);
+      *moved_from_op_depth = m_from_op_depth; /* ### Ok? */
+      return SVN_NO_ERROR;
+    }
+  else if (!m_move_from_depth)
+    {
+      *moved_from_relpath = NULL;
+      *moved_from_op_depth = -1;
+      return SVN_NO_ERROR;
+    }
+
+  return svn_error_trace(
+        resolve_moved_from(moved_from_relpath,
+                           moved_from_op_depth,
+                           wcroot,
+                           root_relpath,
+                           svn_relpath_join(m_from_relpath, suffix,
+                                            scratch_pool),
+                           m_move_from_depth,
+                           result_pool, scratch_pool));
+}
+
 static svn_error_t *
 delete_node(void *baton,
             svn_wc__db_wcroot_t *wcroot,
@@ -7564,6 +7642,7 @@ delete_node(void *baton,
                                                          part, scratch_pool);
           moved_node->op_depth = move_op_depth;
           moved_node->moved_to_relpath = b->moved_to_relpath;
+          moved_node->moved_from_depth = -1;
 
           APR_ARRAY_PUSH(moved_nodes, const struct moved_node_t *) = moved_node;
         }
@@ -7577,6 +7656,7 @@ delete_node(void *baton,
           moved_node->local_relpath = local_relpath;
           moved_node->op_depth = delete_depth;
           moved_node->moved_to_relpath = b->moved_to_relpath;
+          moved_node->moved_from_depth = -1;
 
           APR_ARRAY_PUSH(moved_nodes, const struct moved_node_t *) = moved_node;
         }
@@ -7591,20 +7671,13 @@ delete_node(void *baton,
                                              b->moved_to_relpath));
       SVN_ERR(svn_sqlite__update(NULL, stmt));
     }
-  else
-    {
-      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                                        STMT_CLEAR_MOVED_TO_DESCENDANTS));
-      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id,
-                                            local_relpath));
-      SVN_ERR(svn_sqlite__update(NULL, stmt));
-    }
 
   /* Find children that were moved out of the subtree rooted at this node.
    * We'll need to update their op-depth columns because their deletion
    * is now implied by the deletion of their parent (i.e. this node). */
     {
       apr_pool_t *iterpool;
+      int i;
 
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                         STMT_SELECT_MOVED_FOR_DELETE));
@@ -7618,52 +7691,83 @@ delete_node(void *baton,
           const char *child_relpath = svn_sqlite__column_text(stmt, 0, NULL);
           const char *mv_to_relpath = svn_sqlite__column_text(stmt, 1, NULL);
           int child_op_depth = svn_sqlite__column_int(stmt, 2);
+          int moved_from_depth = -1;
           svn_boolean_t fixup = FALSE;
 
-          if (!b->moved_to_relpath
+          if (! b->moved_to_relpath
               && ! svn_relpath_skip_ancestor(local_relpath, mv_to_relpath))
             {
-              /* Update the op-depth of an moved node below this tree */
-              fixup = TRUE;
-              child_op_depth = delete_depth;
-            }
-          else if (b->moved_to_relpath
-                   && delete_depth == child_op_depth)
-            {
-              /* Update the op-depth of a tree shadowed by this tree */
-              fixup = TRUE;
-              child_op_depth = delete_depth;
-            }
-          else if (b->moved_to_relpath
-                   && child_op_depth >= delete_depth
-                   && !svn_relpath_skip_ancestor(local_relpath, mv_to_relpath))
-            {
-              /* Update the move destination of something that is now moved
-                 away further */
+              /* a NULL moved_here_depth will be reported as 0 */
+              int moved_here_depth = svn_sqlite__column_int(stmt, 3);
 
-              child_relpath = svn_relpath_skip_ancestor(local_relpath, child_relpath);
+              /* Plain delete. Fixup move information of descendants that were
+                 moved here, or that were moved out */
 
-              if (child_relpath)
+              if (moved_here_depth >= delete_depth)
                 {
-                  child_relpath = svn_relpath_join(b->moved_to_relpath, child_relpath, scratch_pool);
+                  /* The move we recorded here must be moved to the location
+                     this node had before it was moved here.
 
-                  if (child_op_depth > delete_depth
-                      && svn_relpath_skip_ancestor(local_relpath, child_relpath))
-                    child_op_depth = delete_depth;
-                  else
-                    child_op_depth = relpath_depth(child_relpath);
+                     This might contain multiple steps when the node was moved
+                     in several places within the to be deleted tree */
 
+                  /* ### TODO: Add logic */
+                  fixup = TRUE;
+                  moved_from_depth = moved_here_depth;
+                }
+              else
+                {
+                  /* Update the op-depth of an moved node below this tree */
                   fixup = TRUE;
+                  child_op_depth = delete_depth;
+                }
+            }
+          else if (b->moved_to_relpath)
+            {
+              /* The node is moved to a new location */
+
+              if (delete_depth == child_op_depth)
+                {
+                  /* Update the op-depth of a tree shadowed by this tree */
+                  fixup = TRUE;
+                  child_op_depth = delete_depth;
+                }
+              else if (child_op_depth >= delete_depth
+                       && !svn_relpath_skip_ancestor(local_relpath,
+                                                     mv_to_relpath))
+                {
+                  /* Update the move destination of something that is now moved
+                     away further */
+
+                  child_relpath = svn_relpath_skip_ancestor(local_relpath,
+                                                            child_relpath);
+
+                  if (child_relpath)
+                    {
+                      child_relpath = svn_relpath_join(b->moved_to_relpath,
+                                                       child_relpath,
+                                                       scratch_pool);
+
+                      if (child_op_depth > delete_depth
+                           && svn_relpath_skip_ancestor(local_relpath,
+                                                        child_relpath))
+                        child_op_depth = delete_depth;
+                      else
+                        child_op_depth = relpath_depth(child_relpath);
+
+                      fixup = TRUE;
+                    }
                 }
             }
 
           if (fixup)
             {
-              mn = apr_pcalloc(scratch_pool, sizeof(struct moved_node_t));
+              mn = apr_palloc(scratch_pool, sizeof(struct moved_node_t));
 
               mn->local_relpath = apr_pstrdup(scratch_pool, child_relpath);
               mn->moved_to_relpath = apr_pstrdup(scratch_pool, mv_to_relpath);
               mn->op_depth = child_op_depth;
+              mn->moved_from_depth = moved_from_depth;
 
               if (!moved_nodes)
                 moved_nodes = apr_array_make(scratch_pool, 1,
@@ -7673,8 +7777,48 @@ delete_node(void *baton,
 
           SVN_ERR(svn_sqlite__step(&have_row, stmt));
         }
-      svn_pool_destroy(iterpool);
       SVN_ERR(svn_sqlite__reset(stmt));
+
+      for (i = 0; moved_nodes && (i < moved_nodes->nelts); i++)
+        {
+          struct moved_node_t *mn = APR_ARRAY_IDX(moved_nodes, i,
+                                                  struct moved_node_t *);
+
+          if (mn->moved_from_depth > 0)
+            {
+              svn_pool_clear(iterpool);
+
+              SVN_ERR(resolve_moved_from(&mn->local_relpath, &mn->op_depth,
+                                         wcroot, local_relpath,
+                                         mn->local_relpath,
+                                         mn->moved_from_depth,
+                                         scratch_pool, iterpool));
+
+              if (!mn->local_relpath)
+                svn_sort__array_delete(moved_nodes, i--, 1);
+            }
+        }
+
+      svn_pool_destroy(iterpool);
+    }
+
+  if (!b->moved_to_relpath)
+    {
+      SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                        STMT_CLEAR_MOVED_TO_DESCENDANTS));
+      SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id,
+                                local_relpath));
+      SVN_ERR(svn_sqlite__update(NULL, stmt));
+
+      if (op_root)
+        {
+          SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                            STMT_CLEAR_MOVED_TO_FROM_DEST));
+          SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id,
+                                    local_relpath));
+
+          SVN_ERR(svn_sqlite__update(NULL, stmt));
+        }
     }
 
   if (op_root)
@@ -13456,7 +13600,7 @@ svn_wc__db_temp_wcroot_tempdir(const cha
                                            wcroot->abspath,
                                            svn_wc_get_adm_dir(scratch_pool),
                                            WCROOT_TEMPDIR_RELPATH,
-                                           NULL);
+                                           SVN_VA_NULL);
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db_pristine.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db_pristine.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db_pristine.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_wc/wc_db_pristine.c Wed Oct 30 01:04:22 2013
@@ -67,7 +67,7 @@ get_pristine_fname(const char **pristine
                                           wcroot_abspath,
                                           svn_wc_get_adm_dir(scratch_pool),
                                           PRISTINE_STORAGE_RELPATH,
-                                          NULL);
+                                          SVN_VA_NULL);
 
   /* We should have a valid checksum and (thus) a valid digest. */
   SVN_ERR_ASSERT(hexdigest != NULL);
@@ -78,14 +78,14 @@ get_pristine_fname(const char **pristine
   subdir[2] = '\0';
 
   hexdigest = apr_pstrcat(scratch_pool, hexdigest, PRISTINE_STORAGE_EXT,
-                          (char *)NULL);
+                          SVN_VA_NULL);
 
   /* The file is located at DIR/.svn/pristine/XX/XXYYZZ...svn-base */
   *pristine_abspath = svn_dirent_join_many(result_pool,
                                            base_dir_abspath,
                                            subdir,
                                            hexdigest,
-                                           NULL);
+                                           SVN_VA_NULL);
   return SVN_NO_ERROR;
 }
 
@@ -253,7 +253,7 @@ pristine_get_tempdir(svn_wc__db_wcroot_t
 {
   return svn_dirent_join_many(result_pool, wcroot->abspath,
                               svn_wc_get_adm_dir(scratch_pool),
-                              PRISTINE_TEMPDIR_RELPATH, (char *)NULL);
+                              PRISTINE_TEMPDIR_RELPATH, SVN_VA_NULL);
 }
 
 svn_error_t *

Modified: subversion/branches/fsfs-improvements/subversion/mod_authz_svn/mod_authz_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/mod_authz_svn/mod_authz_svn.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/mod_authz_svn/mod_authz_svn.c (original)
+++ subversion/branches/fsfs-improvements/subversion/mod_authz_svn/mod_authz_svn.c Wed Oct 30 01:04:22 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);
+                                             SVN_VA_NULL);
         }
     }
   else
@@ -404,7 +404,7 @@ get_access_conf(request_rec *r, authz_sv
     }
 
   cache_key = apr_pstrcat(scratch_pool, "mod_authz_svn:",
-                          access_file, groups_file, (char *)NULL);
+                          access_file, groups_file, SVN_VA_NULL);
   apr_pool_userdata_get(&user_data, cache_key, r->connection->pool);
   access_conf = user_data;
   if (access_conf == NULL)
@@ -572,7 +572,7 @@ req_check_access(request_rec *r,
     repos_path = svn_fspath__canonicalize(repos_path, r->pool);
 
   *repos_path_ref = apr_pstrcat(r->pool, repos_name, ":", repos_path,
-                                (char *)NULL);
+                                SVN_VA_NULL);
 
   if (r->method_number == M_MOVE || r->method_number == M_COPY)
     {
@@ -620,7 +620,7 @@ req_check_access(request_rec *r,
         dest_repos_path = svn_fspath__canonicalize(dest_repos_path, r->pool);
 
       *dest_repos_path_ref = apr_pstrcat(r->pool, dest_repos_name, ":",
-                                         dest_repos_path, (char *)NULL);
+                                         dest_repos_path, SVN_VA_NULL);
     }
 
   /* Retrieve/cache authorization file */

Modified: subversion/branches/fsfs-improvements/subversion/mod_dav_svn/authz.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/mod_dav_svn/authz.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/mod_dav_svn/authz.c (original)
+++ subversion/branches/fsfs-improvements/subversion/mod_dav_svn/authz.c Wed Oct 30 01:04:22 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, SVN_VA_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/fsfs-improvements/subversion/mod_dav_svn/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/mod_dav_svn/lock.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/mod_dav_svn/lock.c (original)
+++ subversion/branches/fsfs-improvements/subversion/mod_dav_svn/lock.c Wed Oct 30 01:04:22 2013
@@ -92,7 +92,7 @@ svn_lock_to_dav_lock(dav_lock **dlock,
                                     "<D:owner xmlns:D=\"DAV:\">",
                                     apr_xml_quote_string(pool,
                                                          slock->comment, 1),
-                                    "</D:owner>", (char *)NULL);
+                                    "</D:owner>", SVN_VA_NULL);
         }
       else
         {
@@ -134,7 +134,7 @@ unescape_xml(const char **output,
   apr_xml_doc *xml_doc;
   apr_status_t apr_err;
   const char *xml_input = apr_pstrcat
-    (pool, "<?xml version=\"1.0\" encoding=\"utf-8\"?>", input, (char *)NULL);
+    (pool, "<?xml version=\"1.0\" encoding=\"utf-8\"?>", input, SVN_VA_NULL);
 
   apr_err = apr_xml_parser_feed(xml_parser, xml_input, strlen(xml_input));
   if (!apr_err)

Modified: subversion/branches/fsfs-improvements/subversion/mod_dav_svn/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/mod_dav_svn/merge.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/mod_dav_svn/merge.c (original)
+++ subversion/branches/fsfs-improvements/subversion/mod_dav_svn/merge.c Wed Oct 30 01:04:22 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/fsfs-improvements/subversion/mod_dav_svn/mirror.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/mod_dav_svn/mirror.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/mod_dav_svn/mirror.c (original)
+++ subversion/branches/fsfs-improvements/subversion/mod_dav_svn/mirror.c Wed Oct 30 01:04:22 2013
@@ -56,7 +56,7 @@ static int proxy_request_fixup(request_r
     r->filename = (char *) svn_path_uri_encode(apr_pstrcat(r->pool, "proxy:",
                                                            master_uri,
                                                            uri_segment,
-                                                           (char *)NULL),
+                                                           SVN_VA_NULL),
                                                r->pool);
     r->handler = "proxy-server";
 
@@ -102,11 +102,11 @@ int dav_svn__proxy_request_fixup(request
             r->method_number == M_GET) {
             if ((seg = ap_strstr(r->uri, root_dir))) {
                 if (ap_strstr_c(seg, apr_pstrcat(r->pool, special_uri,
-                                                 "/wrk/", (char *)NULL))
+                                                 "/wrk/", SVN_VA_NULL))
                     || ap_strstr_c(seg, apr_pstrcat(r->pool, special_uri,
-                                                    "/txn/", (char *)NULL))
+                                                    "/txn/", SVN_VA_NULL))
                     || ap_strstr_c(seg, apr_pstrcat(r->pool, special_uri,
-                                                    "/txr/", (char *)NULL))) {
+                                                    "/txr/", SVN_VA_NULL))) {
                     int rv;
                     seg += strlen(root_dir);
                     rv = proxy_request_fixup(r, master_uri, seg);
@@ -259,7 +259,7 @@ apr_status_t dav_svn__location_header_fi
         new_uri = ap_construct_url(r->pool,
                                    apr_pstrcat(r->pool,
                                                dav_svn__get_root_dir(r), "/",
-                                               start_foo, (char *)NULL),
+                                               start_foo, SVN_VA_NULL),
                                    r);
         apr_table_set(r->headers_out, "Location", new_uri);
     }

Modified: subversion/branches/fsfs-improvements/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/mod_dav_svn/mod_dav_svn.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/branches/fsfs-improvements/subversion/mod_dav_svn/mod_dav_svn.c Wed Oct 30 01:04:22 2013
@@ -746,7 +746,7 @@ const char *
 dav_svn__get_me_resource_uri(request_rec *r)
 {
   return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/me",
-                     (char *)NULL);
+                     SVN_VA_NULL);
 }
 
 
@@ -754,7 +754,7 @@ const char *
 dav_svn__get_rev_stub(request_rec *r)
 {
   return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/rev",
-                     (char *)NULL);
+                     SVN_VA_NULL);
 }
 
 
@@ -762,7 +762,7 @@ const char *
 dav_svn__get_rev_root_stub(request_rec *r)
 {
   return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/rvr",
-                     (char *)NULL);
+                     SVN_VA_NULL);
 }
 
 
@@ -770,14 +770,14 @@ const char *
 dav_svn__get_txn_stub(request_rec *r)
 {
   return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/txn",
-                     (char *)NULL);
+                     SVN_VA_NULL);
 }
 
 
 const char *
 dav_svn__get_txn_root_stub(request_rec *r)
 {
-  return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/txr", (char *)NULL);
+  return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/txr", SVN_VA_NULL);
 }
 
 
@@ -785,7 +785,7 @@ const char *
 dav_svn__get_vtxn_stub(request_rec *r)
 {
   return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/vtxn",
-                     (char *)NULL);
+                     SVN_VA_NULL);
 }
 
 
@@ -793,7 +793,7 @@ const char *
 dav_svn__get_vtxn_root_stub(request_rec *r)
 {
   return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/vtxr",
-                     (char *)NULL);
+                     SVN_VA_NULL);
 }
 
 

Modified: subversion/branches/fsfs-improvements/subversion/mod_dav_svn/reports/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/mod_dav_svn/reports/log.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/mod_dav_svn/reports/log.c (original)
+++ subversion/branches/fsfs-improvements/subversion/mod_dav_svn/reports/log.c Wed Oct 30 01:04:22 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/fsfs-improvements/subversion/mod_dav_svn/reports/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/mod_dav_svn/reports/replay.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/mod_dav_svn/reports/replay.c (original)
+++ subversion/branches/fsfs-improvements/subversion/mod_dav_svn/reports/replay.c Wed Oct 30 01:04:22 2013
@@ -406,7 +406,7 @@ malformed_element_error(const char *tagn
                                             "The request's '", tagname,
                                             "' element is malformed; there "
                                             "is a problem with the client.",
-                                            (char *)NULL),
+                                            SVN_VA_NULL),
                                 SVN_DAV_ERROR_NAMESPACE, SVN_DAV_ERROR_TAG);
 }
 

Modified: subversion/branches/fsfs-improvements/subversion/mod_dav_svn/reports/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/mod_dav_svn/reports/update.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/branches/fsfs-improvements/subversion/mod_dav_svn/reports/update.c Wed Oct 30 01:04:22 2013
@@ -913,7 +913,7 @@ malformed_element_error(const char *tagn
   const char *errstr = apr_pstrcat(pool, "The request's '", tagname,
                                    "' element is malformed; there "
                                    "is a problem with the client.",
-                                   (char *)NULL);
+                                   SVN_VA_NULL);
   return dav_svn__new_error_tag(pool, HTTP_BAD_REQUEST, 0, errstr,
                                 SVN_DAV_ERROR_NAMESPACE, SVN_DAV_ERROR_TAG);
 }

Modified: subversion/branches/fsfs-improvements/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/mod_dav_svn/repos.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/fsfs-improvements/subversion/mod_dav_svn/repos.c Wed Oct 30 01:04:22 2013
@@ -1154,7 +1154,7 @@ create_private_resource(const dav_resour
 
   if (base->info->repos->root_path[1])
     comb->res.uri = apr_pstrcat(base->pool, base->info->repos->root_path,
-                                path->data, (char *)NULL);
+                                path->data, SVN_VA_NULL);
   else
     comb->res.uri = path->data;
   comb->res.info = &comb->priv;
@@ -1516,7 +1516,7 @@ get_parentpath_resource(request_rec *r,
   if (r->uri[len-1] != '/')
     {
       new_uri = apr_pstrcat(r->pool, ap_escape_uri(r->pool, r->uri),
-                            "/", (char *)NULL);
+                            "/", SVN_VA_NULL);
       apr_table_setn(r->headers_out, "Location",
                      ap_construct_url(r->pool, new_uri, r));
       return dav_svn__new_error(r->pool, HTTP_MOVED_PERMANENTLY, 0,
@@ -2159,7 +2159,7 @@ get_resource(request_rec *r,
   }
 
   /* Retrieve/cache open repository */
-  repos_key = apr_pstrcat(r->pool, "mod_dav_svn:", fs_path, (char *)NULL);
+  repos_key = apr_pstrcat(r->pool, "mod_dav_svn:", fs_path, SVN_VA_NULL);
   apr_pool_userdata_get(&userdata, repos_key, r->connection->pool);
   repos->repos = userdata;
   if (repos->repos == NULL)
@@ -2365,7 +2365,7 @@ get_resource(request_rec *r,
                                          "/",
                                          r->args ? "?" : "",
                                          r->args ? r->args : "",
-                                         (char *)NULL);
+                                         SVN_VA_NULL);
       apr_table_setn(r->headers_out, "Location",
                      ap_construct_url(r->pool, new_path, r));
       return dav_svn__new_error(r->pool, HTTP_MOVED_PERMANENTLY, 0,
@@ -3366,7 +3366,7 @@ deliver(const dav_resource *resource, ap
           /* ### The xml output doesn't like to see a trailing slash on
              ### the visible portion, so avoid that. */
           if (is_dir)
-            href = apr_pstrcat(entry_pool, href, "/", (char *)NULL);
+            href = apr_pstrcat(entry_pool, href, "/", SVN_VA_NULL);
 
           if (gen_html)
             name = href;
@@ -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);
+                                    SVN_VA_NULL);
               str_root = apr_pstrcat(resource->pool,
                                      resource->info->repos->base_url,
                                      resource->info->repos->root_path,
-                                     NULL);
+                                     SVN_VA_NULL);
 
               serr = svn_subst_build_keywords3(&kw, keywords->data,
                                                str_cmt_rev, str_uri, str_root,
@@ -4160,7 +4160,7 @@ do_walk(walker_ctx_t *ctx, int depth)
                         apr_pstrmemdup(iterpool,
                                        ctx->repos_path->data,
                                        ctx->repos_path->len),
-                        key, (char *)NULL);
+                        key, SVN_VA_NULL);
           if (! dav_svn__allow_read(ctx->info.r, ctx->info.repos,
                                     repos_relpath, ctx->info.root.rev,
                                     iterpool))
@@ -4321,7 +4321,7 @@ dav_svn__create_working_resource(dav_res
 
   if (base->info->repos->root_path[1])
     res->uri = apr_pstrcat(base->pool, base->info->repos->root_path,
-                           path, (char *)NULL);
+                           path, SVN_VA_NULL);
   else
     res->uri = path;
   res->hooks = &dav_svn__hooks_repository;

Modified: subversion/branches/fsfs-improvements/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/mod_dav_svn/version.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/fsfs-improvements/subversion/mod_dav_svn/version.c Wed Oct 30 01:04:22 2013
@@ -298,25 +298,25 @@ get_option(const dav_resource *resource,
       apr_table_set(r->headers_out, SVN_DAV_ROOT_URI_HEADER, repos_root_uri);
       apr_table_set(r->headers_out, SVN_DAV_ME_RESOURCE_HEADER,
                     apr_pstrcat(resource->pool, repos_root_uri, "/",
-                                dav_svn__get_me_resource_uri(r), (char *)NULL));
+                                dav_svn__get_me_resource_uri(r), SVN_VA_NULL));
       apr_table_set(r->headers_out, SVN_DAV_REV_ROOT_STUB_HEADER,
                     apr_pstrcat(resource->pool, repos_root_uri, "/",
-                                dav_svn__get_rev_root_stub(r), (char *)NULL));
+                                dav_svn__get_rev_root_stub(r), SVN_VA_NULL));
       apr_table_set(r->headers_out, SVN_DAV_REV_STUB_HEADER,
                     apr_pstrcat(resource->pool, repos_root_uri, "/",
-                                dav_svn__get_rev_stub(r), (char *)NULL));
+                                dav_svn__get_rev_stub(r), SVN_VA_NULL));
       apr_table_set(r->headers_out, SVN_DAV_TXN_ROOT_STUB_HEADER,
                     apr_pstrcat(resource->pool, repos_root_uri, "/",
-                                dav_svn__get_txn_root_stub(r), (char *)NULL));
+                                dav_svn__get_txn_root_stub(r), SVN_VA_NULL));
       apr_table_set(r->headers_out, SVN_DAV_TXN_STUB_HEADER,
                     apr_pstrcat(resource->pool, repos_root_uri, "/",
-                                dav_svn__get_txn_stub(r), (char *)NULL));
+                                dav_svn__get_txn_stub(r), SVN_VA_NULL));
       apr_table_set(r->headers_out, SVN_DAV_VTXN_ROOT_STUB_HEADER,
                     apr_pstrcat(resource->pool, repos_root_uri, "/",
-                                dav_svn__get_vtxn_root_stub(r), (char *)NULL));
+                                dav_svn__get_vtxn_root_stub(r), SVN_VA_NULL));
       apr_table_set(r->headers_out, SVN_DAV_VTXN_STUB_HEADER,
                     apr_pstrcat(resource->pool, repos_root_uri, "/",
-                                dav_svn__get_vtxn_stub(r), (char *)NULL));
+                                dav_svn__get_vtxn_stub(r), SVN_VA_NULL));
       apr_table_set(r->headers_out, SVN_DAV_ALLOW_BULK_UPDATES,
                     bulk_upd_conf == CONF_BULKUPD_ON ? "On" :
                       bulk_upd_conf == CONF_BULKUPD_OFF ? "Off" : "Prefer");

Modified: subversion/branches/fsfs-improvements/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/svn/conflict-callbacks.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/fsfs-improvements/subversion/svn/conflict-callbacks.c Wed Oct 30 01:04:22 2013
@@ -599,21 +599,21 @@ prompt_string(const resolver_option_t *o
         }
 
       if (! first)
-        result = apr_pstrcat(pool, result, ",", (char *)NULL);
+        result = apr_pstrcat(pool, result, ",", SVN_VA_NULL);
       s = apr_psprintf(pool, _(" (%s) %s"),
                        opt->code, _(opt->short_desc));
       slen = svn_utf_cstring_utf8_width(s);
       /* Break the line if adding the next option would make it too long */
       if (this_line_len + slen > MAX_PROMPT_WIDTH)
         {
-          result = apr_pstrcat(pool, result, line_sep, (char *)NULL);
+          result = apr_pstrcat(pool, result, line_sep, SVN_VA_NULL);
           this_line_len = left_margin;
         }
-      result = apr_pstrcat(pool, result, s, (char *)NULL);
+      result = apr_pstrcat(pool, result, s, SVN_VA_NULL);
       this_line_len += slen;
       first = FALSE;
     }
-  return apr_pstrcat(pool, result, ": ", (char *)NULL);
+  return apr_pstrcat(pool, result, ": ", SVN_VA_NULL);
 }
 
 /* Return a help string listing the OPTIONS. */
@@ -636,13 +636,13 @@ help_string(const resolver_option_t *opt
         }
       else
         {
-          result = apr_pstrcat(pool, result, "\n", (char *)NULL);
+          result = apr_pstrcat(pool, result, "\n", SVN_VA_NULL);
         }
     }
   result = apr_pstrcat(pool, result,
                        _("Words in square brackets are the corresponding "
                          "--accept option arguments.\n"),
-                       (char *)NULL);
+                       SVN_VA_NULL);
   return result;
 }
 

Modified: subversion/branches/fsfs-improvements/subversion/svn/info-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/svn/info-cmd.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/svn/info-cmd.c (original)
+++ subversion/branches/fsfs-improvements/subversion/svn/info-cmd.c Wed Oct 30 01:04:22 2013
@@ -115,7 +115,7 @@ print_info_xml(void *baton,
                                                    info->repos_root_URL,
                                                    info->URL, pool),
                                                pool),
-                                           NULL));
+                                           SVN_VA_NULL));
     }
 
   if (info->repos_root_URL || info->repos_UUID)

Modified: subversion/branches/fsfs-improvements/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/svn/notify.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/svn/notify.c (original)
+++ subversion/branches/fsfs-improvements/subversion/svn/notify.c Wed Oct 30 01:04:22 2013
@@ -485,7 +485,7 @@ notify(void *baton, const svn_wc_notify_
                                            apr_pstrcat(pool, s,
                                                        "%"APR_UINT64_T_FMT
                                                        " and fuzz %lu (%s)\n",
-                                                       (char *)NULL),
+                                                       SVN_VA_NULL),
                                            n->hunk_original_start,
                                            n->hunk_original_length,
                                            n->hunk_modified_start,
@@ -502,7 +502,7 @@ notify(void *baton, const svn_wc_notify_
                                            apr_pstrcat(pool, s,
                                                        "%"APR_UINT64_T_FMT
                                                        " and fuzz %lu\n",
-                                                       (char *)NULL),
+                                                       SVN_VA_NULL),
                                            n->hunk_original_start,
                                            n->hunk_original_length,
                                            n->hunk_modified_start,
@@ -523,7 +523,7 @@ notify(void *baton, const svn_wc_notify_
                   err = svn_cmdline_printf(pool,
                                             apr_pstrcat(pool, s,
                                                         "%"APR_UINT64_T_FMT" (%s)\n",
-                                                        (char *)NULL),
+                                                        SVN_VA_NULL),
                                             n->hunk_original_start,
                                             n->hunk_original_length,
                                             n->hunk_modified_start,
@@ -537,7 +537,7 @@ notify(void *baton, const svn_wc_notify_
                   err = svn_cmdline_printf(pool,
                                            apr_pstrcat(pool, s,
                                                        "%"APR_UINT64_T_FMT"\n",
-                                                       (char *)NULL),
+                                                       SVN_VA_NULL),
                                            n->hunk_original_start,
                                            n->hunk_original_length,
                                            n->hunk_modified_start,

Modified: subversion/branches/fsfs-improvements/subversion/svn/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/svn/status.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/svn/status.c (original)
+++ subversion/branches/fsfs-improvements/subversion/svn/status.c Wed Oct 30 01:04:22 2013
@@ -319,7 +319,7 @@ print_status(const char *target_abspath,
                                     apr_psprintf(pool,
                                                  _("swapped places with %s"),
                                                  relpath),
-                                    (char *)NULL);
+                                    SVN_VA_NULL);
     }
   else if (status->moved_from_abspath || status->moved_to_abspath)
     {
@@ -334,7 +334,7 @@ print_status(const char *target_abspath,
           moved_from_line = apr_pstrcat(pool, "\n        > ",
                                         apr_psprintf(pool, _("moved from %s"),
                                                      relpath),
-                                        (char *)NULL);
+                                        SVN_VA_NULL);
         }
 
       if (status->moved_to_abspath)
@@ -346,7 +346,7 @@ print_status(const char *target_abspath,
           moved_to_line = apr_pstrcat(pool, "\n        > ",
                                       apr_psprintf(pool, _("moved to %s"),
                                                    relpath),
-                                      (char *)NULL);
+                                      SVN_VA_NULL);
         }
     }
 

Modified: subversion/branches/fsfs-improvements/subversion/svnauth/svnauth.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/svnauth/svnauth.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/svnauth/svnauth.c (original)
+++ subversion/branches/fsfs-improvements/subversion/svnauth/svnauth.c Wed Oct 30 01:04:22 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", SVN_VA_NULL);
 #endif
 #ifdef SVN_HAVE_GPG_AGENT
-      footer = apr_pstrcat(pool, footer, "  GPG-Agent\n", NULL);
+      footer = apr_pstrcat(pool, footer, "  GPG-Agent\n", SVN_VA_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", SVN_VA_NULL);
 #endif
 #ifdef SVN_HAVE_KWALLET
-      footer = apr_pstrcat(pool, footer, "  KWallet (KDE)\n", NULL);
+      footer = apr_pstrcat(pool, footer, "  KWallet (KDE)\n", SVN_VA_NULL);
 #endif
     }
 

Modified: subversion/branches/fsfs-improvements/subversion/svndumpfilter/svndumpfilter.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/svndumpfilter/svndumpfilter.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/svndumpfilter/svndumpfilter.c (original)
+++ subversion/branches/fsfs-improvements/subversion/svndumpfilter/svndumpfilter.c Wed Oct 30 01:04:22 2013
@@ -550,9 +550,9 @@ new_node_record(void **node_baton,
 
   /* Ensure that paths start with a leading '/'. */
   if (node_path[0] != '/')
-    node_path = apr_pstrcat(pool, "/", node_path, (char *)NULL);
+    node_path = apr_pstrcat(pool, "/", node_path, SVN_VA_NULL);
   if (copyfrom_path && copyfrom_path[0] != '/')
-    copyfrom_path = apr_pstrcat(pool, "/", copyfrom_path, (char *)NULL);
+    copyfrom_path = apr_pstrcat(pool, "/", copyfrom_path, SVN_VA_NULL);
 
   nb->do_skip = skip_path(node_path, pb->prefixes,
                           pb->do_exclude, pb->glob);
@@ -1554,7 +1554,7 @@ main(int argc, const char *argv[])
           SVN_INT_ERR(svn_utf_cstring_to_utf8(&prefix, os->argv[i], pool));
           prefix = svn_relpath__internal_style(prefix, pool);
           if (prefix[0] != '/')
-            prefix = apr_pstrcat(pool, "/", prefix, (char *)NULL);
+            prefix = apr_pstrcat(pool, "/", prefix, SVN_VA_NULL);
           APR_ARRAY_PUSH(opt_state.prefixes, const char *) = prefix;
         }
 
@@ -1585,7 +1585,7 @@ main(int argc, const char *argv[])
             {
               const char *prefix = APR_ARRAY_IDX(targets, i, const char *);
               if (prefix[0] != '/')
-                prefix = apr_pstrcat(pool, "/", prefix, (char *)NULL);
+                prefix = apr_pstrcat(pool, "/", prefix, SVN_VA_NULL);
               APR_ARRAY_PUSH(opt_state.prefixes, const char *) = prefix;
             }
         }

Modified: subversion/branches/fsfs-improvements/subversion/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/svnmucc/svnmucc.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/svnmucc/svnmucc.c (original)
+++ subversion/branches/fsfs-improvements/subversion/svnmucc/svnmucc.c Wed Oct 30 01:04:22 2013
@@ -1419,7 +1419,7 @@ main(int argc, const char **argv)
               /* ### These relpaths are already URI-encoded. */
               url = apr_pstrcat(pool, root_url, "/",
                                 svn_relpath_canonicalize(url, pool),
-                                (char *)NULL);
+                                SVN_VA_NULL);
             }
           url = sanitize_url(url, pool);
           action->path[j] = url;

Modified: subversion/branches/fsfs-improvements/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/svnserve/serve.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/svnserve/serve.c (original)
+++ subversion/branches/fsfs-improvements/subversion/svnserve/serve.c Wed Oct 30 01:04:22 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/fsfs-improvements/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/tests/cmdline/diff_tests.py?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/fsfs-improvements/subversion/tests/cmdline/diff_tests.py Wed Oct 30 01:04:22 2013
@@ -2752,6 +2752,20 @@ def basic_diff_summarize(sbox):
   svntest.actions.run_and_verify_diff_summarize(expected_reverse_diff,
                                                 wc_dir, '-c-3')
 
+  # Get the differences between a deep newly added dir Issue(4421)
+  expected_diff = svntest.wc.State(wc_dir, {
+    'Q/R'         : Item(status='A '),
+    'Q/R/newfile' : Item(status='A '),
+    })
+  expected_reverse_diff = svntest.wc.State(wc_dir, {
+    'Q/R'         : Item(status='D '),
+    'Q/R/newfile' : Item(status='D '),
+    })
+  svntest.actions.run_and_verify_diff_summarize(expected_diff,
+                                                p('Q/R'), '-c3')
+  svntest.actions.run_and_verify_diff_summarize(expected_reverse_diff,
+                                                p('Q/R'), '-c-3')
+
 #----------------------------------------------------------------------
 def diff_weird_author(sbox):
   "diff with svn:author that has < in it"

Modified: subversion/branches/fsfs-improvements/subversion/tests/cmdline/entries-dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/tests/cmdline/entries-dump.c?rev=1536949&r1=1536948&r2=1536949&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/tests/cmdline/entries-dump.c (original)
+++ subversion/branches/fsfs-improvements/subversion/tests/cmdline/entries-dump.c Wed Oct 30 01:04:22 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", SVN_VA_NULL);
       SVN_ERR(svn_io_check_path(lockfile_path, &kind, pool));
       locked = (kind == svn_node_file);
     }