You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2017/08/24 08:39:33 UTC

svn commit: r1806005 [3/4] - in /subversion/branches/shelve: ./ build/ build/ac-macros/ build/generator/ notes/ notes/api-errata/1.10/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_delta/ subversion/libsvn_...

Modified: subversion/branches/shelve/subversion/libsvn_subr/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/libsvn_subr/mergeinfo.c?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/libsvn_subr/mergeinfo.c (original)
+++ subversion/branches/shelve/subversion/libsvn_subr/mergeinfo.c Thu Aug 24 08:39:31 2017
@@ -41,6 +41,14 @@
 #include "svn_hash.h"
 #include "private/svn_dep_compat.h"
 
+/* Return TRUE iff the forward revision range FIRST wholly contains the
+ * forward revision range SECOND and (if CONSIDER_INHERITANCE is TRUE) has
+ * the same inheritability. */
+static svn_boolean_t
+range_contains(const svn_merge_range_t *first, const svn_merge_range_t *second,
+               svn_boolean_t consider_inheritance);
+
+
 /* Attempt to combine two ranges, IN1 and IN2. If they are adjacent or
    overlapping, and their inheritability allows them to be combined, put
    the result in OUTPUT and return TRUE, otherwise return FALSE.
@@ -954,31 +962,99 @@ adjust_remaining_ranges(svn_rangelist_t
     svn_sort__array_delete(rangelist, starting_index, elements_to_delete);
 }
 
+#if 0 /* Temporary debug helper code */
+static svn_error_t *
+dual_dump(const char *prefix,
+  const svn_rangelist_t *rangelist,
+  const svn_rangelist_t *changes,
+  apr_pool_t *scratch_pool)
+{
+  svn_string_t *rls, *chg;
+
+  SVN_ERR(svn_rangelist_to_string(&rls, rangelist, scratch_pool));
+  SVN_ERR(svn_rangelist_to_string(&chg, changes, scratch_pool));
+
+  SVN_DBG(("%s: %s / %s", prefix, rls->data, chg->data));
+  return SVN_NO_ERROR;
+}
+#endif
+
 svn_error_t *
 svn_rangelist_merge2(svn_rangelist_t *rangelist,
-                     const svn_rangelist_t *changes,
+                     const svn_rangelist_t *chg,
                      apr_pool_t *result_pool,
                      apr_pool_t *scratch_pool)
 {
+  svn_rangelist_t *changes;
   int i = 0;
-  int j = 0;
+  int j;
 
-#ifdef SVN_DEBUG
-  svn_boolean_t was_normalized =
-                    (svn_rangelist__is_canonical(rangelist)
-                     && svn_rangelist__is_canonical(changes));
-#endif
+  SVN_ERR(svn_rangelist__canonicalize(rangelist, scratch_pool));
 
   /* We may modify CHANGES, so make a copy in SCRATCH_POOL. */
-  changes = svn_rangelist_dup(changes, scratch_pool);
+  changes = svn_rangelist_dup(chg, scratch_pool);
+  SVN_ERR(svn_rangelist__canonicalize(changes, scratch_pool));
 
-  while (i < rangelist->nelts && j < changes->nelts)
+  for (j = 0; j < changes->nelts; j++)
     {
-      svn_merge_range_t *range =
-        APR_ARRAY_IDX(rangelist, i, svn_merge_range_t *);
+      svn_merge_range_t *range;
       svn_merge_range_t *change =
         APR_ARRAY_IDX(changes, j, svn_merge_range_t *);
-      int res = svn_sort_compare_ranges(&range, &change);
+      int res;
+
+      range = (i < rangelist->nelts)
+              ? APR_ARRAY_IDX(rangelist, i, svn_merge_range_t *)
+              : NULL;
+
+      if (!range || change->end < range->start)
+        {
+          /* No overlap, nor adjoin, copy change to result range */
+          svn_merge_range_t *chg_copy = svn_merge_range_dup(change,
+                                                            result_pool);
+          svn_sort__array_insert(rangelist, &chg_copy, i++);
+          continue;
+        }
+      else if ((change->start > range->end)
+               || (change->start == range->end
+                   && change->inheritable != range->inheritable))
+        {
+          /* No overlap, nor adjoin. Check next range item against change */
+          i++;
+          j--;
+          continue;
+        }
+
+      if (change->start < range->start
+          && range->inheritable != change->inheritable
+          && ! (change->inheritable && range_contains(change, range, FALSE))
+          && ! (range->inheritable && range_contains(range, change, FALSE)))
+        {
+          /* Can't fold change into existing range.
+             Insert new range before range */
+
+          svn_merge_range_t *chg_copy = svn_merge_range_dup(change,
+                                                            result_pool);
+
+          chg_copy->start = MIN(change->start, range->start);
+          if (! change->inheritable)
+            chg_copy->end = range->start;
+          else
+            range->start = change->end;
+
+          svn_sort__array_insert(rangelist, &chg_copy, i++);
+
+          change->start = chg_copy->end;
+          if (change->start >= change->end)
+            continue; /* No overlap with range left */
+        }
+      else
+        {
+          range->start = MIN(range->start, change->start);
+        }
+
+      SVN_ERR_ASSERT(change->start >= range->start);
+
+      res = svn_sort_compare_ranges(&range, &change);
 
       if (res == 0)
         {
@@ -988,17 +1064,11 @@ svn_rangelist_merge2(svn_rangelist_t *ra
           if (range->inheritable || change->inheritable)
             range->inheritable = TRUE;
           i++;
-          j++;
+          continue;
         }
       else if (res < 0) /* CHANGE is younger than RANGE */
         {
-          if (range->end < change->start)
-            {
-              /* RANGE is older than CHANGE and the two do not
-                 adjoin or overlap */
-              i++;
-            }
-          else if (range->end == change->start)
+          if (range->end == change->start)
             {
               /* RANGE and CHANGE adjoin */
               if (range->inheritable == change->inheritable)
@@ -1007,14 +1077,14 @@ svn_rangelist_merge2(svn_rangelist_t *ra
                      RANGE expands to absord CHANGE. */
                   range->end = change->end;
                   adjust_remaining_ranges(rangelist, &i, result_pool);
-                  j++;
+                  continue;
                 }
               else
                 {
                   /* RANGE and CHANGE adjoin, but have different
                      inheritability.  Since RANGE is older, just
                      move on to the next RANGE. */
-                  i++;
+                  SVN_ERR_MALFUNCTION();
                 }
             }
           else
@@ -1027,9 +1097,13 @@ svn_rangelist_merge2(svn_rangelist_t *ra
                       with no adjustment otherwise only the intersection is
                       absorbed and CHANGE is truncated. */
                   if (range->end >= change->end)
-                    j++;
+                    continue;
                   else
-                    change->start = range->end;
+                    {
+                      change->start = range->end;
+                      j--;
+                      continue;
+                    }
                 }
               else
                 {
@@ -1043,6 +1117,8 @@ svn_rangelist_merge2(svn_rangelist_t *ra
                       range_copy->end = change->start;
                       range->start = change->start;
                       svn_sort__array_insert(rangelist, &range_copy, i++);
+                      j--;
+                      continue;
                     }
                   else
                     {
@@ -1051,23 +1127,15 @@ svn_rangelist_merge2(svn_rangelist_t *ra
                          is older. */
                       range->inheritable = TRUE;
                       change->start = range->end;
+                      j--;
+                      continue;
                     }
                 }
             }
         }
       else /* res > 0, CHANGE is older than RANGE */
         {
-          if (change->end < range->start)
-            {
-              /* CHANGE is older than RANGE and the two do not
-                 adjoin or overlap, so insert a copy of CHANGE
-                 into RANGELIST. */
-              svn_merge_range_t *change_copy =
-                svn_merge_range_dup(change, result_pool);
-              svn_sort__array_insert(rangelist, &change_copy, i++);
-              j++;
-            }
-          else if (change->end == range->start)
+          if (change->end == range->start)
             {
               /* RANGE and CHANGE adjoin */
               if (range->inheritable == change->inheritable)
@@ -1075,16 +1143,13 @@ svn_rangelist_merge2(svn_rangelist_t *ra
                   /* RANGE and CHANGE have the same inheritability so we
                      can simply combine the two in place. */
                   range->start = change->start;
-                  j++;
+                  continue;
                 }
               else
                 {
                   /* RANGE and CHANGE have different inheritability so insert
                      a copy of CHANGE into RANGELIST. */
-                  svn_merge_range_t *change_copy =
-                    svn_merge_range_dup(change, result_pool);
-                  svn_sort__array_insert(rangelist, &change_copy, i);
-                  j++;
+                  SVN_ERR_MALFUNCTION(); /* Already handled */
                 }
             }
           else
@@ -1102,7 +1167,7 @@ svn_rangelist_merge2(svn_rangelist_t *ra
                       range->end = change->end;
                       adjust_remaining_ranges(rangelist, &i, result_pool);
                     }
-                  j++;
+                  continue;
                 }
               else if (range->inheritable)
                 {
@@ -1111,18 +1176,14 @@ svn_rangelist_merge2(svn_rangelist_t *ra
                       /* RANGE is inheritable so absorbs any part of CHANGE
                          it overlaps.  CHANGE is truncated and the remainder
                          inserted into RANGELIST. */
-                      svn_merge_range_t *change_copy =
-                        svn_merge_range_dup(change, result_pool);
-                      change_copy->end = range->start;
-                      change->start = range->start;
-                      svn_sort__array_insert(rangelist, &change_copy, i++);
+                      SVN_ERR_MALFUNCTION(); /* Already handled */
                     }
                   else
                     {
                       /* CHANGE and RANGE share the same start rev, but
                          CHANGE is considered older because CHANGE->END is
                          older than RANGE->END. */
-                      j++;
+                      continue;
                     }
                 }
               else
@@ -1136,7 +1197,7 @@ svn_rangelist_merge2(svn_rangelist_t *ra
                              same end revision, so set RANGE equal to CHANGE. */
                           range->start = change->start;
                           range->inheritable = TRUE;
-                          j++;
+                          continue;
                         }
                       else if (change->end > range->end)
                         {
@@ -1146,6 +1207,8 @@ svn_rangelist_merge2(svn_rangelist_t *ra
                           range->start = change->start;
                           range->inheritable = TRUE;
                           change->start = range->end;
+                          j--;
+                          continue;
                         }
                       else
                         {
@@ -1159,7 +1222,7 @@ svn_rangelist_merge2(svn_rangelist_t *ra
                           range->end = change->end;
                           range->inheritable = TRUE;
                           svn_sort__array_insert(rangelist, &range_copy, ++i);
-                          j++;
+                          continue;
                         }
                     }
                   else
@@ -1177,25 +1240,16 @@ svn_rangelist_merge2(svn_rangelist_t *ra
                       range_copy->inheritable = TRUE;
                       range->start = change->end;
                       svn_sort__array_insert(rangelist, &range_copy, i++);
-                      j++;
+                      continue;
                     }
                 }
             }
         }
-    }
-
-  /* Copy any remaining elements in CHANGES into RANGELIST. */
-  for (; j < (changes)->nelts; j++)
-    {
-      svn_merge_range_t *change =
-        APR_ARRAY_IDX(changes, j, svn_merge_range_t *);
-      svn_merge_range_t *change_copy = svn_merge_range_dup(change,
-                                                           result_pool);
-      svn_sort__array_insert(rangelist, &change_copy, rangelist->nelts);
+      SVN_ERR_MALFUNCTION(); /* Unreachable */
     }
 
 #ifdef SVN_DEBUG
