You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2015/11/30 11:24:23 UTC

svn commit: r1717223 [33/50] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ contrib/hook-scripts/ notes/ notes/api-errata/1.9/ notes/move-tracking/ subversion/ subversion/bindings/ctypes-python/...

Modified: subversion/branches/ra-git/subversion/libsvn_subr/subst.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/subst.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/subst.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/subst.c Mon Nov 30 10:24:16 2015
@@ -1127,7 +1127,7 @@ translate_chunk(svn_stream_t *dst,
                 {
                   /* Check 4 bytes at once to allow for efficient pipelining
                     and to reduce loop condition overhead. */
-                  while ((p + len + 4) <= end)
+                  while ((end - p) >= (len + 4))
                     {
                       if (interesting[(unsigned char)p[len]]
                           || interesting[(unsigned char)p[len+1]]
@@ -1157,7 +1157,7 @@ translate_chunk(svn_stream_t *dst,
             }
           while (b->nl_translation_skippable ==
                    svn_tristate_true &&       /* can potentially skip EOLs */
-                 p + len + 2 < end &&         /* not too close to EOF */
+                 (end - p) > (len + 2) &&     /* not too close to EOF */
                  eol_unchanged(b, p + len));  /* EOL format already ok */
 
           while ((p + len) < end && !interesting[(unsigned char)p[len]])
@@ -1649,7 +1649,7 @@ detranslate_special_file(const char *src
                            cancel_func, cancel_baton, scratch_pool));
 
   /* Do the atomic rename from our temporary location. */
-  return svn_error_trace(svn_io_file_rename(dst_tmp, dst, scratch_pool));
+  return svn_error_trace(svn_io_file_rename2(dst_tmp, dst, FALSE, scratch_pool));
 }
 
 /* Creates a special file DST from the "normal form" located in SOURCE.
@@ -1691,17 +1691,16 @@ create_special_file_from_stream(svn_stre
                                                    ".tmp", pool);
 
       /* If we had an error, check to see if it was because symlinks are
-         not supported on the platform.  If so, fall back
-         to using the internal representation. */
-      if (err)
+         not supported on the platform.  If so, fall back to using the
+         internal representation. */
+      if (err && err->apr_err == SVN_ERR_UNSUPPORTED_FEATURE)
         {
-          if (err->apr_err == SVN_ERR_UNSUPPORTED_FEATURE)
-            {
-              svn_error_clear(err);
-              create_using_internal_representation = TRUE;
-            }
-          else
-            return err;
+          svn_error_clear(err);
+          create_using_internal_representation = TRUE;
+        }
+      else if (err)
+        {
+          return svn_error_trace(err);
         }
     }
   else
@@ -1733,7 +1732,7 @@ create_special_file_from_stream(svn_stre
     }
 
   /* Do the atomic rename from our temporary location. */
-  return svn_error_trace(svn_io_file_rename(dst_tmp, dst, pool));
+  return svn_error_trace(svn_io_file_rename2(dst_tmp, dst, FALSE, pool));
 }
 
 
@@ -1824,7 +1823,7 @@ svn_subst_copy_and_translate4(const char
     }
 
   /* Now that dst_tmp contains the translated data, do the atomic rename. */
-  SVN_ERR(svn_io_file_rename(dst_tmp, dst, pool));
+  SVN_ERR(svn_io_file_rename2(dst_tmp, dst, FALSE, pool));
 
   /* Preserve the source file's permission bits. */
   SVN_ERR(svn_io_copy_perms(src, dst, pool));

Modified: subversion/branches/ra-git/subversion/libsvn_subr/sysinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/sysinfo.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/sysinfo.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/sysinfo.c Mon Nov 30 10:24:16 2015
@@ -45,6 +45,8 @@
 #include "svn_version.h"
 
 #include "private/svn_sqlite.h"
+#include "private/svn_subr_private.h"
+#include "private/svn_utf_private.h"
 
 #include "sysinfo.h"
 #include "svn_private_config.h"
