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/07/17 14:33:06 UTC

svn commit: r1802152 - in /subversion/branches/shelve-checkpoint: ./ build/ notes/ subversion/include/ subversion/include/private/ subversion/libsvn_delta/ subversion/libsvn_fs_fs/ subversion/libsvn_ra_serf/ subversion/libsvn_repos/ subversion/libsvn_s...

Author: julianfoad
Date: Mon Jul 17 14:33:05 2017
New Revision: 1802152

URL: http://svn.apache.org/viewvc?rev=1802152&view=rev
Log:
On the 'shelve-checkpoint' branch: catch up to trunk@1802151.

Added:
    subversion/branches/shelve-checkpoint/subversion/libsvn_subr/lz4/
      - copied from r1802151, subversion/trunk/subversion/libsvn_subr/lz4/
    subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/compress-test.c
      - copied unchanged from r1802151, subversion/trunk/subversion/tests/libsvn_subr/compress-test.c
Modified:
    subversion/branches/shelve-checkpoint/   (props changed)
    subversion/branches/shelve-checkpoint/LICENSE
    subversion/branches/shelve-checkpoint/Makefile.in
    subversion/branches/shelve-checkpoint/NOTICE
    subversion/branches/shelve-checkpoint/build.conf
    subversion/branches/shelve-checkpoint/build/run_tests.py
    subversion/branches/shelve-checkpoint/notes/svndiff
    subversion/branches/shelve-checkpoint/subversion/include/private/svn_mergeinfo_private.h
    subversion/branches/shelve-checkpoint/subversion/include/private/svn_subr_private.h
    subversion/branches/shelve-checkpoint/subversion/include/svn_dav.h
    subversion/branches/shelve-checkpoint/subversion/include/svn_delta.h
    subversion/branches/shelve-checkpoint/subversion/include/svn_error_codes.h
    subversion/branches/shelve-checkpoint/subversion/include/svn_repos.h
    subversion/branches/shelve-checkpoint/subversion/libsvn_delta/svndiff.c
    subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/fs.h
    subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/revprops.c
    subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/structure
    subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/transaction.c
    subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/commit.c
    subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/options.c
    subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/ra_serf.h
    subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/util.c
    subversion/branches/shelve-checkpoint/subversion/libsvn_repos/log.c
    subversion/branches/shelve-checkpoint/subversion/libsvn_subr/compress.c
    subversion/branches/shelve-checkpoint/subversion/libsvn_subr/deprecated.c
    subversion/branches/shelve-checkpoint/subversion/libsvn_subr/mergeinfo.c
    subversion/branches/shelve-checkpoint/subversion/libsvn_subr/packed_data.c
    subversion/branches/shelve-checkpoint/subversion/mod_dav_svn/repos.c
    subversion/branches/shelve-checkpoint/subversion/mod_dav_svn/version.c
    subversion/branches/shelve-checkpoint/subversion/tests/cmdline/export_tests.py
    subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svnserveautocheck.sh
    subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svntest/main.py
    subversion/branches/shelve-checkpoint/subversion/tests/libsvn_delta/random-test.c
    subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/mergeinfo-test.c
    subversion/branches/shelve-checkpoint/tools/dist/release.py
    subversion/branches/shelve-checkpoint/tools/dist/templates/rc-release-ann.ezt
    subversion/branches/shelve-checkpoint/tools/dist/templates/stable-release-ann.ezt
    subversion/branches/shelve-checkpoint/win-tests.py

Propchange: subversion/branches/shelve-checkpoint/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jul 17 14:33:05 2017
@@ -97,3 +97,4 @@
 /subversion/branches/verify-at-commit:1462039-1462408
 /subversion/branches/verify-keep-going:1439280-1546110
 /subversion/branches/wc-collate-path:1402685-1480384
+/subversion/trunk:1801593-1802151

Modified: subversion/branches/shelve-checkpoint/LICENSE
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/LICENSE?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/LICENSE (original)
+++ subversion/branches/shelve-checkpoint/LICENSE Mon Jul 17 14:33:05 2017
@@ -395,3 +395,31 @@ For the (modified) 'linenoise' library i
   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+For the (modified) LZ4 library files in subversion/libsvn_subr/lz4
+
+  LZ4 Library
+  Copyright (c) 2011-2016, Yann Collet
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions are met:
+
+  * Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimer.
+
+  * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+  THE POSSIBILITY OF SUCH DAMAGE.

Modified: subversion/branches/shelve-checkpoint/Makefile.in
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/Makefile.in?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/Makefile.in (original)
+++ subversion/branches/shelve-checkpoint/Makefile.in Mon Jul 17 14:33:05 2017
@@ -585,6 +585,9 @@ check: bin @TRANSFORM_LIBTOOL_SCRIPTS@ $
 	  if test "$(MEMCACHED_SERVER)" != ""; then                          \
 	    flags="--memcached-server $(MEMCACHED_SERVER) $$flags";          \
 	  fi;                                                                \
+	  if test "$(FSFS_COMPRESSION)" != ""; then                          \
+	    flags="--fsfs-compression $(FSFS_COMPRESSION) $$flags";          \
+	  fi;                                                                \
 	  LD_LIBRARY_PATH='$(auth_plugin_dirs):$(LD_LIBRARY_PATH)'           \
 	  $(PYTHON) $(top_srcdir)/build/run_tests.py                         \
 	            --config-file $(top_srcdir)/subversion/tests/tests.conf  \
@@ -996,4 +999,11 @@ INSTALL_EXTRA_TOOLS=\
   if test "$(DESTDIR)$(bindir)" != "$(DESTDIR)$(toolsdir)"; then \
     ln -sf $(bindir)/svnmucc$(EXEEXT) $(DESTDIR)$(toolsdir)/svnmucc$(EXEEXT); \
     ln -sf $(bindir)/svnbench$(EXEEXT) $(DESTDIR)$(toolsdir)/svn-bench$(EXEEXT); \
-  fi
+  fi; \
+  printf '\043\041/bin/sh\n%s\n' \
+    'exec $(bindir)/svnfsfs stats $${2:+"-M"} $$2 $$1' \
+    > $(DESTDIR)$(toolsdir)/fsfs-stats$(EXEEXT) && \
+  chmod +x $(DESTDIR)$(toolsdir)/fsfs-stats$(EXEEXT)
+# \043\041 is a "#!".  It's written this way because gmake and bmake disagree on
+# how to include a literal '#' in a command, and because '!' is special to some
+# shells.

Modified: subversion/branches/shelve-checkpoint/NOTICE
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/NOTICE?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/NOTICE (original)
+++ subversion/branches/shelve-checkpoint/NOTICE Mon Jul 17 14:33:05 2017
@@ -26,3 +26,6 @@ under a permissive license, see LICENSE.
 
 This software contains code derived from TropicSSL under a BSD 3-Clause
 license, see LICENSE.
+
+This product includes code derived from the software developed by Yann Collet
+under a BSD 2-Clause license, see LICENSE.

Modified: subversion/branches/shelve-checkpoint/build.conf
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/build.conf?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/build.conf (original)
+++ subversion/branches/shelve-checkpoint/build.conf Mon Jul 17 14:33:05 2017
@@ -370,6 +370,7 @@ description = Subversion General Utility
 type = lib
 install = fsmod-lib
 path = subversion/libsvn_subr