-  SVN_ERR_ASSERT(!was_normalized || svn_rangelist__is_canonical(rangelist));
+  SVN_ERR_ASSERT(svn_rangelist__is_canonical(rangelist));
 #endif
 
   return SVN_NO_ERROR;

Modified: subversion/branches/shelve/subversion/libsvn_subr/stream.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/libsvn_subr/stream.c?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/libsvn_subr/stream.c (original)
+++ subversion/branches/shelve/subversion/libsvn_subr/stream.c Thu Aug 24 08:39:31 2017
@@ -235,6 +235,12 @@ svn_stream_supports_mark(svn_stream_t *s
   return stream->mark_fn != NULL;
 }
 
+svn_boolean_t
+svn_stream_supports_reset(svn_stream_t *stream)
+{
+  return stream->seek_fn != NULL;
+}
+
 svn_error_t *
 svn_stream_mark(svn_stream_t *stream, svn_stream_mark_t **mark,
                 apr_pool_t *pool)
@@ -670,6 +676,7 @@ svn_stream_disown(svn_stream_t *stream,
 struct baton_apr {
   apr_file_t *file;
   apr_pool_t *pool;
+  svn_boolean_t truncate_on_seek;
 };
 
 /* svn_stream_mark_t for streams backed by APR files. */
@@ -790,7 +797,16 @@ seek_handler_apr(void *baton, const svn_
   struct baton_apr *btn = baton;
   apr_off_t offset = (mark != NULL) ? ((const struct mark_apr *)mark)->off : 0;
 
-  SVN_ERR(svn_io_file_seek(btn->file, APR_SET, &offset, btn->pool));
+  if (btn->truncate_on_seek)
+    {
+      /* The apr_file_trunc() function always does seek + trunc,
+       * and this is documented, so don't seek when truncating. */
+      SVN_ERR(svn_io_file_trunc(btn->file, offset, btn->pool));
+    }
+  else
+    {
+      SVN_ERR(svn_io_file_seek(btn->file, APR_SET, &offset, btn->pool));
+    }
 
   return SVN_NO_ERROR;
 }
@@ -1052,6 +1068,7 @@ static svn_stream_t *
 make_stream_from_apr_file(apr_file_t *file,
                           svn_boolean_t disown,
                           svn_boolean_t supports_seek,
+                          svn_boolean_t truncate_on_seek,
                           apr_pool_t *pool)
 {
   struct baton_apr *baton;
@@ -1063,6 +1080,7 @@ make_stream_from_apr_file(apr_file_t *fi
   baton = apr_palloc(pool, sizeof(*baton));
   baton->file = file;
   baton->pool = pool;
+  baton->truncate_on_seek = truncate_on_seek;
   stream = svn_stream_create(baton, pool);
   svn_stream_set_read2(stream, read_handler_apr, read_full_handler_apr);
   svn_stream_set_write(stream, write_handler_apr);
@@ -1085,11 +1103,20 @@ make_stream_from_apr_file(apr_file_t *fi
 }
 
 svn_stream_t *
+svn_stream__from_aprfile(apr_file_t *file,
+                         svn_boolean_t disown,
+                         svn_boolean_t truncate_on_seek,
+                         apr_pool_t *pool)
+{
+  return make_stream_from_apr_file(file, disown, TRUE, truncate_on_seek, pool);
+}
+
+svn_stream_t *
 svn_stream_from_aprfile2(apr_file_t *file,
                          svn_boolean_t disown,
                          apr_pool_t *pool)
 {
-  return make_stream_from_apr_file(file, disown, TRUE, pool);
+  return make_stream_from_apr_file(file, disown, TRUE, FALSE, pool);
 }
 
 apr_file_t *
@@ -1427,6 +1454,31 @@ close_handler_checksum(void *baton)
   return svn_error_trace(svn_stream_close(btn->proxy));
 }
 
+static svn_error_t *
+seek_handler_checksum(void *baton, const svn_stream_mark_t *mark)
+{
+  struct checksum_stream_baton *btn = baton;
+
+  /* Only reset support. */
+  if (mark)
+    {
+      return svn_error_create(SVN_ERR_STREAM_SEEK_NOT_SUPPORTED,
+                              NULL, NULL);
+    }
+  else
+    {
+      if (btn->read_ctx)
+        svn_checksum_ctx_reset(btn->read_ctx);
+
+      if (btn->write_ctx)
+        svn_checksum_ctx_reset(btn->write_ctx);
+
+      SVN_ERR(svn_stream_reset(btn->proxy));
+    }
+
+  return SVN_NO_ERROR;
+}
+
 
 svn_stream_t *
 svn_stream_checksummed2(svn_stream_t *stream,
@@ -1464,6 +1516,8 @@ svn_stream_checksummed2(svn_stream_t *st
   svn_stream_set_write(s, write_handler_checksum);
   svn_stream_set_data_available(s, data_available_handler_checksum);
   svn_stream_set_close(s, close_handler_checksum);
+  if (svn_stream_supports_reset(stream))
+    svn_stream_set_seek(s, seek_handler_checksum);
   return s;
 }
 
@@ -1842,7 +1896,7 @@ svn_stream_for_stdin2(svn_stream_t **in,
      it does not, or the behavior is implementation-specific.  Hence,
      we cannot safely advertise mark(), seek() and non-default skip()
      support. */
-  *in = make_stream_from_apr_file(stdin_file, TRUE, FALSE, pool);
+  *in = make_stream_from_apr_file(stdin_file, TRUE, FALSE, FALSE, pool);
 
   return SVN_NO_ERROR;
 }
@@ -1862,7 +1916,7 @@ svn_stream_for_stdout(svn_stream_t **out
      it does not, or the behavior is implementation-specific.  Hence,
      we cannot safely advertise mark(), seek() and non-default skip()
      support. */
-  *out = make_stream_from_apr_file(stdout_file, TRUE, FALSE, pool);
+  *out = make_stream_from_apr_file(stdout_file, TRUE, FALSE, FALSE, pool);
 
   return SVN_NO_ERROR;
 }
@@ -1882,7 +1936,7 @@ svn_stream_for_stderr(svn_stream_t **err
      it does not, or the behavior is implementation-specific.  Hence,
      we cannot safely advertise mark(), seek() and non-default skip()
      support. */
-  *err = make_stream_from_apr_file(stderr_file, TRUE, FALSE, pool);
+  *err = make_stream_from_apr_file(stderr_file, TRUE, FALSE, FALSE, pool);
 
   return SVN_NO_ERROR;
 }
@@ -2247,7 +2301,9 @@ svn_stream__create_for_install(svn_strea
                                    svn_io_file_del_none,
                                    result_pool, scratch_pool));
 #endif
-  *install_stream = svn_stream_from_aprfile2(file, FALSE, result_pool);
+  /* Set the temporary file to be truncated on seeks. */
+  *install_stream = svn_stream__from_aprfile(file, FALSE, TRUE,
+                                             result_pool);
 
   ib = apr_pcalloc(result_pool, sizeof(*ib));
   ib->baton_apr = *(struct baton_apr*)(*install_stream)->baton;

Modified: subversion/branches/shelve/subversion/libsvn_subr/utf8proc.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/libsvn_subr/utf8proc.c?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/libsvn_subr/utf8proc.c (original)
+++ subversion/branches/shelve/subversion/libsvn_subr/utf8proc.c Thu Aug 24 08:39:31 2017
@@ -29,12 +29,16 @@
 #include "private/svn_utf_private.h"
 #include "svn_private_config.h"
 
+#if SVN_INTERNAL_UTF8PROC
 #define UTF8PROC_INLINE
 /* Somehow utf8proc thinks it is nice to use strlen as an argument name,
    while this function is already defined via apr.h */
 #define strlen svn__strlen_var
 #include "utf8proc/utf8proc.c"
 #undef strlen
+#else
+#include <utf8proc.h>
+#endif
 
 
 

Modified: subversion/branches/shelve/subversion/libsvn_subr/utf8proc/utf8proc.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/libsvn_subr/utf8proc/utf8proc.c?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/libsvn_subr/utf8proc/utf8proc.c (original)
+++ subversion/branches/shelve/subversion/libsvn_subr/utf8proc/utf8proc.c Thu Aug 24 08:39:31 2017
@@ -1,3 +1,5 @@
+#include "svn_private_config.h"
+#if SVN_INTERNAL_UTF8PROC
 /*
  *  Copyright (c) 2009 Public Software Group e. V., Berlin, Germany
  *
@@ -39,7 +41,7 @@
  */
 
 
-#include "utf8proc.h"
+#include "utf8proc_internal.h"
 #include "utf8proc_data.c"
 
 
@@ -609,3 +611,4 @@ uint8_t *utf8proc_NFKC(const uint8_t *st
   return retval;
 }
 
+#endif /* SVN_INTERNAL_UTF8PROC */

Modified: subversion/branches/shelve/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/libsvn_wc/adm_crawler.c?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/branches/shelve/subversion/libsvn_wc/adm_crawler.c Thu Aug 24 08:39:31 2017
@@ -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/shelve/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/libsvn_wc/deprecated.c?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/shelve/subversion/libsvn_wc/deprecated.c Thu Aug 24 08:39:31 2017
@@ -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;
+
+      /* 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(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));
+  SVN_ERR(err);
 
   if (digest)
     memcpy(digest, new_text_base_md5_checksum->digest, APR_MD5_DIGESTSIZE);

Modified: subversion/branches/shelve/subversion/libsvn_wc/translate.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/libsvn_wc/translate.c?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/libsvn_wc/translate.c (original)
+++ subversion/branches/shelve/subversion/libsvn_wc/translate.c Thu Aug 24 08:39:31 2017
@@ -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/shelve/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/libsvn_wc/wc.h?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/shelve/subversion/libsvn_wc/wc.h Thu Aug 24 08:39:31 2017
@@ -480,7 +480,7 @@ svn_wc__conflicted_for_update_p(svn_bool
 
 /* Internal version of svn_wc_transmit_text_deltas3(). */
 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,

Modified: subversion/branches/shelve/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/mod_dav_svn/repos.c?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/shelve/subversion/mod_dav_svn/repos.c Thu Aug 24 08:39:31 2017
@@ -1739,6 +1739,18 @@ static int sort_encoding_pref(const void
   return (diff == 0 ? 0 : (diff > 0 ? -1 : 1));
 }
 
+static int get_svndiff_version(const struct accept_rec *rec)
+{
+  if (strcmp(rec->name, "svndiff2") == 0)
+    return 2;
+  else if (strcmp(rec->name, "svndiff1") == 0)
+    return 1;
+  else if (strcmp(rec->name, "svndiff") == 0)
+    return 0;
+  else
+    return -1;
+}
+
 /* Parse and handle any possible Accept-Encoding header that has been
    sent as part of the request.  */
 static void
@@ -1752,7 +1764,7 @@ negotiate_encoding_prefs(request_rec *r,
      necessary ones in this file. */
   int i;
   apr_array_header_t *encoding_prefs;
-  svn_boolean_t accepts_svndiff1 = FALSE;
+  apr_array_header_t *svndiff_encodings;
   svn_boolean_t accepts_svndiff2 = FALSE;
 
   encoding_prefs = do_header_line(r->pool,
@@ -1765,33 +1777,43 @@ negotiate_encoding_prefs(request_rec *r,
       return;
     }
 
-  svn_sort__array(encoding_prefs, sort_encoding_pref);
+  svndiff_encodings = apr_array_make(r->pool, 3, sizeof(struct accept_rec));
   for (i = 0; i < encoding_prefs->nelts; i++)
     {
-      struct accept_rec rec = APR_ARRAY_IDX(encoding_prefs, i,
-                                            struct accept_rec);
-      if (strcmp(rec.name, "svndiff2") == 0)
-        {
-          accepts_svndiff2 = TRUE;
-        }
-      else if (strcmp(rec.name, "svndiff1") == 0)
-        {
-          accepts_svndiff1 = TRUE;
-        }
+      const struct accept_rec *rec = &APR_ARRAY_IDX(encoding_prefs, i,
+                                                    struct accept_rec);
+      int version = get_svndiff_version(rec);
+
+      if (version > 0)
+        APR_ARRAY_PUSH(svndiff_encodings, struct accept_rec) = *rec;
+
+      if (version == 2)
+        accepts_svndiff2 = TRUE;
     }
 
-  /* Enable svndiff2 if the client can read it, and if the server-side
-   * compression level is set to 1.  Svndiff2 offers better speed and
-   * compression ratio comparable to svndiff1 with compression level 1,
-   * but with for other compression levels.
-   */
-  if (accepts_svndiff2 && dav_svn__get_compression_level(r) == 1)
+  if (dav_svn__get_compression_level(r) == 0)
+    {
+      /* If the compression is disabled on the server, use the uncompressed
+       * svndiff0 format, which we assume is always supported. */
+      *svndiff_version = 0;
+    }
+  else if (accepts_svndiff2 && dav_svn__get_compression_level(r) == 1)
     {
+      /* Enable svndiff2 if the client can read it, and if the server-side
+       * compression level is set to 1.  Svndiff2 offers better speed and
+       * compression ratio comparable to svndiff1 with compression level 1,
+       * but not with other compression levels.
+       */
       *svndiff_version = 2;
     }
-  else if (accepts_svndiff1)
+  else if (svndiff_encodings->nelts > 0)
     {
-      *svndiff_version = 1;
+      const struct accept_rec *rec;
+
+      /* Otherwise, use what the client prefers to see. */
+      svn_sort__array(svndiff_encodings, sort_encoding_pref);
+      rec = &APR_ARRAY_IDX(svndiff_encodings, 0, struct accept_rec);
+      *svndiff_version = get_svndiff_version(rec);
     }
   else
     {
@@ -2987,6 +3009,26 @@ close_stream(dav_stream *stream, int com
            pool);
     }
 
+  if (stream->wstream != NULL || stream->delta_handler != NULL)
+    {
+      request_rec *r = stream->res->info->r;
+      svn_checksum_t *checksum;
+
+      serr = svn_fs_file_checksum(&checksum, svn_checksum_md5,
+                                  stream->res->info->root.root,
+                                  stream->res->info->repos_path,
+                                  FALSE, pool);
+      if (serr)
+        return dav_svn__convert_err
+          (serr, HTTP_INTERNAL_SERVER_ERROR,
+            "mod_dav_svn close_stream: error getting file checksum",
+            pool);
+
+      if (checksum)
+        apr_table_set(r->headers_out, SVN_DAV_RESULT_FULLTEXT_MD5_HEADER,
+                      svn_checksum_to_cstring(checksum, pool));
+    }
+
   return NULL;
 }
 

Modified: subversion/branches/shelve/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/mod_dav_svn/version.c?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/shelve/subversion/mod_dav_svn/version.c Thu Aug 24 08:39:31 2017
@@ -154,6 +154,7 @@ get_vsn_options(apr_pool_t *p, apr_text_
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_REVERSE_FILE_REVS);
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_SVNDIFF1);
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_SVNDIFF2);
+  apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_PUT_RESULT_CHECKSUM);
   /* Mergeinfo is a special case: here we merely say that the server
    * knows how to handle mergeinfo -- whether the repository does too
    * is a separate matter.

Modified: subversion/branches/shelve/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/svn/cl.h?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/svn/cl.h (original)
+++ subversion/branches/shelve/subversion/svn/cl.h Thu Aug 24 08:39:31 2017
@@ -83,7 +83,10 @@ typedef enum svn_cl__accept_t
   svn_cl__accept_edit,
 
   /* Launch user's resolver and resolve conflict with edited file. */