@@ -125,7 +127,7 @@ const apr_array_header_t *
 svn_sysinfo__linked_libs(apr_pool_t *pool)
 {
   svn_version_ext_linked_lib_t *lib;
-  apr_array_header_t *array = apr_array_make(pool, 3, sizeof(*lib));
+  apr_array_header_t *array = apr_array_make(pool, 6, sizeof(*lib));
 
   lib = &APR_ARRAY_PUSH(array, svn_version_ext_linked_lib_t);
   lib->name = "APR";
@@ -142,6 +144,11 @@ svn_sysinfo__linked_libs(apr_pool_t *poo
 #endif
 
   lib = &APR_ARRAY_PUSH(array, svn_version_ext_linked_lib_t);
+  lib->name = "Expat";
+  lib->compiled_version = apr_pstrdup(pool, svn_xml__compiled_version());
+  lib->runtime_version = apr_pstrdup(pool, svn_xml__runtime_version());
+
+  lib = &APR_ARRAY_PUSH(array, svn_version_ext_linked_lib_t);
   lib->name = "SQLite";
   lib->compiled_version = apr_pstrdup(pool, svn_sqlite__compiled_version());
 #ifdef SVN_SQLITE_INLINE
@@ -150,6 +157,16 @@ svn_sysinfo__linked_libs(apr_pool_t *poo
   lib->runtime_version = apr_pstrdup(pool, svn_sqlite__runtime_version());
 #endif
 
+  lib = &APR_ARRAY_PUSH(array, svn_version_ext_linked_lib_t);
+  lib->name = "Utf8proc";
+  lib->compiled_version = apr_pstrdup(pool, svn_utf__utf8proc_compiled_version());
+  lib->runtime_version = apr_pstrdup(pool, svn_utf__utf8proc_runtime_version());
+
+  lib = &APR_ARRAY_PUSH(array, svn_version_ext_linked_lib_t);
+  lib->name = "ZLib";
+  lib->compiled_version = apr_pstrdup(pool, svn_zlib__compiled_version());
+  lib->runtime_version = apr_pstrdup(pool, svn_zlib__runtime_version());
+
   return array;
 }
 

Modified: subversion/branches/ra-git/subversion/libsvn_subr/temp_serializer.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/temp_serializer.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/temp_serializer.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/temp_serializer.c Mon Nov 30 10:24:16 2015
@@ -366,7 +366,7 @@ svn_temp_serializer__get(svn_temp_serial
  * proper pointer value.
  */
 void
-svn_temp_deserializer__resolve(void *buffer, void **ptr)
+svn_temp_deserializer__resolve(const void *buffer, void **ptr)
 {
   /* All pointers are stored as offsets to the buffer start
    * (of the respective serialized sub-struct). */

Modified: subversion/branches/ra-git/subversion/libsvn_subr/user.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/user.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/user.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/user.c Mon Nov 30 10:24:16 2015
@@ -28,6 +28,7 @@
 
 #include "svn_user.h"
 #include "svn_utf.h"
+#include "svn_dirent_uri.h"
 
 /* Get the current user's name from the OS */
 static const char *
@@ -68,8 +69,11 @@ svn_user_get_name(apr_pool_t *pool)
   return utf8_or_nothing(username, pool);
 }
 
-const char *
-svn_user_get_homedir(apr_pool_t *pool)
+/* Most of the guts of svn_user_get_homedir(): everything except
+ * canonicalizing the path.
+ */
+static const char *
+user_get_homedir(apr_pool_t *pool)
 {
   const char *username;
   char *homedir;
@@ -84,3 +88,14 @@ svn_user_get_homedir(apr_pool_t *pool)
 
   return NULL;
 }
+
+const char *
+svn_user_get_homedir(apr_pool_t *pool)
+{
+  const char *homedir = user_get_homedir(pool);
+
+  if (homedir)
+    return svn_dirent_canonicalize(homedir, pool);
+
+  return NULL;
+}

Modified: subversion/branches/ra-git/subversion/libsvn_subr/utf.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/utf.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/utf.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/utf.c Mon Nov 30 10:24:16 2015
@@ -860,7 +860,6 @@ svn_utf_string_from_utf8(const svn_strin
                          const svn_string_t *src,
                          apr_pool_t *pool)
 {
-  svn_stringbuf_t *dbuf;
   xlate_handle_node_t *node;
   svn_error_t *err;
 
@@ -870,10 +869,15 @@ svn_utf_string_from_utf8(const svn_strin
     {
       err = check_utf8(src->data, src->len, pool);
       if (! err)
-        err = convert_to_stringbuf(node, src->data, src->len,
-                                   &dbuf, pool);
-      if (! err)
-        *dest = svn_stringbuf__morph_into_string(dbuf);
+        {
+          svn_stringbuf_t *dbuf;
+
+          err = convert_to_stringbuf(node, src->data, src->len,
+                                     &dbuf, pool);
+
+          if (! err)
+            *dest = svn_stringbuf__morph_into_string(dbuf);
+        }
     }
   else
     {
@@ -991,7 +995,6 @@ svn_utf_cstring_from_utf8_string(const c
                                  const svn_string_t *src,
                                  apr_pool_t *pool)
 {
-  svn_stringbuf_t *dbuf;
   xlate_handle_node_t *node;
   svn_error_t *err;
 
@@ -1001,10 +1004,14 @@ svn_utf_cstring_from_utf8_string(const c
     {
       err = check_utf8(src->data, src->len, pool);
       if (! err)
-        err = convert_to_stringbuf(node, src->data, src->len,
-                                   &dbuf, pool);
-      if (! err)
-        *dest = dbuf->data;
+        {
+          svn_stringbuf_t *dbuf;
+
+          err = convert_to_stringbuf(node, src->data, src->len,
+                                     &dbuf, pool);
+          if (! err)
+            *dest = dbuf->data;
+        }
     }
   else
     {

Modified: subversion/branches/ra-git/subversion/libsvn_subr/utf8proc.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/utf8proc.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/utf8proc.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/utf8proc.c Mon Nov 30 10:24:16 2015
@@ -37,7 +37,19 @@
 #undef strlen
 
 
-const char *svn_utf__utf8proc_version(void)
+
+const char *
+svn_utf__utf8proc_compiled_version(void)
+{
+  static const char utf8proc_version[] =
+                                  APR_STRINGIFY(UTF8PROC_VERSION_MAJOR) "."
+                                  APR_STRINGIFY(UTF8PROC_VERSION_MINOR) "."
+                                  APR_STRINGIFY(UTF8PROC_VERSION_PATCH);
+  return utf8proc_version;
+}
+
+const char *
+svn_utf__utf8proc_runtime_version(void)
 {
   /* Unused static function warning removal hack. */
   SVN_UNUSED(utf8proc_NFD);

Modified: subversion/branches/ra-git/subversion/libsvn_subr/utf8proc/utf8proc.h
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/utf8proc/utf8proc.h?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/utf8proc/utf8proc.h (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/utf8proc/utf8proc.h Mon Nov 30 10:24:16 2015
@@ -51,6 +51,27 @@
 #ifndef UTF8PROC_H
 #define UTF8PROC_H
 
+/** @name API version
+ *  
+ * The utf8proc API version MAJOR.MINOR.PATCH, following
+ * semantic-versioning rules (http://semver.org) based on API
+ * compatibility.
+ *
+ * This is also returned at runtime by @ref utf8proc_version; however, the
+ * runtime version may append a string like "-dev" to the version number
+ * for prerelease versions.
+ *
+ * @note The shared-library version number in the Makefile may be different,
+ *       being based on ABI compatibility rather than API compatibility.
+ */
+/** @{ */
+/** The MAJOR version number (increased when backwards API compatibility is broken). */
+#define UTF8PROC_VERSION_MAJOR 1
+/** The MINOR version number (increased when new functionality is added in a backwards-compatible manner). */
+#define UTF8PROC_VERSION_MINOR 1
+/** The PATCH version (increased for fixes that do not change the API). */
+#define UTF8PROC_VERSION_PATCH 5
+/** @} */
 
 /*
  * Define UTF8PROC_INLINE and include utf8proc.c to embed a static
@@ -70,34 +91,34 @@
 
 #include <stdlib.h>
 #include <sys/types.h>
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#else
+#include <apr.h>
+#ifdef _MSC_VER
+typedef apr_int8_t int8_t;
+typedef apr_uint8_t uint8_t;
+typedef apr_int16_t int16_t;
+typedef apr_uint16_t uint16_t;
+typedef apr_int32_t int32_t;
+typedef apr_uint32_t uint32_t;
+#endif
+#endif
+
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#elif !defined(__cplusplus)
+typedef uint8_t bool;
+enum { false, true };
+#endif
+
 #ifdef _MSC_VER
-# if _MSC_VER >= 1600
-#   include <stdint.h>
-# else
-    typedef signed char int8_t;
-    typedef unsigned char uint8_t;
-    typedef short int16_t;
-    typedef unsigned short uint16_t;
-    typedef int int32_t;
-# endif
-# if _MSC_VER >= 1800
-#   include <stdbool.h>
-# else
-    typedef unsigned char bool;
-    enum {false, true};
-# endif
 # ifdef _WIN64
 #   define ssize_t __int64
 # else
 #   define ssize_t int
 # endif
-#elif defined(HAVE_STDBOOL_H) && defined(HAVE_INTTYPES_H)
-#include <stdbool.h>
-#include <inttypes.h>
-#else
-#include <apr.h>
-typedef uint8_t bool;
-enum {false, true};
 #endif
 #include <limits.h>
 

Modified: subversion/branches/ra-git/subversion/libsvn_subr/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/version.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/version.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/version.c Mon Nov 30 10:24:16 2015
@@ -40,11 +40,13 @@ svn_subr_version(void)
 svn_boolean_t svn_ver_compatible(const svn_version_t *my_version,
                                  const svn_version_t *lib_version)
 {
-  /* With normal development builds the matching rules are strict, to
-     avoid inadvertantly using the wrong libraries.  For backward
-     compatibility testing use --disable-full-version-match to
-     configure 1.7 and then the libraries that get built can be used
-     to replace those in 1.6 or earlier builds.  */
+  /* With normal development builds the matching rules are stricter
+     that for release builds, to avoid inadvertantly using the wrong
+     libraries.  For backward compatibility testing of development
+     builds one can use --disable-full-version-match to cause a
+     development build to use the release build rules.  This allows
+     the libraries from the newer development build to be used by an
+     older development build. */
 
 #ifndef SVN_DISABLE_FULL_VERSION_MATCH
   if (lib_version->tag[0] != '\0')
@@ -83,6 +85,11 @@ svn_ver_check_list2(const svn_version_t
   svn_error_t *err = SVN_NO_ERROR;
   int i;
 
+#ifdef SVN_DISABLE_FULL_VERSION_MATCH
+  /* Force more relaxed check for --disable-full-version-match. */
+  comparator = svn_ver_compatible;
+#endif
+
   for (i = 0; checklist[i].label != NULL; ++i)
     {
       const svn_version_t *lib_version = checklist[i].version_query();
@@ -136,7 +143,7 @@ svn_version_extended(svn_boolean_t verbo
   info->build_time = __TIME__;
   info->build_host = SVN_BUILD_HOST;
   info->copyright = apr_pstrdup
-    (pool, _("Copyright (C) 2014 The Apache Software Foundation.\n"
+    (pool, _("Copyright (C) 2015 The Apache Software Foundation.\n"
              "This software consists of contributions made by many people;\n"
              "see the NOTICE file for more information.\n"
              "Subversion is open source software, see "

Modified: subversion/branches/ra-git/subversion/libsvn_subr/win32_crashrpt.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/win32_crashrpt.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/win32_crashrpt.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/win32_crashrpt.c Mon Nov 30 10:24:16 2015
@@ -53,9 +53,9 @@ HANDLE dbghelp_dll = INVALID_HANDLE_VALU
 #define LOGFILE_PREFIX "svn-crash-log"
 
 #if defined(_M_IX86)
-#define FORMAT_PTR "0x%08x"
+#define FORMAT_PTR "0x%08Ix"
 #elif defined(_M_X64)
-#define FORMAT_PTR "0x%016I64x"
+#define FORMAT_PTR "0x%016Ix"
 #endif
 
 /*** Code. ***/
@@ -171,7 +171,7 @@ write_module_info_callback(void *data,
       MINIDUMP_MODULE_CALLBACK module = callback_input->Module;
 
       char *buf = convert_wbcs_to_ansi(module.FullPath);
-      fprintf(log_file, FORMAT_PTR, module.BaseOfImage);
+      fprintf(log_file, FORMAT_PTR, (INT_PTR)module.BaseOfImage);
       fprintf(log_file, "  %s", buf);
       free(buf);
 
@@ -302,7 +302,7 @@ format_basic_type(char *buf, DWORD basic
         break;
       default:
         sprintf(buf, "[unhandled type 0x%08x of length " FORMAT_PTR "]",
-                     basic_type, length);
+                     basic_type, (INT_PTR)length);
         break;
     }
 }
@@ -341,7 +341,7 @@ format_value(char *value_str, DWORD64 mo
 
               if (ptr == 0)
                 sprintf(value_str, "(%s) " FORMAT_PTR,
-                        type_name, (DWORD_PTR *)value_addr);
+                        type_name, (INT_PTR)(DWORD_PTR *)value_addr);
               else if (ptr == 1)
                 sprintf(value_str, "(%s *) " FORMAT_PTR,
                         type_name, *(DWORD_PTR *)value_addr);

Modified: subversion/branches/ra-git/subversion/libsvn_subr/x509info.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/x509info.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/x509info.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/x509info.c Mon Nov 30 10:24:16 2015
@@ -41,8 +41,7 @@ svn_x509_name_attr_dup(const svn_x509_na
 {
   svn_x509_name_attr_t *result = apr_palloc(result_pool, sizeof(*result));
   result->oid_len = attr->oid_len;
-  result->oid = apr_palloc(result_pool, result->oid_len);
-  memcpy(result->oid, attr->oid, result->oid_len);
+  result->oid = apr_pmemdup(result_pool, attr->oid, attr->oid_len);
   result->utf8_value = apr_pstrdup(result_pool, attr->utf8_value);
 
   return result;

Modified: subversion/branches/ra-git/subversion/libsvn_subr/x509parse.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/x509parse.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/x509parse.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/x509parse.c Mon Nov 30 10:24:16 2015
@@ -685,12 +685,13 @@ x509_get_ext(apr_array_header_t *dnsname
                   *p += len;
                   continue;
                 }
+
+              return svn_error_trace(err);
             }
           else
             {
               /* We found a dNSName entry */
-              x509_buf *dnsname = apr_palloc(dnsnames->pool,
-                                             sizeof(x509_buf));
+              x509_buf *dnsname = apr_palloc(dnsnames->pool, sizeof(*dnsname));
               dnsname->tag = ASN1_IA5_STRING; /* implicit based on dNSName */
               dnsname->len = len;
               dnsname->p = *p;
@@ -917,8 +918,7 @@ x509_name_to_certinfo(apr_array_header_t
     svn_x509_name_attr_t *attr = apr_palloc(result_pool, sizeof(svn_x509_name_attr_t));
 
     attr->oid_len = name->oid.len;
-    attr->oid = apr_palloc(result_pool, attr->oid_len);
-    memcpy(attr->oid, name->oid.p, attr->oid_len);
+    attr->oid = apr_pmemdup(result_pool, name->oid.p, attr->oid_len);
     attr->utf8_value = x509name_to_utf8_string(name, result_pool);
     if (!attr->utf8_value)
       /* this should never happen */
@@ -1052,7 +1052,7 @@ svn_x509_parse_cert(svn_x509_certinfo_t
    */
   err = asn1_get_tag(&p, end, &len, ASN1_CONSTRUCTED | ASN1_SEQUENCE);
   if (err)
-    return svn_error_create(SVN_ERR_X509_CERT_INVALID_FORMAT, NULL, NULL);
+    return svn_error_create(SVN_ERR_X509_CERT_INVALID_FORMAT, err, NULL);
 
   if (len != (end - p))
     {

Modified: subversion/branches/ra-git/subversion/libsvn_subr/xml.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/xml.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/xml.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/xml.c Mon Nov 30 10:24:16 2015
@@ -34,6 +34,7 @@
 #include "svn_ctype.h"
 
 #include "private/svn_utf_private.h"
+#include "private/svn_subr_private.h"
 
 #ifdef SVN_HAVE_OLD_EXPAT
 #include <xmlparse.h>
@@ -45,6 +46,28 @@
 #error Expat is unusable -- it has been compiled for wide characters
 #endif
 
+const char *
+svn_xml__compiled_version(void)
+{
+  static const char xml_version_str[] = APR_STRINGIFY(XML_MAJOR_VERSION)
+                                        "." APR_STRINGIFY(XML_MINOR_VERSION)
+                                        "." APR_STRINGIFY(XML_MICRO_VERSION);
+
+  return xml_version_str;
+}
+
+const char *
+svn_xml__runtime_version(void)
+{
+  const char *expat_version = XML_ExpatVersion();
+
+  if (!strncmp(expat_version, "expat_", 6))
+    expat_version += 6;
+
+  return expat_version;
+}
+
+
 /* The private internals for a parser object. */
 struct svn_xml_parser_t
 {

Modified: subversion/branches/ra-git/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/adm_crawler.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/adm_crawler.c Mon Nov 30 10:24:16 2015
@@ -1016,6 +1016,7 @@ svn_wc__internal_transmit_text_deltas(co
   svn_checksum_t *local_sha1_checksum;  /* calc'd SHA1 of LOCAL_STREAM */
   svn_wc__db_install_data_t *install_data = NULL;
   svn_error_t *err;
+  svn_error_t *err2;
   svn_stream_t *base_stream;  /* delta source */
   svn_stream_t *local_stream;  /* delta target: LOCAL_ABSPATH transl. to NF */
 
@@ -1112,7 +1113,15 @@ svn_wc__internal_transmit_text_deltas(co
                         scratch_pool, scratch_pool);
 
   /* Close the two streams to force writing the digest */
-  err = svn_error_compose_create(err, svn_stream_close(base_stream));
+  err2 = svn_stream_close(base_stream);
+  if (err2)
+    {
+      /* Set verify_checksum to NULL if svn_stream_close() returns error
+         because checksum will be uninitialized in this case. */
+      verify_checksum = NULL;
+      err = svn_error_compose_create(err, err2);
+    }
+
   err = svn_error_compose_create(err, svn_stream_close(local_stream));
 
   /* If we have an error, it may be caused by a corrupt text base,

Modified: subversion/branches/ra-git/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/conflicts.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/conflicts.c Mon Nov 30 10:24:16 2015
@@ -1142,6 +1142,7 @@ static svn_error_t *
 generate_propconflict(svn_boolean_t *conflict_remains,
                       svn_wc__db_t *db,
                       const char *local_abspath,
+                      svn_node_kind_t kind,
                       svn_wc_operation_t operation,
                       const svn_wc_conflict_version_t *left_version,
                       const svn_wc_conflict_version_t *right_version,
@@ -1159,24 +1160,11 @@ generate_propconflict(svn_boolean_t *con
   svn_wc_conflict_result_t *result = NULL;
   svn_wc_conflict_description2_t *cdesc;
   const char *dirpath = svn_dirent_dirname(local_abspath, scratch_pool);
-  svn_node_kind_t kind;
   const svn_string_t *new_value = NULL;
 
-  SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath,
-                               FALSE /* allow_missing */,
-                               FALSE /* show_deleted */,
-                               FALSE /* show_hidden */,
-                               scratch_pool));
-
-  if (kind == svn_node_none)
-    return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
-                             _("The node '%s' was not found."),
-                             svn_dirent_local_style(local_abspath,
-                                                    scratch_pool));
-
   cdesc = svn_wc_conflict_description_create_prop2(
                 local_abspath,
-                (kind == svn_node_dir) ? svn_node_dir : svn_node_file,
+                kind,
                 propname, scratch_pool);
 
   cdesc->operation = operation;
@@ -1363,8 +1351,6 @@ generate_propconflict(svn_boolean_t *con
         }
       case svn_wc_conflict_choose_merged:
         {
-          svn_stringbuf_t *merged_stringbuf;
-
           if (!cdesc->merged_file 
               && (!result->merged_file && !result->merged_value))
             return svn_error_create
@@ -1376,6 +1362,8 @@ generate_propconflict(svn_boolean_t *con
             new_value = result->merged_value;
           else
             {
+              svn_stringbuf_t *merged_stringbuf;
+
               SVN_ERR(svn_stringbuf_from_file2(&merged_stringbuf,
                                                result->merged_file ?
                                                     result->merged_file :
@@ -1681,7 +1669,13 @@ build_text_conflict_resolve_items(svn_sk
         SVN_ERR_ASSERT(choice == svn_wc_conflict_choose_postpone);
     }
 
-  SVN_ERR_ASSERT(install_from_abspath != NULL);
+  if (install_from_abspath == NULL)
+    return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
+                             _("Conflict on '%s' could not be resolved "
+                               "because the chosen version of the file "
+                               "is not available."),
+                             svn_dirent_local_style(local_abspath,
+                                                    scratch_pool));
 
   /* ### It would be nice if we could somehow pass RECORD_FILEINFO
          as true in some easy cases. */
@@ -1739,7 +1733,6 @@ read_text_conflict_desc(svn_wc_conflict_
                         svn_wc__db_t *db,
                         const char *local_abspath,
                         const svn_skel_t *conflict_skel,
-                        svn_boolean_t is_binary,
                         const char *mime_type,
                         svn_wc_operation_t operation,
                         const svn_wc_conflict_version_t *left_version,
@@ -1748,8 +1741,8 @@ read_text_conflict_desc(svn_wc_conflict_
                         apr_pool_t *scratch_pool)
 {
   *desc = svn_wc_conflict_description_create_text2(local_abspath, result_pool);
-  (*desc)->is_binary = is_binary;
   (*desc)->mime_type = mime_type;
+  (*desc)->is_binary = mime_type ? svn_mime_type_is_binary(mime_type) : FALSE;
   (*desc)->operation = operation;
   (*desc)->src_left_version = left_version;
   (*desc)->src_right_version = right_version;
@@ -1839,6 +1832,7 @@ resolve_tree_conflict_on_node(svn_boolea
 svn_error_t *
 svn_wc__conflict_invoke_resolver(svn_wc__db_t *db,
                                  const char *local_abspath,
+                                 svn_node_kind_t kind,
                                  const svn_skel_t *conflict_skel,
                                  const apr_array_header_t *merge_options,
                                  svn_wc_conflict_resolver_func2_t resolver_func,
@@ -1915,7 +1909,7 @@ svn_wc__conflict_invoke_resolver(svn_wc_
             SVN_ERR(cancel_func(cancel_baton));
 
           SVN_ERR(generate_propconflict(&conflict_remains,
-                                        db, local_abspath,
+                                        db, local_abspath, kind,
                                         operation,
                                         left_version,
                                         right_version,
@@ -1960,7 +1954,7 @@ svn_wc__conflict_invoke_resolver(svn_wc_
                                     scratch_pool, scratch_pool));
 
       SVN_ERR(read_text_conflict_desc(&desc,
-                                      db, local_abspath, conflict_skel, FALSE,
+                                      db, local_abspath, conflict_skel,
                                       svn_prop_get_value(props,
                                                          SVN_PROP_MIME_TYPE),
                                       operation, left_version, right_version,
@@ -2066,7 +2060,7 @@ read_prop_conflict_descs(apr_array_heade
                          apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool)
 {
-  const char *prop_reject_file;
+  const char *prop_reject_abspath;
   apr_hash_t *base_props;
   apr_hash_t *my_props;
   apr_hash_t *their_old_props;
@@ -2074,8 +2068,16 @@ read_prop_conflict_descs(apr_array_heade
   apr_hash_t *conflicted_props;
   apr_hash_index_t *hi;
   apr_pool_t *iterpool;
+  svn_boolean_t prop_conflicted;
 
-  SVN_ERR(svn_wc__conflict_read_prop_conflict(&prop_reject_file,
+  SVN_ERR(svn_wc__conflict_read_info(&operation, NULL, NULL, &prop_conflicted,
+                                     NULL, db, local_abspath, conflict_skel,
+                                     scratch_pool, scratch_pool));
+
+  if (!prop_conflicted)
+    return SVN_NO_ERROR;
+
+  SVN_ERR(svn_wc__conflict_read_prop_conflict(&prop_reject_abspath,
                                               &my_props,
                                               &their_old_props,
                                               &their_props,
@@ -2084,7 +2086,9 @@ read_prop_conflict_descs(apr_array_heade
                                               conflict_skel,
                                               scratch_pool, scratch_pool));
 
-  if ((! create_tempfiles) || apr_hash_count(conflicted_props) == 0)
+  prop_reject_abspath = apr_pstrdup(result_pool, prop_reject_abspath);
+
+  if (apr_hash_count(conflicted_props) == 0)
     {
       /* Legacy prop conflict with only a .reject file. */
       svn_wc_conflict_description2_t *desc;
@@ -2095,7 +2099,7 @@ read_prop_conflict_descs(apr_array_heade
 
       /* ### For property conflicts, cd2 stores prop_reject_abspath in
        * ### their_abspath, and stores theirs_abspath in merged_file. */
-      desc->prop_reject_abspath = apr_pstrdup(result_pool, prop_reject_file);
+      desc->prop_reject_abspath = prop_reject_abspath; /* in result_pool */
       desc->their_abspath = desc->prop_reject_abspath;
 
       desc->operation = operation;
@@ -2107,8 +2111,11 @@ read_prop_conflict_descs(apr_array_heade
       return SVN_NO_ERROR;
     }
 
-  SVN_ERR(svn_wc__db_read_pristine_props(&base_props, db, local_abspath,
-                                         result_pool, scratch_pool));
+  if (operation == svn_wc_operation_merge)
+    SVN_ERR(svn_wc__db_read_pristine_props(&base_props, db, local_abspath,
+                                           result_pool, scratch_pool));
+  else
+    base_props = NULL;
   iterpool = svn_pool_create(scratch_pool);
   for (hi = apr_hash_first(scratch_pool, conflicted_props);
        hi;
@@ -2155,22 +2162,26 @@ read_prop_conflict_descs(apr_array_heade
 
       /* ### For property conflicts, cd2 stores prop_reject_abspath in
        * ### their_abspath, and stores theirs_abspath in merged_file. */
-      desc->prop_reject_abspath = apr_pstrdup(result_pool, prop_reject_file);
+      desc->prop_reject_abspath = prop_reject_abspath; /* in result_pool */
       desc->their_abspath = desc->prop_reject_abspath;
 
-      desc->prop_value_base = svn_hash_gets(base_props, propname);
+      desc->prop_value_base = base_props ? svn_hash_gets(base_props, propname)
+                                         : desc->prop_value_incoming_old;
 
       if (my_value)
         {
           svn_stream_t *s;
           apr_size_t len;
 
-          SVN_ERR(svn_stream_open_unique(&s, &desc->my_abspath, NULL,
-                                         svn_io_file_del_on_pool_cleanup,
-                                         result_pool, iterpool));
-          len = my_value->len;
-          SVN_ERR(svn_stream_write(s, my_value->data, &len));
-          SVN_ERR(svn_stream_close(s));
+          if (create_tempfiles)
+            {
+              SVN_ERR(svn_stream_open_unique(&s, &desc->my_abspath, NULL,
+                                             svn_io_file_del_on_pool_cleanup,
+                                             result_pool, iterpool));
+              len = my_value->len;
+              SVN_ERR(svn_stream_write(s, my_value->data, &len));
+              SVN_ERR(svn_stream_close(s));
+            }
 
           desc->prop_value_working = svn_string_dup(my_value, result_pool);
         }
@@ -2182,12 +2193,15 @@ read_prop_conflict_descs(apr_array_heade
 
           /* ### For property conflicts, cd2 stores prop_reject_abspath in
            * ### their_abspath, and stores theirs_abspath in merged_file. */
-          SVN_ERR(svn_stream_open_unique(&s, &desc->merged_file, NULL,
-                                         svn_io_file_del_on_pool_cleanup,
-                                         result_pool, iterpool));
-          len = their_value->len;
-          SVN_ERR(svn_stream_write(s, their_value->data, &len));
-          SVN_ERR(svn_stream_close(s));
+          if (create_tempfiles)
+            {
+              SVN_ERR(svn_stream_open_unique(&s, &desc->merged_file, NULL,
+                                             svn_io_file_del_on_pool_cleanup,
+                                             result_pool, iterpool));
+              len = their_value->len;
+              SVN_ERR(svn_stream_write(s, their_value->data, &len));
+              SVN_ERR(svn_stream_close(s));
+            }
 
           desc->prop_value_incoming_new = svn_string_dup(their_value, result_pool);
         }
@@ -2197,12 +2211,15 @@ read_prop_conflict_descs(apr_array_heade
           svn_stream_t *s;
           apr_size_t len;
 
-          SVN_ERR(svn_stream_open_unique(&s, &desc->base_abspath, NULL,
-                                         svn_io_file_del_on_pool_cleanup,
-                                         result_pool, iterpool));
-          len = old_value->len;
-          SVN_ERR(svn_stream_write(s, old_value->data, &len));
-          SVN_ERR(svn_stream_close(s));
+          if (create_tempfiles)
+            {
+              SVN_ERR(svn_stream_open_unique(&s, &desc->base_abspath, NULL,
+                                             svn_io_file_del_on_pool_cleanup,
+                                             result_pool, iterpool));
+              len = old_value->len;
+              SVN_ERR(svn_stream_write(s, old_value->data, &len));
+              SVN_ERR(svn_stream_close(s));
+            }
 
           desc->prop_value_incoming_old = svn_string_dup(old_value, result_pool);
         }
@@ -2216,13 +2233,15 @@ read_prop_conflict_descs(apr_array_heade
 
 svn_error_t *
 svn_wc__read_conflicts(const apr_array_header_t **conflicts,
+                       svn_skel_t **conflict_skel,
                        svn_wc__db_t *db,
                        const char *local_abspath,
                        svn_boolean_t create_tempfiles,
+                       svn_boolean_t only_tree_conflict,
                        apr_pool_t *result_pool,
                        apr_pool_t *scratch_pool)
 {
-  svn_skel_t *conflict_skel;
+  svn_skel_t *the_conflict_skel;
   apr_array_header_t *cflcts;
   svn_boolean_t prop_conflicted;
   svn_boolean_t text_conflicted;
@@ -2232,12 +2251,19 @@ svn_wc__read_conflicts(const apr_array_h
   const svn_wc_conflict_version_t *left_version = NULL;
   const svn_wc_conflict_version_t *right_version = NULL;
   svn_node_kind_t node_kind;
+  apr_hash_t *props;
 
-  SVN_ERR(svn_wc__db_read_conflict(&conflict_skel, &node_kind,
+  if (!conflict_skel)
+    conflict_skel = &the_conflict_skel;
+
+  SVN_ERR(svn_wc__db_read_conflict(conflict_skel, &node_kind, &props,
                                    db, local_abspath,
-                                   scratch_pool, scratch_pool));
+                                   (conflict_skel == &the_conflict_skel)
+                                        ? scratch_pool
+                                        : result_pool,
+                                   scratch_pool));
 
-  if (!conflict_skel)
+  if (!*conflict_skel)
     {
       /* Some callers expect not NULL */
       *conflicts = apr_array_make(result_pool, 0,
@@ -2247,7 +2273,7 @@ svn_wc__read_conflicts(const apr_array_h
 
   SVN_ERR(svn_wc__conflict_read_info(&operation, &locations, &text_conflicted,
                                      &prop_conflicted, &tree_conflicted,
-                                     db, local_abspath, conflict_skel,
+                                     db, local_abspath, *conflict_skel,
                                      result_pool, scratch_pool));
 
   cflcts = apr_array_make(result_pool, 4,
@@ -2258,22 +2284,23 @@ svn_wc__read_conflicts(const apr_array_h
   if (locations && locations->nelts > 1)
     right_version = APR_ARRAY_IDX(locations, 1, const svn_wc_conflict_version_t *);
 
-  if (prop_conflicted)
+  if (prop_conflicted && !only_tree_conflict)
     {
       SVN_ERR(read_prop_conflict_descs(cflcts,
-                                       db, local_abspath, conflict_skel,
+                                       db, local_abspath, *conflict_skel,
                                        create_tempfiles, node_kind,
                                        operation, left_version, right_version,
                                        result_pool, scratch_pool));
     }
 
-  if (text_conflicted)
+  if (text_conflicted && !only_tree_conflict)
     {
       svn_wc_conflict_description2_t *desc;
 
       SVN_ERR(read_text_conflict_desc(&desc,
-                                      db, local_abspath, conflict_skel,
-                                      FALSE /*is_binary*/, NULL /*mime_type*/,
+                                      db, local_abspath, *conflict_skel,
+                                      svn_prop_get_value(props,
+                                                         SVN_PROP_MIME_TYPE),
                                       operation, left_version, right_version,
                                       result_pool, scratch_pool));
       APR_ARRAY_PUSH(cflcts, svn_wc_conflict_description2_t *) = desc;
@@ -2285,7 +2312,7 @@ svn_wc__read_conflicts(const apr_array_h
 
       SVN_ERR(read_tree_conflict_desc(&desc,
                                       db, local_abspath, node_kind,
-                                      conflict_skel,
+                                      *conflict_skel,
                                       operation, left_version, right_version,
                                       result_pool, scratch_pool));
 
@@ -2296,6 +2323,17 @@ svn_wc__read_conflicts(const apr_array_h
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_wc__read_conflict_descriptions2_t(const apr_array_header_t **conflicts,
+                                      svn_wc_context_t *wc_ctx,
+                                      const char *local_abspath,
+                                      apr_pool_t *result_pool,
+                                      apr_pool_t *scratch_pool)
+{
+  return svn_wc__read_conflicts(conflicts, NULL, wc_ctx->db, local_abspath, 
+                                FALSE, FALSE, result_pool, scratch_pool);
+}
+
 
 /*** Resolving a conflict automatically ***/
 
@@ -2434,15 +2472,12 @@ resolve_prop_conflict_on_node(svn_boolea
 
           if (!merged_value)
             {
-              svn_stream_t *stream;
-              svn_string_t *merged_propval;
+              svn_stringbuf_t *merged_propval;
 
-              SVN_ERR(svn_stream_open_readonly(&stream, merged_file,
-                                               scratch_pool, scratch_pool));
-              SVN_ERR(svn_string_from_stream(&merged_propval, stream,
-                                             scratch_pool, scratch_pool));
+              SVN_ERR(svn_stringbuf_from_file2(&merged_propval, merged_file,
+                                               scratch_pool));
 
-              merged_value = merged_propval;
+              merged_value = svn_stringbuf__morph_into_string(merged_propval);
             }
           svn_hash_sets(resolve_from, conflicted_propname, merged_value);
         }
@@ -2551,6 +2586,35 @@ resolve_prop_conflict_on_node(svn_boolea
   return SVN_NO_ERROR;
 }
 
+/* 
+ * Record a tree conflict resolution failure due to error condition ERR
+ * in the RESOLVE_LATER hash table. If the hash table is not available
+ * (meaning the caller does not wish to retry resolution later), or if
+ * the error condition does not indicate circumstances where another
+ * existing tree conflict is blocking the resolution attempt, then
+ * return the error ERR itself.
+ */
+static svn_error_t *
+handle_tree_conflict_resolution_failure(const char *local_abspath,
+                                        svn_error_t *err,
+                                        apr_hash_t *resolve_later)
+{
+  const char *dup_abspath;
+
+  if (!resolve_later
+      || (err->apr_err != SVN_ERR_WC_OBSTRUCTED_UPDATE
+          && err->apr_err != SVN_ERR_WC_FOUND_CONFLICT))
+    return svn_error_trace(err); /* Give up. Do not retry resolution later. */
+
+  svn_error_clear(err);
+  dup_abspath = apr_pstrdup(apr_hash_pool_get(resolve_later),
+                            local_abspath);
+
+  svn_hash_sets(resolve_later, dup_abspath, dup_abspath);
+
+  return SVN_NO_ERROR; /* Caller may retry after resolving other conflicts. */
+}
+
 /*
  * Resolve the tree conflict found in DB/LOCAL_ABSPATH according to
  * CONFLICT_CHOICE.
@@ -2560,9 +2624,11 @@ resolve_prop_conflict_on_node(svn_boolea
  *
  * It is not an error if there is no tree conflict.
  *
- * If the conflict can't be resolved yet because another tree conflict is
- * blocking a storage location, store the tree conflict in the RESOLVE_LATER
- * hash.
+ * If the conflict can't be resolved yet (e.g. because another tree conflict
+ * is blocking a storage location), and RESOLVE_LATER is not NULL, store the
+ * tree conflict in RESOLVE_LATER and do not mark the conflict resolved.
+ * Else if RESOLVE_LATER is NULL, do not mark the conflict resolved and
+ * return the error which prevented the conflict from being marked resolved.
  */
 static svn_error_t *
 resolve_tree_conflict_on_node(svn_boolean_t *did_resolve,
@@ -2637,26 +2703,12 @@ resolve_tree_conflict_on_node(svn_boolea
                         scratch_pool);
 
               if (err)
-                {
-                  const char *dup_abspath;
-
-                  if (!resolve_later
-                      || (err->apr_err != SVN_ERR_WC_OBSTRUCTED_UPDATE
-                          && err->apr_err != SVN_ERR_WC_FOUND_CONFLICT))
-                    return svn_error_trace(err);
-
-                  svn_error_clear(err);
-                  dup_abspath = apr_pstrdup(apr_hash_pool_get(resolve_later),
-                                            local_abspath);
-
-                  svn_hash_sets(resolve_later, dup_abspath, dup_abspath);
-
-                  return SVN_NO_ERROR; /* Retry after other conflicts */
-                }
+                SVN_ERR(handle_tree_conflict_resolution_failure(
+                          local_abspath, err, resolve_later));
 
               /* We might now have a moved-away on *this* path, let's
                  try to resolve that directly if that is the case */
-              SVN_ERR(svn_wc__db_read_conflict(&new_conflicts, NULL,
+              SVN_ERR(svn_wc__db_read_conflict(&new_conflicts, NULL, NULL,
                                                db, local_abspath,
                                                scratch_pool, scratch_pool));
 
@@ -2719,22 +2771,8 @@ resolve_tree_conflict_on_node(svn_boolea
                         scratch_pool);
 
               if (err)
-                {
-                  const char *dup_abspath;
-
-                  if (!resolve_later
-                      || (err->apr_err != SVN_ERR_WC_OBSTRUCTED_UPDATE
-                          && err->apr_err != SVN_ERR_WC_FOUND_CONFLICT))
-                    return svn_error_trace(err);
-
-                  svn_error_clear(err);
-                  dup_abspath = apr_pstrdup(apr_hash_pool_get(resolve_later),
-                                            local_abspath);
-
-                  svn_hash_sets(resolve_later, dup_abspath, dup_abspath);
-
-                  return SVN_NO_ERROR; /* Retry after other conflicts */
-                }
+                SVN_ERR(handle_tree_conflict_resolution_failure(
+                          local_abspath, err, resolve_later));
               else
                 *did_resolve = TRUE;
             }
@@ -2828,7 +2866,8 @@ svn_wc__mark_resolved_text_conflict(svn_
   svn_skel_t *work_items;
   svn_skel_t *conflict;
 
-  SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, db, local_abspath,
+  SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, NULL,
+                                   db, local_abspath,
                                    scratch_pool, scratch_pool));
 
   if (!conflict)
@@ -2857,7 +2896,8 @@ svn_wc__mark_resolved_prop_conflicts(svn
   svn_boolean_t ignored_result;
   svn_skel_t *conflicts;
 
-  SVN_ERR(svn_wc__db_read_conflict(&conflicts, NULL, db, local_abspath,
+  SVN_ERR(svn_wc__db_read_conflict(&conflicts, NULL, NULL,
+                                   db, local_abspath,
                                    scratch_pool, scratch_pool));
 
   if (!conflicts)
@@ -2942,10 +2982,10 @@ conflict_status_walker(void *baton,
 
   iterpool = svn_pool_create(scratch_pool);
 
-  SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, db, local_abspath,
-                                   scratch_pool, scratch_pool));
-
-  SVN_ERR(svn_wc__read_conflicts(&conflicts, db, local_abspath, TRUE,
+  SVN_ERR(svn_wc__read_conflicts(&conflicts, &conflict,
+                                 db, local_abspath,
+                                 (cswb->conflict_func != NULL) /* tmp files */,
+                                 FALSE /* only tree conflicts */,
                                  scratch_pool, iterpool));
 
   for (i = 0; i < conflicts->nelts; i++)

Modified: subversion/branches/ra-git/subversion/libsvn_wc/conflicts.h
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/conflicts.h?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/conflicts.h (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/conflicts.h Mon Nov 30 10:24:16 2015
@@ -419,6 +419,7 @@ svn_wc__conflict_create_markers(svn_skel
 svn_error_t *
 svn_wc__conflict_invoke_resolver(svn_wc__db_t *db,
                                  const char *local_abspath,
+                                 svn_node_kind_t kind,
                                  const svn_skel_t *conflict_skel,
                                  const apr_array_header_t *merge_options,
                                  svn_wc_conflict_resolver_func2_t resolver_func,

Modified: subversion/branches/ra-git/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/copy.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/copy.c Mon Nov 30 10:24:16 2015
@@ -258,8 +258,9 @@ copy_versioned_file(svn_wc__db_t *db,
           svn_error_t *err;
 
           /* Is there a text conflict at the source path? */
-          SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, db, src_abspath,
-                                         scratch_pool, scratch_pool));
+          SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, NULL,
+                                           db, src_abspath,
+                                           scratch_pool, scratch_pool));
 
           err = svn_wc__conflict_read_text_conflict(&conflict_working, NULL, NULL,
                                                     db, src_abspath, conflict,
@@ -945,7 +946,8 @@ remove_node_conflict_markers(svn_wc__db_
 {
   svn_skel_t *conflict;
 
-  SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, db, src_abspath,
+  SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, NULL,
+                                   db, src_abspath,
                                    scratch_pool, scratch_pool));
 
   /* Do we have conflict markers that should be removed? */
@@ -1102,8 +1104,8 @@ svn_wc__move2(svn_wc_context_t *wc_ctx,
     {
       svn_error_t *err;
 
-      err = svn_error_trace(svn_io_file_rename(src_abspath, dst_abspath,
-                                               scratch_pool));
+      err = svn_error_trace(svn_io_file_rename2(src_abspath, dst_abspath,
+                                                FALSE, scratch_pool));
 
       /* Let's try if we can keep wc.db consistent even when the move
          fails. Deleting the target is a wc.db only operation, while

Modified: subversion/branches/ra-git/subversion/libsvn_wc/delete.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/delete.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/delete.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/delete.c Mon Nov 30 10:24:16 2015
@@ -135,7 +135,8 @@ create_delete_wq_items(svn_skel_t **work
       const apr_array_header_t *markers;
       int i;
 
-      SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, db, local_abspath,
+      SVN_ERR(svn_wc__db_read_conflict(&conflict, NULL, NULL,
+                                       db, local_abspath,
                                        scratch_pool, scratch_pool));
 
       SVN_ERR(svn_wc__conflict_read_markers(&markers, db, local_abspath,

Modified: subversion/branches/ra-git/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/deprecated.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/deprecated.c Mon Nov 30 10:24:16 2015
@@ -948,12 +948,12 @@ svn_wc_delete(const char *path,
 svn_error_t *
 svn_wc_add_from_disk2(svn_wc_context_t *wc_ctx,
                      const char *local_abspath,
-                      const apr_hash_t *props,
+                     const apr_hash_t *props,
                      svn_wc_notify_func2_t notify_func,
                      void *notify_baton,
                      apr_pool_t *scratch_pool)
 {
-  SVN_ERR(svn_wc_add_from_disk3(wc_ctx, local_abspath, NULL, FALSE,
+  SVN_ERR(svn_wc_add_from_disk3(wc_ctx, local_abspath, props, FALSE,
                                  notify_func, notify_baton, scratch_pool));
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/ra-git/subversion/libsvn_wc/diff.h
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/diff.h?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/diff.h (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/diff.h Mon Nov 30 10:24:16 2015
@@ -52,6 +52,7 @@ svn_error_t *
 svn_wc__diff_local_only_file(svn_wc__db_t *db,
                              const char *local_abspath,
                              const char *relpath,
+                             const char *moved_from_relpath,
                              const svn_diff_tree_processor_t *processor,
                              void *processor_parent_baton,
                              svn_boolean_t diff_pristine,
@@ -75,6 +76,7 @@ svn_wc__diff_local_only_dir(svn_wc__db_t
                             const char *local_abspath,
                             const char *relpath,
                             svn_depth_t depth,
+                            const char *moved_from_relpath,
                             const svn_diff_tree_processor_t *processor,
                             void *processor_parent_baton,
                             svn_boolean_t diff_pristine,

Modified: subversion/branches/ra-git/subversion/libsvn_wc/diff_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/diff_editor.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/diff_editor.c Mon Nov 30 10:24:16 2015
@@ -145,6 +145,9 @@ struct dir_baton_t
   /* TRUE if the node is to be compared with an unrelated node*/
   svn_boolean_t ignoring_ancestry;
 
+  /* TRUE if the directory was reported incomplete to the repository */
+  svn_boolean_t is_incomplete;
+
   /* Processor state */
   void *pdb;
   svn_boolean_t skip;
@@ -741,9 +744,29 @@ walk_local_nodes_diff(struct edit_baton_
 
           if (eb->local_before_remote && local_only)
             {
+              const char *moved_from_relpath;
+
+              if (info->moved_here)
+                {
+                  const char *moved_from_abspath;
+
+                  SVN_ERR(svn_wc__db_scan_moved(&moved_from_abspath,
+                                                NULL, NULL, NULL,
+                                                db, child_abspath,
+                                                iterpool, iterpool));
+                  SVN_ERR_ASSERT(moved_from_abspath != NULL);
+
+                  moved_from_relpath = svn_dirent_skip_ancestor(
+                                                        eb->anchor_abspath,
+                                                        moved_from_abspath);
+                }
+              else
+                moved_from_relpath = NULL;
+
               if (info->kind == svn_node_file && diff_files)
                 SVN_ERR(svn_wc__diff_local_only_file(db, child_abspath,
                                                      child_relpath,
+                                                     moved_from_relpath,
                                                      eb->processor, dir_baton,
                                                      eb->diff_pristine,
                                                      eb->cancel_func,
@@ -753,6 +776,7 @@ walk_local_nodes_diff(struct edit_baton_
                 SVN_ERR(svn_wc__diff_local_only_dir(db, child_abspath,
                                                     child_relpath,
                                                     depth_below_here,
+                                                    moved_from_relpath,
                                                     eb->processor, dir_baton,
                                                     eb->diff_pristine,
                                                     eb->cancel_func,
@@ -807,9 +831,29 @@ walk_local_nodes_diff(struct edit_baton_
 
           if (!eb->local_before_remote && local_only)
             {
+              const char *moved_from_relpath;
+
+              if (info->moved_here)
+                {
+                  const char *moved_from_abspath;
+
+                  SVN_ERR(svn_wc__db_scan_moved(&moved_from_abspath,
+                                                NULL, NULL, NULL,
+                                                db, child_abspath,
+                                                iterpool, iterpool));
+                  SVN_ERR_ASSERT(moved_from_abspath != NULL);
+
+                  moved_from_relpath = svn_dirent_skip_ancestor(
+                                                        eb->anchor_abspath,
+                                                        moved_from_abspath);
+                }
+              else
+                moved_from_relpath = NULL;
+
               if (info->kind == svn_node_file && diff_files)
                 SVN_ERR(svn_wc__diff_local_only_file(db, child_abspath,
                                                      child_relpath,
+                                                     moved_from_relpath,
                                                      eb->processor, dir_baton,
                                                      eb->diff_pristine,
                                                      eb->cancel_func,
@@ -817,12 +861,13 @@ walk_local_nodes_diff(struct edit_baton_
                                                      iterpool));
               else if (info->kind == svn_node_dir && diff_dirs)
                 SVN_ERR(svn_wc__diff_local_only_dir(db, child_abspath,
-                                                     child_relpath, depth_below_here,
-                                                     eb->processor, dir_baton,
-                                                     eb->diff_pristine,
-                                                     eb->cancel_func,
-                                                     eb->cancel_baton,
-                                                     iterpool));
+                                                    child_relpath, depth_below_here,
+                                                    moved_from_relpath,
+                                                    eb->processor, dir_baton,
+                                                    eb->diff_pristine,
+                                                    eb->cancel_func,
+                                                    eb->cancel_baton,
+                                                    iterpool));
             }
         }
     }
@@ -873,6 +918,7 @@ svn_error_t *
 svn_wc__diff_local_only_file(svn_wc__db_t *db,
                              const char *local_abspath,
                              const char *relpath,
+                             const char *moved_from_relpath,
                              const svn_diff_tree_processor_t *processor,
                              void *processor_parent_baton,
                              svn_boolean_t diff_pristine,
@@ -935,6 +981,7 @@ svn_wc__diff_local_only_file(svn_wc__db_
     {
       copyfrom_src = svn_diff__source_create(original_revision, scratch_pool);
       copyfrom_src->repos_relpath = original_repos_relpath;
+      copyfrom_src->moved_from_relpath = moved_from_relpath;
     }
 
   if (props_mod || !SVN_IS_VALID_REVNUM(revision))
@@ -1013,6 +1060,7 @@ svn_wc__diff_local_only_dir(svn_wc__db_t
                             const char *local_abspath,
                             const char *relpath,
                             svn_depth_t depth,
+                            const char *moved_from_relpath,
                             const svn_diff_tree_processor_t *processor,
                             void *processor_parent_baton,
                             svn_boolean_t diff_pristine,
@@ -1049,6 +1097,7 @@ svn_wc__diff_local_only_dir(svn_wc__db_t
     {
       copyfrom_src = svn_diff__source_create(original_revision, scratch_pool);
       copyfrom_src->repos_relpath = original_repos_relpath;
+      copyfrom_src->moved_from_relpath = moved_from_relpath;
     }
 
   /* svn_wc__db_status_incomplete should never happen, as the result won't be
@@ -1136,12 +1185,40 @@ svn_wc__diff_local_only_dir(svn_wc__db_t
 
           child_relpath = svn_relpath_join(relpath, name, iterpool);
 
+          if (info->moved_here)
+            {
+              const char *moved_from_abspath;
+              const char *a_abspath;
+              const char *a_relpath;
+
+              a_relpath = relpath;
+              a_abspath = local_abspath;
+              while (*a_relpath)
+                {
+                  a_relpath = svn_relpath_dirname(a_relpath, iterpool);
+                  a_abspath = svn_dirent_dirname(a_abspath, iterpool);
+                }
+
+              SVN_ERR(svn_wc__db_scan_moved(&moved_from_abspath,
+                                            NULL, NULL, NULL,
+                                            db, child_abspath,
+                                            iterpool, iterpool));
+              SVN_ERR_ASSERT(moved_from_abspath != NULL);
+
+              moved_from_relpath = svn_dirent_skip_ancestor(
+                                                        a_abspath,
+                                                        moved_from_abspath);
+            }
+          else
+            moved_from_relpath = NULL;
+
           switch (info->kind)
             {
             case svn_node_file:
             case svn_node_symlink:
               SVN_ERR(svn_wc__diff_local_only_file(db, child_abspath,
                                                    child_relpath,
+                                                   moved_from_relpath,
                                                    processor, pdb,
                                                    diff_pristine,
                                                    cancel_func, cancel_baton,
@@ -1154,6 +1231,7 @@ svn_wc__diff_local_only_dir(svn_wc__db_t
                   SVN_ERR(svn_wc__diff_local_only_dir(db, child_abspath,
                                                       child_relpath,
                                                       depth_below_here,
+                                                      moved_from_relpath,
                                                       processor, pdb,
                                                       diff_pristine,
                                                       cancel_func,
@@ -1202,6 +1280,8 @@ handle_local_only(struct dir_baton_t *pb
 {
   struct edit_baton_t *eb = pb->eb;
   const struct svn_wc__db_info_t *info;
+  const char *child_abspath;
+  const char *moved_from_relpath;
   svn_boolean_t repos_delete = (pb->deletes
                                 && svn_hash_gets(pb->deletes, name));
 
@@ -1220,10 +1300,8 @@ handle_local_only(struct dir_baton_t *pb
 
   switch (info->status)
     {
-      case svn_wc__db_status_incomplete:
-        return SVN_NO_ERROR; /* Not local only */
-
       case svn_wc__db_status_normal:
+      case svn_wc__db_status_incomplete:
         if (!repos_delete)
           return SVN_NO_ERROR; /* Local and remote */
         svn_hash_sets(pb->deletes, name, NULL);
@@ -1239,6 +1317,25 @@ handle_local_only(struct dir_baton_t *pb
         break;
     }
 
+  child_abspath = svn_dirent_join(pb->local_abspath, name, scratch_pool);
+
+  if (info->moved_here)
+    {
+      const char *moved_from_abspath;
+
+      SVN_ERR(svn_wc__db_scan_moved(&moved_from_abspath,
+                                    NULL, NULL, NULL,
+                                    eb->db, child_abspath,
+                                    scratch_pool, scratch_pool));
+      SVN_ERR_ASSERT(moved_from_abspath != NULL);
+
+      moved_from_relpath = svn_dirent_skip_ancestor(
+                                    eb->anchor_abspath,
+                                    moved_from_abspath);
+    }
+  else
+    moved_from_relpath = NULL;
+
   if (info->kind == svn_node_dir)
     {
       svn_depth_t depth ;
@@ -1250,9 +1347,10 @@ handle_local_only(struct dir_baton_t *pb
 
       SVN_ERR(svn_wc__diff_local_only_dir(
                       eb->db,
-                      svn_dirent_join(pb->local_abspath, name, scratch_pool),
+                      child_abspath,
                       svn_relpath_join(pb->relpath, name, scratch_pool),
                       repos_delete ? svn_depth_infinity : depth,
+                      moved_from_relpath,
                       eb->processor, pb->pdb,
                       eb->diff_pristine,
                       eb->cancel_func, eb->cancel_baton,
@@ -1261,8 +1359,9 @@ handle_local_only(struct dir_baton_t *pb
   else
     SVN_ERR(svn_wc__diff_local_only_file(
                       eb->db,
-                      svn_dirent_join(pb->local_abspath, name, scratch_pool),
+                      child_abspath,
                       svn_relpath_join(pb->relpath, name, scratch_pool),
+                      moved_from_relpath,
                       eb->processor, pb->pdb,
                       eb->diff_pristine,
                       eb->cancel_func, eb->cancel_baton,
@@ -1608,25 +1707,47 @@ open_directory(const char *path,
         db->repos_only = TRUE;
 
       if (!db->repos_only)
-        switch (info->status)
-          {
-            case svn_wc__db_status_normal:
-              break;
-            case svn_wc__db_status_deleted:
-              db->repos_only = TRUE;
-
-              if (!info->have_more_work)
-                svn_hash_sets(pb->compared,
-                              apr_pstrdup(pb->pool, db->name), "");
-              break;
-            case svn_wc__db_status_added:
-              if (eb->ignore_ancestry)
-                db->ignoring_ancestry = TRUE;
-              else
+        {
+          switch (info->status)
+            {
+              case svn_wc__db_status_normal:
+              case svn_wc__db_status_incomplete:
+                db->is_incomplete = (info->status ==
+                                     svn_wc__db_status_incomplete);
+                break;
+              case svn_wc__db_status_deleted:
                 db->repos_only = TRUE;
-              break;
-            default:
-              SVN_ERR_MALFUNCTION();
+
+                if (!info->have_more_work)
+                  svn_hash_sets(pb->compared,
+                                apr_pstrdup(pb->pool, db->name), "");
+                break;
+              case svn_wc__db_status_added:
+                if (eb->ignore_ancestry)
+                  db->ignoring_ancestry = TRUE;
+                else
+                  db->repos_only = TRUE;
+                break;
+              default:
+                SVN_ERR_MALFUNCTION();
+          }
+
+          if (info->status == svn_wc__db_status_added
+              || info->status == svn_wc__db_status_deleted)
+            {
+              svn_wc__db_status_t base_status;
+
+              /* Node is shadowed; check BASE */
+              SVN_ERR(svn_wc__db_base_get_info(&base_status, NULL, NULL,
+                                               NULL, NULL, NULL, NULL, NULL,
+                                               NULL, NULL, NULL, NULL, NULL,
+                                               NULL, NULL, NULL,
+                                               eb->db, db->local_abspath,
+                                               dir_pool, dir_pool));
+
+              if (base_status == svn_wc__db_status_incomplete)
+                db->is_incomplete = TRUE;
+            }
         }
 
       if (!db->repos_only)
@@ -1714,7 +1835,7 @@ close_directory(void *dir_baton,
     {
       apr_hash_t *repos_props;
 
-      if (db->added)
+      if (db->added || db->is_incomplete)
         {
           repos_props = apr_hash_make(scratch_pool);
         }
@@ -1891,6 +2012,7 @@ open_file(const char *path,
         switch (info->status)
           {
             case svn_wc__db_status_normal:
+            case svn_wc__db_status_incomplete:
               break;
             case svn_wc__db_status_deleted:
               fb->repos_only = TRUE;
@@ -2404,8 +2526,8 @@ wrap_dir_opened(void **new_dir_baton,
   wc_diff_wrap_baton_t *wb = processor->baton;
   svn_boolean_t tree_conflicted = FALSE;
 
-  assert(left_source || right_source);
-  assert(!copyfrom_source || !right_source);
+  assert(left_source || right_source);      /* Must exist at one point. */
+  assert(!left_source || !copyfrom_source); /* Either existed or added. */
 
   /* Maybe store state and tree_conflicted in baton? */
   if (left_source != NULL)

Modified: subversion/branches/ra-git/subversion/libsvn_wc/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/diff_local.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/diff_local.c Mon Nov 30 10:24:16 2015
@@ -281,7 +281,8 @@ diff_status_callback(void *baton,
       {
         local_only = TRUE; /* Only report additions */
       }
-    else if (db_status == svn_wc__db_status_normal)
+    else if (db_status == svn_wc__db_status_normal
+             || db_status == svn_wc__db_status_incomplete)
       {
         /* Simple diff */
         base_kind = db_kind;
@@ -297,7 +298,8 @@ diff_status_callback(void *baton,
                                          eb->db, local_abspath,
                                          scratch_pool, scratch_pool));
 
-        if (base_status != svn_wc__db_status_normal)
+        if (base_status != svn_wc__db_status_normal
+            && base_status != svn_wc__db_status_incomplete)
           return SVN_NO_ERROR;
       }
     else
@@ -312,7 +314,8 @@ diff_status_callback(void *baton,
                                          eb->db, local_abspath,
                                          scratch_pool, scratch_pool));
 
-        if (base_status != svn_wc__db_status_normal)
+        if (base_status != svn_wc__db_status_normal
+            && base_status != svn_wc__db_status_incomplete)
           local_only = TRUE;
         else if (base_kind != db_kind || !eb->ignore_ancestry)
           {
@@ -388,9 +391,20 @@ diff_status_callback(void *baton,
 
     if (local_only && (db_status != svn_wc__db_status_deleted))
       {
+        /* Moved from. Relative from diff anchor*/
+        const char *moved_from_relpath = NULL;
+
+        if (status->moved_from_abspath)
+          {
+            moved_from_relpath = svn_dirent_skip_ancestor(
+                                          eb->anchor_abspath,
+                                          status->moved_from_abspath);
+          }
+
         if (db_kind == svn_node_file)
           SVN_ERR(svn_wc__diff_local_only_file(db, child_abspath,
                                                child_relpath,
+                                               moved_from_relpath,
                                                eb->processor,
                                                eb->cur ? eb->cur->baton : NULL,
                                                FALSE,
@@ -400,6 +414,7 @@ diff_status_callback(void *baton,
         else if (db_kind == svn_node_dir)
           SVN_ERR(svn_wc__diff_local_only_dir(db, child_abspath,
                                               child_relpath, depth_below_here,
+                                              moved_from_relpath,
                                               eb->processor,
                                               eb->cur ? eb->cur->baton : NULL,
                                               FALSE,

Modified: subversion/branches/ra-git/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/entries.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/entries.c Mon Nov 30 10:24:16 2015
@@ -483,9 +483,10 @@ read_one_entry(const svn_wc_entry_t **ne
           child_abspath = svn_dirent_join(dir_abspath, child_name,
                                           scratch_pool);
 
-          SVN_ERR(svn_wc__read_conflicts(&child_conflicts,
+          SVN_ERR(svn_wc__read_conflicts(&child_conflicts, NULL,
                                          db, child_abspath,
                                          FALSE /* create tempfiles */,
+                                         TRUE /* tree_conflicts_only */,
                                          scratch_pool, scratch_pool));
 
           for (j = 0; j < child_conflicts->nelts; j++)
@@ -938,7 +939,7 @@ read_one_entry(const svn_wc_entry_t **ne
       svn_skel_t *conflict;
       svn_boolean_t text_conflicted;
       svn_boolean_t prop_conflicted;
-      SVN_ERR(svn_wc__db_read_conflict_internal(&conflict, NULL,
+      SVN_ERR(svn_wc__db_read_conflict_internal(&conflict, NULL, NULL,
                                                 wcroot, entry_relpath,
                                                 scratch_pool, scratch_pool));
 
@@ -1799,7 +1800,7 @@ write_entry(struct write_baton **entry_n
      normal         replace+copied        base       base+work
      add+copied     replace+copied        work       work+work
 
-     although obviously the node is a directory rather then a file.
+     although obviously the node is a directory rather than a file.
      There are then more conversion states where the parent is
      replaced.
 

Modified: subversion/branches/ra-git/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/externals.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/externals.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/externals.c Mon Nov 30 10:24:16 2015
@@ -462,9 +462,10 @@ struct edit_baton
   const apr_array_header_t *ext_patterns;
   const char *diff3cmd;
 
-  const char *url;
   const char *repos_root_url;
   const char *repos_uuid;
+  const char *old_repos_relpath;
+  const char *new_repos_relpath;
 
   const char *record_ancestor_abspath;
   const char *recorded_repos_relpath;
@@ -474,6 +475,8 @@ struct edit_baton
   /* Introducing a new file external */
   svn_boolean_t added;
 
+  svn_wc_conflict_resolver_func2_t conflict_func;
+  void *conflict_baton;
   svn_cancel_func_t cancel_func;
   void *cancel_baton;
   svn_wc_notify_func2_t notify_func;
@@ -572,7 +575,8 @@ open_file(const char *path,
 
   *file_baton = eb;
   SVN_ERR(svn_wc__db_base_get_info(NULL, &kind, &eb->original_revision,
-                                   NULL, NULL, NULL, &eb->changed_rev,
+                                   &eb->old_repos_relpath, NULL, NULL,
+                                   &eb->changed_rev,
                                    &eb->changed_date, &eb->changed_author,
                                    NULL, &eb->original_checksum, NULL, NULL,
                                    &eb->had_props, NULL, NULL,
@@ -733,8 +737,6 @@ close_file(void *file_baton,
     const svn_checksum_t *original_checksum = NULL;
 
     svn_boolean_t added = !SVN_IS_VALID_REVNUM(eb->original_revision);
-    const char *repos_relpath = svn_uri_skip_ancestor(eb->repos_root_url,
-                                                      eb->url, pool);
 
     if (! added)
       {
@@ -908,14 +910,14 @@ close_file(void *file_baton,
                             svn_wc_conflict_version_create2(
                                     eb->repos_root_url,
                                     eb->repos_uuid,
-                                    repos_relpath,
+                                    eb->old_repos_relpath,
                                     eb->original_revision,
                                     svn_node_file,
                                     pool),
                             svn_wc_conflict_version_create2(
                                     eb->repos_root_url,
                                     eb->repos_uuid,
-                                    repos_relpath,
+                                    eb->new_repos_relpath,
                                     *eb->target_revision,
                                     svn_node_file,
                                     pool),
@@ -933,7 +935,7 @@ close_file(void *file_baton,
                         eb->db,
                         eb->local_abspath,
                         eb->wri_abspath,
-                        repos_relpath,
+                        eb->new_repos_relpath,
                         eb->repos_root_url,
                         eb->repos_uuid,
                         *eb->target_revision,
@@ -963,6 +965,18 @@ close_file(void *file_baton,
     /* Run the work queue to complete the installation */
     SVN_ERR(svn_wc__wq_run(eb->db, eb->wri_abspath,
                            eb->cancel_func, eb->cancel_baton, pool));
+
+    if (conflict_skel && eb->conflict_func)
+      SVN_ERR(svn_wc__conflict_invoke_resolver(eb->db,
+                                               eb->local_abspath,
+                                               svn_node_file,
+                                               conflict_skel,
+                                               NULL /* merge_options */,
+                                               eb->conflict_func,
+                                               eb->conflict_baton,
+                                               eb->cancel_func,
+                                               eb->cancel_baton,
+                                               pool));
   }
 
   /* Notify */
@@ -1002,6 +1016,7 @@ close_edit(void *edit_baton,
 
   if (!eb->file_closed)
     {
+      apr_hash_t *wcroot_iprops = NULL;
       /* The file wasn't updated, but its url or revision might have...
          e.g. switch between branches for relative externals.
 
@@ -1009,53 +1024,26 @@ close_edit(void *edit_baton,
          investigating when we should and shouldn't update it...
          and avoid hard to debug edge cases */
 
-      svn_node_kind_t kind;
-      const char *old_repos_relpath;
-      svn_revnum_t changed_rev;
-      apr_time_t changed_date;
-      const char *changed_author;
-      const svn_checksum_t *checksum;
-      apr_hash_t *pristine_props;
-      const char *repos_relpath = svn_uri_skip_ancestor(eb->repos_root_url,
-                                                        eb->url, pool);
-
-      SVN_ERR(svn_wc__db_base_get_info(NULL, &kind, NULL, &old_repos_relpath,
-                                       NULL, NULL, &changed_rev, &changed_date,
-                                       &changed_author, NULL, &checksum, NULL,
-                                       NULL, NULL, &pristine_props, NULL,
-                                       eb->db, eb->local_abspath,
-                                       pool, pool));
+      if (eb->iprops)
+        {
+          wcroot_iprops = apr_hash_make(pool);
+          svn_hash_sets(wcroot_iprops, eb->local_abspath, eb->iprops);
+        }
 
-      if (kind != svn_node_file)
-        return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
-                                   _("Node '%s' is no existing file external"),
-                                   svn_dirent_local_style(eb->local_abspath,
-                                                          pool));
-
-      SVN_ERR(svn_wc__db_external_add_file(
-                    eb->db,
-                    eb->local_abspath,
-                    eb->wri_abspath,
-                    repos_relpath,
-                    eb->repos_root_url,
-                    eb->repos_uuid,
-                    *eb->target_revision,
-                    pristine_props,
-                    eb->iprops,
-                    eb->changed_rev,
-                    eb->changed_date,
-                    eb->changed_author,
-                    checksum,
-                    NULL /* clear dav props */,
-                    eb->record_ancestor_abspath,
-                    eb->recorded_repos_relpath,
-                    eb->recorded_peg_revision,
-                    eb->recorded_revision,
-                    FALSE, NULL,
-                    TRUE /* keep_recorded_info */,
-                    NULL /* conflict_skel */,
-                    NULL /* work_items */,
-                    pool));
+      SVN_ERR(svn_wc__db_op_bump_revisions_post_update(eb->db,
+                                                       eb->local_abspath,
+                                                       svn_depth_infinity,
+                                                       eb->new_repos_relpath,
+                                                       eb->repos_root_url,
+                                                       eb->repos_uuid,
+                                                       *eb->target_revision,
+                                                       apr_hash_make(pool)
+                                                       /* exclude_relpaths */,
+                                                       wcroot_iprops,
+                                                       TRUE /* empty update */,
+                                                       eb->notify_func,
+                                                       eb->notify_baton,
+                                                       pool));
     }
 
   return SVN_NO_ERROR;
@@ -1079,6 +1067,8 @@ svn_wc__get_file_external_editor(const s
                                  const char *recorded_url,
                                  const svn_opt_revision_t *recorded_peg_rev,
                                  const svn_opt_revision_t *recorded_rev,
+                                 svn_wc_conflict_resolver_func2_t conflict_func,
+                                 void *conflict_baton,
                                  svn_cancel_func_t cancel_func,
                                  void *cancel_baton,
                                  svn_wc_notify_func2_t notify_func,
@@ -1101,9 +1091,12 @@ svn_wc__get_file_external_editor(const s
   eb->name = svn_dirent_basename(eb->local_abspath, NULL);
   eb->target_revision = target_revision;
 
-  eb->url = apr_pstrdup(edit_pool, url);
   eb->repos_root_url = apr_pstrdup(edit_pool, repos_root_url);
   eb->repos_uuid = apr_pstrdup(edit_pool, repos_uuid);
+  eb->new_repos_relpath = svn_uri_skip_ancestor(eb->repos_root_url, url, edit_pool);
+  eb->old_repos_relpath = eb->new_repos_relpath;
+
+  eb->original_revision = SVN_INVALID_REVNUM;
 
   eb->iprops = iprops;
 
@@ -1127,6 +1120,8 @@ svn_wc__get_file_external_editor(const s
   else
     eb->recorded_revision = SVN_INVALID_REVNUM; /* Not fixed/HEAD */
 
+  eb->conflict_func = conflict_func;
+  eb->conflict_baton = conflict_baton;
   eb->cancel_func = cancel_func;
   eb->cancel_baton = cancel_baton;
   eb->notify_func = notify_func;

Modified: subversion/branches/ra-git/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/info.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/info.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/info.c Mon Nov 30 10:24:16 2015
@@ -283,9 +283,10 @@ build_info_for_node(svn_wc__info2_t **in
                                 local_abspath, result_pool, scratch_pool));
 
   if (conflicted)
-    SVN_ERR(svn_wc__read_conflicts(&wc_info->conflicts, db,
-                                   local_abspath,
-                                   TRUE /* ### create tempfiles */,
+    SVN_ERR(svn_wc__read_conflicts(&wc_info->conflicts, NULL,
+                                   db, local_abspath,
+                                   FALSE /* create tempfiles */,
+                                   FALSE /* only tree conflicts */,
                                    result_pool, scratch_pool));
   else
     wc_info->conflicts = NULL;
@@ -530,9 +531,10 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
       info->repos_root_URL = repos_root_url;
       info->repos_UUID = repos_uuid;
 
-      SVN_ERR(svn_wc__read_conflicts(&conflicts,
+      SVN_ERR(svn_wc__read_conflicts(&conflicts, NULL,
                                      wc_ctx->db, this_abspath,
-                                     TRUE /* ### create tempfiles */,
+                                     FALSE /* create tempfiles */,
+                                     FALSE /* only tree conflicts */,
                                      iterpool, iterpool));
       if (! conflicts || ! conflicts->nelts)
         continue;

Modified: subversion/branches/ra-git/subversion/libsvn_wc/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/merge.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/merge.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/merge.c Mon Nov 30 10:24:16 2015
@@ -1230,6 +1230,7 @@ svn_wc_merge5(enum svn_wc_merge_outcome_
   apr_hash_t *pristine_props = NULL;
   apr_hash_t *old_actual_props;
   apr_hash_t *new_actual_props = NULL;
+  svn_node_kind_t kind;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(left_abspath));
   SVN_ERR_ASSERT(svn_dirent_is_absolute(right_abspath));
@@ -1242,7 +1243,6 @@ svn_wc_merge5(enum svn_wc_merge_outcome_
   /* Sanity check:  the merge target must be a file under revision control */
   {
     svn_wc__db_status_t status;
-    svn_node_kind_t kind;
     svn_boolean_t had_props;
     svn_boolean_t props_mod;
     svn_boolean_t conflicted;
@@ -1405,7 +1405,7 @@ svn_wc_merge5(enum svn_wc_merge_outcome_
           svn_boolean_t text_conflicted, prop_conflicted;
 
           SVN_ERR(svn_wc__conflict_invoke_resolver(
-                    wc_ctx->db, target_abspath,
+                    wc_ctx->db, target_abspath, kind,
                     conflict_skel, merge_options,
                     conflict_func, conflict_baton,
                     cancel_func, cancel_baton,

Modified: subversion/branches/ra-git/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/node.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/node.c Mon Nov 30 10:24:16 2015
@@ -906,7 +906,8 @@ svn_wc__rename_wc(svn_wc_context_t *wc_c
     {
       SVN_ERR(svn_wc__db_drop_root(wc_ctx->db, wcroot_abspath, scratch_pool));
 
-      SVN_ERR(svn_io_file_rename(from_abspath, dst_abspath, scratch_pool));
+      SVN_ERR(svn_io_file_rename2(from_abspath, dst_abspath, FALSE,
+                                  scratch_pool));
     }
   else
     return svn_error_createf(

Modified: subversion/branches/ra-git/subversion/libsvn_wc/old-and-busted.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/old-and-busted.c?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/old-and-busted.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/old-and-busted.c Mon Nov 30 10:24:16 2015
@@ -1203,7 +1203,8 @@ svn_wc__read_entries_old(apr_hash_t **en
   /* Open the entries file. */
   SVN_ERR(svn_wc__open_adm_stream(&stream, dir_abspath, SVN_WC__ADM_ENTRIES,
                                   scratch_pool, scratch_pool));
-  SVN_ERR(svn_string_from_stream(&buf, stream, scratch_pool, scratch_pool));
+  SVN_ERR(svn_string_from_stream2(&buf, stream, SVN__STREAM_CHUNK_SIZE,
+                                  scratch_pool));
 
   /* We own the returned data; it is modifiable, so cast away... */
   curp = (char *)buf->data;