Author: stsp
Date: Tue Aug 22 14:19:36 2017
New Revision: 1805769
URL: http://svn.apache.org/viewvc?rev=1805769&view=rev
Log:
On the addremove branch, merge outstanding changes from trunk.
Added:
subversion/branches/addremove/build/ac-macros/lz4.m4
- copied unchanged from r1805764, subversion/trunk/build/ac-macros/lz4.m4
subversion/branches/addremove/build/ac-macros/utf8proc.m4
- copied unchanged from r1805764,
subversion/trunk/build/ac-macros/utf8proc.m4
subversion/branches/addremove/notes/api-errata/1.10/
- copied from r1805764, subversion/trunk/notes/api-errata/1.10/
subversion/branches/addremove/subversion/libsvn_ra_serf/stream_bucket.c
- copied unchanged from r1805764,
subversion/trunk/subversion/libsvn_ra_serf/stream_bucket.c
subversion/branches/addremove/subversion/libsvn_subr/compress_lz4.c
- copied unchanged from r1805764,
subversion/trunk/subversion/libsvn_subr/compress_lz4.c
subversion/branches/addremove/subversion/libsvn_subr/compress_zlib.c
- copied unchanged from r1805764,
subversion/trunk/subversion/libsvn_subr/compress_zlib.c
subversion/branches/addremove/subversion/libsvn_subr/encode.c
- copied unchanged from r1805764,
subversion/trunk/subversion/libsvn_subr/encode.c
subversion/branches/addremove/subversion/libsvn_subr/lz4/lz4internal.h
- copied unchanged from r1805764,
subversion/trunk/subversion/libsvn_subr/lz4/lz4internal.h
subversion/branches/addremove/subversion/libsvn_subr/utf8proc/utf8proc_internal.h
- copied unchanged from r1805764,
subversion/trunk/subversion/libsvn_subr/utf8proc/utf8proc_internal.h
subversion/branches/addremove/subversion/tests/cmdline/externals_tests_data/
- copied from r1805764,
subversion/trunk/subversion/tests/cmdline/externals_tests_data/
subversion/branches/addremove/tools/hook-scripts/CVE-2017-9800-pre-commit.py
- copied unchanged from r1805764,
subversion/trunk/tools/hook-scripts/CVE-2017-9800-pre-commit.py
Removed:
subversion/branches/addremove/subversion/libsvn_subr/compress.c
subversion/branches/addremove/subversion/libsvn_subr/lz4/lz4.h
subversion/branches/addremove/subversion/libsvn_subr/utf8proc/utf8proc.h
Modified:
subversion/branches/addremove/ (props changed)
subversion/branches/addremove/CHANGES
subversion/branches/addremove/Makefile.in
subversion/branches/addremove/aclocal.m4
subversion/branches/addremove/build.conf
subversion/branches/addremove/build/generator/gen_base.py
subversion/branches/addremove/build/generator/gen_win.py
subversion/branches/addremove/build/generator/gen_win_dependencies.py
subversion/branches/addremove/build/run_tests.py
subversion/branches/addremove/configure.ac
subversion/branches/addremove/notes/resolve-moves
subversion/branches/addremove/notes/ssh-tricks
subversion/branches/addremove/subversion/include/private/svn_io_private.h
subversion/branches/addremove/subversion/include/private/svn_wc_private.h
subversion/branches/addremove/subversion/include/svn_checksum.h
subversion/branches/addremove/subversion/include/svn_client.h
subversion/branches/addremove/subversion/include/svn_dav.h
subversion/branches/addremove/subversion/include/svn_delta.h
subversion/branches/addremove/subversion/include/svn_error_codes.h
subversion/branches/addremove/subversion/include/svn_io.h
subversion/branches/addremove/subversion/include/svn_ra_svn.h
subversion/branches/addremove/subversion/libsvn_client/conflicts.c
subversion/branches/addremove/subversion/libsvn_client/import.c
subversion/branches/addremove/subversion/libsvn_client/merge.c
subversion/branches/addremove/subversion/libsvn_delta/cancel.c
subversion/branches/addremove/subversion/libsvn_delta/default_editor.c
subversion/branches/addremove/subversion/libsvn_delta/svndiff.c
subversion/branches/addremove/subversion/libsvn_delta/text_delta.c
subversion/branches/addremove/subversion/libsvn_fs_base/fs.c
subversion/branches/addremove/subversion/libsvn_fs_fs/fs.h
subversion/branches/addremove/subversion/libsvn_fs_fs/fs_fs.c
subversion/branches/addremove/subversion/libsvn_fs_fs/transaction.c
subversion/branches/addremove/subversion/libsvn_ra_serf/blame.c
subversion/branches/addremove/subversion/libsvn_ra_serf/commit.c
subversion/branches/addremove/subversion/libsvn_ra_serf/get_file.c
subversion/branches/addremove/subversion/libsvn_ra_serf/options.c
subversion/branches/addremove/subversion/libsvn_ra_serf/ra_serf.h
subversion/branches/addremove/subversion/libsvn_ra_serf/replay.c
subversion/branches/addremove/subversion/libsvn_ra_serf/serf.c
subversion/branches/addremove/subversion/libsvn_ra_serf/update.c
subversion/branches/addremove/subversion/libsvn_ra_serf/util.c
subversion/branches/addremove/subversion/libsvn_ra_svn/client.c
subversion/branches/addremove/subversion/libsvn_ra_svn/editorp.c
subversion/branches/addremove/subversion/libsvn_ra_svn/protocol
subversion/branches/addremove/subversion/libsvn_repos/repos.c
subversion/branches/addremove/subversion/libsvn_subr/checksum.c
subversion/branches/addremove/subversion/libsvn_subr/config_file.c
subversion/branches/addremove/subversion/libsvn_subr/dirent_uri.c
subversion/branches/addremove/subversion/libsvn_subr/fnv1a.c
subversion/branches/addremove/subversion/libsvn_subr/fnv1a.h
subversion/branches/addremove/subversion/libsvn_subr/lz4/lz4.c
subversion/branches/addremove/subversion/libsvn_subr/stream.c
subversion/branches/addremove/subversion/libsvn_subr/utf8proc.c
subversion/branches/addremove/subversion/libsvn_subr/utf8proc/utf8proc.c
subversion/branches/addremove/subversion/libsvn_wc/adm_crawler.c
subversion/branches/addremove/subversion/libsvn_wc/deprecated.c
subversion/branches/addremove/subversion/libsvn_wc/translate.c
subversion/branches/addremove/subversion/libsvn_wc/wc.h
subversion/branches/addremove/subversion/mod_dav_svn/repos.c
subversion/branches/addremove/subversion/mod_dav_svn/version.c
subversion/branches/addremove/subversion/svn/cl.h
subversion/branches/addremove/subversion/svn/cleanup-cmd.c
subversion/branches/addremove/subversion/svn/conflict-callbacks.c
subversion/branches/addremove/subversion/svn/merge-cmd.c
subversion/branches/addremove/subversion/svn/notify.c
subversion/branches/addremove/subversion/svn/svn.c
subversion/branches/addremove/subversion/svnserve/serve.c
subversion/branches/addremove/subversion/tests/cmdline/davautocheck.sh
subversion/branches/addremove/subversion/tests/cmdline/externals_tests.py
subversion/branches/addremove/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
subversion/branches/addremove/subversion/tests/cmdline/merge_tests.py
subversion/branches/addremove/subversion/tests/cmdline/merge_tree_conflict_tests.py
subversion/branches/addremove/subversion/tests/cmdline/patch_tests.py
subversion/branches/addremove/subversion/tests/cmdline/stat_tests.py
subversion/branches/addremove/subversion/tests/cmdline/svntest/main.py
subversion/branches/addremove/subversion/tests/cmdline/svntest/mergetrees.py
subversion/branches/addremove/subversion/tests/cmdline/tree_conflict_tests.py
subversion/branches/addremove/subversion/tests/cmdline/update_tests.py
subversion/branches/addremove/subversion/tests/libsvn_client/conflicts-test.c
subversion/branches/addremove/subversion/tests/libsvn_delta/random-test.c
subversion/branches/addremove/subversion/tests/libsvn_subr/ (props
changed)
subversion/branches/addremove/subversion/tests/libsvn_subr/checksum-test.c
subversion/branches/addremove/subversion/tests/libsvn_subr/dirent_uri-test.c
subversion/branches/addremove/subversion/tests/libsvn_subr/mergeinfo-test.c
subversion/branches/addremove/subversion/tests/libsvn_subr/utf-test.c
subversion/branches/addremove/tools/buildbot/slaves/svn-x64-macosx/svnbuild.sh
subversion/branches/addremove/tools/dev/unix-build/Makefile.svn
subversion/branches/addremove/tools/dist/dist.sh
subversion/branches/addremove/tools/dist/release.py
subversion/branches/addremove/tools/dist/templates/rc-release-ann.ezt
subversion/branches/addremove/tools/dist/templates/stable-news.ezt
subversion/branches/addremove/tools/dist/templates/stable-release-ann.ezt
subversion/branches/addremove/win-tests.py
Propchange: subversion/branches/addremove/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 22 14:19:36 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:1802696-1805764
Modified: subversion/branches/addremove/CHANGES
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/CHANGES?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/CHANGES (original)
+++ subversion/branches/addremove/CHANGES Tue Aug 22 14:19:36 2017
@@ -115,6 +115,7 @@ the 1.9 release: https://subversion.apa
+ Parse any properties following svn:mergeinfo (r1706825)
+ Fix potential unbounded memory usage in parser (r1705979)
+ Fix problems with --git diffs applied in reverse (r1704854, -88)
+ + Fix removal of EOL if final patch context line has no EOL (#4315)
* 'svn diff --git': Fix file permission modes to match git and hg
(r1695384)
* Fix a problem with relocating some externals (r1723385)
* Fix 'svn diff URL@REV WC' wrongly looks up URL@HEAD (issue #4597)
@@ -248,6 +249,30 @@ the 1.9 release: https://subversion.apa
* JavaHL: Add missing exception checks (r1801108)
+Version 1.9.7
+(10 Aug 2017, from /branches/1.9.x)
+http://svn.apache.org/repos/asf/subversion/tags/1.9.7
+
+ User-visible changes:
+ - Client-side bugfixes:
+ * Fix arbitrary code execution vulnerability CVE-2017-9800
+ See <https://subversion.apache.org/security/CVE-2017-9800-advisory.txt>
+ for details.
+
+ - Server-side bugfixes:
+ (none)
+
+ - Bindings bugfixes:
+ (none)
+
+ Developer-visible changes:
+ - General:
+ (none)
+
+ - API changes:
+ (none)
+
+
Version 1.9.6
(5 Jul 2017, from /branches/1.9.x)
http://svn.apache.org/repos/asf/subversion/tags/1.9.6
@@ -1220,6 +1245,30 @@ http://svn.apache.org/repos/asf/subversi
* javahl: allow compiling with a C++11 compiler (r1684412)
+Version 1.8.19
+(10 Aug 2017, from /branches/1.8.x)
+http://svn.apache.org/repos/asf/subversion/tags/1.8.19
+
+ User-visible changes:
+ - Client-side bugfixes:
+ * Fix arbitrary code execution vulnerability CVE-2017-9800
+ See <https://subversion.apache.org/security/CVE-2017-9800-advisory.txt>
+ for details.
+
+ - Server-side bugfixes:
+ (none)
+
+ - Bindings bugfixes:
+ (none)
+
+ Developer-visible changes:
+ - General:
+ (none)
+
+ - API changes:
+ (none)
+
+
Version 1.8.18
(10 Jul 2017, from /branches/1.8.x)
http://svn.apache.org/repos/asf/subversion/tags/1.8.18
Modified: subversion/branches/addremove/Makefile.in
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/Makefile.in?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/Makefile.in (original)
+++ subversion/branches/addremove/Makefile.in Tue Aug 22 14:19:36 2017
@@ -54,6 +54,8 @@ SVN_SERF_LIBS = @SVN_SERF_LIBS@
SVN_SQLITE_LIBS = @SVN_SQLITE_LIBS@
SVN_XML_LIBS = @SVN_XML_LIBS@
SVN_ZLIB_LIBS = @SVN_ZLIB_LIBS@
+SVN_LZ4_LIBS = @SVN_LZ4_LIBS@
+SVN_UTF8PROC_LIBS = @SVN_UTF8PROC_LIBS@
LIBS = @LIBS@
@@ -130,7 +132,8 @@ INCLUDES = -I$(top_srcdir)/subversion/in
@SVN_DB_INCLUDES@ @SVN_GNOME_KEYRING_INCLUDES@ \
@SVN_KWALLET_INCLUDES@ @SVN_MAGIC_INCLUDES@ \
@SVN_SASL_INCLUDES@ @SVN_SERF_INCLUDES@ @SVN_SQLITE_INCLUDES@ \
- @SVN_XML_INCLUDES@ @SVN_ZLIB_INCLUDES@
+ @SVN_XML_INCLUDES@ @SVN_ZLIB_INCLUDES@ @SVN_LZ4_INCLUDES@ \
+ @SVN_UTF8PROC_INCLUDES@
APACHE_INCLUDES = @APACHE_INCLUDES@
APACHE_LIBEXECDIR = $(DESTDIR)@APACHE_LIBEXECDIR@
@@ -1005,7 +1008,7 @@ INSTALL_EXTRA_TOOLS=\
ln -sf $(bindir)/svnbench$(EXEEXT)
$(DESTDIR)$(toolsdir)/svn-bench$(EXEEXT); \
fi; \
printf '\043\041/bin/sh\n%s\n' \
- 'exec $(bindir)/svnfsfs stats $${2:+"-M"} $$2 $$1' \
+ 'exec $(bindir)/svnfsfs stats $${2:+"-M"} $${2:+"$$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
Modified: subversion/branches/addremove/aclocal.m4
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/aclocal.m4?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/aclocal.m4 (original)
+++ subversion/branches/addremove/aclocal.m4 Tue Aug 22 14:19:36 2017
@@ -44,8 +44,10 @@ sinclude(build/ac-macros/serf.m4)
sinclude(build/ac-macros/sqlite.m4)
sinclude(build/ac-macros/swig.m4)
sinclude(build/ac-macros/zlib.m4)
+sinclude(build/ac-macros/lz4.m4)
sinclude(build/ac-macros/kwallet.m4)
sinclude(build/ac-macros/libsecret.m4)
+sinclude(build/ac-macros/utf8proc.m4)
sinclude(build/ac-macros/macosx.m4)
# Include the libtool macros
Modified: subversion/branches/addremove/build.conf
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/build.conf?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/build.conf (original)
+++ subversion/branches/addremove/build.conf Tue Aug 22 14:19:36 2017
@@ -47,7 +47,7 @@ private-includes =
subversion/bindings/javahl/native/jniwrapper/jni_*.hpp
tools/dev/svnmover/linenoise/linenoise.h
tools/dev/svnmover/linenoise/linenoise.c
- subversion/libsvn_subr/utf8proc/utf8proc.h
+ subversion/libsvn_subr/utf8proc/utf8proc_internal.h
subversion/libsvn_subr/utf8proc/utf8proc.c
subversion/libsvn_subr/utf8proc/utf8proc_data.c
private-built-includes =
@@ -371,7 +371,7 @@ type = lib
install = fsmod-lib
path = subversion/libsvn_subr
sources = *.c lz4/*.c
-libs = aprutil apriconv apr xml zlib apr_memcache sqlite magic intl
+libs = aprutil apriconv apr xml zlib apr_memcache sqlite magic intl lz4
utf8proc
msvc-libs = kernel32.lib advapi32.lib shfolder.lib ole32.lib
crypt32.lib version.lib
msvc-export =
@@ -1483,6 +1483,14 @@ type = lib
external-lib = $(SVN_ZLIB_LIBS)
msvc-static = yes
+[lz4]
+type = lib
+external-lib = $(SVN_LZ4_LIBS)
+
+[utf8proc]
+type = lib
+external-lib = $(SVN_UTF8PROC_LIBS)
+
[apr_memcache]
type = lib
external-lib = $(SVN_APR_MEMCACHE_LIBS)
Modified: subversion/branches/addremove/build/generator/gen_base.py
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/build/generator/gen_base.py?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/build/generator/gen_base.py (original)
+++ subversion/branches/addremove/build/generator/gen_base.py Tue Aug 22
14:19:36 2017
@@ -288,7 +288,7 @@ class GeneratorBase:
' { %d, "%s" },' % (num, val),
])
- # Remove ',' for c89 compatibility
+ # Remove ',' for c89 compatibility
lines[-1] = lines[-1][0:-1]
lines.extend([
@@ -296,7 +296,14 @@ class GeneratorBase:
'',
])
- write_struct('svn__errno', errno.errorcode.items())
+ # errno names can vary depending on the Python, and possibly the
+ # OS, version and they are not even used by normal release builds
+ # so omit them from the tarball. We always want the struct itself
+ # so that SVN_DEBUG builds still compile and it needs a dummy
+ # entry to avoid a zero-sized array.
+ write_struct('svn__errno',
+ [(0, "success")] if self.release_mode
+ else errno.errorcode.items())
# Fetch and write apr_errno.h codes.
aprerr = []
Modified: subversion/branches/addremove/build/generator/gen_win.py
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/build/generator/gen_win.py?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/build/generator/gen_win.py (original)
+++ subversion/branches/addremove/build/generator/gen_win.py Tue Aug 22
14:19:36 2017
@@ -79,11 +79,15 @@ class WinGeneratorBase(gen_win_dependenc
# Print list of identified libraries
printed = []
- for lib in sorted(self._libraries.values(), key = lambda s: s.name):
+ for lib in sorted(self._libraries.values(),
+ key = lambda s: (s.internal, s.name)):
if lib.name in printed:
continue
printed.append(lib.name)
- print('Found %s %s' % (lib.name, lib.version))
+ if lib.internal:
+ print('Using bundled %s %s' % (lib.name, lib.version))
+ else:
+ print('Found %s %s' % (lib.name, lib.version))
#Make some files for the installer so that we don't need to
#require sed or some other command to do it
Modified: subversion/branches/addremove/build/generator/gen_win_dependencies.py
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/build/generator/gen_win_dependencies.py?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/build/generator/gen_win_dependencies.py
(original)
+++ subversion/branches/addremove/build/generator/gen_win_dependencies.py Tue
Aug 22 14:19:36 2017
@@ -51,7 +51,7 @@ class SVNCommonLibrary:
def __init__(self, name, include_dirs, lib_dir, lib_name, version=None,
debug_lib_dir=None, debug_lib_name=None, dll_dir=None,
dll_name=None, debug_dll_dir=None, debug_dll_name=None,
- defines=[], forced_includes=[], extra_bin=[]):
+ defines=[], forced_includes=[], extra_bin=[], internal=False):
self.name = name
if include_dirs:
self.include_dirs = include_dirs if isinstance(include_dirs, list) \
@@ -90,6 +90,7 @@ class SVNCommonLibrary:
self.debug_dll_name = dll_name
self.extra_bin = extra_bin
+ self.internal = internal
class GenDependenciesBase(gen_base.GeneratorBase):
"""This intermediate base class exists to be instantiated by win-tests.py,
@@ -305,6 +306,8 @@ class GenDependenciesBase(gen_base.Gener
self._find_apr_util_etc()
self._find_zlib()
self._find_sqlite(show_warnings)
+ self._find_lz4()
+ self._find_utf8proc()
# Optional dependencies
self._find_httpd(show_warnings)
@@ -1446,6 +1449,57 @@ class GenDependenciesBase(gen_base.Gener
dll_name=dll_name,
defines=defines)
+ def _find_lz4(self):
+ "Find the LZ4 library"
+
+ # For now, we always use the internal (bundled) library.
+ version_file_path = os.path.join('subversion', 'libsvn_subr',
+ 'lz4', 'lz4internal.h')
+ txt = open(version_file_path).read()
+
+ vermatch = re.search(r'^\s*#define\s+LZ4_VERSION_MAJOR\s+(\d+)',
+ txt, re.M)
+ major = int(vermatch.group(1))
+
+ vermatch = re.search(r'^\s*#define\s+LZ4_VERSION_MINOR\s+(\d+)',
+ txt, re.M)
+ minor = int(vermatch.group(1))
+
+ vermatch = re.search(r'^\s*#define\s+LZ4_VERSION_RELEASE\s+(\d+)',
+ txt, re.M)
+ rel = vermatch.group(1)
+
+ lz4_version = '%d.%d.%s' % (major, minor, rel)
+ self._libraries['lz4'] = SVNCommonLibrary('lz4', None, None, None,
+ lz4_version, internal=True,
+ defines=['SVN_INTERNAL_LZ4'])
+
+ def _find_utf8proc(self):
+ "Find the Utf8proc library"
+
+ # For now, we always use the internal (bundled) library.
+ version_file_path = os.path.join('subversion', 'libsvn_subr',
+ 'utf8proc', 'utf8proc_internal.h')
+ txt = open(version_file_path).read()
+
+ vermatch = re.search(r'^\s*#define\s+UTF8PROC_VERSION_MAJOR\s+(\d+)',
+ txt, re.M)
+ major = int(vermatch.group(1))
+
+ vermatch = re.search(r'^\s*#define\s+UTF8PROC_VERSION_MINOR\s+(\d+)',
+ txt, re.M)
+ minor = int(vermatch.group(1))
+
+ vermatch = re.search(r'^\s*#define\s+UTF8PROC_VERSION_PATCH\s+(\d+)',
+ txt, re.M)
+ patch = int(vermatch.group(1))
+
+ utf8proc_version = '%d.%d.%d' % (major, minor, patch)
+ self._libraries['utf8proc'] = SVNCommonLibrary('utf8proc', None, None,
+ None, utf8proc_version,
+ internal=True,
+ defines=['SVN_INTERNAL_UTF8PROC'])
+
# ============================================================================
# This is a cut-down and modified version of code from:
# subversion/subversion/bindings/swig/python/svn/core.py
Modified: subversion/branches/addremove/build/run_tests.py
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/build/run_tests.py?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/build/run_tests.py (original)
+++ subversion/branches/addremove/build/run_tests.py Tue Aug 22 14:19:36 2017
@@ -33,7 +33,7 @@
[--httpd-version=<version>] [--httpd-whitelist=<version>]
[--config-file=<file>] [--ssl-cert=<file>]
[--exclusive-wc-locks] [--memcached-server=<url:port>]
- [--fsfs-compression=<n>]
+ [--fsfs-compression=<type>]
<abs_srcdir> <abs_builddir>
<prog ...>
@@ -276,8 +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)
+ if self.opts.fsfs_compression is not None:
+ cmdline.append('--fsfs-compression=%s' % self.opts.fsfs_compression)
self.py_test_cmdline = cmdline
@@ -1026,9 +1026,8 @@ 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.add_option('--fsfs-compression', action='store', type='str',
+ help='Set compression type (for fsfs)')
parser.set_defaults(set_log_level=None)
return parser
Modified: subversion/branches/addremove/configure.ac
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/configure.ac?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/configure.ac (original)
+++ subversion/branches/addremove/configure.ac Tue Aug 22 14:19:36 2017
@@ -1216,6 +1216,10 @@ AS_HELP_STRING([--with-editor=PATH],
SVN_LIB_Z
+SVN_LZ4
+
+SVN_UTF8PROC
+
MOD_ACTIVATION=""
AC_ARG_ENABLE(mod-activation,
AS_HELP_STRING([--enable-mod-activation],
Modified: subversion/branches/addremove/notes/resolve-moves
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/notes/resolve-moves?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/notes/resolve-moves (original)
+++ subversion/branches/addremove/notes/resolve-moves Tue Aug 22 14:19:36 2017
@@ -144,8 +144,9 @@ The repos-path@rev is for the conflict v
appeared in the working copy at the time the conflict was flagged.
To determine whether path@old-rev was moved to another path-moved@new-rev,
-SVN must find path-moved@new-rev, and it must find a chain of moves which
-starts at path@old-rev and ends at path-moved@new-rev.
+SVN must look for a chain of moves which starts at path@old-rev and ends at
+new-rev. If a single such chain is found, then the final path-moved@new-rev
+is known.
To do this, SVN scans all revisions between old-rev and new-rev and
detects any moves within them. Moves of the same node are linked together
Modified: subversion/branches/addremove/notes/ssh-tricks
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/notes/ssh-tricks?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/notes/ssh-tricks (original)
+++ subversion/branches/addremove/notes/ssh-tricks Tue Aug 22 14:19:36 2017
@@ -15,7 +15,7 @@ not work with password authentication.
the client's key-pair is used only for access to svnserve; if you want
to retain general shell access to the host, create a second, dedicated
key-pair for Subversion access and (assuming a Unix client) set the
-environment variable SVN_SSH to "ssh -i /path/to/private/key/file".
+environment variable SVN_SSH to "ssh -i /path/to/private/key/file --".
The basic idea
--------------
Modified:
subversion/branches/addremove/subversion/include/private/svn_io_private.h
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/private/svn_io_private.h?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/include/private/svn_io_private.h
(original)
+++ subversion/branches/addremove/subversion/include/private/svn_io_private.h
Tue Aug 22 14:19:36 2017
@@ -127,6 +127,13 @@ svn_stream__install_get_info(apr_finfo_t
apr_int32_t wanted,
apr_pool_t *scratch_pool);
+/* Internal version of svn_stream_from_aprfile2() supporting the
+ additional TRUNCATE_ON_SEEK argument. */
+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);
#if defined(WIN32)
Modified:
subversion/branches/addremove/subversion/include/private/svn_wc_private.h
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/private/svn_wc_private.h?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/include/private/svn_wc_private.h
(original)
+++ subversion/branches/addremove/subversion/include/private/svn_wc_private.h
Tue Aug 22 14:19:36 2017
@@ -2075,6 +2075,17 @@ svn_wc__find_similar_files(apr_array_hea
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+/* Internal version of svn_wc_translated_stream(), accepting a working
+ copy context. */
+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);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/addremove/subversion/include/svn_checksum.h
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_checksum.h?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/include/svn_checksum.h (original)
+++ subversion/branches/addremove/subversion/include/svn_checksum.h Tue Aug 22
14:19:36 2017
@@ -223,6 +223,15 @@ svn_checksum_ctx_create(svn_checksum_kin
apr_pool_t *pool);
/**
+ * Reset an existing checksum @a ctx to initial state.
+ * @see svn_checksum_ctx_create()
+ *
+ * @since New in 1.10.
+ */
+svn_error_t *
+svn_checksum_ctx_reset(svn_checksum_ctx_t *ctx);
+
+/**
* Update the checksum represented by @a ctx, with @a len bytes starting at
* @a data.
*
Modified: subversion/branches/addremove/subversion/include/svn_client.h
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_client.h?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/include/svn_client.h (original)
+++ subversion/branches/addremove/subversion/include/svn_client.h Tue Aug 22
14:19:36 2017
@@ -1991,7 +1991,7 @@ typedef svn_error_t *(*svn_client_import
* on @a url if @a url is already under versioned control, or the nearest
parents
* of @a path which are already under version control if not.
*
- * If @a ignore_unknown_node_types is @c FALSE, ignore files of which the
+ * If @a ignore_unknown_node_types is @c TRUE, ignore files of which the
* node type is unknown, such as device files and pipes.
*
* If @a filter_callback is non-NULL, call it for each node that isn't ignored
Modified: subversion/branches/addremove/subversion/include/svn_dav.h
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_dav.h?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/include/svn_dav.h (original)
+++ subversion/branches/addremove/subversion/include/svn_dav.h Tue Aug 22
14:19:36 2017
@@ -404,6 +404,15 @@ extern "C" {
#define SVN_DAV_NS_DAV_SVN_SVNDIFF2\
SVN_DAV_PROP_NS_DAV "svn/svndiff2"
+/** Presence of this in a DAV header in an OPTIONS response indicates
+ * that the transmitter (in this case, the server) sends the result
+ * checksum in the response to a successful PUT request.
+ *
+ * @since New in 1.10.
+ */
+#define SVN_DAV_NS_DAV_SVN_PUT_RESULT_CHECKSUM\
+ SVN_DAV_PROP_NS_DAV "svn/put-result-checksum"
+
/** @} */
/** @} */
Modified: subversion/branches/addremove/subversion/include/svn_delta.h
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_delta.h?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/include/svn_delta.h (original)
+++ subversion/branches/addremove/subversion/include/svn_delta.h Tue Aug 22
14:19:36 2017
@@ -330,6 +330,18 @@ typedef svn_error_t *
typedef const unsigned char *
(*svn_txdelta_md5_digest_fn_t)(void *baton);
+/** A typedef for a function that opens an #svn_txdelta_stream_t object,
+ * allocated in @a result_pool. @a baton is provided by the caller.
+ * Any temporary allocations may be performed in @a scratch_pool.
+ *
+ * @since New in 1.10.
+ */
+typedef svn_error_t *
+(*svn_txdelta_stream_open_func_t)(svn_txdelta_stream_t **txdelta_stream,
+ void *baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
/** Create and return a generic text delta stream with @a baton, @a
* next_window and @a md5_digest. Allocate the new stream in @a
* pool.
@@ -546,6 +558,20 @@ svn_txdelta_to_svndiff(svn_stream_t *out
svn_txdelta_window_handler_t *handler,
void **handler_baton);
+/** Return a readable generic stream which will produce svndiff-encoded
+ * text delta from the delta stream @a txstream. @a svndiff_version and
+ * @a compression_level are same as in svn_txdelta_to_svndiff3().
+ *
+ * Allocate the stream in @a pool.
+ *
+ * @since New in 1.10.
+ */
+svn_stream_t *
+svn_txdelta_to_svndiff_stream(svn_txdelta_stream_t *txstream,
+ int svndiff_version,
+ int compression_level,
+ apr_pool_t *pool);
+
/** Return a writable generic stream which will parse svndiff-format
* data into a text delta, invoking @a handler with @a handler_baton
* whenever a new window is ready.
@@ -1117,6 +1143,35 @@ typedef struct svn_delta_editor_t
svn_error_t *(*abort_edit)(void *edit_baton,
apr_pool_t *scratch_pool);
+ /** Apply a text delta stream, yielding the new revision of a file.
+ *
+ * @a file_baton indicates the file we're creating or updating, and the
+ * ancestor file on which it is based; it is the baton set by some
+ * prior @c add_file or @c open_file callback.
+ *
+ * @a open_func is a function that opens a #svn_txdelta_stream_t object.
+ * @a open_baton is provided by the caller.
+ *
+ * @a base_checksum is the hex MD5 digest for the base text against
+ * which the delta is being applied; it is ignored if NULL, and may
+ * be ignored even if not NULL. If it is not ignored, it must match
+ * the checksum of the base text against which svndiff data is being
+ * applied; if it does not, @c apply_textdelta_stream call which detects
+ * the mismatch will return the error SVN_ERR_CHECKSUM_MISMATCH
+ * (if there is no base text, there may still be an error if
+ * @a base_checksum is neither NULL nor the hex MD5 checksum of the
+ * empty string).
+ *
+ * Any temporary allocations may be performed in @a scratch_pool.
+ */
+ svn_error_t *(*apply_textdelta_stream)(
+ const struct svn_delta_editor_t *editor,
+ void *file_baton,
+ const char *base_checksum,
+ svn_txdelta_stream_open_func_t open_func,
+ void *open_baton,
+ apr_pool_t *scratch_pool);
+
/* Be sure to update svn_delta_get_cancellation_editor() and
* svn_delta_default_editor() if you add a new callback here. */
} svn_delta_editor_t;
Modified: subversion/branches/addremove/subversion/include/svn_error_codes.h
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_error_codes.h?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/include/svn_error_codes.h
(original)
+++ subversion/branches/addremove/subversion/include/svn_error_codes.h Tue Aug
22 14:19:36 2017
@@ -1667,6 +1667,11 @@ SVN_ERROR_START
SVN_ERR_RA_SERF_CATEGORY_START + 3,
"While handling serf response:")
+ /** @since New in 1.10. */
+ SVN_ERRDEF(SVN_ERR_RA_SERF_STREAM_BUCKET_READ_ERROR,
+ SVN_ERR_RA_SERF_CATEGORY_START + 4,
+ "Can't read from stream")
+
/* malfunctions such as assertion failures */
SVN_ERRDEF(SVN_ERR_ASSERTION_FAIL,
Modified: subversion/branches/addremove/subversion/include/svn_io.h
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_io.h?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/include/svn_io.h (original)
+++ subversion/branches/addremove/subversion/include/svn_io.h Tue Aug 22
14:19:36 2017
@@ -1248,7 +1248,8 @@ svn_stream_compressed(svn_stream_t *stre
* The @a stream passed into this function is closed when the created
* stream is closed.
*
- * @since New in 1.6.
+ * @since New in 1.6. Since 1.10, the resulting stream supports reset
+ * via stream_stream_reset().
*/
svn_stream_t *
svn_stream_checksummed2(svn_stream_t *stream,
@@ -1384,6 +1385,14 @@ svn_stream_reset(svn_stream_t *stream);
svn_boolean_t
svn_stream_supports_mark(svn_stream_t *stream);
+/** Returns @c TRUE if the generic @a stream supports svn_stream_reset().
+ *
+ * @see svn_stream_reset()
+ * @since New in 1.10.
+ */
+svn_boolean_t
+svn_stream_supports_reset(svn_stream_t *stream);
+
/** Set a @a mark at the current position of a generic @a stream,
* which can later be sought back to using svn_stream_seek().
* The @a mark is allocated in @a pool.
Modified: subversion/branches/addremove/subversion/include/svn_ra_svn.h
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/include/svn_ra_svn.h?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/include/svn_ra_svn.h (original)
+++ subversion/branches/addremove/subversion/include/svn_ra_svn.h Tue Aug 22
14:19:36 2017
@@ -49,6 +49,7 @@ extern "C" {
/** Currently-defined capabilities. */
#define SVN_RA_SVN_CAP_EDIT_PIPELINE "edit-pipeline"
#define SVN_RA_SVN_CAP_SVNDIFF1 "svndiff1"
+#define SVN_RA_SVN_CAP_SVNDIFF2_ACCEPTED "accepts-svndiff2"
#define SVN_RA_SVN_CAP_ABSENT_ENTRIES "absent-entries"
/* maps to SVN_RA_CAPABILITY_COMMIT_REVPROPS: */
#define SVN_RA_SVN_CAP_COMMIT_REVPROPS "commit-revprops"
Modified: subversion/branches/addremove/subversion/libsvn_client/conflicts.c
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_client/conflicts.c?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/libsvn_client/conflicts.c
(original)
+++ subversion/branches/addremove/subversion/libsvn_client/conflicts.c Tue Aug
22 14:19:36 2017
@@ -2072,6 +2072,7 @@ conflict_tree_get_details_local_missing(
const char *old_repos_relpath;
const char *new_repos_relpath;
const char *parent_repos_relpath;
+ svn_revnum_t parent_peg_rev;
svn_revnum_t old_rev;
svn_revnum_t new_rev;
svn_revnum_t deleted_rev;
@@ -2094,7 +2095,7 @@ conflict_tree_get_details_local_missing(
* deleted the node. */
deleted_basename = svn_dirent_basename(conflict->local_abspath,
scratch_pool);
- SVN_ERR(svn_wc__node_get_repos_info(NULL, &parent_repos_relpath,
+ SVN_ERR(svn_wc__node_get_repos_info(&parent_peg_rev, &parent_repos_relpath,
NULL, NULL,
ctx->wc_ctx,
svn_dirent_dirname(
@@ -2122,8 +2123,7 @@ conflict_tree_get_details_local_missing(
SVN_ERR(find_revision_for_suspected_deletion(
&deleted_rev, &deleted_rev_author, &replacing_node_kind, &moves,
conflict, deleted_basename, parent_repos_relpath,
- old_rev < new_rev ? new_rev : old_rev, 0,
- related_repos_relpath, related_peg_rev,
+ parent_peg_rev, 0, related_repos_relpath, related_peg_rev,
ctx, conflict->pool, scratch_pool));
if (deleted_rev == SVN_INVALID_REVNUM)
@@ -4158,6 +4158,7 @@ conflict_tree_get_details_incoming_delet
if (old_rev < new_rev)
{
const char *parent_repos_relpath;
+ svn_revnum_t parent_peg_rev;
svn_revnum_t deleted_rev;
const char *deleted_rev_author;
svn_node_kind_t replacing_node_kind;
@@ -4166,7 +4167,8 @@ conflict_tree_get_details_incoming_delet
svn_revnum_t related_peg_rev;
/* The update operation went forward in history. */
- SVN_ERR(svn_wc__node_get_repos_info(NULL, &parent_repos_relpath,
+ SVN_ERR(svn_wc__node_get_repos_info(&parent_peg_rev,
+ &parent_repos_relpath,
NULL, NULL,
ctx->wc_ctx,
svn_dirent_dirname(
@@ -4194,8 +4196,8 @@ conflict_tree_get_details_incoming_delet
&deleted_rev, &deleted_rev_author, &replacing_node_kind,
&moves, conflict,
svn_dirent_basename(conflict->local_abspath, scratch_pool),
- parent_repos_relpath,
- new_rev, new_kind == svn_node_none ? 0 : old_rev,
+ parent_repos_relpath, parent_peg_rev,
+ new_kind == svn_node_none ? 0 : old_rev,
related_repos_relpath, related_peg_rev,
ctx, conflict->pool, scratch_pool));
if (deleted_rev == SVN_INVALID_REVNUM)
@@ -5917,58 +5919,6 @@ filter_props(apr_hash_t *props, apr_pool
}
}
-/* Get KEYWORDS for LOCAL_ABSPATH.
- * WC_CTX is a context for the working copy the patch is applied to.
- * Use RESULT_POOL for allocations of fields in TARGET.
- * Use SCRATCH_POOL for all other allocations. */
-static svn_error_t *
-get_keywords(apr_hash_t **keywords,
- svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- apr_hash_t *props;
- svn_string_t *keywords_val;
-
- *keywords = NULL;
- SVN_ERR(svn_wc_prop_list2(&props, wc_ctx, local_abspath,
- scratch_pool, scratch_pool));
- keywords_val = svn_hash_gets(props, SVN_PROP_KEYWORDS);
- if (keywords_val)
- {
- svn_revnum_t changed_rev;
- apr_time_t changed_date;
- const char *rev_str;
- const char *author;
- const char *url;
- const char *repos_root_url;
- const char *repos_relpath;
-
- SVN_ERR(svn_wc__node_get_changed_info(&changed_rev,
- &changed_date,
- &author, wc_ctx,
- local_abspath,
- scratch_pool,
- scratch_pool));
- rev_str = apr_psprintf(scratch_pool, "%ld", changed_rev);
- SVN_ERR(svn_wc__node_get_repos_info(NULL, &repos_relpath,
&repos_root_url,
- NULL,
- wc_ctx, local_abspath,
- scratch_pool, scratch_pool));
- url = svn_path_url_add_component2(repos_root_url, repos_relpath,
- scratch_pool);
-
- SVN_ERR(svn_subst_build_keywords3(keywords,
- keywords_val->data,
- rev_str, url, repos_root_url,
- changed_date,
- author, result_pool));
- }
-
- return SVN_NO_ERROR;
-}
-
/* Implements conflict_option_resolve_func_t. */
static svn_error_t *
resolve_merge_incoming_added_file_text_update(
@@ -5986,11 +5936,9 @@ resolve_merge_incoming_added_file_text_u
const char *working_file_tmp_abspath;
svn_stream_t *working_file_stream;
svn_stream_t *working_file_tmp_stream;
- svn_stream_t *normalized_stream;
apr_hash_t *working_props;
apr_array_header_t *propdiffs;
svn_error_t *err;
- apr_hash_t *keywords;
local_abspath = svn_client_conflict_get_local_abspath(conflict);
@@ -6003,16 +5951,12 @@ resolve_merge_incoming_added_file_text_u
svn_io_file_del_none,
scratch_pool, scratch_pool));
- /* Copy the working file to temporary storage. */
- SVN_ERR(svn_stream_open_readonly(&working_file_stream, local_abspath,
- scratch_pool, scratch_pool));
- SVN_ERR(get_keywords(&keywords, ctx->wc_ctx, local_abspath,
- scratch_pool, scratch_pool));
- normalized_stream = svn_subst_stream_translated(working_file_stream,
- "\n", TRUE,
- keywords, FALSE,
- scratch_pool);
- SVN_ERR(svn_stream_copy3(normalized_stream, working_file_tmp_stream,
+ /* Copy the detranslated working file to temporary storage. */
+ SVN_ERR(svn_wc__translated_stream(&working_file_stream, ctx->wc_ctx,
+ local_abspath, local_abspath,
+ SVN_WC_TRANSLATE_TO_NF,
+ scratch_pool, scratch_pool));
+ SVN_ERR(svn_stream_copy3(working_file_stream, working_file_tmp_stream,
ctx->cancel_func, ctx->cancel_baton,
scratch_pool));
@@ -6254,10 +6198,8 @@ resolve_merge_incoming_added_file_replac
const char *wc_tmpdir;
svn_stream_t *working_file_tmp_stream;
const char *working_file_tmp_abspath;
- svn_stream_t *normalized_stream;
svn_stream_t *working_file_stream;
apr_hash_t *working_props;
- apr_hash_t *keywords;
svn_error_t *err;
svn_wc_merge_outcome_t merge_content_outcome;
svn_wc_notify_state_t merge_props_outcome;
@@ -6275,16 +6217,12 @@ resolve_merge_incoming_added_file_replac
svn_io_file_del_on_pool_cleanup,
scratch_pool, scratch_pool));
- /* Copy the working file to temporary storage. */
- SVN_ERR(svn_stream_open_readonly(&working_file_stream, local_abspath,
- scratch_pool, scratch_pool));
- SVN_ERR(get_keywords(&keywords, ctx->wc_ctx, local_abspath,
- scratch_pool, scratch_pool));
- normalized_stream = svn_subst_stream_translated(working_file_stream,
- "\n", TRUE,
- keywords, FALSE,
- scratch_pool);
- SVN_ERR(svn_stream_copy3(normalized_stream, working_file_tmp_stream,
+ /* Copy the detranslated working file to temporary storage. */
+ SVN_ERR(svn_wc__translated_stream(&working_file_stream, ctx->wc_ctx,
+ local_abspath, local_abspath,
+ SVN_WC_TRANSLATE_TO_NF,
+ scratch_pool, scratch_pool));
+ SVN_ERR(svn_stream_copy3(working_file_stream, working_file_tmp_stream,
ctx->cancel_func, ctx->cancel_baton,
scratch_pool));
@@ -7746,8 +7684,6 @@ resolve_incoming_move_file_text_merge(sv
{
svn_stream_t *working_stream;
svn_stream_t *incoming_stream;
- svn_stream_t *normalized_stream;
- apr_hash_t *keywords;
/* Create a temporary copy of the working file in repository-normal form.
* Set up this temporary file to be automatically removed. */
@@ -7758,21 +7694,14 @@ resolve_incoming_move_file_text_merge(sv
if (err)
goto unlock_wc;
- err = svn_stream_open_readonly(&working_stream, local_abspath,
- scratch_pool, scratch_pool);
+ err = svn_wc__translated_stream(&working_stream, ctx->wc_ctx,
+ local_abspath, local_abspath,
+ SVN_WC_TRANSLATE_TO_NF,
+ scratch_pool, scratch_pool);
if (err)
goto unlock_wc;
- err = get_keywords(&keywords, ctx->wc_ctx, local_abspath,
- scratch_pool, scratch_pool);
- if (err)
- goto unlock_wc;
-
- normalized_stream = svn_subst_stream_translated(working_stream,
- "\n", TRUE,
- keywords, FALSE,
- scratch_pool);
- err = svn_stream_copy3(normalized_stream, incoming_stream,
+ err = svn_stream_copy3(working_stream, incoming_stream,
NULL, NULL, /* no cancellation */
scratch_pool);
if (err)
@@ -7782,8 +7711,6 @@ resolve_incoming_move_file_text_merge(sv
{
svn_stream_t *incoming_stream;
svn_stream_t *move_target_stream;
- svn_stream_t *normalized_stream;
- apr_hash_t *keywords;
/* Set aside the current move target file. This is required to apply
* the move, and only then perform a three-way text merge between
@@ -7798,21 +7725,14 @@ resolve_incoming_move_file_text_merge(sv
if (err)
goto unlock_wc;
- err = svn_stream_open_readonly(&move_target_stream, moved_to_abspath,
- scratch_pool, scratch_pool);
- if (err)
- goto unlock_wc;
-
- err = get_keywords(&keywords, ctx->wc_ctx, moved_to_abspath,
- scratch_pool, scratch_pool);
+ err = svn_wc__translated_stream(&move_target_stream, ctx->wc_ctx,
+ moved_to_abspath, moved_to_abspath,
+ SVN_WC_TRANSLATE_TO_NF,
+ scratch_pool, scratch_pool);
if (err)
goto unlock_wc;
- normalized_stream = svn_subst_stream_translated(move_target_stream,
- "\n", TRUE,
- keywords, FALSE,
- scratch_pool);
- err = svn_stream_copy3(normalized_stream, incoming_stream,
+ err = svn_stream_copy3(move_target_stream, incoming_stream,
NULL, NULL, /* no cancellation */
scratch_pool);
if (err)
Modified: subversion/branches/addremove/subversion/libsvn_client/import.c
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_client/import.c?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/libsvn_client/import.c (original)
+++ subversion/branches/addremove/subversion/libsvn_client/import.c Tue Aug 22
14:19:36 2017
@@ -73,32 +73,59 @@ typedef struct import_ctx_t
apr_hash_t *autoprops;
} import_ctx_t;
+typedef struct open_txdelta_stream_baton_t
+{
+ svn_boolean_t need_reset;
+ svn_stream_t *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 the base
+ * stream. */
+ SVN_ERR(svn_stream_reset(b->stream));
+ }
+
+ /* Get the delta stream (delta against the empty string). */
+ svn_txdelta2(txdelta_stream_p, svn_stream_empty(result_pool),
+ b->stream, FALSE, result_pool);
+ b->need_reset = TRUE;
+ return SVN_NO_ERROR;
+}
/* Apply LOCAL_ABSPATH's contents (as a delta against the empty string) to
FILE_BATON in EDITOR. Use POOL for any temporary allocation.
PROPERTIES is the set of node properties set on this file.
- Fill DIGEST with the md5 checksum of the sent file; DIGEST must be
- at least APR_MD5_DIGESTSIZE bytes long. */
+ Return the resulting checksum in *RESULT_MD5_CHECKSUM_P. */
/* ### how does this compare against svn_wc_transmit_text_deltas2() ??? */
static svn_error_t *
-send_file_contents(const char *local_abspath,
+send_file_contents(svn_checksum_t **result_md5_checksum_p,
+ const char *local_abspath,
void *file_baton,
const svn_delta_editor_t *editor,
apr_hash_t *properties,
- unsigned char *digest,
apr_pool_t *pool)
{
svn_stream_t *contents;
- svn_txdelta_window_handler_t handler;
- void *handler_baton;
const svn_string_t *eol_style_val = NULL, *keywords_val = NULL;
svn_boolean_t special = FALSE;
svn_subst_eol_style_t eol_style;
const char *eol;
apr_hash_t *keywords;
+ open_txdelta_stream_baton_t baton = { 0 };
/* If there are properties, look for EOL-style and keywords ones. */
if (properties)
@@ -111,10 +138,6 @@ send_file_contents(const char *local_abs
special = TRUE;
}
- /* Get an editor func that wants to consume the delta stream. */
- SVN_ERR(editor->apply_textdelta(file_baton, NULL, pool,
- &handler, &handler_baton));
-
if (eol_style_val)
svn_subst_eol_style_from_value(&eol_style, &eol, eol_style_val->data);
else
@@ -168,10 +191,17 @@ send_file_contents(const char *local_abs
}
}
- /* Send the file's contents to the delta-window handler. */
- return svn_error_trace(svn_txdelta_send_stream(contents, handler,
- handler_baton, digest,
- pool));
+ /* Arrange the stream to calculate the resulting MD5. */
+ contents = svn_stream_checksummed2(contents, result_md5_checksum_p, NULL,
+ svn_checksum_md5, TRUE, pool);
+ /* Send the contents. */
+ baton.need_reset = FALSE;
+ baton.stream = svn_stream_disown(contents, pool);
+ SVN_ERR(editor->apply_textdelta_stream(editor, file_baton, NULL,
+ open_txdelta_stream, &baton, pool));
+ SVN_ERR(svn_stream_close(contents));
+
+ return SVN_NO_ERROR;
}
@@ -198,7 +228,7 @@ import_file(const svn_delta_editor_t *ed
{
void *file_baton;
const char *mimetype = NULL;
- unsigned char digest[APR_MD5_DIGESTSIZE];
+ svn_checksum_t *result_md5_checksum;
const char *text_checksum;
apr_hash_t* properties;
apr_hash_index_t *hi;
@@ -262,13 +292,11 @@ import_file(const svn_delta_editor_t *ed
}
/* Now, transmit the file contents. */
- SVN_ERR(send_file_contents(local_abspath, file_baton, editor,
- properties, digest, pool));
+ SVN_ERR(send_file_contents(&result_md5_checksum, local_abspath,
+ file_baton, editor, properties, pool));
/* Finally, close the file. */
- text_checksum =
- svn_checksum_to_cstring(svn_checksum__from_digest_md5(digest, pool), pool);
-
+ text_checksum = svn_checksum_to_cstring(result_md5_checksum, pool);
return svn_error_trace(editor->close_file(file_baton, text_checksum, pool));
}
@@ -577,26 +605,26 @@ import_dir(const svn_delta_editor_t *edi
}
-/* Recursively import PATH to a repository using EDITOR and
- * EDIT_BATON. PATH can be a file or directory.
+/* Recursively import LOCAL_ABSPATH to a repository using EDITOR and
+ * EDIT_BATON. LOCAL_ABSPATH can be a file or directory.
*
* Sets *UPDATED_REPOSITORY to TRUE when the repository was modified by
* a successfull commit, otherwise to FALSE.
*
- * DEPTH is the depth at which to import PATH; it behaves as for
- * svn_client_import4().
+ * DEPTH is the depth at which to import LOCAL_ABSPATH; it behaves as for
+ * svn_client_import5().
*
* BASE_REV is the revision to use for the root of the commit. We
* checked the preconditions against this revision.
*
* NEW_ENTRIES is an ordered array of path components that must be
* created in the repository (where the ordering direction is
- * parent-to-child). If PATH is a directory, NEW_ENTRIES may be empty
+ * parent-to-child). If LOCAL_ABSPATH is a directory, NEW_ENTRIES may be empty
* -- the result is an import which creates as many new entries in the
* top repository target directory as there are importable entries in
- * the top of PATH; but if NEW_ENTRIES is not empty, its last item is
+ * the top of LOCAL_ABSPATH; but if NEW_ENTRIES is not empty, its last item is
* the name of a new subdirectory in the repository to hold the
- * import. If PATH is a file, NEW_ENTRIES may not be empty, and its
+ * import. If LOCAL_ABSPATH is a file, NEW_ENTRIES may not be empty, and its
* last item is the name used for the file in the repository. If
* NEW_ENTRIES contains more than one item, all but the last item are
* the names of intermediate directories that are created before the
@@ -624,6 +652,8 @@ import_dir(const svn_delta_editor_t *edi
* If CTX->NOTIFY_FUNC is non-null, invoke it with CTX->NOTIFY_BATON for
* each imported path, passing actions svn_wc_notify_commit_added.
*
+ * URL is used only in the 'commit_finalizing' notification.
+ *
* Use POOL for any temporary allocation.
*
* Note: the repository directory receiving the import was specified
Modified: subversion/branches/addremove/subversion/libsvn_client/merge.c
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_client/merge.c?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/addremove/subversion/libsvn_client/merge.c Tue Aug 22
14:19:36 2017
@@ -2240,13 +2240,9 @@ merge_file_added(const char *relpath,
Otherwise, we'll use a pure add. */
if (merge_b->same_repos)
{
- const char *child =
- svn_dirent_skip_ancestor(merge_b->target->abspath,
- local_abspath);
- SVN_ERR_ASSERT(child != NULL);
copyfrom_url = svn_path_url_add_component2(
merge_b->merge_source.loc2->url,
- child, scratch_pool);
+ relpath, scratch_pool);
copyfrom_rev = right_source->revision;
SVN_ERR(check_repos_match(merge_b->target, local_abspath,
copyfrom_url, scratch_pool));
Modified: subversion/branches/addremove/subversion/libsvn_delta/cancel.c
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_delta/cancel.c?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/libsvn_delta/cancel.c (original)
+++ subversion/branches/addremove/subversion/libsvn_delta/cancel.c Tue Aug 22
14:19:36 2017
@@ -222,6 +222,26 @@ apply_textdelta(void *file_baton,
}
static svn_error_t *
+apply_textdelta_stream(const svn_delta_editor_t *editor,
+ void *file_baton,
+ const char *base_checksum,
+ svn_txdelta_stream_open_func_t open_func,
+ void *open_baton,
+ apr_pool_t *scratch_pool)
+{
+ struct file_baton *fb = file_baton;
+ struct edit_baton *eb = fb->edit_baton;
+
+ SVN_ERR(eb->cancel_func(eb->cancel_baton));
+
+ return eb->wrapped_editor->apply_textdelta_stream(eb->wrapped_editor,
+ fb->wrapped_file_baton,
+ base_checksum,
+ open_func, open_baton,
+ scratch_pool);
+}
+
+static svn_error_t *
close_file(void *file_baton,
const char *text_checksum,
apr_pool_t *pool)
@@ -354,6 +374,7 @@ svn_delta_get_cancellation_editor(svn_ca
tree_editor->add_file = add_file;
tree_editor->open_file = open_file;
tree_editor->apply_textdelta = apply_textdelta;
+ tree_editor->apply_textdelta_stream = apply_textdelta_stream;
tree_editor->change_file_prop = change_file_prop;
tree_editor->close_file = close_file;
tree_editor->absent_file = absent_file;
Modified: subversion/branches/addremove/subversion/libsvn_delta/default_editor.c
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_delta/default_editor.c?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/libsvn_delta/default_editor.c
(original)
+++ subversion/branches/addremove/subversion/libsvn_delta/default_editor.c Tue
Aug 22 14:19:36 2017
@@ -133,6 +133,33 @@ close_file(void *file_baton,
}
+static svn_error_t *
+apply_textdelta_stream(const svn_delta_editor_t *editor,
+ void *file_baton,
+ const char *base_checksum,
+ svn_txdelta_stream_open_func_t open_func,
+ void *open_baton,
+ apr_pool_t *scratch_pool)
+{
+ svn_txdelta_window_handler_t handler;
+ void *handler_baton;
+
+ SVN_ERR(editor->apply_textdelta(file_baton, base_checksum,
+ scratch_pool, &handler,
+ &handler_baton));
+ if (handler != svn_delta_noop_window_handler)
+ {
+ svn_txdelta_stream_t *txdelta_stream;
+
+ SVN_ERR(open_func(&txdelta_stream, open_baton, scratch_pool,
+ scratch_pool));
+ SVN_ERR(svn_txdelta_send_txstream(txdelta_stream, handler,
+ handler_baton, scratch_pool));
+ }
+
+ return SVN_NO_ERROR;
+}
+
static const svn_delta_editor_t default_editor =
{
@@ -151,7 +178,8 @@ static const svn_delta_editor_t default_
close_file,
absent_xxx_func,
single_baton_func,
- single_baton_func
+ single_baton_func,
+ apply_textdelta_stream
};
svn_delta_editor_t *
Modified: subversion/branches/addremove/subversion/libsvn_delta/svndiff.c
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_delta/svndiff.c?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/libsvn_delta/svndiff.c (original)
+++ subversion/branches/addremove/subversion/libsvn_delta/svndiff.c Tue Aug 22
14:19:36 2017
@@ -245,6 +245,8 @@ encode_window(svn_stringbuf_t **instruct
return SVN_NO_ERROR;
}
+/* Note: When changing things here, check the related comment in
+ the svn_txdelta_to_svndiff_stream() function. */
static svn_error_t *
window_handler(svn_txdelta_window_t *window, void *baton)
{
@@ -993,3 +995,104 @@ svn_txdelta__read_raw_window_len(apr_siz
return SVN_NO_ERROR;
}
+typedef struct svndiff_stream_baton_t
+{
+ apr_pool_t *scratch_pool;
+ svn_txdelta_stream_t *txstream;
+ svn_txdelta_window_handler_t handler;
+ void *handler_baton;
+ svn_stringbuf_t *window_buffer;
+ apr_size_t read_pos;
+ svn_boolean_t hit_eof;
+} svndiff_stream_baton_t;
+
+static svn_error_t *
+svndiff_stream_write_fn(void *baton, const char *data, apr_size_t *len)
+{
+ svndiff_stream_baton_t *b = baton;
+
+ /* The memory usage here is limited, as this buffer doesn't grow
+ beyond the (header size + max window size in svndiff format).
+ See the comment in svn_txdelta_to_svndiff_stream(). */
+ svn_stringbuf_appendbytes(b->window_buffer, data, *len);
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+svndiff_stream_read_fn(void *baton, char *buffer, apr_size_t *len)
+{
+ svndiff_stream_baton_t *b = baton;
+ apr_size_t left = *len;
+ apr_size_t read = 0;
+
+ while (left && !b->hit_eof)
+ {
+ apr_size_t chunk_size;
+
+ if (b->read_pos == b->window_buffer->len)
+ {
+ svn_txdelta_window_t *window;
+
+ svn_pool_clear(b->scratch_pool);
+ svn_stringbuf_setempty(b->window_buffer);
+ SVN_ERR(svn_txdelta_next_window(&window, b->txstream,
+ b->scratch_pool));
+ SVN_ERR(b->handler(window, b->handler_baton));
+ b->read_pos = 0;
+
+ if (!window)
+ b->hit_eof = TRUE;
+ }
+
+ if (left > b->window_buffer->len - b->read_pos)
+ chunk_size = b->window_buffer->len - b->read_pos;
+ else
+ chunk_size = left;
+
+ memcpy(buffer, b->window_buffer->data + b->read_pos, chunk_size);
+ b->read_pos += chunk_size;
+ buffer += chunk_size;
+ read += chunk_size;
+ left -= chunk_size;
+ }
+
+ *len = read;
+ return SVN_NO_ERROR;
+}
+
+svn_stream_t *
+svn_txdelta_to_svndiff_stream(svn_txdelta_stream_t *txstream,
+ int svndiff_version,
+ int compression_level,
+ apr_pool_t *pool)
+{
+ svndiff_stream_baton_t *baton;
+ svn_stream_t *push_stream;
+ svn_stream_t *pull_stream;
+
+ baton = apr_pcalloc(pool, sizeof(*baton));
+ baton->scratch_pool = svn_pool_create(pool);
+ baton->txstream = txstream;
+ baton->window_buffer = svn_stringbuf_create_empty(pool);
+ baton->hit_eof = FALSE;
+ baton->read_pos = 0;
+
+ push_stream = svn_stream_create(baton, pool);
+ svn_stream_set_write(push_stream, svndiff_stream_write_fn);
+
+ /* We rely on the implementation detail of the svn_txdelta_to_svndiff3()
+ function, namely, on how the window_handler() function behaves.
+ As long as it writes one svndiff window at a time to the target
+ stream, the memory usage of this function (in other words, how
+ much data can be accumulated in the internal 'window_buffer')
+ is limited. */
+ svn_txdelta_to_svndiff3(&baton->handler, &baton->handler_baton,
+ push_stream, svndiff_version,
+ compression_level, pool);
+
+ pull_stream = svn_stream_create(baton, pool);
+ svn_stream_set_read2(pull_stream, NULL, svndiff_stream_read_fn);
+
+ return pull_stream;
+}
Modified: subversion/branches/addremove/subversion/libsvn_delta/text_delta.c
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_delta/text_delta.c?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/libsvn_delta/text_delta.c
(original)
+++ subversion/branches/addremove/subversion/libsvn_delta/text_delta.c Tue Aug
22 14:19:36 2017
@@ -102,7 +102,7 @@ struct apply_baton {
char *tbuf; /* Target buffer */
apr_size_t tbuf_size; /* Allocated target buffer space */
- apr_md5_ctx_t md5_context; /* Leads to result_digest below. */
+ svn_checksum_ctx_t *md5_context; /* Leads to result_digest below. */
unsigned char *result_digest; /* MD5 digest of resultant fulltext;
must point to at least APR_MD5_DIGESTSIZE
bytes of storage. */
@@ -720,15 +720,23 @@ apply_window(svn_txdelta_window_t *windo
{
struct apply_baton *ab = (struct apply_baton *) baton;
apr_size_t len;
- svn_error_t *err;
if (window == NULL)
{
+ svn_error_t *err = SVN_NO_ERROR;
+
/* We're done; just clean up. */
if (ab->result_digest)
- apr_md5_final(ab->result_digest, &(ab->md5_context));
+ {
+ svn_checksum_t *md5_checksum;
+
+ err = svn_checksum_final(&md5_checksum, ab->md5_context, ab->pool);
+ if (!err)
+ memcpy(ab->result_digest, md5_checksum->digest,
+ svn_checksum_size(md5_checksum));
+ }
- err = svn_stream_close(ab->target);
+ err = svn_error_compose_create(err, svn_stream_close(ab->target));
svn_pool_destroy(ab->pool);
return err;
@@ -772,12 +780,10 @@ apply_window(svn_txdelta_window_t *windo
if (ab->sbuf_len < window->sview_len)
{
len = window->sview_len - ab->sbuf_len;
- err = svn_stream_read_full(ab->source, ab->sbuf + ab->sbuf_len, &len);
- if (err == SVN_NO_ERROR && len != window->sview_len - ab->sbuf_len)
- err = svn_error_create(SVN_ERR_INCOMPLETE_DATA, NULL,
- "Delta source ended unexpectedly");
- if (err != SVN_NO_ERROR)
- return err;
+ SVN_ERR(svn_stream_read_full(ab->source, ab->sbuf + ab->sbuf_len, &len));
+ if (len != window->sview_len - ab->sbuf_len)
+ return svn_error_create(SVN_ERR_INCOMPLETE_DATA, NULL,
+ "Delta source ended unexpectedly");
ab->sbuf_len = window->sview_len;
}
@@ -791,7 +797,7 @@ apply_window(svn_txdelta_window_t *windo
/* Just update the context here. */
if (ab->result_digest)
- apr_md5_update(&(ab->md5_context), ab->tbuf, len);
+ SVN_ERR(svn_checksum_update(ab->md5_context, ab->tbuf, len));
return svn_stream_write(ab->target, ab->tbuf, &len);
}
@@ -822,7 +828,7 @@ svn_txdelta_apply(svn_stream_t *source,
ab->result_digest = result_digest;
if (result_digest)
- apr_md5_init(&(ab->md5_context));
+ ab->md5_context = svn_checksum_ctx_create(svn_checksum_md5, subpool);
if (error_info)
ab->error_info = apr_pstrdup(subpool, error_info);
Modified: subversion/branches/addremove/subversion/libsvn_fs_base/fs.c
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_fs_base/fs.c?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/libsvn_fs_base/fs.c (original)
+++ subversion/branches/addremove/subversion/libsvn_fs_base/fs.c Tue Aug 22
14:19:36 2017
@@ -957,6 +957,7 @@ base_upgrade(svn_fs_t *fs,
err = SVN_NO_ERROR;
}
SVN_ERR(err);
+ SVN_ERR(check_format(old_format_number));
/* Bump the format file's stored version number. */
SVN_ERR(svn_io_write_version_file(version_file_path,
Modified: subversion/branches/addremove/subversion/libsvn_fs_fs/fs.h
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_fs_fs/fs.h?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/branches/addremove/subversion/libsvn_fs_fs/fs.h Tue Aug 22
14:19:36 2017
@@ -118,6 +118,7 @@ extern "C" {
#define CONFIG_SECTION_DEBUG "debug"
#define CONFIG_OPTION_PACK_AFTER_COMMIT "pack-after-commit"
#define CONFIG_OPTION_VERIFY_BEFORE_COMMIT "verify-before-commit"
+#define CONFIG_OPTION_COMPRESSION "compression"
/* The format number of this filesystem.
This is independent of the repository format number, and
@@ -162,6 +163,9 @@ extern "C" {
* issues with very old servers, restrict those options to the 1.6+ format*/
#define SVN_FS_FS__MIN_DELTIFICATION_FORMAT 4
+/* The minimum format number that supports a configuration file (fsfs.conf) */
+#define SVN_FS_FS__MIN_CONFIG_FILE 4
+
/* The 1.7-dev format, never released, that packed revprops into SQLite
revprops.db . */
#define SVN_FS_FS__PACKED_REVPROP_SQLITE_DEV_FORMAT 5
@@ -184,9 +188,6 @@ extern "C" {
/* 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
-
/* On most operating systems apr implements file locks per process, not
per file. On Windows apr implements the locking as per file handle
locks, so we don't have to add our own mutex for just in-process
@@ -298,6 +299,13 @@ typedef struct window_cache_key_t
apr_uint64_t item_index;
} window_cache_key_t;
+typedef enum compression_type_t
+{
+ compression_type_none,
+ compression_type_zlib,
+ compression_type_lz4
+} compression_type_t;
+
/* Private (non-shared) FSFS-specific data for each svn_fs_t object.
Any caches in here may be NULL. */
typedef struct fs_fs_data_t
@@ -473,7 +481,10 @@ typedef struct fs_fs_data_t
* deltification history after which skip deltas will be used. */
apr_int64_t max_linear_deltification;
- /* Compression level to use with txdelta storage format in new revs. */
+ /* Compression type to use with txdelta storage format in new revs. */
+ compression_type_t delta_compression_type;
+
+ /* Compression level (currently, only used with compression_type_zlib). */
int delta_compression_level;
/* Pack after every commit. */
Modified: subversion/branches/addremove/subversion/libsvn_fs_fs/fs_fs.c
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_fs_fs/fs_fs.c?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/addremove/subversion/libsvn_fs_fs/fs_fs.c Tue Aug 22
14:19:36 2017
@@ -683,6 +683,60 @@ verify_block_size(apr_int64_t block_size
return SVN_NO_ERROR;
}
+static svn_error_t *
+parse_compression_option(compression_type_t *compression_type_p,
+ int *compression_level_p,
+ const char *value)
+{
+ compression_type_t type;
+ int level;
+ svn_boolean_t is_valid = TRUE;
+
+ /* compression = none | lz4 | zlib | zlib-1 ... zlib-9 */
+ if (strcmp(value, "none") == 0)
+ {
+ type = compression_type_none;
+ level = SVN_DELTA_COMPRESSION_LEVEL_NONE;
+ }
+ else if (strcmp(value, "lz4") == 0)
+ {
+ type = compression_type_lz4;
+ level = SVN_DELTA_COMPRESSION_LEVEL_DEFAULT;
+ }
+ else if (strncmp(value, "zlib", 4) == 0)
+ {
+ const char *p = value + 4;
+
+ type = compression_type_zlib;
+ if (*p == 0)
+ {
+ level = SVN_DELTA_COMPRESSION_LEVEL_DEFAULT;
+ }
+ else if (*p == '-')
+ {
+ p++;
+ SVN_ERR(svn_cstring_atoi(&level, p));
+ if (level < 1 || level > 9)
+ is_valid = FALSE;
+ }
+ else
+ is_valid = FALSE;
+ }
+ else
+ {
+ is_valid = FALSE;
+ }
+
+ if (!is_valid)
+ return svn_error_createf(SVN_ERR_BAD_CONFIG_VALUE, NULL,
+ _("Invalid 'compression' value '%s' in the config"),
+ value);
+
+ *compression_type_p = type;
+ *compression_level_p = level;
+ return SVN_NO_ERROR;
+}
+
/* Read the configuration information of the file system at FS_PATH
* and set the respective values in FFD. Use pools as usual.
*/
@@ -709,8 +763,6 @@ read_config(fs_fs_data_t *ffd,
/* Initialize deltification settings in ffd. */
if (ffd->format >= SVN_FS_FS__MIN_DELTIFICATION_FORMAT)
{
- apr_int64_t compression_level;
-
SVN_ERR(svn_config_get_bool(config, &ffd->deltify_directories,
CONFIG_SECTION_DELTIFICATION,
CONFIG_OPTION_ENABLE_DIR_DELTIFICATION,
@@ -727,14 +779,6 @@ read_config(fs_fs_data_t *ffd,
CONFIG_SECTION_DELTIFICATION,
CONFIG_OPTION_MAX_LINEAR_DELTIFICATION,
SVN_FS_FS_MAX_LINEAR_DELTIFICATION));
-
- SVN_ERR(svn_config_get_int64(config, &compression_level,
- CONFIG_SECTION_DELTIFICATION,
- CONFIG_OPTION_COMPRESSION_LEVEL,
- SVN_DELTA_COMPRESSION_LEVEL_DEFAULT));
- ffd->delta_compression_level
- = (int)MIN(MAX(SVN_DELTA_COMPRESSION_LEVEL_NONE, compression_level),
- SVN_DELTA_COMPRESSION_LEVEL_MAX);
}
else
{
@@ -742,7 +786,6 @@ read_config(fs_fs_data_t *ffd,
ffd->deltify_properties = FALSE;
ffd->max_deltification_walk = SVN_FS_FS_MAX_DELTIFICATION_WALK;
ffd->max_linear_deltification = SVN_FS_FS_MAX_LINEAR_DELTIFICATION;
- ffd->delta_compression_level = SVN_DELTA_COMPRESSION_LEVEL_DEFAULT;
}
/* Initialize revprop packing settings in ffd. */
@@ -816,6 +859,67 @@ read_config(fs_fs_data_t *ffd,
{
ffd->pack_after_commit = FALSE;
}
+
+ /* Initialize compression settings in ffd. */
+ if (ffd->format >= SVN_FS_FS__MIN_DELTIFICATION_FORMAT)
+ {
+ const char *compression_val;
+ const char *compression_level_val;
+
+ svn_config_get(config, &compression_val,
+ CONFIG_SECTION_DELTIFICATION,
+ CONFIG_OPTION_COMPRESSION, NULL);
+ svn_config_get(config, &compression_level_val,
+ CONFIG_SECTION_DELTIFICATION,
+ CONFIG_OPTION_COMPRESSION_LEVEL, NULL);
+ if (compression_val && compression_level_val)
+ {
+ return svn_error_create(SVN_ERR_BAD_CONFIG_VALUE, NULL,
+ _("The 'compression' and 'compression-level'
"
+ "config options are mutually exclusive"));
+ }
+ else if (compression_val)
+ {
+ SVN_ERR(parse_compression_option(&ffd->delta_compression_type,
+ &ffd->delta_compression_level,
+ compression_val));
+ if (ffd->delta_compression_type == compression_type_lz4 &&
+ ffd->format < SVN_FS_FS__MIN_SVNDIFF2_FORMAT)
+ {
+ return svn_error_create(SVN_ERR_BAD_CONFIG_VALUE, NULL,
+ _("Compression type 'lz4' requires "
+ "filesystem format 8 or higher"));
+ }
+ }
+ else if (compression_level_val)
+ {
+ /* Handle the deprecated 'compression-level' option. */
+ ffd->delta_compression_type = compression_type_zlib;
+ SVN_ERR(svn_cstring_atoi(&ffd->delta_compression_level,
+ compression_level_val));
+ ffd->delta_compression_level =
+ MIN(MAX(SVN_DELTA_COMPRESSION_LEVEL_NONE,
+ ffd->delta_compression_level),
+ SVN_DELTA_COMPRESSION_LEVEL_MAX);
+ }
+ else
+ {
+ /* Nothing specified explicitly, use default settings. */
+ ffd->delta_compression_type = compression_type_zlib;
+ ffd->delta_compression_level = SVN_DELTA_COMPRESSION_LEVEL_DEFAULT;
+ }
+ }
+ else if (ffd->format >= SVN_FS_FS__MIN_SVNDIFF1_FORMAT)
+ {
+ ffd->delta_compression_type = compression_type_zlib;
+ ffd->delta_compression_level = SVN_DELTA_COMPRESSION_LEVEL_DEFAULT;
+ }
+ else
+ {
+ ffd->delta_compression_type = compression_type_none;
+ ffd->delta_compression_level = SVN_DELTA_COMPRESSION_LEVEL_NONE;
+ }
+
#ifdef SVN_DEBUG
SVN_ERR(svn_config_get_bool(config, &ffd->verify_before_commit,
CONFIG_SECTION_DEBUG,
@@ -947,23 +1051,26 @@ write_config(svn_fs_t *fs,
"# " CONFIG_OPTION_MAX_LINEAR_DELTIFICATION " = 16" NL
"###" 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." 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
+"### This setting controls the compression algorithm, which will be used in" NL
+"### future revisions. It can be used to either disable compression or to" NL
+"### select between available algorithms (zlib, lz4). zlib is a general-" NL
+"### purpose compression algorithm. lz4 is a fast compression algorithm" NL
+"### which should be preferred for repositories with large and, possibly," NL
+"### incompressible files. Note that the compression ratio of lz4 is" NL
+"### usually lower than the one provided by zlib, but using it can" NL
+"### significantly speed up commits as well as reading the data." NL
+"### The syntax of this option is:" NL
+"### " CONFIG_OPTION_COMPRESSION " = none | lz4 | zlib | zlib-1 ... zlib-9"
NL
+"### Versions prior to Subversion 1.10 will ignore this option." NL
+"### The default value is 'zlib', which is currently equivalent to 'zlib-5'."
NL
+"# " CONFIG_OPTION_COMPRESSION " = zlib" NL
+"###" NL
+"### DEPRECATED: The new '" CONFIG_OPTION_COMPRESSION "' option deprecates
previously used" NL
+"### '" CONFIG_OPTION_COMPRESSION_LEVEL "' option, which was used to configure
zlib compression." NL
+"### For compatibility with previous versions of Subversion, this option can"NL
+"### still be used (and it will result in zlib compression with the" NL
+"### corresponding compression level)." NL
+"### " CONFIG_OPTION_COMPRESSION_LEVEL " = 0 ... 9 (default is 5)" NL
"" NL
"[" CONFIG_SECTION_PACKED_REVPROPS "]" NL
"### This parameter controls the size (in kBytes) of packed revprop files." NL
Modified: subversion/branches/addremove/subversion/libsvn_fs_fs/transaction.c
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_fs_fs/transaction.c?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/libsvn_fs_fs/transaction.c
(original)
+++ subversion/branches/addremove/subversion/libsvn_fs_fs/transaction.c Tue Aug
22 14:19:36 2017
@@ -2168,27 +2168,24 @@ txdelta_to_svndiff(svn_txdelta_window_ha
{
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)
+ if (ffd->delta_compression_type == compression_type_lz4)
{
+ SVN_ERR_ASSERT_NO_RETURN(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)
+ else if (ffd->delta_compression_type == compression_type_zlib)
{
+ SVN_ERR_ASSERT_NO_RETURN(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);
+ ffd->delta_compression_level, pool);
}
/* Get a rep_write_baton and store it in *WB_P for the representation
Modified: subversion/branches/addremove/subversion/libsvn_ra_serf/blame.c
URL:
http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/libsvn_ra_serf/blame.c?rev=1805769&r1=1805768&r2=1805769&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/libsvn_ra_serf/blame.c (original)
+++ subversion/branches/addremove/subversion/libsvn_ra_serf/blame.c Tue Aug 22
14:19:36 2017
@@ -81,7 +81,7 @@ typedef struct blame_context_t {
svn_stream_t *stream;
- svn_boolean_t using_compression;
+ svn_ra_serf__session_t *session;
} blame_context_t;
@@ -329,8 +329,7 @@ setup_headers(serf_bucket_t *headers,
{
blame_context_t *blame_ctx = baton;
- svn_ra_serf__setup_svndiff_accept_encoding(headers,
- blame_ctx->using_compression);
+ svn_ra_serf__setup_svndiff_accept_encoding(headers, blame_ctx->session);
return SVN_NO_ERROR;
}
@@ -360,7 +359,7 @@ svn_ra_serf__get_file_revs(svn_ra_sessio
blame_ctx->start = start;
blame_ctx->end = end;
blame_ctx->include_merged_revisions = include_merged_revisions;
- blame_ctx->using_compression = session->using_compression;
+ blame_ctx->session = session;
/* Since Subversion 1.8 we allow retrieving blames backwards. So we can't
just unconditionally use end_rev as the peg revision as before */