-  svn_cl__accept_launch
+  svn_cl__accept_launch,
+
+  /* Use recommended resolution if available, else leave the conflict alone. */
+  svn_cl__accept_recommended
 
 } svn_cl__accept_t;
 
@@ -97,6 +100,7 @@ typedef enum svn_cl__accept_t
 #define SVN_CL__ACCEPT_THEIRS_FULL "theirs-full"
 #define SVN_CL__ACCEPT_EDIT "edit"
 #define SVN_CL__ACCEPT_LAUNCH "launch"
+#define SVN_CL__ACCEPT_RECOMMENDED "recommended"
 
 /* Return the svn_cl__accept_t value corresponding to WORD, using exact
  * case-sensitive string comparison. Return svn_cl__accept_invalid if WORD
@@ -250,6 +254,7 @@ typedef struct svn_cl__opt_state_t
   svn_boolean_t pin_externals;     /* pin externals to last-changed revisions */
   const char *show_item;           /* print only the given item */
   svn_boolean_t adds_as_modification; /* update 'add vs add' no tree conflict */
+  svn_boolean_t vacuum_pristines; /* remove unreferenced pristines */
   svn_boolean_t list;
 } svn_cl__opt_state_t;
 

Modified: subversion/branches/shelve/subversion/svn/cleanup-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/svn/cleanup-cmd.c?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/svn/cleanup-cmd.c (original)
+++ subversion/branches/shelve/subversion/svn/cleanup-cmd.c Thu Aug 24 08:39:31 2017
@@ -72,13 +72,14 @@ svn_cl__cleanup(apr_getopt_t *os,
 
       SVN_ERR(svn_dirent_get_absolute(&target_abspath, target, iterpool));
 
-      if (opt_state->remove_unversioned || opt_state->remove_ignored)
+      if (opt_state->remove_unversioned || opt_state->remove_ignored ||
+          opt_state->vacuum_pristines)
         {
           svn_error_t *err = svn_client_vacuum(target_abspath,
                                                opt_state->remove_unversioned,
                                                opt_state->remove_ignored,
                                                TRUE /* fix_timestamps */,
-                                               FALSE /* vacuum_pristines */,
+                                               opt_state->vacuum_pristines,
                                                opt_state->include_externals,
                                                ctx, iterpool);
 

Modified: subversion/branches/shelve/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/svn/conflict-callbacks.c?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/shelve/subversion/svn/conflict-callbacks.c Thu Aug 24 08:39:31 2017
@@ -78,6 +78,9 @@ svn_cl__accept_from_word(const char *wor
   if (strcmp(word, SVN_CL__ACCEPT_LAUNCH) == 0
       || strcmp(word, "l") == 0 || strcmp(word, ":-l") == 0)
     return svn_cl__accept_launch;
+  if (strcmp(word, SVN_CL__ACCEPT_RECOMMENDED) == 0
+      || strcmp(word, "r") == 0)
+    return svn_cl__accept_recommended;
   /* word is an invalid action. */
   return svn_cl__accept_invalid;
 }
@@ -2174,6 +2177,19 @@ svn_cl__resolve_conflict(svn_boolean_t *
             }
         }
     }