+sources = *.c lz4/*.c
 libs = aprutil apriconv apr xml zlib apr_memcache sqlite magic intl
 msvc-libs = kernel32.lib advapi32.lib shfolder.lib ole32.lib
             crypt32.lib version.lib
@@ -1179,6 +1180,14 @@ sources = xml-test.c
 install = test
 libs = libsvn_test libsvn_subr apriconv apr
 
+[compress-test]
+description = Test compression functions
+type = exe
+path = subversion/tests/libsvn_subr
+sources = compress-test.c
+install = test
+libs = libsvn_test libsvn_subr apr
+
 # ----------------------------------------------------------------------------
 # Tests for libsvn_delta
 
@@ -1563,7 +1572,7 @@ libs = __ALL__
        conflict-data-test db-test pristine-store-test entries-compat-test
        op-depth-test dirent_uri-test wc-queries-test wc-test
        auth-test
-       parse-diff-test x509-test xml-test afl-x509
+       parse-diff-test x509-test xml-test afl-x509 compress-test
 
 [__MORE__]
 type = project

Modified: subversion/branches/shelve-checkpoint/build/run_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/build/run_tests.py?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/build/run_tests.py (original)
+++ subversion/branches/shelve-checkpoint/build/run_tests.py Mon Jul 17 14:33:05 2017
@@ -33,6 +33,7 @@
             [--httpd-version=<version>] [--httpd-whitelist=<version>]
             [--config-file=<file>] [--ssl-cert=<file>]
             [--exclusive-wc-locks] [--memcached-server=<url:port>]
+            [--fsfs-compression=<n>]
             <abs_srcdir> <abs_builddir>
             <prog ...>
 
@@ -275,6 +276,8 @@ class TestHarness:
       cmdline.append('--exclusive-wc-locks')
     if self.opts.memcached_server is not None:
       cmdline.append('--memcached-server=%s' % self.opts.memcached_server)
+    if self.opts.fsfs_compression_level is not None:
+      cmdline.append('--fsfs-compression=%d' % self.opts.fsfs_compression_level)
 
     self.py_test_cmdline = cmdline
 
@@ -1023,6 +1026,9 @@ def create_parser():
                     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.set_defaults(set_log_level=None)
   return parser

Modified: subversion/branches/shelve-checkpoint/notes/svndiff
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/notes/svndiff?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/notes/svndiff (original)
+++ subversion/branches/shelve-checkpoint/notes/svndiff Mon Jul 17 14:33:05 2017
@@ -1,4 +1,4 @@
-This file describes the svndiff version 0 and 1 format used by the
+This file describes the svndiff version 0, 1 and 2 formats used by the
 Subversion code.  Its design borrows many ideas from the vdelta and
 vcdiff encoding formats from AT&T Research Labs, but it is much
 simpler and thus a little less compact.
@@ -33,13 +33,14 @@ A window is the concatenation of the fol
 	[original length of the new data section in bytes (version 1)]
 	The window's new data section
 
-In svndiff version 1, the instructions and new data
-sections may be compressed by zlib.  In svndiff1, in order to determine the
-original size, an integer is appended to the beginning of each of the
-sections.  If the original size matches the encoded size (minus the
+In svndiff version 1 and 2, the instructions and new data sections may
+be compressed.  Version 1 uses zlib for compression.  Version 2 uses LZ4
+for compression.  In order to determine the original size in these
+compressed formats, an integer is appended to the beginning of each of
+the sections.  If the original size matches the encoded size (minus the
 length of the original size integer) from the header, the data is not
 compressed.  If the original size is different than the encoded size
-from the header, the remaining data in the section is compressed with zlib.
+from the header, the remaining data in the section is compressed.
 
 Integers (including the offset and all of the lengths) are encoded using a
 variable-length format.  The high bit of each byte is used as a

Modified: subversion/branches/shelve-checkpoint/subversion/include/private/svn_mergeinfo_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/include/private/svn_mergeinfo_private.h?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/include/private/svn_mergeinfo_private.h (original)
+++ subversion/branches/shelve-checkpoint/subversion/include/private/svn_mergeinfo_private.h Mon Jul 17 14:33:05 2017
@@ -52,18 +52,21 @@ svn_rangelist__set_inheritance(svn_range
  * Unlike svn_mergeinfo_parse(), this does not sort the ranges into order
  * or combine adjacent and overlapping ranges.
  *
- * The compaction can be done with svn_rangelist__combine_adjacent_ranges().
+ * The compaction can be done with svn_rangelist__canonicalize().
  */
 svn_error_t *
 svn_rangelist__parse(svn_rangelist_t **rangelist,
                      const char *str,
                      apr_pool_t *result_pool);
 
-/* In-place combines adjacent ranges in a rangelist.
-   SCRATCH_POOL is just used for providing error messages. */
-svn_error_t *
-svn_rangelist__combine_adjacent_ranges(svn_rangelist_t *rangelist,
-                                       apr_pool_t *scratch_pool);
+/* Return TRUE, if all ranges in RANGELIST are in ascending order and do
+* not overlap and are not adjacent.
+*
+* If this returns FALSE, you probaly want to call
+* svn_rangelist__canonicalize().
+*/
+svn_boolean_t
+svn_rangelist__is_canonical(const svn_rangelist_t *rangelist);
 
 /** Canonicalize the @a rangelist: sort the ranges, and combine adjacent or
  * overlapping ranges into single ranges where possible.

Modified: subversion/branches/shelve-checkpoint/subversion/include/private/svn_subr_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/include/private/svn_subr_private.h?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/include/private/svn_subr_private.h (original)
+++ subversion/branches/shelve-checkpoint/subversion/include/private/svn_subr_private.h Mon Jul 17 14:33:05 2017
@@ -560,18 +560,36 @@ svn__decode_int(apr_int64_t *val,
  * SVN__COMPRESSION_NONE is valid for COMPRESSION_METHOD.
  */
 svn_error_t *
-svn__compress(const void *data, apr_size_t len,
-              svn_stringbuf_t *out,
-              int compression_method);
+svn__compress_zlib(const void *data, apr_size_t len,
+                   svn_stringbuf_t *out,
+                   int compression_method);
 
 /* Decompress the compressed data from DATA with length LEN and write the
  * result to OUT.  Return an error if the decompressed size is larger than
  * LIMIT.
  */
 svn_error_t *
-svn__decompress(const void *data, apr_size_t len,
-                svn_stringbuf_t *out,
-                apr_size_t limit);
+svn__decompress_zlib(const void *data, apr_size_t len,
+                     svn_stringbuf_t *out,
+                     apr_size_t limit);
+
+/* Same as svn__compress_zlib(), but use LZ4 compression.  Note that
+ * while the declaration of this function uses apr_size_t, it expects
+ * blocks of size not exceeding LZ4_MAX_INPUT_SIZE.  The caller should
+ * ensure that the proper size is passed to this function.
+ */
+svn_error_t *
+svn__compress_lz4(const void *data, apr_size_t len,
+                  svn_stringbuf_t *out);
+
+/* Same as svn__decompress_zlib(), but use LZ4 compression.  The caller
+ * should ensure that the size and limit passed to this function do not
+ * exceed INT_MAX.
+ */
+svn_error_t *
+svn__decompress_lz4(const void *data, apr_size_t len,
+                    svn_stringbuf_t *out,
+                    apr_size_t limit);
 
 /** @} */
 

