You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by iv...@apache.org on 2015/09/11 17:51:34 UTC
svn commit: r1702504 [2/19] - in /subversion/branches/reuse-ra-session: ./
build/ build/ac-macros/ build/generator/ build/generator/templates/
contrib/hook-scripts/ notes/ subversion/bindings/ctypes-python/csvn/ext/
subversion/bindings/javahl/native/ s...
Modified: subversion/branches/reuse-ra-session/build/generator/templates/vcnet_vcxproj_filters.ezt
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/build/generator/templates/vcnet_vcxproj_filters.ezt?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/build/generator/templates/vcnet_vcxproj_filters.ezt (original)
+++ subversion/branches/reuse-ra-session/build/generator/templates/vcnet_vcxproj_filters.ezt Fri Sep 11 15:51:30 2015
@@ -1,4 +1,4 @@
-[define COPYRIGHT]
+[#
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -17,7 +17,7 @@
specific language governing permissions and limitations
under the License.
-->
-[end]<?xml version="1.0" encoding="utf-8"?>
+]<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Header Files">
Modified: subversion/branches/reuse-ra-session/build/run_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/build/run_tests.py?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/build/run_tests.py (original)
+++ subversion/branches/reuse-ra-session/build/run_tests.py Fri Sep 11 15:51:30 2015
@@ -44,22 +44,18 @@ and filename of a test program, optional
separated list of test numbers; the default is to run all the tests in it.
'''
-# A few useful constants
-SVN_VER_MINOR = 10
-
-import os, re, subprocess, sys, imp, threading, traceback, exceptions
+import os, sys
+import re
+import optparse, subprocess, imp, threading, traceback, exceptions
from datetime import datetime
-import getopt
-try:
- my_getopt = getopt.gnu_getopt
-except AttributeError:
- my_getopt = getopt.getopt
-
# Ensure the compiled C tests use a known locale (Python tests set the locale
# explicitly).
os.environ['LC_ALL'] = 'C'
+# Placeholder for the svntest module
+svntest = None
+
class TextColors:
'''Some ANSI terminal constants for output color'''
ENDC = '\033[0;m'
@@ -81,7 +77,8 @@ def _get_term_width():
def ioctl_GWINSZ(fd):
try:
import fcntl, termios, struct, os
- cr = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234'))
+ cr = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ,
+ struct.pack('hh', 0, 0)))
except:
return None
return cr
@@ -120,104 +117,216 @@ class TestHarness:
'''Test harness for Subversion tests.
'''
- def __init__(self, abs_srcdir, abs_builddir, logfile, faillogfile,
- base_url=None, fs_type=None, http_library=None,
- server_minor_version=None, verbose=None,
- cleanup=None, enable_sasl=None, parallel=None, config_file=None,
- fsfs_sharding=None, fsfs_packing=None,
- list_tests=None, svn_bin=None, mode_filter=None,
- milestone_filter=None, set_log_level=None, ssl_cert=None,
- http_proxy=None, http_proxy_username=None,
- http_proxy_password=None, httpd_version=None,
- exclusive_wc_locks=None,
- memcached_server=None, skip_c_tests=None,
- dump_load_cross_check=None):
+ def __init__(self, abs_srcdir, abs_builddir, logfile, faillogfile, opts):
'''Construct a TestHarness instance.
ABS_SRCDIR and ABS_BUILDDIR are the source and build directories.
LOGFILE is the name of the log file. If LOGFILE is None, let tests
print their output to stdout and stderr, and don't print a summary
at the end (since there's no log file to analyze).
- BASE_URL is the base url for DAV tests.
- FS_TYPE is the FS type for repository creation.
- HTTP_LIBRARY is the HTTP library for DAV-based communications.
- SERVER_MINOR_VERSION is the minor version of the server being tested.
- SVN_BIN is the path where the svn binaries are installed.
- MODE_FILTER restricts the TestHarness to tests with the expected mode
- XFail, Skip, Pass, or All tests (default). MILESTONE_FILTER is a
- string representation of a valid regular expression pattern; when used
- in conjunction with LIST_TESTS, the only tests that are listed are
- those with an associated issue in the tracker which has a target
- milestone that matches the regex.
- HTTP_PROXY (hostname:port), HTTP_PROXY_USERNAME and HTTP_PROXY_PASSWORD
- define the params to run the tests over a proxy server.
+ OPTS are the options that will be sent to the tests.
'''
+
+ # Canonicalize the test base URL
+ if opts.url is not None and opts.url[-1] == '/':
+ opts.url = opts.url[:-1]
+
+ # Make the configfile path absolute
+ if opts.config_file is not None:
+ opts.config_file = os.path.abspath(opts.config_file)
+
+ # Parse out the FSFS version number
+ if (opts.fs_type is not None
+ and opts.fs_type.startswith('fsfs-v')):
+ opts.fsfs_version = int(opts.fs_type[6:])
+ opts.fs_type = 'fsfs'
+ else:
+ opts.fsfs_version = None
+
self.srcdir = abs_srcdir
self.builddir = abs_builddir
self.logfile = logfile
self.faillogfile = faillogfile
- self.base_url = base_url
- self.fs_type = fs_type
- self.http_library = http_library
- self.server_minor_version = server_minor_version
- # If you change the below condition then change in
- # ../subversion/tests/cmdline/svntest/main.py too.
- if server_minor_version is not None:
- if int(server_minor_version) not in range(3, 1+SVN_VER_MINOR):
- sys.stderr.write("Test harness only supports server minor versions 3-%d\n"
- % SVN_VER_MINOR)
- sys.exit(1)
- self.verbose = verbose
- self.cleanup = cleanup
- self.enable_sasl = enable_sasl
- self.parallel = parallel
- self.fsfs_sharding = fsfs_sharding
- self.fsfs_packing = fsfs_packing
- if fsfs_packing is not None and fsfs_sharding is None:
- raise Exception('--fsfs-packing requires --fsfs-sharding')
- self.config_file = None
- if config_file is not None:
- self.config_file = os.path.abspath(config_file)
- self.list_tests = list_tests
- self.milestone_filter = milestone_filter
- self.set_log_level = set_log_level
- self.svn_bin = svn_bin
- self.mode_filter = mode_filter
self.log = None
- self.ssl_cert = ssl_cert
- self.http_proxy = http_proxy
- self.http_proxy_username = http_proxy_username
- self.http_proxy_password = http_proxy_password
- self.httpd_version = httpd_version
- self.exclusive_wc_locks = exclusive_wc_locks
- self.memcached_server = memcached_server
+ self.opts = opts
+
if not sys.stdout.isatty() or sys.platform == 'win32':
TextColors.disable()
- self.skip_c_tests = (not not skip_c_tests)
- self.dump_load_cross_check = (not not dump_load_cross_check)
- # Parse out the FSFS version number
- if self.fs_type is not None and self.fs_type.startswith('fsfs-v'):
- self.fsfs_version = int(self.fs_type[6:])
- self.fs_type = 'fsfs'
- else:
- self.fsfs_version = None
+ def _init_c_tests(self):
+ cmdline = [None, None] # Program name and source dir
+
+ if self.opts.config_file is not None:
+ cmdline.append('--config-file=' + self.opts.config_file)
+ elif self.opts.memcached_server is not None:
+ cmdline.append('--memcached-server=' + self.opts.memcached_server)
+
+ if self.opts.url is not None:
+ subdir = 'subversion/tests/cmdline/svn-test-work'
+ cmdline.append('--repos-url=%s' % self.opts.url +
+ '/svn-test-work/repositories')
+ cmdline.append('--repos-dir=%s'
+ % os.path.abspath(
+ os.path.join(self.builddir,
+ subdir, 'repositories')))
+
+ # Enable access for http
+ if self.opts.url.startswith('http'):
+ authzparent = os.path.join(self.builddir, subdir)
+ if not os.path.exists(authzparent):
+ os.makedirs(authzparent);
+ open(os.path.join(authzparent, 'authz'), 'w').write('[/]\n'
+ '* = rw\n')
+
+ # ### Support --repos-template
+ if self.opts.list_tests is not None:
+ cmdline.append('--list')
+ if self.opts.verbose is not None:
+ cmdline.append('--verbose')
+ if self.opts.cleanup is not None:
+ cmdline.append('--cleanup')
+ if self.opts.fs_type is not None:
+ cmdline.append('--fs-type=%s' % self.opts.fs_type)
+ if self.opts.fsfs_version is not None:
+ cmdline.append('--fsfs-version=%d' % self.opts.fsfs_version)
+ if self.opts.server_minor_version is not None:
+ cmdline.append('--server-minor-version=' +
+ self.opts.server_minor_version)
+ if self.opts.mode_filter is not None:
+ cmdline.append('--mode-filter=' + self.opts.mode_filter)
+ if self.opts.parallel is not None:
+ cmdline.append('--parallel')
+
+ self.c_test_cmdline = cmdline
+
+
+ def _init_py_tests(self, basedir):
+ cmdline = ['--srcdir=%s' % self.srcdir]
+ if self.opts.list_tests is not None:
+ cmdline.append('--list')
+ if self.opts.verbose is not None:
+ cmdline.append('--verbose')
+ if self.opts.cleanup is not None:
+ cmdline.append('--cleanup')
+ if self.opts.parallel is not None:
+ if self.opts.parallel == 1:
+ cmdline.append('--parallel')
+ else:
+ cmdline.append('--parallel-instances=%d' % self.opts.parallel)
+ if self.opts.svn_bin is not None:
+ cmdline.append('--bin=%s', self.opts.svn_bin)
+ if self.opts.url is not None:
+ cmdline.append('--url=%s' % self.opts.url)
+ if self.opts.fs_type is not None:
+ cmdline.append('--fs-type=%s' % self.opts.fs_type)
+ if self.opts.http_library is not None:
+ cmdline.append('--http-library=%s' % self.opts.http_library)
+ if self.opts.fsfs_sharding is not None:
+ cmdline.append('--fsfs-sharding=%d' % self.opts.fsfs_sharding)
+ if self.opts.fsfs_packing is not None:
+ cmdline.append('--fsfs-packing')
+ if self.opts.fsfs_version is not None:
+ cmdline.append('--fsfs-version=%d' % self.opts.fsfs_version)
+ if self.opts.server_minor_version is not None:
+ cmdline.append('--server-minor-version=%d' % self.opts.server_minor_version)
+ if self.opts.dump_load_cross_check is not None:
+ cmdline.append('--dump-load-cross-check')
+ if self.opts.enable_sasl is not None:
+ cmdline.append('--enable-sasl')
+ if self.opts.config_file is not None:
+ cmdline.append('--config-file=%s' % self.opts.config_file)
+ if self.opts.milestone_filter is not None:
+ cmdline.append('--milestone-filter=%s' % self.opts.milestone_filter)
+ if self.opts.mode_filter is not None:
+ cmdline.append('--mode-filter=%s' % self.opts.mode_filter)
+ if self.opts.set_log_level is not None:
+ cmdline.append('--set-log-level=%s' % self.opts.set_log_level)
+ if self.opts.ssl_cert is not None:
+ cmdline.append('--ssl-cert=%s' % self.opts.ssl_cert)
+ if self.opts.http_proxy is not None:
+ cmdline.append('--http-proxy=%s' % self.opts.http_proxy)
+ if self.opts.http_proxy_username is not None:
+ cmdline.append('--http-proxy-username=%s' % self.opts.http_proxy_username)
+ if self.opts.http_proxy_password is not None:
+ cmdline.append('--http-proxy-password=%s' % self.opts.http_proxy_password)
+ if self.opts.httpd_version is not None:
+ cmdline.append('--httpd-version=%s' % self.opts.httpd_version)
+ if self.opts.exclusive_wc_locks is not None:
+ cmdline.append('--exclusive-wc-locks')
+ if self.opts.memcached_server is not None:
+ cmdline.append('--memcached-server=%s' % self.opts.memcached_server)
+
+ # The svntest module is very pedantic about the current working directory
+ old_cwd = os.getcwd()
+ try:
+ os.chdir(basedir)
+ sys.path.insert(0, os.path.abspath(os.path.join(self.srcdir, basedir)))
- def run(self, list):
- '''Run all test programs given in LIST. Print a summary of results, if
+ global svntest
+ __import__('svntest')
+ __import__('svntest.main')
+ __import__('svntest.testcase')
+ svntest = sys.modules['svntest']
+ svntest.main = sys.modules['svntest.main']
+ svntest.testcase = sys.modules['svntest.testcase']
+
+ svntest.main.parse_options(cmdline, optparse.SUPPRESS_USAGE)
+ svntest.testcase.TextColors.disable()
+ finally:
+ os.chdir(old_cwd)
+
+ def run(self, testlist):
+ '''Run all test programs given in TESTLIST. Print a summary of results, if
there is a log file. Return zero iff all test programs passed.'''
self._open_log('w')
failed = 0
- # If asked to skip C tests, remove non-Python tests from the list
- if self.skip_c_tests:
- def is_py_test(prog):
- progpath, nums = self._split_nums(prog)
- return progpath.endswith('.py')
- list = filter(is_py_test, list)
+ # Filter tests into Python and native groups and prepare arguments
+ # for each group. The resulting list will contain tuples of
+ # (program dir, program name, test numbers), where the test
+ # numbers may be None.
+
+ def split_nums(prog):
+ test_nums = []
+ if '#' in prog:
+ prog, test_nums = prog.split('#')
+ if test_nums:
+ test_nums = test_nums.split(',')
+ return prog, test_nums
+
+ py_basedir = set()
+ py_tests = []
+ c_tests = []
+
+ for prog in testlist:
+ progpath, testnums = split_nums(prog)
+ progdir, progbase = os.path.split(progpath)
+ if progpath.endswith('.py'):
+ py_basedir.add(progdir)
+ py_tests.append((progdir, progbase, testnums))
+ elif not self.opts.skip_c_tests:
+ c_tests.append((progdir, progbase, testnums))
+
+ # Initialize svntest.main.options for Python tests. Load the
+ # svntest.main module from the Python test path.
+ if len(py_tests):
+ if len(py_basedir) > 1:
+ sys.stderr.write('The test harness requires all Python tests'
+ ' to be in the same directory.')
+ sys.exit(1)
+ self._init_py_tests(list(py_basedir)[0])
+ py_tests.sort(key=lambda x: x[1])
- for cnt, prog in enumerate(list):
- failed = self._run_test(prog, cnt, len(list)) or failed
+ # Create the common command line for C tests
+ if len(c_tests):
+ self._init_c_tests()
+ c_tests.sort(key=lambda x: x[1])
+
+ # Run the tests
+ testlist = c_tests + py_tests
+ testcount = len(testlist)
+ for count, testcase in enumerate(testlist):
+ failed = self._run_test(testcase, count, testcount) or failed
if self.log is None:
return failed
@@ -245,26 +354,26 @@ class TestHarness:
sys.stdout.write('%s\n [[%s'
% (x[:wip], x[wip + len(wimptag):]))
- if self.list_tests:
+ if self.opts.list_tests:
passed = [x for x in log_lines if x[8:13] == ' ']
else:
passed = [x for x in log_lines if x[:6] == 'PASS: ']
- if self.list_tests:
+ if self.opts.list_tests:
skipped = [x for x in log_lines if x[8:12] == 'SKIP']
else:
skipped = [x for x in log_lines if x[:6] == 'SKIP: ']
- if skipped and not self.list_tests:
+ if skipped and not self.opts.list_tests:
print('At least one test was SKIPPED, checking ' + self.logfile)
for x in skipped:
sys.stdout.write(x)
- if self.list_tests:
+ if self.opts.list_tests:
xfailed = [x for x in log_lines if x[8:13] == 'XFAIL']
else:
xfailed = [x for x in log_lines if x[:6] == 'XFAIL:']
- if xfailed and not self.list_tests:
+ if xfailed and not self.opts.list_tests:
print('At least one test XFAILED, checking ' + self.logfile)
for x in xfailed:
printxfail(x)
@@ -282,19 +391,19 @@ class TestHarness:
sys.stdout.write(x)
# Print summaries, from least interesting to most interesting.
- if self.list_tests:
+ if self.opts.list_tests:
print('Summary of test listing:')
else:
print('Summary of test results:')
if passed:
- if self.list_tests:
+ if self.opts.list_tests:
print(' %d test%s are set to PASS'
% (len(passed), 's'*min(len(passed) - 1, 1)))
else:
print(' %d test%s PASSED'
% (len(passed), 's'*min(len(passed) - 1, 1)))
if skipped:
- if self.list_tests:
+ if self.opts.list_tests:
print(' %d test%s are set as SKIP'
% (len(skipped), 's'*min(len(skipped) - 1, 1)))
else:
@@ -303,14 +412,14 @@ class TestHarness:
if xfailed:
passwimp = [x for x in xfailed if 0 <= x.find(wimptag)]
if passwimp:
- if self.list_tests:
+ if self.opts.list_tests:
print(' %d test%s are set to XFAIL (%d WORK-IN-PROGRESS)'
% (len(xfailed), 's'*min(len(xfailed) - 1, 1), len(passwimp)))
else:
print(' %d test%s XFAILED (%d WORK-IN-PROGRESS)'
% (len(xfailed), 's'*min(len(xfailed) - 1, 1), len(passwimp)))
else:
- if self.list_tests:
+ if self.opts.list_tests:
print(' %d test%s are set as XFAIL'
% (len(xfailed), 's'*min(len(xfailed) - 1, 1)))
else:
@@ -370,65 +479,21 @@ class TestHarness:
self.log.close()
self.log = None
- def _run_c_test(self, prog, test_nums, dot_count):
+ def _run_c_test(self, progabs, progdir, progbase, test_nums, dot_count):
'Run a c test, escaping parameters as required.'
- progdir, progbase = os.path.split(prog)
-
- if self.list_tests and self.milestone_filter:
+ if self.opts.list_tests and self.opts.milestone_filter:
print 'WARNING: --milestone-filter option does not currently work with C tests'
if not os.access(progbase, os.X_OK):
print("\nNot an executable file: " + progbase)
sys.exit(1)
- progname = './' + progbase
- cmdline = [progname,
- '--srcdir=' + os.path.join(self.srcdir, progdir)]
- if self.config_file is not None:
- cmdline.append('--config-file=' + self.config_file)
- elif self.memcached_server is not None:
- cmdline.append('--memcached-server=' + self.memcached_server)
-
- if self.base_url is not None:
- subdir = 'subversion/tests/cmdline/svn-test-work'
-
- cmdline.append('--repos-url=%s' % self.base_url +
- '/svn-test-work/repositories')
- cmdline.append('--repos-dir=%s'
- % os.path.abspath(
- os.path.join(self.builddir, subdir, 'repositories')))
-
- # Enable access for http
- if self.base_url.startswith('http'):
- authzparent = os.path.join(self.builddir, subdir)
- if not os.path.exists(authzparent):
- os.makedirs(authzparent);
- open(os.path.join(authzparent, 'authz'), 'w').write('[/]\n'
- '* = rw\n')
-
- # ### Support --repos-template
- if self.verbose is not None:
- cmdline.append('--verbose')
- if self.cleanup is not None:
- cmdline.append('--cleanup')
- if self.fs_type is not None:
- cmdline.append('--fs-type=' + self.fs_type)
- if self.fsfs_version is not None:
- cmdline.append('--fsfs-version=%d' % self.fsfs_version)
- if self.server_minor_version is not None:
- cmdline.append('--server-minor-version=' + self.server_minor_version)
- if self.list_tests is not None:
- cmdline.append('--list')
- if self.mode_filter is not None:
- cmdline.append('--mode-filter=' + self.mode_filter)
- if self.parallel is not None:
- cmdline.append('--parallel')
+ cmdline = self.c_test_cmdline[:]
+ cmdline[0] = './' + progbase
+ cmdline[1] = '--srcdir=%s' % os.path.join(self.srcdir, progdir)
if test_nums:
- test_nums = test_nums.split(',')
cmdline.extend(test_nums)
-
- if test_nums:
total = len(test_nums)
else:
total_cmdline = [cmdline[0], '--list']
@@ -476,90 +541,16 @@ class TestHarness:
prog.wait()
return prog.returncode
- def _run_py_test(self, prog, test_nums, dot_count):
+ def _run_py_test(self, progabs, progdir, progbase, test_nums, dot_count):
'Run a python test, passing parameters as needed.'
- progdir, progbase = os.path.split(prog)
-
- old_path = sys.path[:]
- sys.path = [progdir] + sys.path
-
try:
- prog_mod = imp.load_module(progbase[:-3], open(prog, 'r'), prog,
+ prog_mod = imp.load_module(progbase[:-3], open(progabs, 'r'), progabs,
('.py', 'U', imp.PY_SOURCE))
except:
print("\nError loading test (details in following traceback): " + progbase)
traceback.print_exc()
sys.exit(1)
- import svntest.main
-
- # set up our options
- svntest.main.create_default_options()
- if self.base_url is not None:
- svntest.main.options.test_area_url = self.base_url
- if self.enable_sasl is not None:
- svntest.main.options.enable_sasl = True
- if self.parallel is not None:
- try:
- num_parallel = int(self.parallel)
- except exceptions.ValueError:
- num_parallel = svntest.main.default_num_threads
- if num_parallel > 1:
- svntest.main.options.parallel = num_parallel
- else:
- svntest.main.options.parallel = svntest.main.default_num_threads
- if self.config_file is not None:
- svntest.main.options.config_file = self.config_file
- if self.verbose is not None:
- svntest.main.options.verbose = True
- if self.cleanup is not None:
- svntest.main.options.cleanup = True
- if self.fs_type is not None:
- svntest.main.options.fs_type = self.fs_type
- if self.fsfs_version is not None:
- svntest.main.options.fsfs_version = self.fsfs_version
- if self.http_library is not None:
- svntest.main.options.http_library = self.http_library
- if self.server_minor_version is not None:
- svntest.main.options.server_minor_version = int(self.server_minor_version)
- if self.list_tests is not None:
- svntest.main.options.list_tests = True
- if self.milestone_filter is not None:
- svntest.main.options.milestone_filter = self.milestone_filter
- if self.set_log_level is not None:
- # Somehow the logger is not setup correctly from win-tests.py, so
- # setting the log level would fail. ### Please fix
- if svntest.main.logger is None:
- import logging
- svntest.main.logger = logging.getLogger()
- svntest.main.logger.setLevel(self.set_log_level)
- if self.svn_bin is not None:
- svntest.main.options.svn_bin = self.svn_bin
- if self.fsfs_sharding is not None:
- svntest.main.options.fsfs_sharding = int(self.fsfs_sharding)
- if self.fsfs_packing is not None:
- svntest.main.options.fsfs_packing = self.fsfs_packing
- if self.mode_filter is not None:
- svntest.main.options.mode_filter = self.mode_filter
- if self.ssl_cert is not None:
- svntest.main.options.ssl_cert = self.ssl_cert
- if self.http_proxy is not None:
- svntest.main.options.http_proxy = self.http_proxy
- if self.http_proxy_username is not None:
- svntest.main.options.http_proxy_username = self.http_proxy_username
- if self.http_proxy_password is not None:
- svntest.main.options.http_proxy_password = self.http_proxy_password
- if self.httpd_version is not None:
- svntest.main.options.httpd_version = self.httpd_version
- if self.exclusive_wc_locks is not None:
- svntest.main.options.exclusive_wc_locks = self.exclusive_wc_locks
- if self.memcached_server is not None:
- svntest.main.options.memcached_server = self.memcached_server
- if self.dump_load_cross_check is not None:
- svntest.main.options.dump_load_cross_check = self.dump_load_cross_check
-
- svntest.main.options.srcdir = self.srcdir
-
# setup the output pipes
if self.log:
sys.stdout.flush()
@@ -591,31 +582,23 @@ class TestHarness:
serial_only = hasattr(prog_mod, 'serial_only') and prog_mod.serial_only
# run the tests
- svntest.testcase.TextColors.disable()
-
- if self.list_tests:
+ if self.opts.list_tests:
prog_f = None
else:
prog_f = progress_func
- if test_nums:
- test_selection = [test_nums]
- else:
- test_selection = []
-
try:
failed = svntest.main.execute_tests(prog_mod.test_list,
serial_only=serial_only,
test_name=progbase,
progress_func=prog_f,
- test_selection=test_selection)
+ test_selection=test_nums)
except svntest.Failure:
if self.log:
os.write(old_stdout, '.' * dot_count)
failed = True
# restore some values
- sys.path = old_path
if self.log:
sys.stdout.flush()
sys.stderr.flush()
@@ -626,13 +609,7 @@ class TestHarness:
return failed
- def _split_nums(self, prog):
- test_nums = None
- if '#' in prog:
- prog, test_nums = prog.split('#')
- return prog, test_nums
-
- def _run_test(self, prog, test_nr, total_tests):
+ def _run_test(self, testcase, test_nr, total_tests):
"Run a single test. Return the test's exit code."
if self.log:
@@ -640,13 +617,12 @@ class TestHarness:
else:
log = sys.stdout
- prog, test_nums = self._split_nums(prog)
- progdir, progbase = os.path.split(prog)
+ progdir, progbase, test_nums = testcase
if self.log:
# Using write here because we don't want even a trailing space
test_info = '[%s/%d] %s' % (str(test_nr + 1).zfill(len(str(total_tests))),
total_tests, progbase)
- if self.list_tests:
+ if self.opts.list_tests:
sys.stdout.write('Listing tests in %s' % (test_info, ))
else:
sys.stdout.write('%s' % (test_info, ))
@@ -655,7 +631,7 @@ class TestHarness:
# ### Hack for --log-to-stdout to work (but not print any dots).
test_info = ''
- if self.list_tests:
+ if self.opts.list_tests:
log.write('LISTING: %s\n' % progbase)
else:
log.write('START: %s\n' % progbase)
@@ -664,7 +640,7 @@ class TestHarness:
start_time = datetime.now()
- progabs = os.path.abspath(os.path.join(self.srcdir, prog))
+ progabs = os.path.abspath(os.path.join(self.srcdir, progdir, progbase))
old_cwd = os.getcwd()
line_length = _get_term_width()
dots_needed = line_length \
@@ -673,9 +649,10 @@ class TestHarness:
try:
os.chdir(progdir)
if progbase[-3:] == '.py':
- failed = self._run_py_test(progabs, test_nums, dots_needed)
+ testcase = self._run_py_test
else:
- failed = self._run_c_test(prog, test_nums, dots_needed)
+ testcase = self._run_c_test
+ failed = testcase(progabs, progdir, progbase, test_nums, dots_needed)
except:
os.chdir(old_cwd)
raise
@@ -693,7 +670,7 @@ class TestHarness:
else:
log.write('FAIL: %s: Unknown test failure.\n' % progbase)
- if not self.list_tests:
+ if not self.opts.list_tests:
# Log the elapsed time.
elapsed_time = str(datetime.now() - start_time)
log.write('END: %s\n' % progbase)
@@ -704,7 +681,7 @@ class TestHarness:
# If we are only listing the tests just add a newline, otherwise if
# we printed a "Running all tests in ..." line, add the test result.
if self.log:
- if self.list_tests:
+ if self.opts.list_tests:
print ''
else:
if failed:
@@ -715,113 +692,84 @@ class TestHarness:
return failed
+def create_parser():
+ parser = optparse.OptionParser(usage=__doc__);
+
+ parser.add_option('-l', '--list', action='store_true', dest='list_tests',
+ help='Print test doc strings instead of running them')
+ parser.add_option('-v', '--verbose', action='store_true',
+ help='Print binary command-lines')
+ parser.add_option('-c', '--cleanup', action='store_true',
+ help='Clean up after successful tests')
+ parser.add_option('-p', '--parallel', action='store', type='int',
+ help='Run the tests in parallel')
+ parser.add_option('-u', '--url', action='store',
+ help='Base url to the repos (e.g. svn://localhost)')
+ parser.add_option('-f', '--fs-type', action='store',
+ help='Subversion file system type (fsfs(-v[46]), bdb or fsx)')
+ parser.add_option('--http-library', action='store',
+ help="Make svn use this DAV library (neon or serf)")
+ parser.add_option('--bin', action='store', dest='svn_bin',
+ help='Use the svn binaries installed in this path')
+ parser.add_option('--fsfs-sharding', action='store', type='int',
+ help='Default shard size (for fsfs)')
+ parser.add_option('--fsfs-packing', action='store_true',
+ help="Run 'svnadmin pack' automatically")
+ parser.add_option('--server-minor-version', type='int', action='store',
+ help="Set the minor version for the server")
+ parser.add_option('--skip-c-tests', '--skip-C-tests', action='store_true',
+ help="Run only the Python tests")
+ parser.add_option('--dump-load-cross-check', action='store_true',
+ help="After every test, run a series of dump and load " +
+ "tests with svnadmin, svnrdump and svndumpfilter " +
+ " on the testcase repositories to cross-check " +
+ " dump file compatibility.")
+ parser.add_option('--enable-sasl', action='store_true',
+ help='Whether to enable SASL authentication')
+ parser.add_option('--config-file', action='store',
+ help="Configuration file for tests.")
+ parser.add_option('--log-to-stdout', action='store_true',
+ help='Print test progress to stdout instead of a log file')
+ parser.add_option('--milestone-filter', action='store', dest='milestone_filter',
+ help='Limit --list to those with target milestone specified')
+ parser.add_option('--mode-filter', action='store', dest='mode_filter',
+ default='ALL',
+ help='Limit tests to those with type specified (e.g. XFAIL)')
+ parser.add_option('--set-log-level', action='store',
+ help="Set log level (numerically or symbolically). " +
+ "Symbolic levels are: CRITICAL, ERROR, WARNING, " +
+ "INFO, DEBUG")
+ parser.add_option('--ssl-cert', action='store',
+ help='Path to SSL server certificate.')
+ parser.add_option('--http-proxy', action='store',
+ help='Use the HTTP Proxy at hostname:port.')
+ parser.add_option('--http-proxy-username', action='store',
+ help='Username for the HTTP Proxy.')
+ parser.add_option('--http-proxy-password', action='store',
+ help='Password for the HTTP Proxy.')
+ parser.add_option('--httpd-version', action='store',
+ help='Assume HTTPD is this version.')
+ parser.add_option('--exclusive-wc-locks', action='store_true',
+ help='Use sqlite exclusive locking for working copies')
+ parser.add_option('--memcached-server', action='store',
+ help='Use memcached server at specified URL (FSFS only)')
+ return parser
+
def main():
- try:
- opts, args = my_getopt(sys.argv[1:], 'u:f:vc',
- ['url=', 'fs-type=', 'verbose', 'cleanup',
- 'skip-c-tests', 'skip-C-tests',
- 'dump-load-cross-check',
- 'http-library=', 'server-minor-version=',
- 'fsfs-packing', 'fsfs-sharding=',
- 'enable-sasl', 'parallel=', 'config-file=',
- 'log-to-stdout', 'list', 'milestone-filter=',
- 'mode-filter=', 'set-log-level=', 'ssl-cert=',
- 'http-proxy=', 'http-proxy-username=',
- 'http-proxy-password=', 'httpd-version=',
- 'exclusive-wc-locks',
- 'memcached-server='])
- except getopt.GetoptError:
- args = []
+ (opts, args) = create_parser().parse_args(sys.argv[1:])
if len(args) < 3:
print(__doc__)
sys.exit(2)
- base_url, fs_type, verbose, cleanup, skip_c_tests, enable_sasl, \
- http_library, server_minor_version, fsfs_sharding, fsfs_packing, \
- parallel, config_file, log_to_stdout, list_tests, mode_filter, \
- milestone_filter, set_log_level, ssl_cert, http_proxy, \
- http_proxy_username, http_proxy_password, httpd_version, \
- exclusive_wc_locks, memcached_server, dump_load_cross_check = \
- None, None, None, None, None, None, None, None, None, None, \
- None, None, None, None, None, None, None, None, None, None, \
- None, None, None, None, None
- for opt, val in opts:
- if opt in ['-u', '--url']:
- base_url = val
- elif opt in ['-f', '--fs-type']:
- fs_type = val
- elif opt in ['--http-library']:
- http_library = val
- elif opt in ['--fsfs-sharding']:
- fsfs_sharding = int(val)
- elif opt in ['--fsfs-packing']:
- fsfs_packing = 1
- elif opt in ['--server-minor-version']:
- server_minor_version = val
- elif opt in ['-v', '--verbose']:
- verbose = 1
- elif opt in ['-c', '--cleanup']:
- cleanup = 1
- elif opt in ['--skip-c-tests', '--skip-C-tests']:
- skip_c_tests = 1
- elif opt in ['--dump-load-cross-check']:
- dump_load_cross_check = 1
- elif opt in ['--enable-sasl']:
- enable_sasl = 1
- elif opt in ['--parallel']:
- parallel = val
- elif opt in ['--config-file']:
- config_file = val
- elif opt in ['--log-to-stdout']:
- log_to_stdout = 1
- elif opt in ['--list']:
- list_tests = 1
- elif opt in ['--milestone-filter']:
- milestone_filter = val
- elif opt in ['--mode-filter']:
- mode_filter = val
- elif opt in ['--set-log-level']:
- set_log_level = val
- elif opt in ['--ssl-cert']:
- ssl_cert = val
- elif opt in ['--http-proxy']:
- http_proxy = val
- elif opt in ['--http-proxy-username']:
- http_proxy_username = val
- elif opt in ['--http-proxy-password']:
- http_proxy_password = val
- elif opt in ['--httpd-version']:
- httpd_version = val
- elif opt in ['--exclusive-wc-locks']:
- exclusive_wc_locks = 1
- elif opt in ['--memcached-server']:
- memcached_server = val
- else:
- raise getopt.GetoptError
-
- if log_to_stdout:
+ if opts.log_to_stdout:
logfile = None
faillogfile = None
else:
logfile = os.path.abspath('tests.log')
faillogfile = os.path.abspath('fails.log')
- th = TestHarness(args[0], args[1], logfile, faillogfile,
- base_url, fs_type, http_library, server_minor_version,
- verbose, cleanup, enable_sasl, parallel, config_file,
- fsfs_sharding, fsfs_packing, list_tests,
- mode_filter=mode_filter, milestone_filter=milestone_filter,
- set_log_level=set_log_level, ssl_cert=ssl_cert,
- http_proxy=http_proxy,
- http_proxy_username=http_proxy_username,
- http_proxy_password=http_proxy_password,
- httpd_version=httpd_version,
- exclusive_wc_locks=exclusive_wc_locks,
- memcached_server=memcached_server,
- skip_c_tests=skip_c_tests,
- dump_load_cross_check=dump_load_cross_check)
-
+ th = TestHarness(args[0], args[1], logfile, faillogfile, opts)
failed = th.run(args[2:])
if failed:
sys.exit(1)
Modified: subversion/branches/reuse-ra-session/build/transform_sql.py
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/build/transform_sql.py?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/build/transform_sql.py (original)
+++ subversion/branches/reuse-ra-session/build/transform_sql.py Fri Sep 11 15:51:30 2015
@@ -31,13 +31,6 @@ import re
import sys
-# operator.methodcaller doesn't exist in Python 2.5.
-if not hasattr(operator, 'methodcaller'):
- def methodcaller(method, *args, **kwargs):
- return lambda x: getattr(x, method)(*args, **kwargs)
- operator.methodcaller = methodcaller
- del methodcaller
-
DEFINE_END = ' ""\n\n'
Modified: subversion/branches/reuse-ra-session/configure.ac
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/configure.ac?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/configure.ac (original)
+++ subversion/branches/reuse-ra-session/configure.ac Fri Sep 11 15:51:30 2015
@@ -1273,7 +1273,7 @@ AS_HELP_STRING([--enable-gprof],
PYTHON="`$abs_srcdir/build/find_python.sh`"
if test -z "$PYTHON"; then
- AC_MSG_WARN([Python 2.5 or later is required to run the testsuite])
+ AC_MSG_WARN([Python 2.7 or later is required to run the testsuite])
AC_MSG_WARN([or to use the Subversion Python bindings])
AC_MSG_WARN([])
AC_MSG_WARN([If you have a suitable Python installed, but not on the])
Modified: subversion/branches/reuse-ra-session/contrib/hook-scripts/check-mime-type.pl
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/contrib/hook-scripts/check-mime-type.pl?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/contrib/hook-scripts/check-mime-type.pl (original)
+++ subversion/branches/reuse-ra-session/contrib/hook-scripts/check-mime-type.pl Fri Sep 11 15:51:30 2015
@@ -119,17 +119,48 @@ foreach my $path ( @files_added )
# Parse the complete list of property values of the file $path to extract
# the mime-type and eol-style
- foreach my $prop (&read_from_process($svnlook, 'proplist', $repos, '-t',
- $txn, '--verbose', '--', $path))
+
+ my @output = &read_from_process($svnlook, 'proplist', $repos, '-t',
+ $txn, '--verbose', '--', $path);
+ my $output_line = 0;
+
+ foreach my $prop (@output)
{
- if ($prop =~ /^\s*svn:mime-type : (\S+)/)
+ if ($prop =~ /^\s*svn:mime-type( : (\S+))?/)
{
- $mime_type = $1;
+ $mime_type = $2;
+ # 1.7.8 (r1416637) onwards changed the format of svnloop proplist --verbose
+ # from propname : propvalue format, to values in an indent list on following lines
+ if (not $mime_type)
+ {
+ if ($output_line + 1 >= scalar(@output))
+ {
+ die "$0: Unexpected EOF reading proplist.\n";
+ }
+ my $next_line_pval_indented = $output[$output_line + 1];
+ if ($next_line_pval_indented =~ /^\s{4}(.*)/)
+ {
+ $mime_type = $1;
+ }
+ }
}
- elsif ($prop =~ /^\s*svn:eol-style : (\S+)/)
+ elsif ($prop =~ /^\s*svn:eol-style( : (\S+))?/)
{
- $eol_style = $1;
+ $eol_style = $2;
+ if (not $eol_style)
+ {
+ if ($output_line + 1 >= scalar(@output))
+ {
+ die "$0: Unexpected EOF reading proplist.\n";
+ }
+ my $next_line_pval_indented = $output[$output_line + 1];
+ if ($next_line_pval_indented =~ /^\s{4}(.*)/)
+ {
+ $eol_style = $1;
+ }
+ }
}
+ $output_line++;
}
# Detect error conditions and add them to @errors
Modified: subversion/branches/reuse-ra-session/notes/svnsync.txt
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/notes/svnsync.txt?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/notes/svnsync.txt (original)
+++ subversion/branches/reuse-ra-session/notes/svnsync.txt Fri Sep 11 15:51:30 2015
@@ -27,14 +27,17 @@ exit 1
EOF
$ chmod +x dest/hooks/pre-revprop-change
-$ svnsync init --username svnsync file://`pwd`/dest \
- http://svn.example.org/source/repos
+$ svnsync init --sync-username svnsync file://`pwd`/dest \
+ --source-username user http://svn.example.org/source/repos
Copied properties for revision 0
$
Note that the arguments to 'svnsync init' are two arbitrary repository
URLs. The first is the destination, which must be empty, and the second
-is the source.
+is the source. Credentials for the source repository can be provided
+using --source-username/--source-password and for the destination using
+--sync-username/--sync-password. These credentials are cached in the
+same way other credentials are cached.
Now you can just run the 'svnsync sync' command to synchronize pending
revisions. This will copy any revisions that exist in the source repos
Modified: subversion/branches/reuse-ra-session/subversion/bindings/ctypes-python/csvn/ext/callback_receiver.py
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/ctypes-python/csvn/ext/callback_receiver.py?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/ctypes-python/csvn/ext/callback_receiver.py (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/ctypes-python/csvn/ext/callback_receiver.py Fri Sep 11 15:51:30 2015
@@ -138,6 +138,7 @@ class _CallbackResultIterator(object):
finally:
self.receiver.lock.release()
+ # ### TODO: simplify, removing support for Python 2.4
# Return the first result. Only Python 2.5 supports 'yield'
# inside a try-finally block, so we jump through some hoops here
# to avoid that case.
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/JNIUtil.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/JNIUtil.cpp?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/JNIUtil.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/JNIUtil.cpp Fri Sep 11 15:51:30 2015
@@ -570,13 +570,13 @@ std::string JNIUtil::makeSVNErrorMessage
return buffer;
}
-void JNIUtil::wrappedHandleSVNError(svn_error_t *err, jthrowable jcause)
+jthrowable JNIUtil::wrappedCreateClientException(svn_error_t *err, jthrowable jcause)
{
jstring jmessage;
jobject jstack;
std::string msg = makeSVNErrorMessage(err, &jmessage, &jstack);
if (JNIUtil::isJavaExceptionThrown())
- return;
+ return NULL;
const char *source = NULL;
#ifdef SVN_DEBUG
@@ -604,11 +604,11 @@ void JNIUtil::wrappedHandleSVNError(svn_
// Create a local frame for our references
env->PushLocalFrame(LOCAL_FRAME_SIZE);
if (JNIUtil::isJavaExceptionThrown())
- return;
+ return NULL;
jclass clazz = env->FindClass(JAVAHL_CLASS("/ClientException"));
if (isJavaExceptionThrown())
- POP_AND_RETURN_NOTHING();
+ POP_AND_RETURN_NULL;
if (getLogLevel() >= exceptionLog)
{
@@ -622,11 +622,11 @@ void JNIUtil::wrappedHandleSVNError(svn_
g_logStream << std::endl;
}
if (isJavaExceptionThrown())
- POP_AND_RETURN_NOTHING();
+ POP_AND_RETURN_NULL;
jstring jsource = makeJString(source);
if (isJavaExceptionThrown())
- POP_AND_RETURN_NOTHING();
+ POP_AND_RETURN_NULL;
jmethodID mid = env->GetMethodID(clazz, "<init>",
"(Ljava/lang/String;"
@@ -634,12 +634,12 @@ void JNIUtil::wrappedHandleSVNError(svn_
"Ljava/lang/String;I"
"Ljava/util/List;)V");
if (isJavaExceptionThrown())
- POP_AND_RETURN_NOTHING();
+ POP_AND_RETURN_NULL;
jobject nativeException = env->NewObject(clazz, mid, jmessage, jcause,
jsource, jint(err->apr_err),
jstack);
if (isJavaExceptionThrown())
- POP_AND_RETURN_NOTHING();
+ POP_AND_RETURN_NULL;
#ifdef SVN_ERR__TRACING
// Add all the C error stack trace information to the Java Exception
@@ -651,7 +651,7 @@ void JNIUtil::wrappedHandleSVNError(svn_
mid_gst = env->GetMethodID(clazz, "getStackTrace",
"()[Ljava/lang/StackTraceElement;");
if (isJavaExceptionThrown())
- POP_AND_RETURN_NOTHING();
+ POP_AND_RETURN_NULL;
}
Array stackTraceArray((jobjectArray) env->CallObjectMethod(nativeException,
mid_gst));
@@ -670,18 +670,18 @@ void JNIUtil::wrappedHandleSVNError(svn_
jclass stClazz = env->FindClass("java/lang/StackTraceElement");
if (isJavaExceptionThrown())
- POP_AND_RETURN_NOTHING();
+ POP_AND_RETURN_NULL;
const jsize stSize = static_cast<jsize>(newStackTrace.size());
if (stSize < 0 || stSize != newStackTrace.size())
{
env->ThrowNew(env->FindClass("java.lang.ArithmeticException"),
"Overflow converting C size_t to JNI jsize");
- POP_AND_RETURN_NOTHING();
+ POP_AND_RETURN_NULL;
}
jobjectArray jStackTrace = env->NewObjectArray(stSize, stClazz, NULL);
if (isJavaExceptionThrown())
- POP_AND_RETURN_NOTHING();
+ POP_AND_RETURN_NULL;
int i = 0;
for (std::vector<jobject>::const_iterator it = newStackTrace.begin();
@@ -698,25 +698,34 @@ void JNIUtil::wrappedHandleSVNError(svn_
mid_sst = env->GetMethodID(clazz, "setStackTrace",
"([Ljava/lang/StackTraceElement;)V");
if (isJavaExceptionThrown())
- POP_AND_RETURN_NOTHING();
+ POP_AND_RETURN_NULL;
}
env->CallVoidMethod(nativeException, mid_sst, jStackTrace);
if (isJavaExceptionThrown())
- POP_AND_RETURN_NOTHING();
+ POP_AND_RETURN_NULL;
#endif
- env->Throw(static_cast<jthrowable>(env->PopLocalFrame(nativeException)));
+ return static_cast<jthrowable>(env->PopLocalFrame(nativeException));
}
-void JNIUtil::handleSVNError(svn_error_t *err, jthrowable jcause)
+jthrowable JNIUtil::createClientException(svn_error_t *err, jthrowable jcause)
{
+ jthrowable jexc = NULL;
try {
- wrappedHandleSVNError(err, jcause);
+ jexc = wrappedCreateClientException(err, jcause);
} catch (...) {
svn_error_clear(err);
throw;
}
svn_error_clear(err);
+ return jexc;
+}
+
+void JNIUtil::handleSVNError(svn_error_t *err, jthrowable jcause)
+{
+ jthrowable jexc = createClientException(err, jcause);
+ if (jexc)
+ getEnv()->Throw(jexc);
}
void JNIUtil::putFinalizedClient(SVNBase *object)
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/JNIUtil.h
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/JNIUtil.h?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/JNIUtil.h (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/JNIUtil.h Fri Sep 11 15:51:30 2015
@@ -136,6 +136,13 @@ class JNIUtil
static svn_error_t* checkJavaException(apr_status_t errorcode);
/**
+ * Create a Java exception corresponding to err, and run
+ * svn_error_clear() on err.
+ */
+ static jthrowable createClientException(svn_error_t *err,
+ jthrowable jcause = NULL);
+
+ /**
* Throw a Java exception corresponding to err, and run
* svn_error_clear() on err.
*/
@@ -178,7 +185,8 @@ class JNIUtil
friend bool initialize_jni_util(JNIEnv *env);
static bool JNIGlobalInit(JNIEnv *env);
- static void wrappedHandleSVNError(svn_error_t *err, jthrowable jcause);
+ static jthrowable wrappedCreateClientException(svn_error_t *err,
+ jthrowable jcause);
static void putErrorsInTrace(svn_error_t *err,
std::vector<jobject> &stackTrace);
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/SVNRepos.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/SVNRepos.cpp?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/SVNRepos.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/SVNRepos.cpp Fri Sep 11 15:51:30 2015
@@ -26,7 +26,6 @@
#include "SVNRepos.h"
#include "CreateJ.h"
-#include "ReposNotifyCallback.h"
#include "JNIUtil.h"
#include "svn_error_codes.h"
#include "svn_repos.h"
@@ -241,8 +240,9 @@ void SVNRepos::dump(File &path, OutputSt
" (%ld)"), youngest), );
}
- SVN_JNI_ERR(svn_repos_dump_fs3(repos, dataOut.getStream(requestPool),
+ SVN_JNI_ERR(svn_repos_dump_fs4(repos, dataOut.getStream(requestPool),
lower, upper, incremental, useDeltas,
+ true, true,
notifyCallback != NULL
? ReposNotifyCallback::notify
: NULL,
@@ -594,8 +594,9 @@ SVNRepos::getRevnum(svn_revnum_t *revnum
void
SVNRepos::verify(File &path, Revision &revisionStart, Revision &revisionEnd,
- bool keepGoing, bool checkNormalization, bool metadataOnly,
- ReposNotifyCallback *notifyCallback)
+ bool checkNormalization, bool metadataOnly,
+ ReposNotifyCallback *notifyCallback,
+ ReposVerifyCallback *verifyCallback)
{
SVN::Pool requestPool;
svn_repos_t *repos;
@@ -639,13 +640,14 @@ SVNRepos::verify(File &path, Revision &r
_("Start revision cannot be higher than end revision")), );
SVN_JNI_ERR(svn_repos_verify_fs3(repos, lower, upper,
- keepGoing,
checkNormalization,
metadataOnly,
- notifyCallback != NULL
- ? ReposNotifyCallback::notify
- : NULL,
+ (!notifyCallback ? NULL
+ : ReposNotifyCallback::notify),
notifyCallback,
+ (!verifyCallback ? NULL
+ : ReposVerifyCallback::callback),
+ verifyCallback,
checkCancel, this /* cancel callback/baton */,
requestPool.getPool()), );
}
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/SVNRepos.h
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/SVNRepos.h?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/SVNRepos.h (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/SVNRepos.h Fri Sep 11 15:51:30 2015
@@ -35,6 +35,7 @@
#include "InputStream.h"
#include "MessageReceiver.h"
#include "ReposNotifyCallback.h"
+#include "ReposVerifyCallback.h"
#include "ReposFreezeAction.h"
#include "StringArray.h"
#include "File.h"
@@ -45,8 +46,9 @@ class SVNRepos : public SVNBase
void rmlocks(File &path, StringArray &locks);
jobject lslocks(File &path, svn_depth_t depth);
void verify(File &path, Revision &revisionStart, Revision &revisionEnd,
- bool keepGoing, bool checkNormalization, bool metadataOnly,
- ReposNotifyCallback *notifyCallback);
+ bool checkNormalization, bool metadataOnly,
+ ReposNotifyCallback *notifyCallback,
+ ReposVerifyCallback *verifyCallback);
void setRevProp(File &path, Revision &revision,
const char *propName, const char *propValue,
bool usePreRevPropChangeHook,
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNRepos.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNRepos.cpp?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNRepos.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNRepos.cpp Fri Sep 11 15:51:30 2015
@@ -419,8 +419,8 @@ JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNRepos_verify(
JNIEnv *env, jobject jthis, jobject jpath,
jobject jrevisionStart, jobject jrevisionEnd,
- jboolean jkeepGoing, jboolean jcheckNormalization, jboolean jmetadataOnly,
- jobject jcallback)
+ jboolean jcheckNormalization, jboolean jmetadataOnly,
+ jobject jnotifyCallback, jobject jverifyCallback)
{
JNIEntry(SVNRepos, verify);
SVNRepos *cl = SVNRepos::getCppObject(jthis);
@@ -442,13 +442,18 @@ Java_org_apache_subversion_javahl_SVNRep
if (JNIUtil::isExceptionThrown())
return;
- ReposNotifyCallback callback(jcallback);
+ ReposNotifyCallback notify_cb(jnotifyCallback);
+ if (JNIUtil::isExceptionThrown())
+ return;
+
+ ReposVerifyCallback verify_cb(jverifyCallback);
if (JNIUtil::isExceptionThrown())
return;
cl->verify(path, revisionStart, revisionEnd,
- jkeepGoing, jcheckNormalization, jmetadataOnly,
- jcallback != NULL ? &callback : NULL);
+ jcheckNormalization, jmetadataOnly,
+ jnotifyCallback != NULL ? ¬ify_cb : NULL,
+ jverifyCallback != NULL ? &verify_cb : NULL);
}
JNIEXPORT jobject JNICALL
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRepos.java
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRepos.java?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRepos.java (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRepos.java Fri Sep 11 15:51:30 2015
@@ -29,6 +29,7 @@ import java.io.InputStream;
import java.io.File;
import org.apache.subversion.javahl.callback.ReposNotifyCallback;
+import org.apache.subversion.javahl.callback.ReposVerifyCallback;
import org.apache.subversion.javahl.callback.ReposFreezeAction;
import org.apache.subversion.javahl.types.*;
@@ -295,32 +296,44 @@ public interface ISVNRepos {
/**
* Verify the repository at <code>path</code> between revisions
* <code>start</code> and <code>end</code>.
+ *<p>
+ * If <code>verifyCallback</code> is <code>null</code>, verification
+ * will stop at the first encountered error. Otherwise, the verification
+ * process may continue, depending on the value returned from the
+ * invocation of <code>verifyCallback</code>.
*
* @param path the path to the repository
* @param start the first revision
* @param end the last revision
- * @param keepGoing continue verification even if a revision is bad
- * @param checkNormalization report directory entry and mergeinfo name collisions
- * caused by denormalized Unicode representations
- * @param metadataOnly check only metadata, not file contents
- * @param callback the callback to receive notifications
+ * @param checkNormalization report directory entry and mergeinfo name collisions
+ * caused by denormalized Unicode representations
+ * @param metadataOnly check only metadata, not file contents
+ * @param notifyCallback the callback to receive notifications
+ * @param verifyCallback the callback to receive verification status
* @throws ClientException If an error occurred.
- * @since 1.9
+ * @since 1.9
*/
public abstract void verify(File path, Revision start, Revision end,
- boolean keepGoing, boolean checkNormalization,
+ boolean checkNormalization,
boolean metadataOnly,
- ReposNotifyCallback callback)
+ ReposNotifyCallback notifyCallback,
+ ReposVerifyCallback verifyCallback)
throws ClientException;
/**
* Verify the repository at <code>path</code> between revisions
* <code>start</code> and <code>end</code>.
+ *<p>
+ *<b>Note:</b> Behaves like the 1.9 version with
+ * <code>checkNormailzation</code> and
+ * <code>metadataOnly</code> set to <code>false</code>
+ * and <code>verifyCallback</code> set to
+ * <code>null</code>.
*
* @param path the path to the repository
* @param start the first revision
* @param end the last revision
- * @param callback the callback to receive notifications
+ * @param callback the callback to receive notifications
* @throws ClientException If an error occurred.
*/
public abstract void verify(File path, Revision start, Revision end,
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/src/org/apache/subversion/javahl/ReposNotifyInformation.java
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/src/org/apache/subversion/javahl/ReposNotifyInformation.java?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/src/org/apache/subversion/javahl/ReposNotifyInformation.java (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/src/org/apache/subversion/javahl/ReposNotifyInformation.java Fri Sep 11 15:51:30 2015
@@ -35,7 +35,7 @@ public class ReposNotifyInformation exte
// Update the serialVersionUID when there is a incompatible change made to
// this class. See the java documentation for when a change is incompatible.
// http://java.sun.com/javase/7/docs/platform/serialization/spec/version.html#6678
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
/**
* The {@link Action} which triggered this event.
@@ -199,12 +199,6 @@ public class ReposNotifyInformation exte
verify_rev_structure,
/**
- * A revision is found with corruption/errors.
- * @since 1.9
- */
- failure,
-
- /**
* A revprop shard got packed. @
* @since 1.9
*/
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNRepos.java
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNRepos.java?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNRepos.java (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNRepos.java Fri Sep 11 15:51:30 2015
@@ -29,6 +29,7 @@ import java.io.InputStream;
import java.io.File;
import org.apache.subversion.javahl.callback.ReposNotifyCallback;
+import org.apache.subversion.javahl.callback.ReposVerifyCallback;
import org.apache.subversion.javahl.callback.ReposFreezeAction;
import org.apache.subversion.javahl.types.*;
@@ -238,13 +239,14 @@ public class SVNRepos implements ISVNRep
ReposNotifyCallback callback)
throws ClientException
{
- verify(path, start, end, false, false, false, callback);
+ verify(path, start, end, false, false, callback, null);
}
public native void verify(File path, Revision start, Revision end,
- boolean keepGoing, boolean checkNormalization,
- boolean metadataOnly,
- ReposNotifyCallback callback)
+ boolean checkNormalization,
+ boolean metadataOnly,
+ ReposNotifyCallback notifyCallback,
+ ReposVerifyCallback verifyCallback)
throws ClientException;
/**
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNReposTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNReposTests.java?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNReposTests.java (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNReposTests.java Fri Sep 11 15:51:30 2015
@@ -26,6 +26,7 @@ import org.apache.subversion.javahl.call
import org.apache.subversion.javahl.types.*;
import java.io.File;
+import java.io.FileWriter;
import java.io.FileInputStream;
import java.io.OutputStream;
import java.io.InputStream;
@@ -99,12 +100,107 @@ public class SVNReposTests extends SVNTe
public void testVerify()
throws SubversionException, IOException
{
- OneTest thisTest = new OneTest(false);
+ OneTest thisTest = new OneTest(false, true);
admin.verify(thisTest.getRepository(), Revision.getInstance(0),
Revision.HEAD, null);
}
- /* This test only tests the call down to the C++ layer. */
+ private class VerifyCallback implements ReposVerifyCallback
+ {
+ public int mderr = 0;
+ public int reverr = 0;
+ public boolean keepGoing = false;
+
+ public void onVerifyError(long revision, ClientException verifyError)
+ throws ClientException
+ {
+ if (revision == Revision.SVN_INVALID_REVNUM) {
+ ++mderr;
+ }
+ else {
+ ++reverr;
+ }
+ if (keepGoing) {
+ return;
+ }
+ else {
+ throw verifyError;
+ }
+ }
+
+ }
+
+ private boolean tryToBreakRepo(OneTest test) throws IOException
+ {
+ File repo = test.getRepository();
+
+ // Check for a sharded repo first
+ File rev1 = new File(repo, "db/revs/0/1");
+ if (!rev1.exists() || !rev1.setWritable(true))
+ {
+ // Try non-sharded
+ rev1 = new File(repo, "db/revs/1");
+ }
+ if (!rev1.exists() || !rev1.setWritable(true))
+ return false;
+
+ FileWriter fd = new FileWriter(rev1);
+ fd.write("inserting junk to corrupt the rev");
+ fd.close();
+ return true;
+ }
+
+ public void testVerifyBrokenRepo() throws Throwable
+ {
+ OneTest thisTest = new OneTest(false, true);
+
+ if (!tryToBreakRepo(thisTest)) {
+ // We don't support the repos format
+ System.err.print("Cannot break repository for verify test.");
+ return;
+ }
+
+ VerifyCallback cb = new VerifyCallback();
+ cb.keepGoing = false;
+
+ try {
+ admin.verify(thisTest.getRepository(),
+ Revision.getInstance(0),
+ Revision.HEAD,
+ false, false, null, cb);
+ }
+ catch(ClientException ex) {
+ assertEquals(cb.mderr, 1);
+ assertEquals(cb.reverr, 0);
+ return;
+ }
+
+ assert("Verify did not catch repository corruption." == "");
+ }
+
+ public void testVerifyBrokenRepo_KeepGoing() throws Throwable
+ {
+ OneTest thisTest = new OneTest(false, true);
+
+ if (!tryToBreakRepo(thisTest)) {
+ // We don't support the repos format
+ System.err.print("Cannot break repository for verify test.");
+ return;
+ }
+
+ VerifyCallback cb = new VerifyCallback();
+ cb.keepGoing = true;
+
+ admin.verify(thisTest.getRepository(),
+ Revision.getInstance(0),
+ Revision.HEAD,
+ false, false, null, cb);
+
+ assertEquals(cb.mderr, 1);
+ assertEquals(cb.reverr, 1);
+ }
+
+ /* this test only tests the call down to the C++ layer. */
public void testUpgrade()
throws SubversionException, IOException
{
Modified: subversion/branches/reuse-ra-session/subversion/bindings/swig/INSTALL
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/swig/INSTALL?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/swig/INSTALL (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/swig/INSTALL Fri Sep 11 15:51:30 2015
@@ -80,7 +80,7 @@ Step 1: Install a suitable version of S
--with-python=/path/to/correct/python/binary
- to the configure script. You need Python 2.5 or above.
+ to the configure script. You need Python 2.7 or above.
If you plan to build the Perl bindings, and have a system
with more than one version of perl installed, you may need
@@ -109,7 +109,7 @@ Step 2: Build and Install Subversion.
python executable you used to configure SWIG as above. If it does not then
you can specify the correct path by adding PYTHON=/path/to/python or
PERL=/path/to/perl onto the command line for configure. For example:
- ./configure PYTHON=/usr/bin/python2.5 PERL=/usr/bin/perl5.8.0
+ ./configure PYTHON=/usr/bin/python2.7 PERL=/usr/bin/perl5.8.0
If Subversion's ./configure finds a SWIG that it's happy with, then
it will build special glue libraries to link svn to the swig bindings:
Modified: subversion/branches/reuse-ra-session/subversion/bindings/swig/include/svn_types.swg
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/swig/include/svn_types.swg?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/swig/include/svn_types.swg (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/swig/include/svn_types.swg Fri Sep 11 15:51:30 2015
@@ -69,6 +69,15 @@
#endif
}
+%typemap(in,warning="901:FIXME: Missing old_value_p typemap") const svn_string_t *const *old_value_p {
+#if defined(SWIGRUBY) && SWIG_VERSION <= 0x010329
+ /* Ruby fails to define $symname. */
+ SWIG_exception(SWIG_ValueError, "Function is not implemented yet");
+#else
+ SWIG_exception(SWIG_ValueError, "$symname is not implemented yet");
+#endif
+}
+
#ifdef SWIGPYTHON
%typemap(argout) SWIGTYPE **OUTPARAM {
%append_output(svn_swig_py_new_pointer_obj(*$1, $*1_descriptor,
@@ -1152,6 +1161,7 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
#endif
#ifdef SWIGPYTHON
+/* ### Verify if this should use '[]' like perl and ruby */
%typemap(in) const unsigned char *digest {
if ($input == Py_None) {
$1 = NULL;
@@ -1163,7 +1173,7 @@ svn_ ## TYPE ## _swig_rb_closed(VALUE se
#endif
#ifdef SWIGRUBY
-%typemap(in) const unsigned char *digest
+%typemap(in) const unsigned char digest[]
{
if (NIL_P($input)) {
$1 = NULL;
Modified: subversion/branches/reuse-ra-session/subversion/bindings/swig/python/svn/core.py
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/swig/python/svn/core.py?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/swig/python/svn/core.py (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/swig/python/svn/core.py Fri Sep 11 15:51:30 2015
@@ -32,14 +32,6 @@ import sys
class SubversionException(Exception):
- # Python 2.6 deprecated BaseException.message, which we inadvertently use.
- # We override it here, so the users of this class are spared from
- # DeprecationWarnings.
- # Note that BaseException.message is not deprecated in Python 2.5, and
- # isn't present in all other versions.
- if sys.version_info[0:2] == (2, 6):
- message = None
-
def __init__(self, message=None, apr_err=None, child=None,
file=None, line=None):
"""Initialize a new Subversion exception object.
Modified: subversion/branches/reuse-ra-session/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb__pre_ruby.h
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb__pre_ruby.h?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb__pre_ruby.h (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb__pre_ruby.h Fri Sep 11 15:51:30 2015
@@ -85,6 +85,11 @@ typedef unsigned __int64 uint64_t;
#undef HAVE_INTTYPES_H
#endif
+/* Visual Studio >= 2015 has timespec defined */
+#if _MSC_VER >= 1900
+#define HAVE_STRUCT_TIMESPEC
+#endif
+
#ifdef _MSC_VER
#pragma warning(disable: 4702) /* warning C4702: unreachable code */
#endif
Modified: subversion/branches/reuse-ra-session/subversion/bindings/swig/svn_client.i
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/swig/svn_client.i?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/swig/svn_client.i (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/swig/svn_client.i Fri Sep 11 15:51:30 2015
@@ -442,13 +442,13 @@ Callback: svn_client_diff_summarize_func
self = apr_palloc(pool, sizeof(*self));
self->path = path ? apr_pstrdup(pool, path) : NULL;
- revision = apr_palloc(pool, sizeof(revision));
+ revision = apr_palloc(pool, sizeof(*revision));
revision->kind = rev->kind;
revision->value.number = rev->value.number;
revision->value.date = rev->value.date;
self->revision = revision;
- peg_revision = apr_palloc(pool, sizeof(peg_revision));
+ peg_revision = apr_palloc(pool, sizeof(*peg_revision));
peg_revision->kind = peg_rev->kind;
peg_revision->value.number = peg_rev->value.number;
peg_revision->value.date = peg_rev->value.date;
Modified: subversion/branches/reuse-ra-session/subversion/include/private/svn_atomic.h
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/include/private/svn_atomic.h?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/include/private/svn_atomic.h (original)
+++ subversion/branches/reuse-ra-session/subversion/include/private/svn_atomic.h Fri Sep 11 15:51:30 2015
@@ -85,15 +85,15 @@ extern "C" {
* @return an #svn_error_t if the initialization fails.
* @since New in 1.10
*/
-typedef svn_error_t *(svn_atomic__err_init_func_t)(void *baton,
- apr_pool_t *pool);
+typedef svn_error_t *(*svn_atomic__err_init_func_t)(void *baton,
+ apr_pool_t *pool);
/**
* Callback for svn_atomic__init_no_error().
* @return a string containing an error message if the initialization fails.
* @since New in 1.10
*/
-typedef const char *(svn_atomic__str_init_func_t)(void *baton);
+typedef const char *(*svn_atomic__str_init_func_t)(void *baton);
/**
* Call an initialization function in a thread-safe manner.
Modified: subversion/branches/reuse-ra-session/subversion/include/private/svn_cache.h
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/include/private/svn_cache.h?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/include/private/svn_cache.h (original)
+++ subversion/branches/reuse-ra-session/subversion/include/private/svn_cache.h Fri Sep 11 15:51:30 2015
@@ -356,7 +356,12 @@ svn_cache__membuffer_cache_create(svn_me
*
* If @a thread_safe is true, and APR is compiled with threads, all
* accesses to the cache will be protected with a mutex, if the shared
- * @a memcache has also been created with thread_safe flag set.
+ * @a membuffer has also been created with thread_safe flag set.
+ *
+ * If @a short_lived is set, assume that the data stored through this
+ * cache will probably only be needed for a short period of time.
+ * Typically, some UUID is used as part of the prefix in that scenario.
+ * This flag is a mere hint and does not affect functionality.
*
* These caches do not support svn_cache__iter.
*/
@@ -369,10 +374,24 @@ svn_cache__create_membuffer_cache(svn_ca
const char *prefix,
apr_uint32_t priority,
svn_boolean_t thread_safe,
+ svn_boolean_t short_lived,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
/**
+ * Creates a null-cache instance in @a *cache_p, allocated from
+ * @a result_pool. The given @c id is the only data stored in it and can
+ * be retrieved through svn_cache__get_info().
+ *
+ * The cache object will immediately evict (reject) any data being added
+ * to it and will always report as empty.
+ */
+svn_error_t *
+svn_cache__create_null(svn_cache__t **cache_p,
+ const char *id,
+ apr_pool_t *result_pool);
+
+/**
* Sets @a handler to be @a cache's error handling routine. If any
* error is returned from a call to svn_cache__get or svn_cache__set, @a
* handler will be called with @a baton and the error, and the
Modified: subversion/branches/reuse-ra-session/subversion/include/private/svn_dep_compat.h
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/include/private/svn_dep_compat.h?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/include/private/svn_dep_compat.h (original)
+++ subversion/branches/reuse-ra-session/subversion/include/private/svn_dep_compat.h Fri Sep 11 15:51:30 2015
@@ -90,12 +90,8 @@ extern "C" {
|| (defined(__APPLE__) && defined(__MACH__))) /* UNIX-style OS? */
# include <unistd.h>
# if defined(_POSIX_VERSION)
-# define SVN_ON_POSIX 1
-# else
-# define SVN_ON_POSIX 0
+# define SVN_ON_POSIX
# endif
-#else
-# define SVN_ON_POSIX 0
#endif
#endif
Modified: subversion/branches/reuse-ra-session/subversion/include/private/svn_io_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/include/private/svn_io_private.h?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/include/private/svn_io_private.h (original)
+++ subversion/branches/reuse-ra-session/subversion/include/private/svn_io_private.h Fri Sep 11 15:51:30 2015
@@ -171,6 +171,26 @@ svn_error_t*
svn_io__utf8_to_unicode_longpath(const WCHAR **result,
const char *source,
apr_pool_t *result_pool);
+
+/* This Windows-specific function marks the file to be deleted on close using
+ an existing file handle. It can be used to avoid having to reopen the file
+ as part of the delete handling. Return SVN_ERR_UNSUPPORTED_FEATURE if
+ delete on close operation is not supported by OS. */
+svn_error_t *
+svn_io__win_delete_file_on_close(apr_file_t *file,
+ const char *path,
+ apr_pool_t *pool);
+
+/* This Windows-specific function renames the file using an existing file
+ handle. It can be used to avoid having to reopen the file as part of the
+ rename operation. Return SVN_ERR_UNSUPPORTED_FEATURE if renaming open
+ file is not supported by OS.*/
+svn_error_t *
+svn_io__win_rename_open_file(apr_file_t *file,
+ const char *from_path,
+ const char *to_path,
+ apr_pool_t *pool);
+
#endif /* WIN32 */
#ifdef __cplusplus
Modified: subversion/branches/reuse-ra-session/subversion/include/private/svn_mutex.h
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/include/private/svn_mutex.h?rev=1702504&r1=1702503&r2=1702504&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/include/private/svn_mutex.h (original)
+++ subversion/branches/reuse-ra-session/subversion/include/private/svn_mutex.h Fri Sep 11 15:51:30 2015
@@ -104,6 +104,17 @@ do {
SVN_ERR(svn_mutex__unlock(svn_mutex__m, (expr))); \
} while (0)
+#if APR_HAS_THREADS
+
+/** Return the APR mutex encapsulated in @a mutex.
+ *
+ * @note This function should only be called by APR wrapper code.
+ */
+apr_thread_mutex_t *
+svn_mutex__get(svn_mutex__t *mutex);
+
+#endif
+
#ifdef __cplusplus
}
#endif /* __cplusplus */