+  else if (accept_which == svn_cl__accept_recommended)
+    {
+      svn_client_conflict_option_id_t recommended_id;
+
+      if (tree_conflicted)
+        SVN_ERR(svn_client_conflict_tree_get_details(conflict, ctx,
+                                                     scratch_pool));
+      recommended_id = svn_client_conflict_get_recommended_option_id(conflict);
+      if (recommended_id != svn_client_conflict_option_unspecified)
+        option_id = recommended_id;
+      else
+        option_id = svn_client_conflict_option_postpone;
+    }
   else
     SVN_ERR_MALFUNCTION();
 

Modified: subversion/branches/shelve/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/svn/merge-cmd.c?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/svn/merge-cmd.c (original)
+++ subversion/branches/shelve/subversion/svn/merge-cmd.c Thu Aug 24 08:39:31 2017
@@ -182,6 +182,7 @@ conflict_func_merge_cmd(svn_wc_conflict_
     case svn_cl__accept_postpone:
     case svn_cl__accept_invalid:
     case svn_cl__accept_unspecified:
+    case svn_cl__accept_recommended:
       /* Postpone or no valid --accept option, postpone the conflict. */
       choice = svn_wc_conflict_choose_postpone;
       break;

Modified: subversion/branches/shelve/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/svn/notify.c?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/svn/notify.c (original)
+++ subversion/branches/shelve/subversion/svn/notify.c Thu Aug 24 08:39:31 2017
@@ -54,6 +54,7 @@ struct notify_baton
   svn_boolean_t is_wc_to_repos_copy;
   svn_boolean_t sent_first_txdelta;
   int in_external;
+  svn_revnum_t progress_revision;
   svn_boolean_t had_print_error; /* Used to not keep printing error messages
                                     when we've already had one print error. */
 
@@ -477,14 +478,27 @@ notify_body(struct notify_baton *nb,
                                  _("Searching tree conflict details for '%s' "
                                    "in repository:\n"),
                                  path_local));
+      nb->progress_revision = 0;
       break;
 
     case svn_wc_notify_tree_conflict_details_progress:
-      SVN_ERR(svn_cmdline_printf(pool, _("\rChecking r%ld..."), n->revision));
+      /* First printf is to obliterate any previous progress printf,
+         assuming no more than 10 digit revisions.  Avoid i18n so the
+         text length is known.  We only need to do this if the new
+         revision is 4 digits less than the previous revision but that
+         requires counting digits.  Dividing by 1000 works well
+         enough: it triggers when needed, it sometimes triggers when
+         not needed, but in typical cases it doesn't trigger as the
+         revisions don't vary much. */
+      if (n->revision < nb->progress_revision / 1000)
+        SVN_ERR(svn_cmdline_printf(pool, "\rChecking r             "));
+      SVN_ERR(svn_cmdline_printf(pool, "\rChecking r%ld...", n->revision));
+      nb->progress_revision = n->revision;
       break;
 
     case svn_wc_notify_end_search_tree_conflict_details:
       SVN_ERR(svn_cmdline_printf(pool, _(" done\n")));