Modified: subversion/branches/shelve-checkpoint/subversion/include/svn_dav.h
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/include/svn_dav.h?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/include/svn_dav.h (original)
+++ subversion/branches/shelve-checkpoint/subversion/include/svn_dav.h Mon Jul 17 14:33:05 2017
@@ -395,6 +395,14 @@ extern "C" {
 #define SVN_DAV_NS_DAV_SVN_SVNDIFF1\
             SVN_DAV_PROP_NS_DAV "svn/svndiff1"
 
+/** Presence of this in a DAV header in an OPTIONS response indicates
+ * that the transmitter (in this case, the server) knows how to handle
+ * svndiff2 format encoding.
+ *
+ * @since New in 1.10.
+ */
+#define SVN_DAV_NS_DAV_SVN_SVNDIFF2\
+            SVN_DAV_PROP_NS_DAV "svn/svndiff2"
 
 /** @} */
 

Modified: subversion/branches/shelve-checkpoint/subversion/include/svn_delta.h
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/include/svn_delta.h?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/include/svn_delta.h (original)
+++ subversion/branches/shelve-checkpoint/subversion/include/svn_delta.h Mon Jul 17 14:33:05 2017
@@ -508,7 +508,9 @@ svn_txdelta_apply(svn_stream_t *source,
  * version is @a svndiff_version. @a compression_level is the zlib
  * compression level from 0 (no compression) and 9 (maximum compression).
  *
- * @since New in 1.7.
+ * @since New in 1.7.  Since 1.10, @a svndiff_version can be 2 for the
+ * svndiff2 format.  @a compression_level is currently ignored if
+ * @a svndiff_version is set to 2.
  */
 void
 svn_txdelta_to_svndiff3(svn_txdelta_window_handler_t *handler,

Modified: subversion/branches/shelve-checkpoint/subversion/include/svn_error_codes.h
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/include/svn_error_codes.h?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/include/svn_error_codes.h (original)
+++ subversion/branches/shelve-checkpoint/subversion/include/svn_error_codes.h Mon Jul 17 14:33:05 2017
@@ -1467,6 +1467,16 @@ SVN_ERROR_START
              SVN_ERR_MISC_CATEGORY_START + 44,
              "SQLite transaction rollback failed")
 
+  /** @since New in 1.10. */
+  SVN_ERRDEF(SVN_ERR_LZ4_COMPRESSION_FAILED,
+             SVN_ERR_MISC_CATEGORY_START + 45,
+             "LZ4 compression failed")
+
+  /** @since New in 1.10. */
+  SVN_ERRDEF(SVN_ERR_LZ4_DECOMPRESSION_FAILED,
+             SVN_ERR_MISC_CATEGORY_START + 46,
+             "LZ4 decompression failed")
+
   /* command-line client errors */
 
   SVN_ERRDEF(SVN_ERR_CL_ARG_PARSING_ERROR,

Modified: subversion/branches/shelve-checkpoint/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/include/svn_repos.h?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/include/svn_repos.h (original)
+++ subversion/branches/shelve-checkpoint/subversion/include/svn_repos.h Mon Jul 17 14:33:05 2017
@@ -1938,12 +1938,37 @@ svn_repos_node_location_segments(svn_rep
  *       known, i.e. @a node_kind is never #svn_node_unknown and
  *       @a copyfrom_known is always @c TRUE.
  *
+ * @note To allow for extending this structure in future releases,
+ * always use svn_repos_path_change_create() to allocate the stucture.
+ *
  * @see svn_fs_path_change3_t
  *
  * @since New in 1.10.
  */
 typedef svn_fs_path_change3_t svn_repos_path_change_t;
 
+/**
+ * Return an #svn_repos_path_change_t structure, allocated in @a result_pool,
+ * with all fields initialized to their respective null/none/empty/invalid
+ * values.
+ *
+ * @note To allow for extending the #svn_repos_path_change_t structure in
+ * future releases, this function should always be used to allocate it.
+ *
+ * @since New in 1.10.
+ */
+svn_repos_path_change_t *
+svn_repos_path_change_create(apr_pool_t *result_pool);
+
+/**
+ * Return a deep copy of @a change, allocated in @a result_pool.
+ *
+ * @since New in 1.10.
+ */
+svn_repos_path_change_t *
+svn_repos_path_change_dup(svn_repos_path_change_t *change,
+                          apr_pool_t *result_pool);
+
 /** The callback invoked by log message loopers, such as
  * svn_repos_get_logs5().
  *
@@ -1970,6 +1995,9 @@ typedef svn_error_t *(*svn_repos_path_ch
 /**
  * A structure to represent all the information about a particular log entry.
  *
+ * @note To allow for extending this structure in future releases,
+ * always use svn_repos_log_entry_create() to allocate the stucture.
+ *
  * @since New in 1.10.
  */
 typedef struct svn_repos_log_entry_t
@@ -2016,6 +2044,27 @@ typedef struct svn_repos_log_entry_t
   /* NOTE: Add new fields at the end to preserve binary compatibility. */
 } svn_repos_log_entry_t;
 
+/**
+ * Return an #svn_repos_log_entry_t, allocated in @a result_pool,
+ * with all fields initialized to their respective null/none/empty/invalid
+ * values.
+ *
+ * @note To allow for extending the #svn_repos_log_entry_t structure in
+ * future releases, this function should always be used to allocate it.
+ *
+ * @since New in 1.10.
+ */
+svn_repos_log_entry_t *
+svn_repos_log_entry_create(apr_pool_t *result_pool);
+
+/** Return a deep copy of @a log_entry, allocated in @a result_pool.
+ *
+ * @since New in 1.10.
+ */
+svn_repos_log_entry_t *
+svn_repos_log_entry_dup(const svn_repos_log_entry_t *log_entry,
+                        apr_pool_t *result_pool);
+
 
 /** The callback invoked by log message loopers, such as
  * svn_repos_get_logs5().

Modified: subversion/branches/shelve-checkpoint/subversion/libsvn_delta/svndiff.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/libsvn_delta/svndiff.c?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/libsvn_delta/svndiff.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/libsvn_delta/svndiff.c Mon Jul 17 14:33:05 2017
@@ -38,13 +38,16 @@
 
 static const char SVNDIFF_V0[] = { 'S', 'V', 'N', 0 };
 static const char SVNDIFF_V1[] = { 'S', 'V', 'N', 1 };
+static const char SVNDIFF_V2[] = { 'S', 'V', 'N', 2 };
 
 #define SVNDIFF_HEADER_SIZE (sizeof(SVNDIFF_V0))
 
 static const char *
 get_svndiff_header(int version)
 {
-  if (version == 1)
+  if (version == 2)
+    return SVNDIFF_V2;
+  else if (version == 1)
     return SVNDIFF_V1;
   else
     return SVNDIFF_V0;
@@ -148,7 +151,7 @@ send_simple_insertion_window(svn_txdelta
 }
 
 /* Encodes delta window WINDOW to svndiff-format.
-   The svndiff version is VERSION. COMPRESSION_LEVEL is the zlib
+   The svndiff version is VERSION. COMPRESSION_LEVEL is the
    compression level to use.
    Returned values will be allocated in POOL or refer to *WINDOW
    fields. */
@@ -195,21 +198,39 @@ encode_window(svn_stringbuf_t **instruct
   append_encoded_int(header, window->sview_offset);
   append_encoded_int(header, window->sview_len);
   append_encoded_int(header, window->tview_len);
-  if (version == 1)
+  if (version == 2)
     {
       svn_stringbuf_t *compressed_instructions;
       compressed_instructions = svn_stringbuf_create_empty(pool);
-      SVN_ERR(svn__compress(instructions->data, instructions->len,
-                            compressed_instructions, compression_level));
+      SVN_ERR(svn__compress_lz4(instructions->data, instructions->len,
+                                compressed_instructions));
+      instructions = compressed_instructions;
+    }
+  else if (version == 1)
+    {
+      svn_stringbuf_t *compressed_instructions;
+      compressed_instructions = svn_stringbuf_create_empty(pool);
+      SVN_ERR(svn__compress_zlib(instructions->data, instructions->len,
+                                 compressed_instructions, compression_level));
       instructions = compressed_instructions;
     }
   append_encoded_int(header, instructions->len);
-  if (version == 1)
+
+  /* Encode the data. */
+  if (version == 2)
+    {
+      svn_stringbuf_t *compressed = svn_stringbuf_create_empty(pool);
+
+      SVN_ERR(svn__compress_lz4(window->new_data->data, window->new_data->len,
+                                compressed));
+      newdata = svn_stringbuf__morph_into_string(compressed);
+    }
+  else if (version == 1)
     {
       svn_stringbuf_t *compressed = svn_stringbuf_create_empty(pool);
 
-      SVN_ERR(svn__compress(window->new_data->data, window->new_data->len,
-                            compressed, compression_level));
+      SVN_ERR(svn__compress_zlib(window->new_data->data, window->new_data->len,
+                                 compressed, compression_level));
       newdata = svn_stringbuf__morph_into_string(compressed);
     }
   else
@@ -542,15 +563,31 @@ decode_window(svn_txdelta_window_t *wind
 
   insend = data + inslen;
 
-  if (version == 1)
+  if (version == 2)
+    {
+      svn_stringbuf_t *instout = svn_stringbuf_create_empty(pool);
+      svn_stringbuf_t *ndout = svn_stringbuf_create_empty(pool);
+
+      SVN_ERR(svn__decompress_lz4(insend, newlen, ndout,
+                                  SVN_DELTA_WINDOW_SIZE));
+      SVN_ERR(svn__decompress_lz4(data, insend - data, instout,
+                                  MAX_INSTRUCTION_SECTION_LEN));
+
+      newlen = ndout->len;
+      data = (unsigned char *)instout->data;
+      insend = (unsigned char *)instout->data + instout->len;
+
+      new_data = svn_stringbuf__morph_into_string(ndout);
+    }
+  else if (version == 1)
     {
       svn_stringbuf_t *instout = svn_stringbuf_create_empty(pool);
       svn_stringbuf_t *ndout = svn_stringbuf_create_empty(pool);
 
-      SVN_ERR(svn__decompress(insend, newlen, ndout,
-                              SVN_DELTA_WINDOW_SIZE));
-      SVN_ERR(svn__decompress(data, insend - data, instout,
-                              MAX_INSTRUCTION_SECTION_LEN));
+      SVN_ERR(svn__decompress_zlib(insend, newlen, ndout,
+                                   SVN_DELTA_WINDOW_SIZE));
+      SVN_ERR(svn__decompress_zlib(data, insend - data, instout,
+                                   MAX_INSTRUCTION_SECTION_LEN));
 
       newlen = ndout->len;
       data = (unsigned char *)instout->data;
@@ -612,6 +649,8 @@ write_handler(void *baton,
         db->version = 0;
       else if (memcmp(buffer, SVNDIFF_V1 + db->header_bytes, nheader) == 0)
         db->version = 1;
+      else if (memcmp(buffer, SVNDIFF_V2 + db->header_bytes, nheader) == 0)
+        db->version = 2;
       else
         return svn_error_create(SVN_ERR_SVNDIFF_INVALID_HEADER, NULL,
                                 _("Svndiff has invalid header"));

Modified: subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/fs.h?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/fs.h Mon Jul 17 14:33:05 2017
@@ -126,7 +126,7 @@ extern "C" {
    Note: If you bump this, please update the switch statement in
          svn_fs_fs__create() as well.
  */
-#define SVN_FS_FS__FORMAT_NUMBER   7
+#define SVN_FS_FS__FORMAT_NUMBER   8
 
 /* The minimum format number that supports svndiff version 1.  */
 #define SVN_FS_FS__MIN_SVNDIFF1_FORMAT 2
@@ -181,6 +181,9 @@ extern "C" {
 /* Minimum format number that supports per-instance filesystem IDs. */
 #define SVN_FS_FS__MIN_INSTANCE_ID_FORMAT 7
 
+/* The minimum format number that supports svndiff version 2. */
+#define SVN_FS_FS__MIN_SVNDIFF2_FORMAT 8
+
 /* The minimum format number that supports a configuration file (fsfs.conf) */
 #define SVN_FS_FS__MIN_CONFIG_FILE 4
 

Modified: subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/fs_fs.c?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/fs_fs.c Mon Jul 17 14:33:05 2017
@@ -946,21 +946,22 @@ write_config(svn_fs_t *fs,
 "### For 1.8, the default value is 16; earlier versions use 1."              NL
 "# " CONFIG_OPTION_MAX_LINEAR_DELTIFICATION " = 16"                          NL
 "###"                                                                        NL
-"### After deltification, we compress the data through zlib to minimize on-" NL
-"### disk size.  That can be an expensive and ineffective process.  This"    NL
-"### setting controls the usage of zlib in future revisions."                NL
+"### After deltification, we compress the data to minimize on-disk size."    NL
+"### This settings control the compression level for this process."          NL
 "### Revisions with highly compressible data in them may shrink in size"     NL
-"### if the setting is increased but may take much longer to commit.  The"   NL
-"### time taken to uncompress that data again is widely independent of the"  NL
-"### compression level."                                                     NL
-"### Compression will be ineffective if the incoming content is already"     NL
-"### highly compressed.  In that case, disabling the compression entirely"   NL
-"### will speed up commits as well as reading the data.  Repositories with"  NL
-"### many small compressible files (source code) but also a high percentage" NL
-"### of large incompressible ones (artwork) may benefit from compression"    NL
-"### levels lowered to e.g. 1."                                              NL
-"### Valid values are 0 to 9 with 9 providing the highest compression ratio" NL
-"### and 0 disabling it altogether."                                         NL
+"### if the setting is increased but may take much longer to commit."        NL
+"### The time taken to uncompress that data again is widely independent"     NL
+"### of the compression level.  Compression will be ineffective if the"      NL
+"### incoming content is already highly compressed.  In that case,"          NL
+"### disabling the compression entirely or using the special value 1"        NL
+"### (see below) will speed up commits as well as reading the data."         NL
+"### Repositories with many small compressible files (source code) but"      NL
+"### also a high percentage of large incompressible ones (artwork) may"      NL
+"### benefit from compression levels lowered."                               NL
+"### Valid values are 0 to 9 with 9 providing the highest compression"       NL
+"### ratio and 0 disabling it altogether.  Using 1 as the level enables"     NL
+"### LZ4 compression that provides a decent compression ratio, but"          NL
+"### performs better with large or incompressible files."                    NL
 "### The default value is 5."                                                NL
 "# " CONFIG_OPTION_COMPRESSION_LEVEL " = 5"                                  NL
 ""                                                                           NL
@@ -1829,6 +1830,8 @@ svn_fs_fs__create(svn_fs_t *fs,
 
           case 8: format = 6;
                   break;
+          case 9: format = 7;
+                  break;
 
           default:format = SVN_FS_FS__FORMAT_NUMBER;
         }
@@ -2198,8 +2201,11 @@ svn_fs_fs__info_format(int *fs_format,
     case 7:
       (*supports_version)->minor = 9;
       break;
+    case 8:
+      (*supports_version)->minor = 10;
+      break;
 #ifdef SVN_DEBUG
-# if SVN_FS_FS__FORMAT_NUMBER != 7
+# if SVN_FS_FS__FORMAT_NUMBER != 8
 #  error "Need to add a 'case' statement here"
 # endif
 #endif

Modified: subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/revprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/revprops.c?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/revprops.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/revprops.c Mon Jul 17 14:33:05 2017
@@ -471,8 +471,8 @@ parse_packed_revprops(svn_fs_t *fs,
    * length header to remove) */
   svn_stringbuf_t *compressed = revprops->packed_revprops;
   svn_stringbuf_t *uncompressed = svn_stringbuf_create_empty(result_pool);
-  SVN_ERR(svn__decompress(compressed->data, compressed->len,
-                          uncompressed, APR_SIZE_MAX));
+  SVN_ERR(svn__decompress_zlib(compressed->data, compressed->len,
+                               uncompressed, APR_SIZE_MAX));
 
   /* read first revision number and number of revisions in the pack */
   stream = svn_stream_from_stringbuf(uncompressed, scratch_pool);
@@ -937,11 +937,11 @@ repack_revprops(svn_fs_t *fs,
   SVN_ERR(svn_stream_close(stream));
 
   /* compress / store the data */
-  SVN_ERR(svn__compress(uncompressed->data, uncompressed->len,
-                        compressed,
-                        ffd->compress_packed_revprops
-                          ? SVN_DELTA_COMPRESSION_LEVEL_DEFAULT
-                          : SVN_DELTA_COMPRESSION_LEVEL_NONE));
+  SVN_ERR(svn__compress_zlib(uncompressed->data, uncompressed->len,
+                             compressed,
+                             ffd->compress_packed_revprops
+                               ? SVN_DELTA_COMPRESSION_LEVEL_DEFAULT
+                               : SVN_DELTA_COMPRESSION_LEVEL_NONE));
 
   /* finally, write the content to the target file, flush and close it */
   SVN_ERR(svn_io_file_write_full(file, compressed->data, compressed->len,
@@ -1345,8 +1345,8 @@ svn_fs_fs__copy_revprops(const char *pac
   SVN_ERR(svn_stream_close(pack_stream));
 
   /* compress the content (or just store it for COMPRESSION_LEVEL 0) */
-  SVN_ERR(svn__compress(uncompressed->data, uncompressed->len,
-                        compressed, compression_level));
+  SVN_ERR(svn__compress_zlib(uncompressed->data, uncompressed->len,
+                             compressed, compression_level));
 
   /* write the pack file content to disk */
   SVN_ERR(svn_io_file_write_full(pack_file, compressed->data, compressed->len,

Modified: subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/structure
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/structure?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/structure (original)
+++ subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/structure Mon Jul 17 14:33:05 2017
@@ -150,12 +150,14 @@ The formats are:
   Format 5, understood by Subversion 1.7-dev, never released
   Format 6, understood by Subversion 1.8
   Format 7, understood by Subversion 1.9
+  Format 8, understood by Subversion 1.10
 
 The differences between the formats are:
 
 Delta representation in revision files
-  Format 1: svndiff0 only
-  Formats 2+: svndiff0 or svndiff1
+  Format 1:    svndiff0 only
+  Formats 2-7: svndiff0 or svndiff1
+  Formats 8:   svndiff0, svndiff1 or svndiff2
 
 Format options
   Formats 1-2: none permitted

Modified: subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/transaction.c?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/libsvn_fs_fs/transaction.c Mon Jul 17 14:33:05 2017
@@ -2159,6 +2159,38 @@ rep_write_cleanup(void *data)
   return APR_SUCCESS;
 }
 
+static void
+txdelta_to_svndiff(svn_txdelta_window_handler_t *handler,
+                   void **handler_baton,
+                   svn_stream_t *output,
+                   svn_fs_t *fs,
+                   apr_pool_t *pool)
+{
+  fs_fs_data_t *ffd = fs->fsap_data;
+  int svndiff_version;
+  int svndiff_compression_level;
+
+  if (ffd->delta_compression_level == 1 &&
+      ffd->format >= SVN_FS_FS__MIN_SVNDIFF2_FORMAT)
+    {
+      svndiff_version = 2;
+      svndiff_compression_level = 0;
+    }
+  else if (ffd->format >= SVN_FS_FS__MIN_SVNDIFF1_FORMAT)
+    {
+      svndiff_version = 1;
+      svndiff_compression_level = ffd->delta_compression_level;
+    }
+  else
+    {
+      svndiff_version = 0;
+      svndiff_compression_level = 0;
+    }
+
+  svn_txdelta_to_svndiff3(handler, handler_baton, output, svndiff_version,
+                          svndiff_compression_level, pool);
+}
+
 /* Get a rep_write_baton and store it in *WB_P for the representation
    indicated by NODEREV in filesystem FS.  Perform allocations in
    POOL.  Only appropriate for file contents, not for props or
@@ -2175,8 +2207,6 @@ rep_write_get_baton(struct rep_write_bat
   svn_stream_t *source;
   svn_txdelta_window_handler_t wh;
   void *whb;
-  fs_fs_data_t *ffd = fs->fsap_data;
-  int diff_version = ffd->format >= SVN_FS_FS__MIN_SVNDIFF1_FORMAT ? 1 : 0;
   svn_fs_fs__rep_header_t header = { 0 };
 
   b = apr_pcalloc(pool, sizeof(*b));
@@ -2232,12 +2262,7 @@ rep_write_get_baton(struct rep_write_bat
                             apr_pool_cleanup_null);
 
   /* Prepare to write the svndiff data. */
-  svn_txdelta_to_svndiff3(&wh,
-                          &whb,
-                          b->rep_stream,
-                          diff_version,
-                          ffd->delta_compression_level,
-                          pool);
+  txdelta_to_svndiff(&wh, &whb, b->rep_stream, fs, pool);
 
   b->delta_stream = svn_txdelta_target_push(wh, whb, source,
                                             b->scratch_pool);
@@ -2891,8 +2916,6 @@ write_container_delta_rep(representation
   apr_off_t offset = 0;
 
   struct write_container_baton *whb;
-  fs_fs_data_t *ffd = fs->fsap_data;
-  int diff_version = ffd->format >= SVN_FS_FS__MIN_SVNDIFF1_FORMAT ? 1 : 0;
   svn_boolean_t is_props = (item_type == SVN_FS_FS__ITEM_TYPE_FILE_PROPS)
                         || (item_type == SVN_FS_FS__ITEM_TYPE_DIR_PROPS);
 
@@ -2925,12 +2948,7 @@ write_container_delta_rep(representation
   SVN_ERR(svn_io_file_get_offset(&delta_start, file, scratch_pool));
 
   /* Prepare to write the svndiff data. */
-  svn_txdelta_to_svndiff3(&diff_wh,
-                          &diff_whb,
-                          file_stream,
-                          diff_version,
-                          ffd->delta_compression_level,
-                          scratch_pool);
+  txdelta_to_svndiff(&diff_wh, &diff_whb, file_stream, fs, scratch_pool);
 
   whb = apr_pcalloc(scratch_pool, sizeof(*whb));
   whb->stream = svn_txdelta_target_push(diff_wh, diff_whb, source,

Modified: subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/commit.c?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/commit.c Mon Jul 17 14:33:05 2017
@@ -1896,17 +1896,32 @@ apply_textdelta(void *file_baton,
   if (ctx->commit_ctx->session->supports_svndiff1 &&
       ctx->commit_ctx->session->using_compression)
     {
-      /* Use compressed svndiff1 format, if possible. */
+      /* Prefer svndiff1 when using http compression, as svndiff2 is not a
+       * substitute for svndiff1 with default compression level.  (It gives
+       * better speed and compression ratio comparable to svndiff1 with
+       * compression level 1, but not 5).
+       *
+       * It might make sense to tweak the current format negotiation scheme
+       * so that the server would say which versions of svndiff it accepts,
+       * _including_ the preferred order.  This would allow us to dynamically
+       * pick svndiff2 if that's what the server thinks is appropriate.
+       */
       svndiff_version = 1;
       compression_level = SVN_DELTA_COMPRESSION_LEVEL_DEFAULT;
     }
+  else if (ctx->commit_ctx->session->supports_svndiff2 &&
+           ctx->commit_ctx->session->using_compression)
+    {
+      svndiff_version = 2;
+      compression_level = SVN_DELTA_COMPRESSION_LEVEL_NONE;
+    }
   else
     {
-      /* Difference between svndiff formats 0 and 1 that format 1 allows
+      /* Difference between svndiff formats 0 and 1/2 that format 1/2 allows
        * compression.  Uncompressed svndiff0 should also be slightly more
        * effective if the compression is not required at all.
        *
-       * If the server cannot handle svndiff1, or compression is disabled
+       * If the server cannot handle svndiff1/2, or compression is disabled
        * with the 'http-compression = no' client configuration option, fall
        * back to uncompressed svndiff0 format.  As a bonus, users can force
        * the usage of the uncompressed format by setting the corresponding

Modified: subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/options.c?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/options.c Mon Jul 17 14:33:05 2017
@@ -232,6 +232,11 @@ capabilities_headers_iterator_callback(v
              advertise this capability (Subversion 1.10 and greater). */
           session->supports_svndiff1 = TRUE;
         }
+      if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_SVNDIFF2, vals))
+        {
+          /* Same for svndiff2. */
+          session->supports_svndiff2 = TRUE;
+        }
     }
 
   /* SVN-specific headers -- if present, server supports HTTP protocol v2 */

Modified: subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/ra_serf.h?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/ra_serf.h Mon Jul 17 14:33:05 2017
@@ -261,6 +261,9 @@ struct svn_ra_serf__session_t {
 
   /* Indicates whether the server can understand svndiff version 1. */
   svn_boolean_t supports_svndiff1;
+
+  /* Indicates whether the server can understand svndiff version 2. */
+  svn_boolean_t supports_svndiff2;
 };
 
 #define SVN_RA_SERF__HAVE_HTTPV2_SUPPORT(sess) ((sess)->me_resource != NULL)

Modified: subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/util.c?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/libsvn_ra_serf/util.c Mon Jul 17 14:33:05 2017
@@ -2030,8 +2030,11 @@ svn_ra_serf__setup_svndiff_accept_encodi
 {
   if (using_compression)
     {
-      serf_bucket_headers_setn(headers, "Accept-Encoding",
-                               "gzip,svndiff1;q=0.9,svndiff;q=0.8");
+      /* We are equally interested in svndiff2 and svndiff1, let the
+         server choose the wire format. */
+      serf_bucket_headers_setn(
+        headers, "Accept-Encoding",
+        "gzip,svndiff2;q=0.9,svndiff1;q=0.9,svndiff;q=0.8");
     }
   else
     {

Modified: subversion/branches/shelve-checkpoint/subversion/libsvn_repos/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/libsvn_repos/log.c?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/libsvn_repos/log.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/libsvn_repos/log.c Mon Jul 17 14:33:05 2017
@@ -58,6 +58,57 @@ typedef struct log_callbacks_t
   void *authz_read_baton;
 } log_callbacks_t;
 
+
+svn_repos_path_change_t *
+svn_repos_path_change_create(apr_pool_t *result_pool)
+{
+  svn_repos_path_change_t *change = apr_pcalloc(result_pool, sizeof(*change));
+
+  change->path.data = "";
+  change->change_kind = svn_fs_path_change_reset;
+  change->mergeinfo_mod = svn_tristate_unknown;
+  change->copyfrom_rev = SVN_INVALID_REVNUM;
+
+  return change;
+}
+
+svn_repos_path_change_t *
+svn_repos_path_change_dup(svn_repos_path_change_t *change,
+                          apr_pool_t *result_pool)
+{
+  svn_repos_path_change_t *new_change = apr_pmemdup(result_pool, change,
+                                                    sizeof(*new_change));
+
+  new_change->path.data = apr_pstrmemdup(result_pool, change->path.data,
+                                         change->path.len);
+  if (change->copyfrom_path)
+    new_change->copyfrom_path = apr_pstrdup(result_pool,
+                                            change->copyfrom_path);
+
+  return new_change;
+}
+
+svn_repos_log_entry_t *
+svn_repos_log_entry_create(apr_pool_t *result_pool)
+{
+  svn_repos_log_entry_t *log_entry = apr_pcalloc(result_pool,
+                                                 sizeof(*log_entry));
+
+  return log_entry;
+}
+
+svn_repos_log_entry_t *
+svn_repos_log_entry_dup(const svn_repos_log_entry_t *log_entry,
+                        apr_pool_t *result_pool)
+{
+  svn_repos_log_entry_t *new_entry = apr_pmemdup(result_pool, log_entry,
+                                                sizeof(*new_entry));
+
+  if (log_entry->revprops)
+    new_entry->revprops = svn_prop_hash_dup(log_entry->revprops, result_pool);
+
+  return new_entry;
+}
 
 svn_error_t *
 svn_repos_check_revision_access(svn_repos_revision_access_level_t *access_level,
@@ -1184,7 +1235,7 @@ typedef struct interesting_merge_baton_t
  */
 static svn_error_t *
 interesting_merge(void *baton,
-                  svn_fs_path_change3_t *change,
+                  svn_repos_path_change_t *change,
                   apr_pool_t *scratch_pool)
 {
   interesting_merge_baton_t *b = baton;

Modified: subversion/branches/shelve-checkpoint/subversion/libsvn_subr/compress.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/libsvn_subr/compress.c?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/libsvn_subr/compress.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/libsvn_subr/compress.c Mon Jul 17 14:33:05 2017
@@ -25,6 +25,7 @@
 #include <string.h>
 #include <assert.h>
 #include <zlib.h>
+#include "lz4/lz4.h"
 
 #include "private/svn_subr_private.h"
 #include "private/svn_error_private.h"
@@ -262,9 +263,9 @@ zlib_decode(const unsigned char *in, apr
 }
 
 svn_error_t *
-svn__compress(const void *data, apr_size_t len,
-              svn_stringbuf_t *out,
-              int compression_method)
+svn__compress_zlib(const void *data, apr_size_t len,
+                   svn_stringbuf_t *out,
+                   int compression_method)
 {
   if (   compression_method < SVN__COMPRESSION_NONE
       || compression_method > SVN__COMPRESSION_ZLIB_MAX)
@@ -276,9 +277,103 @@ svn__compress(const void *data, apr_size
 }
 
 svn_error_t *
-svn__decompress(const void *data, apr_size_t len,
-                svn_stringbuf_t *out,
-                apr_size_t limit)
+svn__decompress_zlib(const void *data, apr_size_t len,
+                     svn_stringbuf_t *out,
+                     apr_size_t limit)
 {
   return zlib_decode(data, len, out, limit);
 }
+
+svn_error_t *
+svn__compress_lz4(const void *data, apr_size_t len,
+                  svn_stringbuf_t *out)
+{
+  apr_size_t hdrlen;
+  unsigned char buf[SVN__MAX_ENCODED_UINT_LEN];
+  unsigned char *p;
+  int compressed_data_len;
+  int max_compressed_data_len;
+
+  assert(len <= LZ4_MAX_INPUT_SIZE);
+
+  p = svn__encode_uint(buf, (apr_uint64_t)len);
+  hdrlen = p - buf;
+  max_compressed_data_len = LZ4_compressBound((int)len);
+  svn_stringbuf_setempty(out);
+  svn_stringbuf_ensure(out, max_compressed_data_len + hdrlen);
+  svn_stringbuf_appendbytes(out, (const char *)buf, hdrlen);
+  compressed_data_len = LZ4_compress_default(data, out->data + out->len,
+                                             (int)len, max_compressed_data_len);
+  if (!compressed_data_len)
+    return svn_error_create(SVN_ERR_LZ4_COMPRESSION_FAILED, NULL, NULL);
+
+  if (compressed_data_len >= (int)len)
+    {
+      /* Compression didn't help :(, just append the original text */
+      svn_stringbuf_appendbytes(out, data, len);
+    }
+  else
+    {
+      out->len += compressed_data_len;
+      out->data[out->len] = 0;
+    }
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn__decompress_lz4(const void *data, apr_size_t len,
+                    svn_stringbuf_t *out,
+                    apr_size_t limit)
+{
+  apr_size_t hdrlen;
+  int compressed_data_len;
+  int decompressed_data_len;
+  apr_uint64_t u64;
+  const unsigned char *p = data;
+  int rv;
+
+  assert(len <= INT_MAX);
+  assert(limit <= INT_MAX);
+
+  /* First thing in the string is the original length.  */
+  p = svn__decode_uint(&u64, p, p + len);
+  if (p == NULL)
+    return svn_error_create(SVN_ERR_SVNDIFF_INVALID_COMPRESSED_DATA, NULL,
+                            _("Decompression of compressed data failed: "
+                              "no size"));
+  if (u64 > limit)
+    return svn_error_create(SVN_ERR_SVNDIFF_INVALID_COMPRESSED_DATA, NULL,
+                            _("Decompression of compressed data failed: "
+                              "size too large"));
+  decompressed_data_len = (int)u64;
+  hdrlen = p - (const unsigned char *)data;
+  compressed_data_len = (int)(len - hdrlen);
+
+  svn_stringbuf_setempty(out);
+  svn_stringbuf_ensure(out, decompressed_data_len);
+
+  if (compressed_data_len == decompressed_data_len)
+    {
+      /* Data is in the original, uncompressed form. */
+      memcpy(out->data, p, decompressed_data_len);
+    }
+  else
+    {
+      rv = LZ4_decompress_safe((const char *)p, out->data, compressed_data_len,
+                               decompressed_data_len);
+      if (rv < 0)
+        return svn_error_create(SVN_ERR_LZ4_DECOMPRESSION_FAILED, NULL, NULL);
+
+      if (rv != decompressed_data_len)
+        return svn_error_create(SVN_ERR_SVNDIFF_INVALID_COMPRESSED_DATA,
+                                NULL,
+                                _("Size of uncompressed data "
+                                  "does not match stored original length"));
+    }
+
+  out->data[decompressed_data_len] = 0;
+  out->len = decompressed_data_len;
+
+  return SVN_NO_ERROR;
+}

Modified: subversion/branches/shelve-checkpoint/subversion/libsvn_subr/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/libsvn_subr/deprecated.c?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/libsvn_subr/deprecated.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/libsvn_subr/deprecated.c Mon Jul 17 14:33:05 2017
@@ -1288,7 +1288,7 @@ svn_rangelist_merge(svn_rangelist_t **ra
                                pool, pool));
 
   return svn_error_trace(
-            svn_rangelist__combine_adjacent_ranges(*rangelist, pool));
+            svn_rangelist__canonicalize(*rangelist, pool));
 }
 
 svn_error_t *

Modified: subversion/branches/shelve-checkpoint/subversion/libsvn_subr/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/libsvn_subr/mergeinfo.c?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/libsvn_subr/mergeinfo.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/libsvn_subr/mergeinfo.c Mon Jul 17 14:33:05 2017
@@ -608,49 +608,48 @@ svn_rangelist__parse(svn_rangelist_t **r
   return SVN_NO_ERROR;
 }
 
-/* Return TRUE, if all ranges in RANGELIST are in ascending order and do
- * not overlap and are not adjacent.
- *
- * ### Can yield false negatives: ranges of differing inheritance are
- * allowed to be adjacent.
- *
- * If this returns FALSE, you probaly want to qsort() the
- * ranges and then call svn_rangelist__combine_adjacent_ranges().
- */
-static svn_boolean_t
-is_rangelist_normalized(svn_rangelist_t *rangelist)
+svn_boolean_t
+svn_rangelist__is_canonical(const svn_rangelist_t *rangelist)
 {
   int i;
   svn_merge_range_t **ranges = (svn_merge_range_t **)rangelist->elts;
 
-  for (i = 0; i < rangelist->nelts-1; ++i)
-    if (ranges[i]->end >= ranges[i+1]->start)
-      return FALSE;
-
-  return TRUE;
-}
-
-svn_error_t *
-svn_rangelist__canonicalize(svn_rangelist_t *rangelist,
-                            apr_pool_t *scratch_pool)
-{
-  if (! is_rangelist_normalized(rangelist))
+  /* Check for reversed and empty ranges */
+  for (i = 0; i < rangelist->nelts; ++i)
     {
-      svn_sort__array(rangelist, svn_sort_compare_ranges);
+      if (ranges[i]->start >= ranges[i]->end)
+        return FALSE;
+    }
 
-      SVN_ERR(svn_rangelist__combine_adjacent_ranges(rangelist, scratch_pool));
+  /* Check for overlapping ranges */
+  for (i = 0; i < rangelist->nelts - 1; ++i)
+    {
+      if (ranges[i]->end > ranges[i + 1]->start)
+        return FALSE; /* Overlapping range */
+      else if (ranges[i]->end == ranges[i+1]->start
+               && ranges[i]->inheritable == ranges[i + 1]->inheritable)
+        {
+          return FALSE; /* Ranges should have been combined */
+        }
     }
 
-  return SVN_NO_ERROR;
+  return TRUE;
 }
 
+/* In-place combines adjacent ranges in a rangelist.
+   SCRATCH_POOL is just used for providing error messages. */
 svn_error_t *
-svn_rangelist__combine_adjacent_ranges(svn_rangelist_t *rangelist,
-                                       apr_pool_t *scratch_pool)
+svn_rangelist__canonicalize(svn_rangelist_t *rangelist,
+                            apr_pool_t *scratch_pool)
 {
   int i;
   svn_merge_range_t *range, *lastrange;
 
+  if (svn_rangelist__is_canonical(rangelist))
+    return SVN_NO_ERROR; /* Nothing to do */
+
+  svn_sort__array(rangelist, svn_sort_compare_ranges);
+
   lastrange = APR_ARRAY_IDX(rangelist, 0, svn_merge_range_t *);
 
   for (i = 1; i < rangelist->nelts; i++)
@@ -964,6 +963,12 @@ svn_rangelist_merge2(svn_rangelist_t *ra
   int i = 0;
   int j = 0;
 
+#ifdef SVN_DEBUG
+  svn_boolean_t was_normalized =
+                    (svn_rangelist__is_canonical(rangelist)
+                     && svn_rangelist__is_canonical(changes));
+#endif
+
   /* We may modify CHANGES, so make a copy in SCRATCH_POOL. */
   changes = svn_rangelist_dup(changes, scratch_pool);
 
@@ -1189,6 +1194,10 @@ svn_rangelist_merge2(svn_rangelist_t *ra
       svn_sort__array_insert(rangelist, &change_copy, rangelist->nelts);
     }
 
+#ifdef SVN_DEBUG
+  SVN_ERR_ASSERT(!was_normalized || svn_rangelist__is_canonical(rangelist));
+#endif
+
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/shelve-checkpoint/subversion/libsvn_subr/packed_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/libsvn_subr/packed_data.c?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/libsvn_subr/packed_data.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/libsvn_subr/packed_data.c Mon Jul 17 14:33:05 2017
@@ -561,9 +561,9 @@ write_stream_data(svn_stream_t *stream,
                   svn_stringbuf_t *uncompressed,
                   svn_stringbuf_t *compressed)
 {
-  SVN_ERR(svn__compress(uncompressed->data, uncompressed->len,
-                        compressed,
-                        SVN_DELTA_COMPRESSION_LEVEL_DEFAULT));
+  SVN_ERR(svn__compress_zlib(uncompressed->data, uncompressed->len,
+                             compressed,
+                             SVN_DELTA_COMPRESSION_LEVEL_DEFAULT));
 
   SVN_ERR(write_stream_uint(stream, compressed->len));
   SVN_ERR(svn_stream_write(stream, compressed->data, &compressed->len));
@@ -978,8 +978,8 @@ read_stream_data(svn_stream_t *stream,
   SVN_ERR(svn_stream_read_full(stream, compressed->data, &compressed->len));
   compressed->data[compressed_len] = '\0';
 
-  SVN_ERR(svn__decompress(compressed->data, compressed->len,
-                          uncompressed, uncompressed_len));
+  SVN_ERR(svn__decompress_zlib(compressed->data, compressed->len,
+                               uncompressed, uncompressed_len));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/shelve-checkpoint/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/mod_dav_svn/repos.c?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/mod_dav_svn/repos.c Mon Jul 17 14:33:05 2017
@@ -1752,6 +1752,9 @@ 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;
+  svn_boolean_t accepts_svndiff2 = FALSE;
+
   encoding_prefs = do_header_line(r->pool,
                                   apr_table_get(r->headers_in,
                                                 "Accept-Encoding"));
@@ -1762,23 +1765,38 @@ negotiate_encoding_prefs(request_rec *r,
       return;
     }
 
-  *svndiff_version = 0;
   svn_sort__array(encoding_prefs, sort_encoding_pref);
   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, "svndiff1") == 0)
+      if (strcmp(rec.name, "svndiff2") == 0)
         {
-          *svndiff_version = 1;
-          break;
+          accepts_svndiff2 = TRUE;
         }
-      else if (strcmp(rec.name, "svndiff") == 0)
+      else if (strcmp(rec.name, "svndiff1") == 0)
         {
-          *svndiff_version = 0;
-          break;
+          accepts_svndiff1 = 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)
+    {
+      *svndiff_version = 2;
+    }
+  else if (accepts_svndiff1)
+    {
+      *svndiff_version = 1;
+    }
+  else
+    {
+      *svndiff_version = 0;
+    }
 }
 
 

Modified: subversion/branches/shelve-checkpoint/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/mod_dav_svn/version.c?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/mod_dav_svn/version.c Mon Jul 17 14:33:05 2017
@@ -153,6 +153,7 @@ get_vsn_options(apr_pool_t *p, apr_text_
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_INLINE_PROPS);
   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);
   /* 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-checkpoint/subversion/tests/cmdline/export_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/tests/cmdline/export_tests.py?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/tests/cmdline/export_tests.py (original)
+++ subversion/branches/shelve-checkpoint/subversion/tests/cmdline/export_tests.py Mon Jul 17 14:33:05 2017
@@ -1070,6 +1070,38 @@ 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()
+
+  wc_dir = sbox.wc_dir
+
+  # Set 'svn:externals' property in 'A/C' to 'A/B/E/alpha'(file external),
+  C_path = os.path.join(wc_dir, 'A', 'C')
+  externals_prop = "^/A/B/E/alpha exfile_alpha"
+
+  tmp_f = sbox.get_tempname('prop')
+  svntest.main.file_append(tmp_f, externals_prop)
+  svntest.main.run_svn(None, 'ps', '-F', tmp_f, 'svn:externals', C_path)
+  svntest.main.run_svn(None,'ci', '-m', 'log msg', '--quiet', C_path)
+
+  # Update the working copy to receive file external
+  svntest.main.run_svn(None, 'up', wc_dir)
+
+  # 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)
+
+  # 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)
+
 
 ########################################################################
 # Run the tests
@@ -1107,6 +1139,7 @@ test_list = [ None,
               export_custom_keywords,
               export_file_external,
               export_file_externals2,
+              export_revision_with_root_relative_external,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svnserveautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svnserveautocheck.sh?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svnserveautocheck.sh (original)
+++ subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svnserveautocheck.sh Mon Jul 17 14:33:05 2017
@@ -66,15 +66,23 @@ fail() {
   exit 1
 }
 
+# Compute ABS_BUILDDIR and ABS_SRCDIR.
 if [ -x subversion/svn/svn ]; then
+  # cwd is build tree root
   ABS_BUILDDIR=$(pwd)
 elif [ -x $SCRIPTDIR/../../svn/svn ]; then
+  # cwd is subversion/tests/cmdline/ in the build tree
   cd $SCRIPTDIR/../../../
   ABS_BUILDDIR=$(pwd)
   cd - >/dev/null
 else
   fail "Run this script from the root of Subversion's build tree!"
 fi
+# Cater for out-of-tree builds
+ABS_SRCDIR=`<$ABS_BUILDDIR/Makefile sed -ne 's/^srcdir = //p'`
+if [ ! -e $ABS_SRCDIR/subversion/include/svn_version.h ]; then
+  fail "Run this script from the root of Subversion's build tree!"
+fi
 
 # If you change this, also make sure to change the svn:ignore entry
 # for it and "make check-clean".
@@ -130,7 +138,7 @@ else
   cd "$ABS_BUILDDIR/subversion/tests/cmdline/"
   TEST="$1"
   shift
-  TIME_CMD "./${TEST}_tests.py" "--url=$BASE_URL" $*
+  TIME_CMD "$ABS_SRCDIR/subversion/tests/cmdline/${TEST}_tests.py" "--url=$BASE_URL" $*
   r=$?
   cd - > /dev/null
 fi

Modified: subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svntest/main.py?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/shelve-checkpoint/subversion/tests/cmdline/svntest/main.py Mon Jul 17 14:33:05 2017
@@ -1010,10 +1010,11 @@ def file_substitute(path, contents, new_
   fcontent = open(path, 'r').read().replace(contents, new_contents)
   open(path, 'w').write(fcontent)
 
-# For setting up authz and hooks in existing repos
+# For setting up authz, hooks and making other tweaks to created repos
 def _post_create_repos(path, minor_version = None):
-  """Set default access right configurations for svnserve and mod_dav
-  as well as hooks etc. in the SVN repository at PATH."""
+  """Set default access right configurations for svnserve and mod_dav,
+  install hooks and perform other various tweaks according to the test
+  options in the SVN repository at PATH."""
 
   # Require authentication to write to the repos, for ra_svn testing.
   file_write(get_svnserve_conf_file_path(path),
@@ -1036,16 +1037,26 @@ def _post_create_repos(path, minor_versi
 
   if options.fs_type is None or options.fs_type == 'fsfs':
     # fsfs.conf file
-    if options.config_file is not None and \
-       (not minor_version or minor_version >= 6):
-      config_file = open(options.config_file, 'r')
-      fsfsconf = open(get_fsfs_conf_file_path(path), 'w')
-      for line in config_file.readlines():
-        fsfsconf.write(line)
-        if options.memcached_server and line == '[memcached-servers]\n':
-            fsfsconf.write('key = %s\n' % options.memcached_server)
-      config_file.close()
-      fsfsconf.close()
+    if (minor_version is None or minor_version >= 6):
+      confpath = get_fsfs_conf_file_path(path)
+      if options.config_file is not None:
+        shutil.copy(options.config_file, confpath)
+
+      if options.memcached_server is not None or \
+         options.fsfs_compression_level 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
+            newlines += line
+            if options.memcached_server is not None and \
+               line == '[memcached-servers]\n':
+              newlines += ('key = %s\n' % options.memcached_server)
+        with open(confpath, 'w') as conffile:
+          conffile.writelines(newlines)
 
     # format file
     if options.fsfs_sharding is not None:
@@ -1726,6 +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))
 
     result, stdout_lines, stderr_lines = spawn_process(command, 0, False, None,
                                                        *args)
@@ -2138,6 +2151,9 @@ 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)')
 
   # most of the defaults are None, but some are other values, set them here
   parser.set_defaults(
@@ -2187,6 +2203,10 @@ 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-checkpoint/subversion/tests/libsvn_delta/random-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/tests/libsvn_delta/random-test.c?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/tests/libsvn_delta/random-test.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/tests/libsvn_delta/random-test.c Mon Jul 17 14:33:05 2017
@@ -41,7 +41,7 @@
 #include "delta-window-test.h"
 
 
-#define DEFAULT_ITERATIONS 30
+#define DEFAULT_ITERATIONS 60
 #define DEFAULT_MAXLEN (100 * 1024)
 #define DEFAULT_DUMP_FILES 0
 #define DEFAULT_PRINT_WINDOWS 0
@@ -329,9 +329,9 @@ do_random_test(apr_pool_t *pool,
                                          delta_pool);
 
       /* Make stage 2: encode the text delta in svndiff format using
-                       varying compression levels. */
-      svn_txdelta_to_svndiff3(&handler, &handler_baton, stream, 1, i % 10,
-                              delta_pool);
+                       varying svndiff versions and compression levels. */
+      svn_txdelta_to_svndiff3(&handler, &handler_baton, stream, i % 3,
+                              i % 10, delta_pool);
 
       /* Make stage 1: create the text delta.  */
       svn_txdelta2(&txdelta_stream,
@@ -425,9 +425,9 @@ do_random_combine_test(apr_pool_t *pool,
                                          delta_pool);
 
       /* Make stage 2: encode the text delta in svndiff format using
-                       varying compression levels. */
-      svn_txdelta_to_svndiff3(&handler, &handler_baton, stream, 1, i % 10,
-                              delta_pool);
+                       varying svndiff versions and compression levels. */
+      svn_txdelta_to_svndiff3(&handler, &handler_baton, stream, i % 3,
+                              i % 10, delta_pool);
 
       /* Make stage 1: create the text deltas.  */
 

Modified: subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/mergeinfo-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/mergeinfo-test.c?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/mergeinfo-test.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/tests/libsvn_subr/mergeinfo-test.c Mon Jul 17 14:33:05 2017
@@ -1678,6 +1678,7 @@ test_rangelist_merge_overlap(apr_pool_t
   svn_rangelist_t * rangelist = apr_array_make(pool, 1, sizeof(svn_merge_range_t *));
   svn_merge_range_t *mrange = apr_pcalloc(pool, sizeof(*mrange));
 
+  /* This range is optional for reproducing issue #4686 */
   mrange->start = 15013;
   mrange->end = 19472;
   mrange->inheritable = TRUE;
@@ -1689,6 +1690,7 @@ test_rangelist_merge_overlap(apr_pool_t
   mrange->inheritable = FALSE;
   APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) = mrange;
 
+  /* This range is optional for reproducing issue #4686 */
   mrange = apr_pcalloc(pool, sizeof(*mrange));
   mrange->start = 19612;
   mrange->end = 19614;
@@ -1707,6 +1709,7 @@ test_rangelist_merge_overlap(apr_pool_t
   mrange->inheritable = TRUE;
   APR_ARRAY_PUSH(rangelist, svn_merge_range_t *) = mrange;
 
+  /* This range is optional for reproducing issue #4686 */
   mrange = apr_pcalloc(pool, sizeof(*mrange));
   mrange->start = 19634;
   mrange->end = 20055;
@@ -1735,7 +1738,12 @@ test_rangelist_merge_overlap(apr_pool_t
   }
 #endif
 
-  svn_rangelist_merge2(rangelist, changes, pool, pool);
+  SVN_TEST_ASSERT(svn_rangelist__is_canonical(rangelist));
+  SVN_TEST_ASSERT(svn_rangelist__is_canonical(changes));
+
+  SVN_ERR(svn_rangelist_merge2(rangelist, changes, pool, pool));
+
+  SVN_TEST_ASSERT(svn_rangelist__is_canonical(rangelist));
 
 #if 0
   {
@@ -1751,14 +1759,12 @@ test_rangelist_merge_overlap(apr_pool_t
   */
 
   {
-     svn_stringbuf_t *info = svn_stringbuf_create("/A:", pool);
-     svn_mergeinfo_t mi;
-     svn_string_t * tmpString;
+     svn_string_t * tmp_string;
+     svn_rangelist_t *range_list;
 
-     svn_rangelist_to_string(&tmpString, rangelist, pool);
-     svn_stringbuf_appendbytes(info, tmpString->data, tmpString->len);
+     svn_rangelist_to_string(&tmp_string, rangelist, pool);
 
-     SVN_ERR(svn_mergeinfo_parse(&mi, info->data, pool));
+     SVN_ERR(svn_rangelist__parse(&range_list, tmp_string->data, pool));
   }
   
   return SVN_NO_ERROR;

Modified: subversion/branches/shelve-checkpoint/tools/dist/release.py
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/tools/dist/release.py?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/tools/dist/release.py (original)
+++ subversion/branches/shelve-checkpoint/tools/dist/release.py Mon Jul 17 14:33:05 2017
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-#
+# python: coding=utf-8
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -71,16 +71,16 @@ tool_versions = {
             '954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969'],
             'libtool'  : ['2.4.6',
             'e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3'],
-            'swig'     : ['2.0.12',
-            '65e13f22a60cecd7279c59882ff8ebe1ffe34078e85c602821a541817a4317f7'],
+            'swig'     : ['3.0.10',
+            '2939aae39dec06095462f1b95ce1c958ac80d07b926e48871046d17c0094f44c'],
   },
   '1.10' : {
             'autoconf' : ['2.69',
             '954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969'],
             'libtool'  : ['2.4.6',
             'e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3'],
-            'swig'     : ['2.0.12',
-            '65e13f22a60cecd7279c59882ff8ebe1ffe34078e85c602821a541817a4317f7'],
+            'swig'     : ['3.0.10',
+            '2939aae39dec06095462f1b95ce1c958ac80d07b926e48871046d17c0094f44c'],
   },
   '1.9' : {
             'autoconf' : ['2.69',
@@ -268,6 +268,20 @@ def download_file(url, target, checksum)
                            (target, checksum, checksum2))
 
 #----------------------------------------------------------------------
+# ezt helpers
+
+# In ezt, «[if-any foo]» is true when «data['foo'] == False»,
+# hence, provide this constant for readability.
+ezt_False = ""
+
+# And this constant for symmetry.
+ezt_True = True
+
+# And this for convenience.
+def ezt_bool(boolean_value):
+    return ezt_True if boolean_value else ezt_False
+
+#----------------------------------------------------------------------
 # Cleaning up the environment
 
 def cleanup(args):
@@ -803,8 +817,19 @@ def write_announcement(args):
     if args.version.is_prerelease():
         template_filename = 'rc-release-ann.ezt'
     else:
+        data['dot-zero'] = ezt_bool(args.version.patch == 0)
+        # TODO: instead of requiring the RM to remember to pass --security,
+        #   read the private repository where CVE announcements are staged,
+        #   parse the json file that identifies which versions are affected,
+        #   and accordingly automagically set data['security'].
+        data['security'] = ezt_bool(args.security)
         template_filename = 'stable-release-ann.ezt'
 
+        # The template text assumes these two are mutually exclusive.
+        # If you ever find a reason to make a x.y.0 release with a security
+        # bug, just comment this out and update the template before sending.
+        assert not (data['dot-zero'] and data['security'])
+
     template = ezt.Template(compress_whitespace = False)
     template.parse(get_tmplfile(template_filename).read())
     template.generate(sys.stdout, data)
@@ -1077,6 +1102,9 @@ def main():
                     help='''Output to stdout template text for the emailed
                             release announcement.''')
     subparser.set_defaults(func=write_announcement)
+    subparser.add_argument('--security', action='store_true', default=False,
+                    help='''The release being announced includes security
+                            fixes.''')
     subparser.add_argument('--target',
                     help='''The full path to the directory containing
                             release artifacts.''')

Modified: subversion/branches/shelve-checkpoint/tools/dist/templates/rc-release-ann.ezt
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/tools/dist/templates/rc-release-ann.ezt?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/tools/dist/templates/rc-release-ann.ezt (original)
+++ subversion/branches/shelve-checkpoint/tools/dist/templates/rc-release-ann.ezt Mon Jul 17 14:33:05 2017
@@ -26,9 +26,10 @@ PGP Signatures are available at:
 For this release, the following people have provided PGP signatures:
 
 [siginfo]
-This is a pre-release for what will eventually become Apache Subversion
-[major-minor-patch].  It may contain known issues, a complete list of
-[major-minor-patch]-blocking issues can be found here:
+This is a pre-release for what will eventually become version [major-minor-patch] of the
+Apache Subversion open source version control system.  It may contain known
+issues, a complete list of [major-minor-patch]-blocking issues can be found
+here:
 
     http://subversion.tigris.org/issues/buglist.cgi?component=subversion&issue_status=NEW&issue_status=STARTED&issue_status=REOPENED&target_milestone=[major-minor-patch]
 

Modified: subversion/branches/shelve-checkpoint/tools/dist/templates/stable-release-ann.ezt
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/tools/dist/templates/stable-release-ann.ezt?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/tools/dist/templates/stable-release-ann.ezt (original)
+++ subversion/branches/shelve-checkpoint/tools/dist/templates/stable-release-ann.ezt Mon Jul 17 14:33:05 2017
@@ -1,17 +1,23 @@
 From: ...@apache.org
 To: announce@subversion.apache.org, users@subversion.apache.org, dev@subversion.apache.org, announce@apache.org
-Subject: [[]ANNOUNCE] Apache Subversion [version] released
-
-From: ...@apache.org
-To: announce@subversion.apache.org, users@subversion.apache.org, dev@subversion.apache.org, announce@apache.org
-Cc: security@apache.org
-Subject: [[]SECURITY][[]ANNOUNCE] Apache Subversion [version] released
-
+[if-any security]Cc: security@apache.org
+[end][if-any security]Subject: [[]SECURITY][[]ANNOUNCE] Apache Subversion [version] released
+[else]Subject: [[]ANNOUNCE] Apache Subversion [version] released
+[end]
 I'm happy to announce the release of Apache Subversion [version].
 Please choose the mirror closest to you by visiting:
 
     http://subversion.apache.org/download.cgi#[anchor]
-
+[if-any dot-zero]
+This is a stable feature release of the Apache Subversion open source
+version control system.
+[else][if-any security]
+This is a stable bugfix and security release of the Apache Subversion
+open source version control system.
+[else]
+This is a stable bugfix release of the Apache Subversion open source
+version control system.
+[end][end]
 The SHA1 checksums are:
 
 [for sha1info]    [sha1info.sha1] [sha1info.filename]

Modified: subversion/branches/shelve-checkpoint/win-tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/win-tests.py?rev=1802152&r1=1802151&r2=1802152&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/win-tests.py (original)
+++ subversion/branches/shelve-checkpoint/win-tests.py Mon Jul 17 14:33:05 2017
@@ -113,6 +113,7 @@ def _usage_exit():
   print("  --config-file          : Configuration file for tests")
   print("  --fsfs-sharding        : Specify shard size (for fsfs)")
   print("  --fsfs-packing         : Run 'svnadmin pack' automatically")
+  print("  --fsfs-compression=VAL : Set compression level to VAL (for fsfs)")
   print("  -q, --quiet            : Deprecated; this is the default.")
   print("                           Use --set-log-level instead.")
 
@@ -144,6 +145,7 @@ opts, args = my_getopt(sys.argv[1:], 'hr
                         'log-to-stdout', 'mode-filter=', 'milestone-filter=',
                         'ssl-cert=', 'exclusive-wc-locks', 'memcached-server=',
                         'skip-c-tests', 'dump-load-cross-check', 'memcached-dir=',
+                        'fsfs-compression=',
                         ])
 if len(args) > 1:
   print('Warning: non-option arguments after the first one will be ignored')
@@ -189,6 +191,7 @@ memcached_server = None
 memcached_dir = None
 skip_c_tests = None
 dump_load_cross_check = None
+fsfs_compression_level = None
 
 for opt, val in opts:
   if opt in ('-h', '--help'):
@@ -283,6 +286,8 @@ for opt, val in opts:
   elif opt == '--memcached-dir':
     memcached_dir = val
     run_memcached = 1
+  elif opt == '--fsfs-compression':
+    fsfs_compression_level = int(val)
 
 # Calculate the source and test directory names
 abs_srcdir = os.path.abspath("")
@@ -1107,6 +1112,7 @@ if not test_javahl and not test_swig:
   opts.memcached_server = memcached_server
   opts.skip_c_tests = skip_c_tests
   opts.dump_load_cross_check = dump_load_cross_check
+  opts.fsfs_compression_level = fsfs_compression_level
   th = run_tests.TestHarness(abs_srcdir, abs_builddir,
                              log_file, fail_log_file, opts)
   old_cwd = os.getcwd()