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 2018/11/07 12:30:11 UTC

svn commit: r1846002 [20/44] - in /subversion/branches/ra-git: ./ build/ build/ac-macros/ build/generator/ build/generator/swig/ build/generator/templates/ build/generator/util/ build/win32/ contrib/client-side/ contrib/client-side/svn_load_dirs/ contr...

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=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/version.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/version.c Wed Nov  7 12:30:06 2018
@@ -143,7 +143,7 @@ svn_version_extended(svn_boolean_t verbo
   info->build_time = __TIME__;
   info->build_host = SVN_BUILD_HOST;
   info->copyright = apr_pstrdup
-    (pool, _("Copyright (C) 2016 The Apache Software Foundation.\n"
+    (pool, _("Copyright (C) 2018 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 "
@@ -271,7 +271,7 @@ svn_version__parse_version_string(svn_ve
 
 
 svn_boolean_t
-svn_version__at_least(svn_version_t *version,
+svn_version__at_least(const svn_version_t *version,
                       int major,
                       int minor,
                       int patch)

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=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/win32_crashrpt.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/win32_crashrpt.c Wed Nov  7 12:30:06 2018
@@ -795,4 +795,11 @@ svn__unhandled_exception_filter(PEXCEPTI
   return EXCEPTION_EXECUTE_HANDLER;
 }
 #endif /* SVN_USE_WIN32_CRASHHANDLER */
+#else  /* !WIN32 */
+
+/* Silence OSX ranlib warnings about object files with no symbols. */
+#include <apr.h>
+extern const apr_uint32_t svn__fake__win32_crashrpt;
+const apr_uint32_t svn__fake__win32_crashrpt = 0xdeadbeef;
+
 #endif /* WIN32 */

Modified: subversion/branches/ra-git/subversion/libsvn_subr/win32_crypto.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/win32_crypto.c?rev=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/win32_crypto.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/win32_crypto.c Wed Nov  7 12:30:06 2018
@@ -512,4 +512,11 @@ svn_auth__get_windows_ssl_server_authori
 }
 
 
+#else  /* !WIN32 */
+
+/* Silence OSX ranlib warnings about object files with no symbols. */
+#include <apr.h>
+extern const apr_uint32_t svn__fake__win32_crypto;
+const apr_uint32_t svn__fake__win32_crypto = 0xdeadbeef;
+
 #endif /* WIN32 */

Modified: subversion/branches/ra-git/subversion/libsvn_subr/win32_xlate.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_subr/win32_xlate.c?rev=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/win32_xlate.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/win32_xlate.c Wed Nov  7 12:30:06 2018
@@ -248,4 +248,11 @@ svn_subr__win32_xlate_to_stringbuf(svn_s
   return APR_SUCCESS;
 }
 
+#else  /* !WIN32 */
+
+/* Silence OSX ranlib warnings about object files with no symbols. */
+#include <apr.h>
+extern const apr_uint32_t svn__fake__win32_xlate;
+const apr_uint32_t svn__fake__win32_xlate = 0xdeadbeef;
+
 #endif /* WIN32 */

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=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/x509info.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/x509info.c Wed Nov  7 12:30:06 2018
@@ -128,7 +128,7 @@ typedef struct asn1_oid {
   const char *long_label;
 } asn1_oid;
 
-#define CONSTANT_PAIR(c) (unsigned char *)(c), sizeof((c)) - 1
+#define CONSTANT_PAIR(c) (const unsigned char *)(c), sizeof((c)) - 1
 
 static const asn1_oid asn1_oids[] = {
   { CONSTANT_PAIR(SVN_X509_OID_COMMON_NAME),  "CN", "commonName" },

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=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_subr/x509parse.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_subr/x509parse.c Wed Nov  7 12:30:06 2018
@@ -262,13 +262,34 @@ x509_get_alg(const unsigned char **p, co
 
   if (*p == end)
     return SVN_NO_ERROR;
+  
+  /* The OID encoding of 1.2.840.113549.1.1.10 (id-RSASSA-PSS) */
+#define OID_RSASSA_PSS "\x2a\x86\x48\x86\xf7\x0d\x01\x01\x0a"
+
+  if (equal(alg->p, alg->len, OID_RSASSA_PSS, sizeof(OID_RSASSA_PSS) - 1))
+    {
+      /* Skip over algorithm parameters for id-RSASSA-PSS (RFC 8017)
+       *
+       * RSASSA-PSS-params ::= SEQUENCE {
+       *  hashAlgorithm      [0] HashAlgorithm    DEFAULT sha1,
+       *  maskGenAlgorithm   [1] MaskGenAlgorithm DEFAULT mgf1SHA1,
+       *  saltLength         [2] INTEGER          DEFAULT 20,
+       *  trailerField       [3] TrailerField     DEFAULT trailerFieldBC
+       * }
+       */
+      err = asn1_get_tag(p, end, &len, ASN1_CONSTRUCTED | ASN1_SEQUENCE);
+      if (err)
+        return svn_error_create(SVN_ERR_X509_CERT_INVALID_ALG, err, NULL);
 
-  /*
-   * assume the algorithm parameters must be NULL
-   */
-  err = asn1_get_tag(p, end, &len, ASN1_NULL);
-  if (err)
-    return svn_error_create(SVN_ERR_X509_CERT_INVALID_ALG, err, NULL);
+      *p += len;
+    }
+  else
+    {
+      /* Algorithm parameters must be NULL for other algorithms */
+      err = asn1_get_tag(p, end, &len, ASN1_NULL);
+      if (err)
+        return svn_error_create(SVN_ERR_X509_CERT_INVALID_ALG, err, NULL);
+    }
 
   if (*p != end)
     {
@@ -362,7 +383,7 @@ x509_get_name(const unsigned char **p, c
   x509_name *cur = NULL;
 
   err = asn1_get_tag(p, name_end, &len, ASN1_CONSTRUCTED | ASN1_SET);
-  if (err)
+  if (err || len < 1)
     return svn_error_create(SVN_ERR_X509_CERT_INVALID_NAME, err, NULL);
 
   set_end = *p + len;
@@ -472,6 +493,18 @@ x509_get_date(apr_time_t *when,
   /* apr_time_exp_t expects months to be zero indexed, 0=Jan, 11=Dec. */
   xt.tm_mon -= 1;
 
+  /* range checks (as per definition of apr_time_exp_t in apr_time.h) */
+  if (xt.tm_usec < 0 ||
+      xt.tm_sec < 0 || xt.tm_sec > 61 ||
+      xt.tm_min < 0 || xt.tm_min > 59 ||
+      xt.tm_hour < 0 || xt.tm_hour > 23 ||
+      xt.tm_mday < 1 || xt.tm_mday > 31 ||
+      xt.tm_mon < 0 || xt.tm_mon > 11 ||
+      xt.tm_year < 0 ||
+      xt.tm_wday < 0 || xt.tm_wday > 6 ||
+      xt.tm_yday < 0 || xt.tm_yday > 365)
+    return svn_error_create(SVN_ERR_X509_CERT_INVALID_DATE, NULL, NULL);
+
   ret = apr_time_exp_gmt_get(when, &xt);
   if (ret)
     return svn_error_wrap_apr(ret, NULL);

Modified: subversion/branches/ra-git/subversion/libsvn_wc/README
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/README?rev=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/README (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/README Wed Nov  7 12:30:06 2018
@@ -94,6 +94,10 @@ copies.
   .svn/wc.db                    /* SQLite database containing node metadata. */
        pristine/                /* Sharded directory containing base files. */
        tmp/                     /* Local tmp area. */
+       experimental/            /* Data for experimental features. */
+       shelves/                 /* Used by 1.10.x shelves implementation */
+       entries                  /* Stub file. */
+       format                   /* Stub file. */
 
 `wc.db':
    A self-contained SQLite database containing all the metadata Subversion
@@ -109,6 +113,17 @@ copies.
 
    Pristines are used for sending diffs back to the server, etc.
 
+`experimental':
+   Experimental (unstable) features store their data here.
+
+`shelves':
+   Subversion 1.10's "svn shelve" command stores shelved changes here.
+   This directory is not used by any other minor release line.
+
+`entries', `format':
+   These stub files exist only to enable a pre-1.7 client to yield a clearer
+   error message.
+
 
 How the client applies an update delta
 --------------------------------------

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=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/adm_crawler.c Wed Nov  7 12:30:06 2018
@@ -906,6 +906,27 @@ close_handler_copy(void *baton)
   return svn_stream_close(btn->source);
 }
 
+/* Implements svn_stream_seek_fn_t */
+static svn_error_t *
+seek_handler_copy(void *baton, const svn_stream_mark_t *mark)
+{
+  struct copying_stream_baton *btn = baton;
+
+  /* Only reset support. */
+  if (mark)
+    {
+      return svn_error_create(SVN_ERR_STREAM_SEEK_NOT_SUPPORTED,
+                              NULL, NULL);
+    }
+  else
+    {
+      SVN_ERR(svn_stream_reset(btn->source));
+      SVN_ERR(svn_stream_reset(btn->target));
+    }
+
+  return SVN_NO_ERROR;
+}
+
 
 /* Return a stream - allocated in POOL - which reads its input
  * from SOURCE and, while returning that to the caller, at the
@@ -928,6 +949,11 @@ copying_stream(svn_stream_t *source,
                        read_handler_copy);
   svn_stream_set_close(stream, close_handler_copy);
 
+  if (svn_stream_supports_reset(source) && svn_stream_supports_reset(target))
+    {
+      svn_stream_set_seek(stream, seek_handler_copy);
+    }
+
   return stream;
 }
 
@@ -995,9 +1021,38 @@ read_and_checksum_pristine_text(svn_stre
   return SVN_NO_ERROR;
 }
 
+typedef struct open_txdelta_stream_baton_t
+{
+  svn_boolean_t need_reset;
+  svn_stream_t *base_stream;
+  svn_stream_t *local_stream;
+} open_txdelta_stream_baton_t;
+
+/* Implements svn_txdelta_stream_open_func_t */
+static svn_error_t *
+open_txdelta_stream(svn_txdelta_stream_t **txdelta_stream_p,
+                    void *baton,
+                    apr_pool_t *result_pool,
+                    apr_pool_t *scratch_pool)
+{
+  open_txdelta_stream_baton_t *b = baton;
+
+  if (b->need_reset)
+    {
+      /* Under rare circumstances, we can be restarted and would need to
+       * supply the delta stream again.  In this case, reset both streams. */
+      SVN_ERR(svn_stream_reset(b->base_stream));
+      SVN_ERR(svn_stream_reset(b->local_stream));
+    }
+
+  svn_txdelta2(txdelta_stream_p, b->base_stream, b->local_stream,
+               FALSE, result_pool);
+  b->need_reset = TRUE;
+  return SVN_NO_ERROR;
+}
 
 svn_error_t *
-svn_wc__internal_transmit_text_deltas(const char **tempfile,
+svn_wc__internal_transmit_text_deltas(svn_stream_t *tempstream,
                                       const svn_checksum_t **new_text_base_md5_checksum,
                                       const svn_checksum_t **new_text_base_sha1_checksum,
                                       svn_wc__db_t *db,
@@ -1008,8 +1063,6 @@ svn_wc__internal_transmit_text_deltas(co
                                       apr_pool_t *result_pool,
                                       apr_pool_t *scratch_pool)
 {
-  svn_txdelta_window_handler_t handler;
-  void *wh_baton;
   const svn_checksum_t *expected_md5_checksum;  /* recorded MD5 of BASE_S. */
   svn_checksum_t *verify_checksum;  /* calc'd MD5 of BASE_STREAM */
   svn_checksum_t *local_md5_checksum;  /* calc'd MD5 of LOCAL_STREAM */
@@ -1027,22 +1080,13 @@ svn_wc__internal_transmit_text_deltas(co
                                              scratch_pool, scratch_pool));
 
   /* If the caller wants a copy of the working file translated to
-   * repository-normal form, make the copy by tee-ing the stream and set
-   * *TEMPFILE to the path to it.  This is only needed for the 1.6 API,
-   * 1.7 doesn't set TEMPFILE.  Even when using the 1.6 API this file
-   * is not used by the functions that would have used it when using
-   * the 1.6 code.  It's possible that 3rd party users (if there are any)
-   * might expect this file to be a text-base. */
-  if (tempfile)
-    {
-      svn_stream_t *tempstream;
-
-      /* It can't be the same location as in 1.6 because the admin directory
-         no longer exists. */
-      SVN_ERR(svn_stream_open_unique(&tempstream, tempfile,
-                                     NULL, svn_io_file_del_none,
-                                     result_pool, scratch_pool));
-
+   * repository-normal form, make the copy by tee-ing the TEMPSTREAM.
+   * This is only needed for the 1.6 API.  Even when using the 1.6 API
+   * this temporary file is not used by the functions that would have used
+   * it when using the 1.6 code.  It's possible that 3rd party users (if
+   * there are any) might expect this file to be a text-base. */
+  if (tempstream)
+    {
       /* Wrap the translated stream with a new stream that writes the
          translated contents into the new text base file as we read from it.
          Note that the new text base file will be closed when the new stream
@@ -1088,30 +1132,33 @@ svn_wc__internal_transmit_text_deltas(co
       verify_checksum = NULL;
     }
 
-  /* Tell the editor that we're about to apply a textdelta to the
-     file baton; the editor returns to us a window consumer and baton.  */
+  /* Arrange the stream to calculate the resulting MD5. */
+  local_stream = svn_stream_checksummed2(local_stream, &local_md5_checksum,
+                                         NULL, svn_checksum_md5, TRUE,
+                                         scratch_pool);
+
+  /* Tell the editor to apply a textdelta stream to the file baton. */
   {
-    /* apply_textdelta() is working against a base with this checksum */
+    open_txdelta_stream_baton_t baton = { 0 };
+
+    /* apply_textdelta_stream() is working against a base with this checksum */
     const char *base_digest_hex = NULL;
 
     if (expected_md5_checksum)
       /* ### Why '..._display()'?  expected_md5_checksum should never be all-
        * zero, but if it is, we would want to pass NULL not an all-zero
-       * digest to apply_textdelta(), wouldn't we? */
+       * digest to apply_textdelta_stream(), wouldn't we? */
       base_digest_hex = svn_checksum_to_cstring_display(expected_md5_checksum,
                                                         scratch_pool);
 
-    SVN_ERR(editor->apply_textdelta(file_baton, base_digest_hex, scratch_pool,
-                                    &handler, &wh_baton));
+    baton.need_reset = FALSE;
+    baton.base_stream = svn_stream_disown(base_stream, scratch_pool);
+    baton.local_stream = svn_stream_disown(local_stream, scratch_pool);
+    err = editor->apply_textdelta_stream(editor, file_baton, base_digest_hex,
+                                         open_txdelta_stream, &baton,
+                                         scratch_pool);
   }
 
-  /* Run diff processing, throwing windows at the handler. */
-  err = svn_txdelta_run(base_stream, local_stream,
-                        handler, wh_baton,
-                        svn_checksum_md5, &local_md5_checksum,
-                        NULL, NULL,
-                        scratch_pool, scratch_pool);
-
   /* Close the two streams to force writing the digest */
   err2 = svn_stream_close(base_stream);
   if (err2)
@@ -1141,11 +1188,6 @@ svn_wc__internal_transmit_text_deltas(co
          investigate.  Other commands could be affected,
          too, such as `svn diff'.  */
 
-      if (tempfile)
-        err = svn_error_compose_create(
-                      err,
-                      svn_io_remove_file2(*tempfile, TRUE, scratch_pool));
-
       err = svn_error_compose_create(
               svn_checksum_mismatch_err(expected_md5_checksum, verify_checksum,
                             scratch_pool,

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=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/conflicts.c Wed Nov  7 12:30:06 2018
@@ -539,6 +539,7 @@ svn_wc__conflict_skel_add_tree_conflict(
                                         svn_wc_conflict_reason_t reason,
                                         svn_wc_conflict_action_t action,
                                         const char *move_src_op_root_abspath,
+                                        const char *move_dst_op_root_abspath,
                                         apr_pool_t *result_pool,
                                         apr_pool_t *scratch_pool)
 {
@@ -555,18 +556,33 @@ svn_wc__conflict_skel_add_tree_conflict(
 
   tree_conflict = svn_skel__make_empty_list(result_pool);
 
-  if (reason == svn_wc_conflict_reason_moved_away
-      && move_src_op_root_abspath)
+  if (reason == svn_wc_conflict_reason_moved_away)
     {
-      const char *move_src_op_root_relpath;
+      if (move_dst_op_root_abspath)
+        {
+          const char *move_dst_op_root_relpath;
 
-      SVN_ERR(svn_wc__db_to_relpath(&move_src_op_root_relpath,
-                                    db, wri_abspath,
-                                    move_src_op_root_abspath,
-                                    result_pool, scratch_pool));
+          SVN_ERR(svn_wc__db_to_relpath(&move_dst_op_root_relpath,
+                                        db, wri_abspath,
+                                        move_dst_op_root_abspath,
+                                        result_pool, scratch_pool));
 
-      svn_skel__prepend_str(move_src_op_root_relpath, tree_conflict,
-                            result_pool);
+          svn_skel__prepend_str(move_dst_op_root_relpath, tree_conflict,
+                                result_pool);
+        }
+
+      if (move_src_op_root_abspath)
+        {
+          const char *move_src_op_root_relpath;
+
+          SVN_ERR(svn_wc__db_to_relpath(&move_src_op_root_relpath,
+                                        db, wri_abspath,
+                                        move_src_op_root_abspath,
+                                        result_pool, scratch_pool));
+
+          svn_skel__prepend_str(move_src_op_root_relpath, tree_conflict,
+                                result_pool);
+        }
     }
 
   svn_skel__prepend_str(svn_token__to_word(action_map, action),
@@ -932,6 +948,7 @@ svn_error_t *
 svn_wc__conflict_read_tree_conflict(svn_wc_conflict_reason_t *reason,
                                     svn_wc_conflict_action_t *action,
                                     const char **move_src_op_root_abspath,
+                                    const char **move_dst_op_root_abspath,
                                     svn_wc__db_t *db,
                                     const char *wri_abspath,
                                     const svn_skel_t *conflict_skel,
@@ -981,10 +998,10 @@ svn_wc__conflict_read_tree_conflict(svn_
 
   c = c->next;
 
-  if (move_src_op_root_abspath)
+  if (move_src_op_root_abspath || move_dst_op_root_abspath)
     {
       /* Only set for update and switch tree conflicts */
-      if (c && is_moved_away)
+      if (c && is_moved_away && move_src_op_root_abspath)
         {
           const char *move_src_op_root_relpath
                             = apr_pstrmemdup(scratch_pool, c->data, c->len);
@@ -994,8 +1011,25 @@ svn_wc__conflict_read_tree_conflict(svn_
                                           move_src_op_root_relpath,
                                           result_pool, scratch_pool));
         }
-      else
+      else if (move_src_op_root_abspath)
         *move_src_op_root_abspath = NULL;
+
+      if (c)
+        c = c->next;
+
+      if (c && is_moved_away && move_dst_op_root_abspath)
+        {
+          const char *move_dst_op_root_relpath
+                            = apr_pstrmemdup(scratch_pool, c->data, c->len);
+
+          SVN_ERR(svn_wc__db_from_relpath(move_dst_op_root_abspath,
+                                          db, wri_abspath,
+                                          move_dst_op_root_relpath,
+                                          result_pool, scratch_pool));
+        }
+      else if (move_dst_op_root_abspath)
+        *move_dst_op_root_abspath = NULL;
+
     }
 
   return SVN_NO_ERROR;
@@ -1801,7 +1835,7 @@ read_tree_conflict_desc(svn_wc_conflict_
   svn_wc_conflict_action_t action;
 
   SVN_ERR(svn_wc__conflict_read_tree_conflict(
-            &reason, &action, NULL,
+            &reason, &action, NULL, NULL,
             db, local_abspath, conflict_skel, scratch_pool, scratch_pool));
 
   if (reason == svn_wc_conflict_reason_missing)
@@ -2676,7 +2710,7 @@ resolve_tree_conflict_on_node(svn_boolea
 
   SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action,
                                               &src_op_root_abspath,
-                                              db, local_abspath,
+                                              NULL, db, local_abspath,
                                               conflicts,
                                               scratch_pool, scratch_pool));
 
@@ -2748,6 +2782,7 @@ resolve_tree_conflict_on_node(svn_boolea
 
               SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action,
                                                           &src_op_root_abspath,
+                                                          NULL,
                                                           db, local_abspath,
                                                           new_conflicts,
                                                           scratch_pool,
@@ -3483,7 +3518,7 @@ svn_wc__conflict_tree_update_break_moved
     return SVN_NO_ERROR;
 
   SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action,
-                                              &src_op_root_abspath,
+                                              &src_op_root_abspath, NULL,
                                               wc_ctx->db, local_abspath,
                                               conflict_skel,
                                               scratch_pool, scratch_pool));
@@ -3569,7 +3604,7 @@ svn_wc__conflict_tree_update_raise_moved
   if (!tree_conflicted)
     return SVN_NO_ERROR;
 
-  SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action, NULL,
+  SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action, NULL, NULL,
                                               wc_ctx->db, local_abspath,
                                               conflict_skel,
                                               scratch_pool, scratch_pool));
@@ -3648,7 +3683,7 @@ svn_wc__conflict_tree_update_moved_away_
     return SVN_NO_ERROR;
 
   SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action,
-                                              &src_op_root_abspath,
+                                              &src_op_root_abspath, NULL,
                                               wc_ctx->db, local_abspath,
                                               conflict_skel,
                                               scratch_pool, scratch_pool));
@@ -3734,8 +3769,8 @@ svn_wc__conflict_tree_update_incoming_mo
     return SVN_NO_ERROR;
 
   SVN_ERR(svn_wc__conflict_read_tree_conflict(&local_change, &incoming_change,
-                                              NULL, wc_ctx->db, local_abspath,
-                                              conflict_skel,
+                                              NULL, NULL, wc_ctx->db,
+                                              local_abspath, conflict_skel,
                                               scratch_pool, scratch_pool));
 
   /* Make sure the expected conflict is recorded. */
@@ -3774,12 +3809,76 @@ svn_wc__conflict_tree_update_incoming_mo
 }
 
 svn_error_t *
+svn_wc__conflict_tree_update_local_add(svn_wc_context_t *wc_ctx,
+                                       const char *local_abspath,
+                                       svn_cancel_func_t cancel_func,
+                                       void *cancel_baton,
+                                       svn_wc_notify_func2_t notify_func,
+                                       void *notify_baton,
+                                       apr_pool_t *scratch_pool)
+{
+  svn_wc_conflict_reason_t local_change;
+  svn_wc_conflict_action_t incoming_change;
+  svn_wc_operation_t operation;
+  svn_boolean_t tree_conflicted;
+  const apr_array_header_t *conflicts;
+  svn_skel_t *conflict_skel;
+
+  SVN_ERR(svn_wc__read_conflicts(&conflicts, &conflict_skel,
+                                 wc_ctx->db, local_abspath,
+                                 FALSE, /* no tempfiles */
+                                 FALSE, /* only tree conflicts */
+                                 scratch_pool, scratch_pool));
+
+  SVN_ERR(svn_wc__conflict_read_info(&operation, NULL, NULL, NULL,
+                                     &tree_conflicted, wc_ctx->db,
+                                     local_abspath, conflict_skel,
+                                     scratch_pool, scratch_pool));
+  if (!tree_conflicted)
+    return SVN_NO_ERROR;
+
+  SVN_ERR(svn_wc__conflict_read_tree_conflict(&local_change, &incoming_change,
+                                              NULL, NULL, wc_ctx->db,
+                                              local_abspath, conflict_skel,
+                                              scratch_pool, scratch_pool));
+
+  /* Make sure the expected conflict is recorded. */
+  if (operation != svn_wc_operation_update)
+    return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
+                             _("Unexpected conflict operation '%s' on '%s'"),
+                             svn_token__to_word(operation_map, operation),
+                             svn_dirent_local_style(local_abspath,
+                                                    scratch_pool));
+  if (local_change != svn_wc_conflict_reason_added)
+    return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
+                             _("Unexpected conflict reason '%s' on '%s'"),
+                             svn_token__to_word(reason_map, local_change),
+                             svn_dirent_local_style(local_abspath,
+                                                    scratch_pool));
+  if (incoming_change != svn_wc_conflict_action_add)
+    return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
+                             _("Unexpected conflict action '%s' on '%s'"),
+                             svn_token__to_word(action_map, incoming_change),
+                             svn_dirent_local_style(local_abspath,
+                                                    scratch_pool));
+
+  SVN_ERR(svn_wc__db_update_local_add(wc_ctx->db, local_abspath,
+                                      cancel_func, cancel_baton,
+                                      notify_func, notify_baton,
+                                      scratch_pool));
+
+  SVN_ERR(svn_wc__wq_run(wc_ctx->db, local_abspath, cancel_func, cancel_baton,
+                         scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
 svn_wc__guess_incoming_move_target_nodes(apr_array_header_t **possible_targets,
                                          svn_wc_context_t *wc_ctx,
                                          const char *victim_abspath,
                                          svn_node_kind_t victim_node_kind,
                                          const char *moved_to_repos_relpath,
-                                         svn_revnum_t rev,
                                          apr_pool_t *result_pool,
                                          apr_pool_t *scratch_pool)
 {
@@ -3789,9 +3888,9 @@ svn_wc__guess_incoming_move_target_nodes
   apr_size_t longest_ancestor_len = 0;
 
   *possible_targets = apr_array_make(result_pool, 1, sizeof(const char *));
-  SVN_ERR(svn_wc__find_repos_node_in_wc(&candidates, wc_ctx->db, victim_abspath,
-                                        moved_to_repos_relpath, rev,
-                                        scratch_pool, scratch_pool));
+  SVN_ERR(svn_wc__db_find_repos_node_in_wc(&candidates, wc_ctx->db, victim_abspath,
+                                           moved_to_repos_relpath,
+                                           scratch_pool, scratch_pool));
 
   /* Find a "useful move target" node in our set of candidates.
    * Since there is no way to be certain, filter out nodes which seem

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=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/conflicts.h (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/conflicts.h Wed Nov  7 12:30:06 2018
@@ -219,6 +219,11 @@ svn_wc__conflict_skel_add_prop_conflict(
    MOVE_SRC_OP_ROOT_ABSPATH should be A for a conflict associated
    with (1), MOVE_SRC_OP_ROOT_ABSPATH should be A/B for a conflict
    associated with (2).
+   MOVE_DST_OP_ROOT_ABSPATH is the op-root of the move target (i.e. the
+   op-root of the corresponding copy). This needs to be stored because 
+   moves in the NODE table do not always persist after an update, while
+   the conflict resolver may need information about the pre-update state
+   of the move.
 
    It is an error to add another tree conflict to a conflict skel that
    already contains a tree conflict.  (It is not an error, at this level,
@@ -233,6 +238,7 @@ svn_wc__conflict_skel_add_tree_conflict(
                                         svn_wc_conflict_reason_t local_change,
                                         svn_wc_conflict_action_t incoming_change,
                                         const char *move_src_op_root_abspath,
+                                        const char *move_dst_op_root_abspath,
                                         apr_pool_t *result_pool,
                                         apr_pool_t *scratch_pool);
 
@@ -364,6 +370,7 @@ svn_error_t *
 svn_wc__conflict_read_tree_conflict(svn_wc_conflict_reason_t *local_change,
                                     svn_wc_conflict_action_t *incoming_change,
                                     const char **move_src_op_root_abspath,
+                                    const char **move_dst_op_root_abspath,
                                     svn_wc__db_t *db,
                                     const char *wri_abspath,
                                     const svn_skel_t *conflict_skel,

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=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/deprecated.c Wed Nov  7 12:30:06 2018
@@ -39,6 +39,7 @@
 
 #include "private/svn_subr_private.h"
 #include "private/svn_wc_private.h"
+#include "private/svn_io_private.h"
 
 #include "wc.h"
 #include "entries.h"
@@ -478,20 +479,49 @@ svn_wc_transmit_text_deltas2(const char
   const char *local_abspath;
   svn_wc_context_t *wc_ctx;
   const svn_checksum_t *new_text_base_md5_checksum;
+  svn_stream_t *tempstream;
+  svn_error_t *err;
 
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
   SVN_ERR(svn_wc__context_create_with_db(&wc_ctx, NULL /* config */,
                                          svn_wc__adm_get_db(adm_access),
                                          pool));
+  if (tempfile)
+    {
+      apr_file_t *f;
 
-  SVN_ERR(svn_wc__internal_transmit_text_deltas(tempfile,
-                                                (digest
-                                                 ? &new_text_base_md5_checksum
-                                                 : NULL),
-                                                NULL, wc_ctx->db,
-                                                local_abspath, fulltext,
-                                                editor, file_baton,
-                                                pool, pool));
+      /* The temporary file can't be the same location as in 1.6 because the
+       * admin directory no longer exists. */
+      SVN_ERR(svn_io_open_unique_file3(&f, tempfile, NULL,
+                                       svn_io_file_del_none,
+                                       pool, pool));
+      tempstream = svn_stream__from_aprfile(f, FALSE, TRUE, pool);
+    }
+  else
+    {
+      tempstream = NULL;
+    }
+
+  err = svn_wc__internal_transmit_text_deltas(svn_stream_disown(tempstream, pool),
+                                              (digest
+                                               ? &new_text_base_md5_checksum
+                                               : NULL),
+                                              NULL, wc_ctx->db,
+                                              local_abspath, fulltext,
+                                              editor, file_baton,
+                                              pool, pool);
+  if (tempfile)
+    {
+      err = svn_error_compose_create(err, svn_stream_close(tempstream));
+
+      if (err)
+        {
+          err = svn_error_compose_create(
+                  err, svn_io_remove_file2(*tempfile, TRUE, pool));
+        }
+    }
+
+  SVN_ERR(err);
 
   if (digest)
     memcpy(digest, new_text_base_md5_checksum->digest, APR_MD5_DIGESTSIZE);
@@ -1061,6 +1091,33 @@ svn_wc_add(const char *path,
 
 /*** From revert.c ***/
 svn_error_t *
+svn_wc_revert5(svn_wc_context_t *wc_ctx,
+               const char *local_abspath,
+               svn_depth_t depth,
+               svn_boolean_t use_commit_times,
+               const apr_array_header_t *changelist_filter,
+               svn_boolean_t clear_changelists,
+               svn_boolean_t metadata_only,
+               svn_cancel_func_t cancel_func,
+               void *cancel_baton,
+               svn_wc_notify_func2_t notify_func,
+               void *notify_baton,
+               apr_pool_t *scratch_pool)
+{
+  SVN_ERR(svn_wc_revert6(wc_ctx, local_abspath,
+                         depth,
+                         use_commit_times,
+                         changelist_filter,
+                         clear_changelists,
+                         metadata_only,
+                         TRUE /*added_keep_local*/,
+                         cancel_func, cancel_baton,
+                         notify_func, notify_baton,
+                         scratch_pool));
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
 svn_wc_revert4(svn_wc_context_t *wc_ctx,
                const char *local_abspath,
                svn_depth_t depth,
@@ -2039,8 +2096,7 @@ svn_wc_get_diff_editor6(const svn_delta_
                                       result_pool, scratch_pool));
 
   if (reverse_order)
-    diff_processor = svn_diff__tree_processor_reverse_create(
-                              diff_processor, NULL, result_pool);
+    diff_processor = svn_diff__tree_processor_reverse_create(diff_processor, result_pool);
 
   if (! show_copies_as_adds)
     diff_processor = svn_diff__tree_processor_copy_as_changed_create(

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=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/diff_local.c Wed Nov  7 12:30:06 2018
@@ -433,8 +433,7 @@ diff_status_callback(void *baton,
 
 /* Public Interface */
 svn_error_t *
-svn_wc__diff7(const char **root_relpath,
-              svn_boolean_t *root_is_dir,
+svn_wc__diff7(svn_boolean_t anchor_at_given_paths,
               svn_wc_context_t *wc_ctx,
               const char *local_abspath,
               svn_depth_t depth,
@@ -459,26 +458,30 @@ svn_wc__diff7(const char **root_relpath,
 
   eb.anchor_abspath = local_abspath;
 
-  if (root_relpath)
+  if (anchor_at_given_paths)
     {
+      /* Anchor the underlying diff processor at the parent of
+         LOCAL_ABSPATH (if possible), and adjust so the outgoing
+         DIFF_PROCESSOR is always anchored at LOCAL_ABSPATH. */
+      /* ### Why anchor the underlying diff processor at the parent? */
       svn_boolean_t is_wcroot;
 
       SVN_ERR(svn_wc__db_is_wcroot(&is_wcroot,
                                    wc_ctx->db, local_abspath, scratch_pool));
 
       if (!is_wcroot)
-        eb.anchor_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
+        {
+          const char *relpath;
+
+          eb.anchor_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
+          relpath = svn_dirent_basename(local_abspath, NULL);
+          diff_processor = svn_diff__tree_processor_filter_create(
+                             diff_processor, relpath, scratch_pool);
+        }
     }
   else if (kind != svn_node_dir)
     eb.anchor_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
 
-  if (root_relpath)
-    *root_relpath = apr_pstrdup(result_pool,
-                                svn_dirent_skip_ancestor(eb.anchor_abspath,
-                                                         local_abspath));
-  if (root_is_dir)
-    *root_is_dir = (kind == svn_node_dir);
-
   /* Apply changelist filtering to the output */
   if (changelist_filter && changelist_filter->nelts)
     {
@@ -572,7 +575,7 @@ svn_wc_diff6(svn_wc_context_t *wc_ctx,
     processor = svn_diff__tree_processor_copy_as_changed_create(processor,
                                                                 scratch_pool);
 
-  return svn_error_trace(svn_wc__diff7(NULL, NULL,
+  return svn_error_trace(svn_wc__diff7(FALSE,
                                        wc_ctx, local_abspath,
                                        depth,
                                        ignore_ancestry,

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=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/node.c Wed Nov  7 12:30:06 2018
@@ -1126,3 +1126,17 @@ svn_wc__node_was_moved_here(const char *
 
   return SVN_NO_ERROR;
 }
+
+svn_error_t *
+svn_wc__find_working_nodes_with_basename(apr_array_header_t **abspaths,
+                                         const char *wri_abspath,
+                                         const char *basename,
+                                         svn_node_kind_t kind,
+                                         svn_wc_context_t *wc_ctx,
+                                         apr_pool_t *result_pool,
+                                         apr_pool_t *scratch_pool)
+{
+  return svn_error_trace(svn_wc__db_find_working_nodes_with_basename(
+                           abspaths, wc_ctx->db, wri_abspath, basename, kind,
+                           result_pool, scratch_pool));
+}

Modified: subversion/branches/ra-git/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/props.c?rev=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/props.c Wed Nov  7 12:30:06 2018
@@ -2236,7 +2236,9 @@ svn_wc_canonicalize_svn_prop(const svn_s
               if (duplicate_targets->nelts > 1)
                 {
                   more_str = apr_psprintf(/*scratch_*/pool,
-                               _(" (%d more duplicate targets found)"),
+                               Q_(" (%d more duplicate target found)",
+                                  " (%d more duplicate targets found)",
+                                  duplicate_targets->nelts - 1),
                                duplicate_targets->nelts - 1);
                 }
               return svn_error_createf(

Modified: subversion/branches/ra-git/subversion/libsvn_wc/questions.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/questions.c?rev=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/questions.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/questions.c Wed Nov  7 12:30:06 2018
@@ -79,15 +79,15 @@
 
 
 /* Set *MODIFIED_P to TRUE if (after translation) VERSIONED_FILE_ABSPATH
- * (of VERSIONED_FILE_SIZE bytes) differs from pristine file with checksum
- * PRISTINE_CHECKSUM, else to FALSE if not.
+ * (of VERSIONED_FILE_SIZE bytes) differs from PRISTINE_STREAM (of
+ * PRISTINE_SIZE bytes), else to FALSE if not.
  *
  * If EXACT_COMPARISON is FALSE, translate VERSIONED_FILE_ABSPATH's EOL
  * style and keywords to repository-normal form according to its properties,
- * calculate checksum and compare the result with PRISTINE_STREAM.  If
- * EXACT_COMPARISON is TRUE, open pristine, translate it's EOL style and
- * keywords to working-copy form according to VERSIONED_FILE_ABSPATH's
- * properties, and compare the result with VERSIONED_FILE_ABSPATH.
+ * and compare the result with PRISTINE_STREAM.  If EXACT_COMPARISON is
+ * TRUE, translate PRISTINE_STREAM's EOL style and keywords to working-copy
+ * form according to VERSIONED_FILE_ABSPATH's properties, and compare the
+ * result with VERSIONED_FILE_ABSPATH.
  *
  * HAS_PROPS should be TRUE if the file had properties when it was not
  * modified, otherwise FALSE.
@@ -95,6 +95,8 @@
  * PROPS_MOD should be TRUE if the file's properties have been changed,
  * otherwise FALSE.
  *
+ * PRISTINE_STREAM will be closed before a successful return.
+ *
  * DB is a wc_db; use SCRATCH_POOL for temporary allocation.
  */
 static svn_error_t *
@@ -102,20 +104,20 @@ compare_and_verify(svn_boolean_t *modifi
                    svn_wc__db_t *db,
                    const char *versioned_file_abspath,
                    svn_filesize_t versioned_file_size,
-                   const svn_checksum_t *pristine_checksum,
+                   svn_stream_t *pristine_stream,
+                   svn_filesize_t pristine_size,
                    svn_boolean_t has_props,
                    svn_boolean_t props_mod,
                    svn_boolean_t exact_comparison,
                    apr_pool_t *scratch_pool)
 {
+  svn_boolean_t same;
   svn_subst_eol_style_t eol_style;
   const char *eol_str;
   apr_hash_t *keywords;
   svn_boolean_t special = FALSE;
   svn_boolean_t need_translation;
   svn_stream_t *v_stream; /* versioned_file */
-  svn_checksum_t *v_checksum;
-  svn_error_t *err;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(versioned_file_abspath));
 
@@ -138,20 +140,13 @@ compare_and_verify(svn_boolean_t *modifi
   else
     need_translation = FALSE;
 
-  if (! need_translation)
+  if (! need_translation
+      && (versioned_file_size != pristine_size))
     {
-      svn_filesize_t pristine_size;
-
-      SVN_ERR(svn_wc__db_pristine_read(NULL, &pristine_size, db,
-                                       versioned_file_abspath, pristine_checksum,
-                                       scratch_pool, scratch_pool));
-
-      if (versioned_file_size != pristine_size)
-        {
-          *modified_p = TRUE;
+      *modified_p = TRUE;
 
-          return SVN_NO_ERROR;
-        }
+      /* ### Why did we open the pristine? */
+      return svn_error_trace(svn_stream_close(pristine_stream));
     }
 
   /* ### Other checks possible? */
@@ -167,13 +162,8 @@ compare_and_verify(svn_boolean_t *modifi
       /* We don't use APR-level buffering because the comparison function
        * will do its own buffering. */
       apr_file_t *file;
-      err = svn_io_file_open(&file, versioned_file_abspath, APR_READ,
-                             APR_OS_DEFAULT, scratch_pool);
-      /* Convert EACCESS on working copy path to WC specific error code. */
-      if (err && APR_STATUS_IS_EACCES(err->apr_err))
-        return svn_error_create(SVN_ERR_WC_PATH_ACCESS_DENIED, err, NULL);
-      else
-        SVN_ERR(err);
+      SVN_ERR(svn_io_file_open(&file, versioned_file_abspath, APR_READ,
+                               APR_OS_DEFAULT, scratch_pool));
       v_stream = svn_stream_from_aprfile2(file, FALSE, scratch_pool);
 
       if (need_translation)
@@ -198,38 +188,20 @@ compare_and_verify(svn_boolean_t *modifi
             }
           else
             {
-              svn_boolean_t same;
-              svn_stream_t *pristine_stream;
-
-              SVN_ERR(svn_wc__db_pristine_read(&pristine_stream, NULL,
-                                               db, versioned_file_abspath,
-                                               pristine_checksum,
-                                               scratch_pool, scratch_pool));
               /* Wrap base stream to translate into working copy form, and
                * arrange to throw an error if its EOL style is inconsistent. */
               pristine_stream = svn_subst_stream_translated(pristine_stream,
                                                             eol_str, FALSE,
                                                             keywords, TRUE,
                                                             scratch_pool);
-              SVN_ERR(svn_stream_contents_same2(&same, pristine_stream, v_stream,
-                                                scratch_pool));
-              *modified_p = (! same);
-              return SVN_NO_ERROR;
             }
         }
     }
 
-  /* Get checksum of detranslated (normalized) content. */
-  err = svn_stream_contents_checksum(&v_checksum, v_stream,
-                                     pristine_checksum->kind,
-                                     scratch_pool, scratch_pool);
-  /* Convert EACCESS on working copy path to WC specific error code. */
-  if (err && APR_STATUS_IS_EACCES(err->apr_err))
-    return svn_error_create(SVN_ERR_WC_PATH_ACCESS_DENIED, err, NULL);
-  else
-    SVN_ERR(err);
+  SVN_ERR(svn_stream_contents_same2(&same, pristine_stream, v_stream,
+                                    scratch_pool));
 
-  *modified_p = (! svn_checksum_match(v_checksum, pristine_checksum));
+  *modified_p = (! same);
 
   return SVN_NO_ERROR;
 }
@@ -241,6 +213,8 @@ svn_wc__internal_file_modified_p(svn_boo
                                  svn_boolean_t exact_comparison,
                                  apr_pool_t *scratch_pool)
 {
+  svn_stream_t *pristine_stream;
+  svn_filesize_t pristine_size;
   svn_wc__db_status_t status;
   svn_node_kind_t kind;
   const svn_checksum_t *checksum;
@@ -328,12 +302,27 @@ svn_wc__internal_file_modified_p(svn_boo
     }
 
  compare_them:
+  SVN_ERR(svn_wc__db_pristine_read(&pristine_stream, &pristine_size,
+                                   db, local_abspath, checksum,
+                                   scratch_pool, scratch_pool));
+
   /* Check all bytes, and verify checksum if requested. */
-  SVN_ERR(compare_and_verify(modified_p, db,
+  {
+    svn_error_t *err;
+    err = compare_and_verify(modified_p, db,
                              local_abspath, dirent->filesize,
-                             checksum, has_props, props_mod,
+                             pristine_stream, pristine_size,
+                             has_props, props_mod,
                              exact_comparison,
-                             scratch_pool));
+                             scratch_pool);
+
+    /* At this point we already opened the pristine file, so we know that
+       the access denied applies to the working copy path */
+    if (err && APR_STATUS_IS_EACCES(err->apr_err))
+      return svn_error_create(SVN_ERR_WC_PATH_ACCESS_DENIED, err, NULL);
+    else
+      SVN_ERR(err);
+  }
 
   if (!*modified_p)
     {
@@ -486,7 +475,7 @@ internal_conflicted_p(svn_boolean_t *tex
           svn_wc_conflict_action_t action;
 
           SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action, NULL,
-                                                      db, local_abspath,
+                                                      NULL, db, local_abspath,
                                                       conflicts,
                                                       scratch_pool,
                                                       scratch_pool));

Modified: subversion/branches/ra-git/subversion/libsvn_wc/revert.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/revert.c?rev=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/revert.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/revert.c Wed Nov  7 12:30:06 2018
@@ -285,6 +285,7 @@ revert_restore(svn_boolean_t *run_wq,
                svn_boolean_t metadata_only,
                svn_boolean_t use_commit_times,
                svn_boolean_t revert_root,
+               svn_boolean_t added_keep_local,
                const struct svn_wc__db_info_t *info,
                svn_cancel_func_t cancel_func,
                void *cancel_baton,
@@ -344,8 +345,9 @@ revert_restore(svn_boolean_t *run_wq,
     }
   else
     {
-      if (!copied_here)
+      if (added_keep_local && !copied_here)
         {
+          /* It is a plain add, and we want to keep the local file/dir. */
           if (notify_func && notify_required)
             notify_func(notify_baton,
                         svn_wc_create_notify(local_abspath,
@@ -359,8 +361,17 @@ revert_restore(svn_boolean_t *run_wq,
                                                   scratch_pool));
           return SVN_NO_ERROR;
         }
+      else if (!copied_here)
+        {
+          /* It is a plain add, and we don't want to keep the local file/dir. */
+          status = svn_wc__db_status_not_present;
+          kind = svn_node_none;
+          recorded_size = SVN_INVALID_FILESIZE;
+          recorded_time = 0;
+        }
       else
         {
+          /* It is a copy, so we don't want to keep the local file/dir. */
           /* ### Initialise to values which prevent the code below from
            * ### trying to restore anything to disk.
            * ### 'status' should be status_unknown but that doesn't exist. */
@@ -429,6 +440,7 @@ revert_restore(svn_boolean_t *run_wq,
           SVN_ERR(revert_restore(run_wq,
                                  db, child_abspath, depth, metadata_only,
                                  use_commit_times, FALSE /* revert root */,
+                                 added_keep_local,
                                  apr_hash_this_val(hi),
                                  cancel_func, cancel_baton,
                                  notify_func, notify_baton,
@@ -536,11 +548,7 @@ revert_wc_data(svn_boolean_t *run_wq,
   /* If we expect a versioned item to be present then check that any
      item on disk matches the versioned item, if it doesn't match then
      fix it or delete it.  */
-  if (on_disk != svn_node_none
-      && status != svn_wc__db_status_server_excluded
-      && status != svn_wc__db_status_deleted
-      && status != svn_wc__db_status_excluded
-      && status != svn_wc__db_status_not_present)
+  if (on_disk != svn_node_none)
     {
       if (on_disk == svn_node_dir && kind != svn_node_dir)
         {
@@ -560,7 +568,11 @@ revert_wc_data(svn_boolean_t *run_wq,
               on_disk = svn_node_none;
             }
         }
-      else if (on_disk == svn_node_file)
+      else if (on_disk == svn_node_file
+               && status != svn_wc__db_status_server_excluded
+               && status != svn_wc__db_status_deleted
+               && status != svn_wc__db_status_excluded
+               && status != svn_wc__db_status_not_present)
         {
           svn_boolean_t modified;
           apr_hash_t *props;
@@ -712,6 +724,7 @@ revert(svn_wc__db_t *db,
        svn_boolean_t use_commit_times,
        svn_boolean_t clear_changelists,
        svn_boolean_t metadata_only,
+       svn_boolean_t added_keep_local,
        svn_cancel_func_t cancel_func,
        void *cancel_baton,
        svn_wc_notify_func2_t notify_func,
@@ -762,6 +775,7 @@ revert(svn_wc__db_t *db,
     err = svn_error_trace(
               revert_restore(&run_queue, db, local_abspath, depth, metadata_only,
                              use_commit_times, TRUE /* revert root */,
+                             added_keep_local,
                              info, cancel_func, cancel_baton,
                              notify_func, notify_baton,
                              scratch_pool));
@@ -791,6 +805,7 @@ revert_changelist(svn_wc__db_t *db,
                   apr_hash_t *changelist_hash,
                   svn_boolean_t clear_changelists,
                   svn_boolean_t metadata_only,
+                  svn_boolean_t added_keep_local,
                   svn_cancel_func_t cancel_func,
                   void *cancel_baton,
                   svn_wc_notify_func2_t notify_func,
@@ -809,7 +824,7 @@ revert_changelist(svn_wc__db_t *db,
                                         scratch_pool))
     SVN_ERR(revert(db, local_abspath,
                    svn_depth_empty, use_commit_times, clear_changelists,
-                   metadata_only,
+                   metadata_only, added_keep_local,
                    cancel_func, cancel_baton,
                    notify_func, notify_baton,
                    scratch_pool));
@@ -845,6 +860,7 @@ revert_changelist(svn_wc__db_t *db,
       SVN_ERR(revert_changelist(db, child_abspath, depth,
                                 use_commit_times, changelist_hash,
                                 clear_changelists, metadata_only,
+                                added_keep_local,
                                 cancel_func, cancel_baton,
                                 notify_func, notify_baton,
                                 iterpool));
@@ -871,6 +887,7 @@ revert_partial(svn_wc__db_t *db,
                svn_boolean_t use_commit_times,
                svn_boolean_t clear_changelists,
                svn_boolean_t metadata_only,
+               svn_boolean_t added_keep_local,
                svn_cancel_func_t cancel_func,
                void *cancel_baton,
                svn_wc_notify_func2_t notify_func,
@@ -892,6 +909,7 @@ revert_partial(svn_wc__db_t *db,
      children.  */
   SVN_ERR(revert(db, local_abspath, svn_depth_empty,
                  use_commit_times, clear_changelists, metadata_only,
+                 added_keep_local,
                  cancel_func, cancel_baton,
                  notify_func, notify_baton, iterpool));
 
@@ -926,7 +944,7 @@ revert_partial(svn_wc__db_t *db,
       /* Revert just this node (depth=empty).  */
       SVN_ERR(revert(db, child_abspath,
                      svn_depth_empty, use_commit_times, clear_changelists,
-                     metadata_only,
+                     metadata_only, added_keep_local,
                      cancel_func, cancel_baton,
                      notify_func, notify_baton,
                      iterpool));
@@ -939,13 +957,14 @@ revert_partial(svn_wc__db_t *db,
 
 
 svn_error_t *
-svn_wc_revert5(svn_wc_context_t *wc_ctx,
+svn_wc_revert6(svn_wc_context_t *wc_ctx,
                const char *local_abspath,
                svn_depth_t depth,
                svn_boolean_t use_commit_times,
                const apr_array_header_t *changelist_filter,
                svn_boolean_t clear_changelists,
                svn_boolean_t metadata_only,
+               svn_boolean_t added_keep_local,
                svn_cancel_func_t cancel_func,
                void *cancel_baton,
                svn_wc_notify_func2_t notify_func,
@@ -963,6 +982,7 @@ svn_wc_revert5(svn_wc_context_t *wc_ctx,
                                                changelist_hash,
                                                clear_changelists,
                                                metadata_only,
+                                               added_keep_local,
                                                cancel_func, cancel_baton,
                                                notify_func, notify_baton,
                                                scratch_pool));
@@ -972,6 +992,7 @@ svn_wc_revert5(svn_wc_context_t *wc_ctx,
     return svn_error_trace(revert(wc_ctx->db, local_abspath,
                                   depth, use_commit_times, clear_changelists,
                                   metadata_only,
+                                  added_keep_local,
                                   cancel_func, cancel_baton,
                                   notify_func, notify_baton,
                                   scratch_pool));
@@ -986,6 +1007,7 @@ svn_wc_revert5(svn_wc_context_t *wc_ctx,
     return svn_error_trace(revert_partial(wc_ctx->db, local_abspath,
                                           depth, use_commit_times,
                                           clear_changelists, metadata_only,
+                                          added_keep_local,
                                           cancel_func, cancel_baton,
                                           notify_func, notify_baton,
                                           scratch_pool));

Modified: subversion/branches/ra-git/subversion/libsvn_wc/translate.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/translate.c?rev=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/translate.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/translate.c Wed Nov  7 12:30:06 2018
@@ -440,3 +440,20 @@ svn_wc__sync_flags_with_props(svn_boolea
 
   return SVN_NO_ERROR;
 }
+
+svn_error_t *
+svn_wc__translated_stream(svn_stream_t **stream,
+                          svn_wc_context_t *wc_ctx,
+                          const char *local_abspath,
+                          const char *versioned_abspath,
+                          apr_uint32_t flags,
+                          apr_pool_t *result_pool,
+                          apr_pool_t *scratch_pool)
+{
+  return svn_error_trace(
+           svn_wc__internal_translated_stream(stream, wc_ctx->db,
+                                              local_abspath,
+                                              versioned_abspath,
+                                              flags, result_pool,
+                                              scratch_pool));
+}

Modified: subversion/branches/ra-git/subversion/libsvn_wc/tree_conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/tree_conflicts.c?rev=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/tree_conflicts.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/tree_conflicts.c Wed Nov  7 12:30:06 2018
@@ -442,7 +442,7 @@ svn_wc__add_tree_conflict(svn_wc_context
                                                   conflict->local_abspath,
                                                   conflict->reason,
                                                   conflict->action,
-                                                  NULL,
+                                                  NULL, NULL,
                                                   scratch_pool, scratch_pool));
 
   switch (conflict->operation)

Modified: subversion/branches/ra-git/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/libsvn_wc/update_editor.c?rev=1846002&r1=1846001&r2=1846002&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/ra-git/subversion/libsvn_wc/update_editor.c Wed Nov  7 12:30:06 2018
@@ -1235,9 +1235,11 @@ open_root(void *edit_baton,
     db->shadowed = TRUE;
   else if (have_work)
     {
+      const char *move_dst_op_root_abspath;
       const char *move_src_root_abspath;
 
-      SVN_ERR(svn_wc__db_base_moved_to(NULL, NULL, &move_src_root_abspath,
+      SVN_ERR(svn_wc__db_base_moved_to(NULL, &move_dst_op_root_abspath,
+                                       &move_src_root_abspath,
                                        NULL, eb->db, db->local_abspath,
                                        pool, pool));
 
@@ -1252,7 +1254,8 @@ open_root(void *edit_baton,
                     tree_conflict, eb->db, move_src_root_abspath,
                     svn_wc_conflict_reason_moved_away,
                     svn_wc_conflict_action_edit,
-                    move_src_root_abspath, pool, pool));
+                    move_src_root_abspath,
+                    move_dst_op_root_abspath, pool, pool));
 
           if (strcmp(db->local_abspath, move_src_root_abspath))
             {
@@ -1345,6 +1348,7 @@ check_tree_conflict(svn_skel_t **pconfli
   svn_wc_conflict_reason_t reason = SVN_WC_CONFLICT_REASON_NONE;
   svn_boolean_t modified = FALSE;
   const char *move_src_op_root_abspath = NULL;
+  const char *move_dst_op_root_abspath = NULL;
 
   *pconflict = NULL;
 
@@ -1397,8 +1401,8 @@ check_tree_conflict(svn_skel_t **pconfli
 
       case svn_wc__db_status_deleted:
         {
-          SVN_ERR(svn_wc__db_base_moved_to(NULL, NULL, NULL,
-                                           &move_src_op_root_abspath,
+          SVN_ERR(svn_wc__db_base_moved_to(NULL, &move_dst_op_root_abspath,
+                                           NULL, &move_src_op_root_abspath,
                                            eb->db, local_abspath,
                                            scratch_pool, scratch_pool));
           if (move_src_op_root_abspath)
@@ -1530,6 +1534,7 @@ check_tree_conflict(svn_skel_t **pconfli
                                                   reason,
                                                   action,
                                                   move_src_op_root_abspath,
+                                                  move_dst_op_root_abspath,
                                                   result_pool, scratch_pool));
 
   return SVN_NO_ERROR;
@@ -2007,11 +2012,13 @@ add_directory(const char *path,
         {
           svn_wc_conflict_reason_t reason;
           const char *move_src_op_root_abspath;
+          const char *move_dst_op_root_abspath;
           /* So this deletion wasn't just a deletion, it is actually a
              replacement. Let's install a better tree conflict. */
 
           SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, NULL,
                                                       &move_src_op_root_abspath,
+                                                      &move_dst_op_root_abspath,
                                                       eb->db,
                                                       db->local_abspath,
                                                       tree_conflict,
@@ -2024,6 +2031,7 @@ add_directory(const char *path,
                                         eb->db, db->local_abspath,
                                         reason, svn_wc_conflict_action_replace,
                                         move_src_op_root_abspath,
+                                        move_dst_op_root_abspath,
                                         db->pool, scratch_pool));
 
           /* And now stop checking for conflicts here and just perform
@@ -2148,8 +2156,8 @@ add_directory(const char *path,
                                         tree_conflict,
                                         eb->db, db->local_abspath,
                                         svn_wc_conflict_reason_unversioned,
-                                        svn_wc_conflict_action_add, NULL,
-                                        db->pool, scratch_pool));
+                                        svn_wc_conflict_action_add,
+                                        NULL, NULL, db->pool, scratch_pool));
           db->edit_conflict = tree_conflict;
         }
     }
@@ -2336,7 +2344,7 @@ open_directory(const char *path,
       db->edit_conflict = tree_conflict;
       /* Other modifications wouldn't be a tree conflict */
 
-      SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, NULL, NULL,
+      SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, NULL, NULL, NULL,
                                                   eb->db, db->local_abspath,
                                                   tree_conflict,
                                                   db->pool, db->pool));
@@ -3220,11 +3228,13 @@ add_file(const char *path,
         {
           svn_wc_conflict_reason_t reason;
           const char *move_src_op_root_abspath;
+          const char *move_dst_op_root_abspath;
           /* So this deletion wasn't just a deletion, it is actually a
              replacement. Let's install a better tree conflict. */
 
           SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, NULL,
                                                       &move_src_op_root_abspath,
+                                                      &move_dst_op_root_abspath,
                                                       eb->db,
                                                       fb->local_abspath,
                                                       tree_conflict,
@@ -3237,6 +3247,7 @@ add_file(const char *path,
                                         eb->db, fb->local_abspath,
                                         reason, svn_wc_conflict_action_replace,
                                         move_src_op_root_abspath,
+                                        move_dst_op_root_abspath,
                                         fb->pool, scratch_pool));
 
           /* And now stop checking for conflicts here and just perform
@@ -3363,7 +3374,7 @@ add_file(const char *path,
                                         eb->db, fb->local_abspath,
                                         svn_wc_conflict_reason_unversioned,
                                         svn_wc_conflict_action_add,
-                                        NULL,
+                                        NULL, NULL,
                                         fb->pool, scratch_pool));
         }
     }
@@ -3528,7 +3539,7 @@ open_file(const char *path,
       fb->edit_conflict = tree_conflict;
       /* Other modifications wouldn't be a tree conflict */
 
-      SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, NULL, NULL,
+      SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, NULL, NULL, NULL,
                                                   eb->db, fb->local_abspath,
                                                   tree_conflict,
                                                   scratch_pool, scratch_pool));
@@ -3797,7 +3808,7 @@ change_file_prop(void *file_baton,
                                      eb->db, fb->local_abspath,
                                      svn_wc_conflict_reason_edited,
                                      svn_wc_conflict_action_replace,
-                                     NULL,
+                                     NULL, NULL,
                                      fb->pool, scratch_pool));
 
           SVN_ERR(complete_conflict(fb->edit_conflict, fb->edit_baton,