+      nb->progress_revision = 0;
       break;
 
     case svn_wc_notify_add:
@@ -1235,6 +1249,7 @@ svn_cl__get_notifier(svn_wc_notify_func2
   nb->is_export = FALSE;
   nb->is_wc_to_repos_copy = FALSE;
   nb->in_external = 0;
+  nb->progress_revision = 0;
   nb->had_print_error = FALSE;
   nb->conflict_stats = conflict_stats;
   SVN_ERR(svn_dirent_get_absolute(&nb->path_prefix, "", pool));

Modified: subversion/branches/shelve/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/svn/svn.c?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/svn/svn.c (original)
+++ subversion/branches/shelve/subversion/svn/svn.c Thu Aug 24 08:39:31 2017
@@ -144,6 +144,7 @@ typedef enum svn_cl__longopt_t {
   opt_pin_externals,
   opt_show_item,
   opt_adds_as_modification,
+  opt_vacuum_pristines,
   opt_delete,
   opt_keep_shelved,
   opt_list
@@ -331,9 +332,9 @@ const apr_getopt_option_t svn_cl__option
                        "                             "
                        "'theirs-conflict', 'mine-full', 'theirs-full',\n"
                        "                             "
-                       "'edit', 'launch')\n"
+                       "'edit', 'launch', 'recommended') (shorthand:\n"
                        "                             "
-                       "(shorthand: 'p', 'mc', 'tc', 'mf', 'tf', 'e', 'l')"
+                       "'p', 'mc', 'tc', 'mf', 'tf', 'e', 'l', 'r')"
                        )},
   {"show-revs",     opt_show_revs, 1,
                     N_("specify which collection of revisions to display\n"
@@ -462,6 +463,9 @@ const apr_getopt_option_t svn_cl__option
                        "                             "
                        "resolve tree conflicts instead.")},
 
+  {"vacuum-pristines", opt_vacuum_pristines, 0,
+                       N_("remove unreferenced pristines from .svn directory")},
+
   {"list", opt_list, 0, N_("list shelved patches")},
   {"keep-shelved", opt_keep_shelved, 0, N_("do not delete the shelved patch")},
   {"delete", opt_delete, 0, N_("delete the shelved patch")},
@@ -532,7 +536,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
     "  or more patterns. With the --remove option, remove cached authentication\n"
     "  credentials matching one or more patterns.\n"
     "\n"
-    "  If more than one pattern is specified credentials are considered only they\n"
+    "  If more than one pattern is specified credentials are considered only if they\n"
     "  match all specified patterns. Patterns are matched case-sensitively and may\n"
     "  contain glob wildcards:\n"
     "    ?      matches any single character\n"
@@ -612,38 +616,45 @@ const svn_opt_subcommand_desc2_t svn_cl_
     {'r', 'q', 'N', opt_depth, opt_force, opt_ignore_externals} },
 
   { "cleanup", svn_cl__cleanup, {0}, N_
-    ("Recursively clean up the working copy, removing write locks, resuming\n"
-     "unfinished operations, etc.\n"
-     "usage: cleanup [WCPATH...]\n"
-     "\n"
-     "  By default, finish any unfinished business in the working copy at WCPATH,\n"
-     "  and remove write locks (shown as 'L' by the 'svn status' command) from\n"
-     "  the working copy. Usually, this is only necessary if a Subversion client\n"
-     "  has crashed while using the working copy, leaving it in an unusable state.\n"
-     "\n"
-     "  WARNING: There is no mechanism that will protect write locks still\n"
-     "           being used by other Subversion clients. Running this command\n"
-     "           while another client is using the working copy can corrupt\n"
-     "           the working copy beyond repair!\n"
-     "\n"
-     "  If the --remove-unversioned option or the --remove-ignored option\n"
-     "  is given, remove any unversioned or ignored items within WCPATH.\n"
-     "  To prevent accidental working copy corruption, unversioned or ignored\n"
-     "  items can only be removed if the working copy is not already locked\n"
-     "  for writing by another Subversion client.\n"
-     "  Note that the 'svn status' command shows unversioned items as '?',\n"
-     "  and ignored items as 'I' if the --no-ignore option is given to it.\n"),
-    {opt_merge_cmd, opt_remove_unversioned, opt_remove_ignored,
-     opt_include_externals, 'q'} },
-
+    ("Either recover from an interrupted operation that left the working copy locked,\n"
+     "or remove unwanted files.\n"
+     "usage: 1. cleanup [WCPATH...]\n"
+     "       2. cleanup --remove-unversioned [WCPATH...]\n"
+     "          cleanup --remove-ignored [WCPATH...]\n"
+     "       3. cleanup --vacuum-pristines [WCPATH...]\n"
+     "\n"
+     "  1. When none of the options --remove-unversioned, --remove-ignored, and\n"
+     "    --vacuum-pristines is specified, remove all write locks (shown as 'L' by\n"
+     "    the 'svn status' command) from the working copy.  Usually, this is only\n"
+     "    necessary if a Subversion client has crashed while using the working copy,\n"
+     "    leaving it in an unusable state.\n"
+     "\n"
+     "    WARNING: There is no mechanism that will protect write locks still\n"
+     "             being used by other Subversion clients. Running this command\n"
+     "             without any options while another client is using the working\n"
+     "             copy can corrupt the working copy beyond repair!\n"
+     "\n"
+     "  2. If the --remove-unversioned option or the --remove-ignored option\n"
+     "    is given, remove any unversioned or ignored items within WCPATH.\n"
+     "    Note that the 'svn status' command shows unversioned items as '?',\n"
+     "    and ignored items as 'I' if the --no-ignore option is given to it.\n"
+     "\n"
+     "  3. If the --vacuum-pristines option is given, remove pristine copies of\n"
+     "    files which are stored inside the .svn directory and which are no longer\n"
+     "    referenced by any file in the working copy.\n"),
+    { opt_remove_unversioned, opt_remove_ignored, opt_vacuum_pristines,
+      opt_include_externals, 'q', opt_merge_cmd }, 
+    { { opt_merge_cmd, N_("deprecated and ignored") } } },
+      
   { "commit", svn_cl__commit, {"ci"},
     N_("Send changes from your working copy to the repository.\n"
        "usage: commit [PATH...]\n"
        "\n"
        "  A log message must be provided, but it can be empty.  If it is not\n"
        "  given by a --message or --file option, an editor will be started.\n"
+       "\n"
        "  If any targets are (or contain) locked items, those will be\n"
-       "  unlocked after a successful commit.\n"
+       "  unlocked after a successful commit, unless --no-unlock is given.\n"
        "\n"
        "  If --include-externals is given, also commit file and directory\n"
        "  externals reached by recursion. Do not commit externals with a\n"
@@ -813,11 +824,12 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "no other user can commit changes to them.\n"
      "usage: lock TARGET...\n"
      "\n"
-     "  Use --force to steal the lock from another user or working copy.\n"),
+     "  Use --force to steal a lock from another user or working copy.\n"),
     { opt_targets, 'm', 'F', opt_force_log, opt_encoding, opt_force, 'q' },
     {{'F', N_("read lock comment from file ARG")},
      {'m', N_("specify lock comment ARG")},
-     {opt_force_log, N_("force validity of lock comment source")}} },
+     {opt_force_log, N_("force validity of lock comment source")},
+     {opt_force, N_("steal locks")}} },
 
   { "log", svn_cl__log, {0}, N_
     ("Show the log messages for a set of revision(s) and/or path(s).\n"
@@ -1322,11 +1334,10 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "  Furthermore, WC -> WC moves will refuse to move a mixed-revision subtree.\n"
      "  To avoid unnecessary conflicts, it is recommended to run 'svn update'\n"
      "  to update the subtree to a single revision before moving it.\n"
-     "  The --allow-mixed-revisions option is provided for backward compatibility.\n"
-     "\n"
-     "  The --revision option has no use and is deprecated.\n"),
-    {'r', 'q', opt_force, opt_parents, opt_allow_mixed_revisions,
-     SVN_CL__LOG_MSG_OPTIONS} },
+     "  The --allow-mixed-revisions option is provided for backward compatibility.\n"),
+    {'q', opt_force, opt_parents, opt_allow_mixed_revisions,
+     SVN_CL__LOG_MSG_OPTIONS, 'r'},
+    {{'r', "deprecated and ignored"}} },
 
   { "patch", svn_cl__patch, {0}, N_
     ("Apply a patch to a working copy.\n"
@@ -1802,20 +1813,23 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "    svn switch --relocate http:// svn://\n"
      "    svn switch --relocate http://www.example.com/repo/project \\\n"
      "                          svn://svn.example.com/repo/project\n"),
-    { 'r', 'N', opt_depth, opt_set_depth, 'q', opt_merge_cmd, opt_relocate,
-      opt_ignore_externals, opt_ignore_ancestry, opt_force, opt_accept},
+    { 'r', 'N', opt_depth, opt_set_depth, 'q', opt_merge_cmd,
+      opt_ignore_externals, opt_ignore_ancestry, opt_force, opt_accept,
+      opt_relocate },
     {{opt_ignore_ancestry,
      N_("allow switching to a node with no common ancestor")},
      {opt_force,
-      N_("handle unversioned obstructions as changes")}}
+      N_("handle unversioned obstructions as changes")},
+     {opt_relocate,N_("deprecated; use 'svn relocate'")}}
   },
 
   { "unlock", svn_cl__unlock, {0}, N_
     ("Unlock working copy paths or URLs.\n"
      "usage: unlock TARGET...\n"
      "\n"
-     "  Use --force to break the lock.\n"),
-    { opt_targets, opt_force, 'q' } },
+     "  Use --force to break a lock held by another user or working copy.\n"),
+    { opt_targets, opt_force, 'q' },
+    {{opt_force, N_("break locks")}} },
 
   { "update", svn_cl__update, {"up"},  N_
     ("Bring changes from the repository into the working copy.\n"
@@ -2543,6 +2557,9 @@ sub_main(int *exit_code, int argc, const
       case opt_adds_as_modification:
         opt_state.adds_as_modification = TRUE;
         break;
+      case opt_vacuum_pristines:
+        opt_state.vacuum_pristines = TRUE;
+        break;
       default:
         /* Hmmm. Perhaps this would be a good place to squirrel away
            opts that commands like svn diff might need. Hmmm indeed. */
@@ -3093,10 +3110,11 @@ sub_main(int *exit_code, int argc, const
                                    SVN_CL__ACCEPT_LAUNCH);
         }
 
-      /* The default action when we're non-interactive is to postpone
-       * conflict resolution. */
+      /* The default action when we're non-interactive is to use the
+       * recommended conflict resolution (this will postpone conflicts
+       * for which no recommended resolution is available). */
       if (opt_state.accept_which == svn_cl__accept_unspecified)
-        opt_state.accept_which = svn_cl__accept_postpone;
+        opt_state.accept_which = svn_cl__accept_recommended;
     }
 
   /* Check whether interactive conflict resolution is disabled by

Modified: subversion/branches/shelve/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/svnserve/serve.c?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/svnserve/serve.c (original)
+++ subversion/branches/shelve/subversion/svnserve/serve.c Thu Aug 24 08:39:31 2017
@@ -2823,6 +2823,8 @@ static svn_error_t *file_rev_handler(voi
 
       /* If the connection does not support SVNDIFF1 or if we don't want to use
        * compression, use the non-compressing "version 0" implementation */
+      /* ### TODO: Check SVN_RA_SVN_CAP_SVNDIFF2_ACCEPTED and decide between
+       * ###       svndiff1[at compression_level] and svndiff2 */
       if (   svn_ra_svn_compression_level(frb->conn) > 0
           && svn_ra_svn_has_capability(frb->conn, SVN_RA_SVN_CAP_SVNDIFF1))
         svn_txdelta_to_svndiff3(d_handler, d_baton, stream, 1,
@@ -3804,6 +3806,7 @@ find_repos(const char *url,
 {
   const char *path, *full_path, *fs_path, *hooks_env;
   svn_stringbuf_t *url_buf;
+  svn_boolean_t sasl_requested;
 
   /* Skip past the scheme and authority part. */
   path = skip_scheme_part(url);
@@ -3877,14 +3880,16 @@ find_repos(const char *url,
   SVN_ERR(load_authz_config(repository, repository->repos_root, cfg,
                             result_pool));
 
-#ifdef SVN_HAVE_SASL
+  /* Should we use Cyrus SASL? */
+  SVN_ERR(svn_config_get_bool(cfg, &sasl_requested,
+                              SVN_CONFIG_SECTION_SASL,
+                              SVN_CONFIG_OPTION_USE_SASL, FALSE));
+  if (sasl_requested)
     {
+#ifdef SVN_HAVE_SASL
       const char *val;
 
-      /* Should we use Cyrus SASL? */
-      SVN_ERR(svn_config_get_bool(cfg, &repository->use_sasl,
-                                  SVN_CONFIG_SECTION_SASL,
-                                  SVN_CONFIG_OPTION_USE_SASL, FALSE));
+      repository->use_sasl = sasl_requested;
 
       svn_config_get(cfg, &val, SVN_CONFIG_SECTION_SASL,
                     SVN_CONFIG_OPTION_MIN_SSF, "0");
@@ -3893,8 +3898,18 @@ find_repos(const char *url,
       svn_config_get(cfg, &val, SVN_CONFIG_SECTION_SASL,
                     SVN_CONFIG_OPTION_MAX_SSF, "256");
       SVN_ERR(svn_cstring_atoui(&repository->max_ssf, val));
+#else /* !SVN_HAVE_SASL */
+      return svn_error_createf(SVN_ERR_BAD_CONFIG_VALUE, NULL,
+                               _("SASL requested but not compiled in; "
+                                 "set '%s' to 'false' or recompile "
+                                 "svnserve with SASL support"),
+                               SVN_CONFIG_OPTION_USE_SASL);
+#endif /* SVN_HAVE_SASL */
+    }
+  else
+    {
+      repository->use_sasl = FALSE;
     }
-#endif
 
   /* Use the repository UUID as the default realm. */
   SVN_ERR(svn_fs_get_uuid(repository->fs, &repository->realm, scratch_pool));
@@ -4122,10 +4137,11 @@ construct_server_baton(server_baton_t **
    * send an empty mechlist. */
   if (params->compression_level > 0)
     SVN_ERR(svn_ra_svn__write_cmd_response(conn, scratch_pool,
-                                           "nn()(wwwwwwwwwwww)",
+                                           "nn()(wwwwwwwwwwwww)",
                                            (apr_uint64_t) 2, (apr_uint64_t) 2,
                                            SVN_RA_SVN_CAP_EDIT_PIPELINE,
                                            SVN_RA_SVN_CAP_SVNDIFF1,
+                                           SVN_RA_SVN_CAP_SVNDIFF2_ACCEPTED,
                                            SVN_RA_SVN_CAP_ABSENT_ENTRIES,
                                            SVN_RA_SVN_CAP_COMMIT_REVPROPS,
                                            SVN_RA_SVN_CAP_DEPTH,

Modified: subversion/branches/shelve/subversion/tests/cmdline/davautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/tests/cmdline/davautocheck.sh?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/tests/cmdline/davautocheck.sh (original)
+++ subversion/branches/shelve/subversion/tests/cmdline/davautocheck.sh Thu Aug 24 08:39:31 2017
@@ -313,6 +313,9 @@ if [ ${APACHE_MPM:+set} ]; then
     LOAD_MOD_MPM=$(get_loadmodule_config mod_mpm_$APACHE_MPM) \
       || fail "MPM module not found"
 fi
+if [ x"$APACHE_MPM" = x"event" ] && [ x"$FS_TYPE" = x"bdb" ]; then
+  fail "FS_TYPE=bdb and APACHE_MPM=event are mutually exclusive (see SVN-4157)"
+fi
 if [ ${USE_SSL:+set} ]; then
     LOAD_MOD_SSL=$(get_loadmodule_config mod_ssl) \
       || fail "SSL module not found"

Modified: subversion/branches/shelve/subversion/tests/cmdline/export_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/tests/cmdline/export_tests.py?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/tests/cmdline/export_tests.py (original)
+++ subversion/branches/shelve/subversion/tests/cmdline/export_tests.py Thu Aug 24 08:39:31 2017
@@ -1070,7 +1070,6 @@ def export_file_externals2(sbox):
                                         expected_output,
                                         expected_disk)
 
-@XFail()
 def export_revision_with_root_relative_external(sbox):
   "export a revision with root-relative external"
   sbox.build()
@@ -1089,18 +1088,37 @@ def export_revision_with_root_relative_e
   # Update the working copy to receive file external
   svntest.main.run_svn(None, 'up', wc_dir)
 
+  # Update the expected disk tree to include the external.
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.add({
+      'A/C/exfile_alpha'  : Item("This is the file 'alpha'.\n"),
+      })
+
+  # Update the expected output to include the external.
+  expected_output = svntest.main.greek_state.copy()
+  expected_output.add({
+      'A/C/exfile_alpha'  : Item("This is the file 'alpha'.\r"),
+      })
+  expected_output.desc[''] = Item()
+  expected_output.tweak(contents=None, status='A ')
+
   # Export revision 2 from URL
   export_target = sbox.add_wc_path('export_url')
-  svntest.actions.run_and_verify_svn(None, [],
-                                     'export', sbox.repo_url, export_target,
-                                     '-r', 2)
+  expected_output.wc_dir = export_target
+  svntest.actions.run_and_verify_export(sbox.repo_url,
+                                        export_target,
+                                        expected_output,
+                                        expected_disk,
+                                        '-r', 2)
 
   # Export revision 2 from WC
-  # Fails (canonicalize: Assertion `*src != '/'' failed)
   export_target = sbox.add_wc_path('export_wc')
-  svntest.actions.run_and_verify_svn(None, [],
-                                     'export', sbox.wc_dir, export_target,
-                                     '-r', 2)
+  expected_output.wc_dir = export_target
+  svntest.actions.run_and_verify_export(sbox.wc_dir,
+                                        export_target,
+                                        expected_output,
+                                        expected_disk,
+                                        '-r', 2)
 
 
 ########################################################################

Modified: subversion/branches/shelve/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/tests/cmdline/externals_tests.py?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/branches/shelve/subversion/tests/cmdline/externals_tests.py Thu Aug 24 08:39:31 2017
@@ -4365,6 +4365,39 @@ def external_externally_removed(sbox):
   sbox.simple_propdel('svn:externals', '')
   sbox.simple_update() # Should succeed
 
+def invalid_uris_in_repo(sbox):
+  "invalid URIs in repo"
+
+  sbox.build(empty=True),
+
+  # Using a dump file because the client may not allow adding invalid URIs.
+  svntest.actions.load_repo(sbox,
+                            os.path.join(os.path.dirname(sys.argv[0]),
+                                         'externals_tests_data',
+                                         'invalid_uris_in_repo.dump'),
+                            create_wc=False)
+
+  # 'foo://host:-/D X'
+  expected_output = svntest.wc.State(sbox.wc_dir, {
+    '' : Item(status=' U')
+    })
+  expected_disk =  svntest.wc.State('', {
+    })
+  expected_error = ".*warning: W205011: Error handling externals definition.*"
+
+  # A repository might have invalid URIs and the client used to SEGV.
+  # r1 has 'foo://host:-/D X'
+  # r2 has 'foo://host::/D X'
+  # r3 has 'foo://host:123xx/D X'
+  # r4 has 'foo://host:123:123/D X'
+  for revision in range(1,4):
+    svntest.actions.run_and_verify_checkout(sbox.repo_url, sbox.wc_dir,
+                                            expected_output,
+                                            expected_disk,
+                                            expected_error,
+                                            "-r", revision)
+    svntest.main.safe_rmtree(sbox.wc_dir)
+
 ########################################################################
 # Run the tests
 
@@ -4440,6 +4473,7 @@ test_list = [ None,
               file_external_to_normal_file,
               file_external_recorded_info,
               external_externally_removed,
+              invalid_uris_in_repo,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/shelve/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (original)
+++ subversion/branches/shelve/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout Thu Aug 24 08:39:31 2017
@@ -209,15 +209,15 @@ Valid options:
                              'empty', 'files', 'immediates', or 'infinity')
   -q [--quiet]             : print nothing, or only summary information
   --diff3-cmd ARG          : use ARG as merge command
-  --relocate               : relocate via URL-rewriting
   --ignore-externals       : ignore externals definitions
   --ignore-ancestry        : allow switching to a node with no common ancestor
   --force                  : handle unversioned obstructions as changes
   --accept ARG             : specify automatic conflict resolution action
                              ('postpone', 'working', 'base', 'mine-conflict',
                              'theirs-conflict', 'mine-full', 'theirs-full',
-                             'edit', 'launch')
-                             (shorthand: 'p', 'mc', 'tc', 'mf', 'tf', 'e', 'l')
+                             'edit', 'launch', 'recommended') (shorthand:
+                             'p', 'mc', 'tc', 'mf', 'tf', 'e', 'l', 'r')
+  --relocate               : deprecated; use 'svn relocate'
 
 Global options:
   --username ARG           : specify a username ARG

Modified: subversion/branches/shelve/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/tests/cmdline/merge_tests.py?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/shelve/subversion/tests/cmdline/merge_tests.py Thu Aug 24 08:39:31 2017
@@ -17395,7 +17395,8 @@ def merge_target_selection(sbox):
     ' U   .\n',
   ] + svntest.main.summary_of_conflicts(tree_conflicts=1)
   svntest.actions.run_and_verify_svn(expected_output, [],
-                                     'merge', '^/dir/binary-file', '-c', '4', '.')
+                                     'merge', '^/dir/binary-file',
+                                     '-c', '4', '.', '--accept', 'postpone')
 
   svntest.main.run_svn(None, 'revert', '-R', '.')
 
@@ -17407,7 +17408,8 @@ def merge_target_selection(sbox):
     ' U   binary-file\n',
   ] + svntest.main.summary_of_conflicts(tree_conflicts=1)
   svntest.actions.run_and_verify_svn(expected_output, [],
-                                     'merge', '^/dir', '-c', '4', 'binary-file')
+                                     'merge', '^/dir', '-c', '4', 'binary-file',
+                                     '--accept', 'postpone')
 
 @SkipUnless(server_has_mergeinfo)
 @Issue(3405) # seems to be the wrong issue number

Modified: subversion/branches/shelve/subversion/tests/cmdline/merge_tree_conflict_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/tests/cmdline/merge_tree_conflict_tests.py?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/tests/cmdline/merge_tree_conflict_tests.py (original)
+++ subversion/branches/shelve/subversion/tests/cmdline/merge_tree_conflict_tests.py Thu Aug 24 08:39:31 2017
@@ -1695,7 +1695,7 @@ def merge_replace_causes_tree_conflict(s
   ], target=A, two_url=True, tree_conflicts=4)
 
   actions.run_and_verify_svn2(expected_stdout, [], 0, 'merge',
-    url_A, url_branch, A)
+    url_A, url_branch, A, '--accept=postpone')
 
   # svn st
   expected_status.tweak('A', status=' M')
@@ -1781,7 +1781,7 @@ def merge_replace_causes_tree_conflict2(
   ], target=A, two_url=True, tree_conflicts=1)
 
   actions.run_and_verify_svn2(expected_stdout, [], 0, 'merge',
-    url_A, url_branch, A, '--depth=files')
+    url_A, url_branch, A, '--depth=files', '--accept=postpone')
   # New mergeinfo describing the merge.
   expected_status.tweak('A', status=' M')
   # Currently this fails because the local status is 'D'eleted rather than
@@ -1801,7 +1801,7 @@ def merge_replace_causes_tree_conflict2(
   ], target=A_B, two_url=True, tree_conflicts=1)
 
   actions.run_and_verify_svn2(expected_stdout, [], 0, 'merge',
-    url_A_B, url_branch_B, A_B)
+    url_A_B, url_branch_B, A_B, '--accept=postpone')
   # New mergeinfo describing the merge.
   expected_status.tweak('A/B', status=' M')
   # Currently this fails because the local status shows a property mod (and
@@ -1821,7 +1821,7 @@ def merge_replace_causes_tree_conflict2(
   ], target=A_D, two_url=True, tree_conflicts=1)
 
   actions.run_and_verify_svn2(expected_stdout, [], 0, 'merge',
-    '--depth=immediates', url_A_D, url_branch_D, A_D)
+    '--depth=immediates', url_A_D, url_branch_D, A_D, '--accept=postpone')
   # New mergeinfo describing the merge.
   expected_status.tweak('A/D', 'A/D/G', status=' M')
   # Currently this fails because the local status is 'D'eleted rather than
@@ -1841,7 +1841,7 @@ def merge_replace_causes_tree_conflict2(
   ], target=A_D_G, two_url=True, tree_conflicts=1)
 
   actions.run_and_verify_svn2(expected_stdout, [], 0, 'merge',
-    url_A_D_G, url_branch_D_G, A_D_G)
+    url_A_D_G, url_branch_D_G, A_D_G, '--accept=postpone')
   # New mergeinfo describing the merge.
   expected_status.tweak('A/D/G', status=' M')
   # Currently this fails because the local status shows a property mod (and
@@ -1932,7 +1932,7 @@ def merge_replace_on_del_fails(sbox):
   #     cmdline\svn-test-work\working_copies\merge_tree_conflict_tests-24\
   #     branch\C' was not found.
   actions.run_and_verify_svn2(expected_stdout, [], 0, 'merge',
-    sbox.repo_url + '/A', branch_path)
+    sbox.repo_url + '/A', branch_path, '--accept=postpone')
 
 def merge_conflict_details(sbox):
   "merge conflict details"

Propchange: subversion/branches/shelve/subversion/tests/cmdline/mod_authz_svn_tests.py
------------------------------------------------------------------------------
    svn:executable = *

Modified: subversion/branches/shelve/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/tests/cmdline/patch_tests.py?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/branches/shelve/subversion/tests/cmdline/patch_tests.py Thu Aug 24 08:39:31 2017
@@ -4696,6 +4696,7 @@ def patch_apply_no_fuz(sbox):
                                        expected_status, expected_skip,
                                        [], True, True)
 
+@Issue(4315)
 def patch_lacking_trailing_eol_on_context(sbox):
   "patch file lacking trailing eol on context"
 

Modified: subversion/branches/shelve/subversion/tests/cmdline/stat_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/tests/cmdline/stat_tests.py?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/tests/cmdline/stat_tests.py (original)
+++ subversion/branches/shelve/subversion/tests/cmdline/stat_tests.py Thu Aug 24 08:39:31 2017
@@ -2224,7 +2224,8 @@ def status_missing_conflicts(sbox):
 
   sbox.simple_rm('A/B/E')
 
-  sbox.simple_update('A/B/E', revision=1)
+  svntest.main.run_svn(False, 'update', sbox.ospath('A/B/E'), '-r', '1',
+    '--accept=postpone')
 
   expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
   expected_status.tweak('A/B/E', status='D ', treeconflict='C', wc_rev=1)
@@ -2277,7 +2278,8 @@ def status_missing_conflicts(sbox):
   sbox.simple_move('A/B/E/beta', 'beta')
 
   sbox.simple_rm('A/B/E')
-  sbox.simple_update('A/B/E', revision=1)
+  svntest.main.run_svn(False, 'update', sbox.ospath('A/B/E'), '-r', '1',
+    '--accept=postpone')
   svntest.actions.run_and_verify_svn(None, [],
                                      'resolve', '--accept=mine-conflict',
                                      '--depth=empty', sbox.ospath('A/B/E'))

Modified: subversion/branches/shelve/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/tests/cmdline/svntest/main.py?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/shelve/subversion/tests/cmdline/svntest/main.py Thu Aug 24 08:39:31 2017
@@ -1043,14 +1043,14 @@ def _post_create_repos(path, minor_versi
         shutil.copy(options.config_file, confpath)
 
       if options.memcached_server is not None or \
-         options.fsfs_compression_level is not None and \
+         options.fsfs_compression is not None and \
          os.path.exists(confpath):
         with open(confpath, 'r') as conffile:
           newlines = []
           for line in conffile.readlines():
-            if line.startswith('# compression-level ') and \
-               options.fsfs_compression_level is not None:
-              line = 'compression-level = %d\n' % options.fsfs_compression_level
+            if line.startswith('# compression ') and \
+               options.fsfs_compression is not None:
+              line = 'compression = %s\n' % options.fsfs_compression
             newlines += line
             if options.memcached_server is not None and \
                line == '[memcached-servers]\n':
@@ -1737,8 +1737,8 @@ class TestSpawningThread(threading.Threa
       args.append('--fsfs-version=' + str(options.fsfs_version))
     if options.dump_load_cross_check:
       args.append('--dump-load-cross-check')
-    if options.fsfs_compression_level:
-      args.append('--fsfs-compression=' + str(options.fsfs_compression_level))
+    if options.fsfs_compression:
+      args.append('--fsfs-compression=' + options.fsfs_compression)
 
     result, stdout_lines, stderr_lines = spawn_process(command, 0, False, None,
                                                        *args)
@@ -2151,9 +2151,8 @@ def _create_parser(usage=None):
                     help='Use sqlite exclusive locking for working copies')
   parser.add_option('--memcached-server', action='store',
                     help='Use memcached server at specified URL (FSFS only)')
-  parser.add_option('--fsfs-compression', action='store', type='int',
-                    dest="fsfs_compression_level",
-                    help='Set compression level (for fsfs)')
+  parser.add_option('--fsfs-compression', action='store', type='str',
+                    help='Set compression type (for fsfs)')
 
   # most of the defaults are None, but some are other values, set them here
   parser.set_defaults(
@@ -2203,10 +2202,6 @@ def parse_options(arglist=sys.argv[1:],
   if options.fsfs_packing and not options.fsfs_sharding:
     parser.error("--fsfs-packing requires --fsfs-sharding")
 
-  if options.fsfs_compression_level is not None and\
-     options.fsfs_compression_level not in range(0, 10):
-    parser.error("--fsfs-compression must be between 0 and 9")
-
   if options.server_minor_version not in range(3, SVN_VER_MINOR+1):
     parser.error("test harness only supports server minor versions 3-%d"
                  % SVN_VER_MINOR)

Modified: subversion/branches/shelve/subversion/tests/cmdline/svntest/mergetrees.py
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/tests/cmdline/svntest/mergetrees.py?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/tests/cmdline/svntest/mergetrees.py (original)
+++ subversion/branches/shelve/subversion/tests/cmdline/svntest/mergetrees.py Thu Aug 24 08:39:31 2017
@@ -446,7 +446,8 @@ def svn_merge(rev_range, source, target,
                                   prop_resolved=prop_resolved,
                                   tree_resolved=tree_resolved)
   actions.run_and_verify_svn(exp_out, [],
-                                     'merge', rev_arg, source, target, *args)
+                                     'merge', rev_arg, source, target,
+                                     '--accept=postpone', *args)
 
 #----------------------------------------------------------------------
 # Setup helper for issue #4056 and issue #4057 tests.

Modified: subversion/branches/shelve/subversion/tests/cmdline/tree_conflict_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/tests/cmdline/tree_conflict_tests.py?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/tests/cmdline/tree_conflict_tests.py (original)
+++ subversion/branches/shelve/subversion/tests/cmdline/tree_conflict_tests.py Thu Aug 24 08:39:31 2017
@@ -463,7 +463,7 @@ def ensure_tree_conflict(sbox, operation
       if operation == 'update':
         logger.debug("--- Updating")
         run_and_verify_svn(expected_stdout, [],
-                           'update', target_path)
+                           'update', target_path, '--accept=postpone')
       elif operation == 'switch':
         logger.debug("--- Switching")
         run_and_verify_svn(expected_stdout, [],

Modified: subversion/branches/shelve/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/tests/cmdline/update_tests.py?rev=1806005&r1=1806004&r2=1806005&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/shelve/subversion/tests/cmdline/update_tests.py Thu Aug 24 08:39:31 2017
@@ -6792,7 +6792,9 @@ def missing_tmp_update(sbox):
   svntest.actions.run_and_verify_svn(None, '.*Unable to create.*',
                                      'up', wc_dir, '--set-depth', 'infinity')
 
-  svntest.actions.run_and_verify_svn(None, [], 'cleanup', wc_dir)
+  # This re-creates .svn/tmp as a side-effect.
+  svntest.actions.run_and_verify_svn(None, [], 'cleanup',
+                                     '--vacuum-pristines', wc_dir)
 
   svntest.actions.run_and_verify_update(wc_dir, None, None, None, [], False,
                                         wc_dir, '--set-depth', 'infinity')