You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/01/26 22:52:10 UTC
svn commit: r1063881 [1/3] - in
/subversion/branches/diff-optimizations-bytes: ./ build/ build/ac-macros/
subversion/bindings/javahl/tests/org/apache/subversion/javahl/
subversion/include/ subversion/include/private/ subversion/libsvn_client/
subversio...
Author: hwright
Date: Wed Jan 26 21:52:08 2011
New Revision: 1063881
URL: http://svn.apache.org/viewvc?rev=1063881&view=rev
Log:
* On the diff-optimizaitons-bytes branch:
Bring up-to-date with trunk.
Added:
subversion/branches/diff-optimizations-bytes/subversion/include/private/svn_fspath.h
- copied unchanged from r1063876, subversion/trunk/subversion/include/private/svn_fspath.h
subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/wc_db_pristine.c
- copied unchanged from r1063876, subversion/trunk/subversion/libsvn_wc/wc_db_pristine.c
subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests_data/descend-into-replace.dump
- copied unchanged from r1063876, subversion/trunk/subversion/tests/cmdline/svnsync_tests_data/descend-into-replace.dump
subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests_data/descend-into-replace.expected.dump
- copied unchanged from r1063876, subversion/trunk/subversion/tests/cmdline/svnsync_tests_data/descend-into-replace.expected.dump
subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests_data/dir-prop-change.dump
- copied unchanged from r1063876, subversion/trunk/subversion/tests/cmdline/svnsync_tests_data/dir-prop-change.dump
subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests_data/repo-with-copy-of-root-dir.dump
- copied unchanged from r1063876, subversion/trunk/subversion/tests/cmdline/svnsync_tests_data/repo-with-copy-of-root-dir.dump
Removed:
subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests_data/descend_into_replace.dump
subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests_data/descend_into_replace.expected.dump
subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests_data/dir_prop_change.dump
subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests_data/repo_with_copy_of_root_dir.dump
Modified:
subversion/branches/diff-optimizations-bytes/ (props changed)
subversion/branches/diff-optimizations-bytes/COMMITTERS
subversion/branches/diff-optimizations-bytes/build.conf
subversion/branches/diff-optimizations-bytes/build/ac-macros/neon.m4
subversion/branches/diff-optimizations-bytes/build/run_tests.py
subversion/branches/diff-optimizations-bytes/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
subversion/branches/diff-optimizations-bytes/subversion/include/private/svn_adler32.h (props changed)
subversion/branches/diff-optimizations-bytes/subversion/include/private/svn_repos_private.h
subversion/branches/diff-optimizations-bytes/subversion/include/svn_client.h
subversion/branches/diff-optimizations-bytes/subversion/include/svn_dirent_uri.h
subversion/branches/diff-optimizations-bytes/subversion/include/svn_repos.h
subversion/branches/diff-optimizations-bytes/subversion/include/svn_subst.h
subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/copy.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/list.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/merge.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/mergeinfo.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/patch.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/update.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_delta/path_driver.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_base/dag.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_base/tree.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/dag.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/fs_fs.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/lock.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/tree.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_local/ra_plugin.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/fetch.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/authz.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/hooks.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/load.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/replay.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/reporter.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/repos.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/adler32.c (props changed)
subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/config_file.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/deprecated.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/dirent_uri.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/io.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/mergeinfo.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/path.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/subst.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/relocate.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/status.c
subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/wc-metadata.sql
subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/wc_db.c
subversion/branches/diff-optimizations-bytes/subversion/mod_dav_svn/reports/update.c
subversion/branches/diff-optimizations-bytes/subversion/svn/lock-cmd.c
subversion/branches/diff-optimizations-bytes/subversion/svn/main.c
subversion/branches/diff-optimizations-bytes/subversion/svn/patch-cmd.c
subversion/branches/diff-optimizations-bytes/subversion/svn/propset-cmd.c
subversion/branches/diff-optimizations-bytes/subversion/svn/util.c
subversion/branches/diff-optimizations-bytes/subversion/svnadmin/main.c
subversion/branches/diff-optimizations-bytes/subversion/svnlook/main.c
subversion/branches/diff-optimizations-bytes/subversion/svnrdump/load_editor.c
subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/davautocheck.sh
subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/merge_tests.py
subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests.py
subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests_data/descend-into-replace.dump
subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnrdump_tests_data/descend-into-replace.expected.dump
subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests.py
subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svntest/main.py
subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svntest/verify.py
subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/switch_tests.py
subversion/branches/diff-optimizations-bytes/subversion/tests/libsvn_subr/dirent_uri-test.c
subversion/branches/diff-optimizations-bytes/subversion/tests/libsvn_subr/subst_translate-test.c
subversion/branches/diff-optimizations-bytes/subversion/tests/svn_test.h
subversion/branches/diff-optimizations-bytes/subversion/tests/svn_test_main.c
subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svnbuild.sh
subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svncheck-bindings.sh
subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svncheck.sh
subversion/branches/diff-optimizations-bytes/tools/buildbot/slaves/svn-openbsd-i386/svnclean.sh
subversion/branches/diff-optimizations-bytes/tools/client-side/svnmucc/svnmucc.c
subversion/branches/diff-optimizations-bytes/tools/dev/unix-build/Makefile.svn
subversion/branches/diff-optimizations-bytes/win-tests.py
Propchange: subversion/branches/diff-optimizations-bytes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 26 21:52:08 2011
@@ -40,4 +40,4 @@
/subversion/branches/tc_url_rev:874351-874483
/subversion/branches/tree-conflicts:868291-873154
/subversion/branches/tree-conflicts-notify:873926-874008
-/subversion/trunk:1031270-1058787
+/subversion/trunk:1031270-1063879
Modified: subversion/branches/diff-optimizations-bytes/COMMITTERS
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/COMMITTERS?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/COMMITTERS [UTF-8] (original)
+++ subversion/branches/diff-optimizations-bytes/COMMITTERS [UTF-8] Wed Jan 26 21:52:08 2011
@@ -54,7 +54,7 @@ Blanket commit access:
neels Neels J. Hofmeyr <ne...@elego.de>
jwhitlock Jeremy Whitlock <jc...@gmail.com>
sbutler Stephen Butler <sb...@elego.de>
- dannas Daniel Näslund <da...@elego.de>
+ dannas Daniel Näslund <da...@dannas.name>
stefan2 Stefan Fuhrmann <st...@alice-dsl.de>
[[END ACTIVE FULL COMMITTERS. LEAVE THIS LINE HERE; SCRIPTS LOOK FOR IT.]]
Modified: subversion/branches/diff-optimizations-bytes/build.conf
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/build.conf?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/build.conf (original)
+++ subversion/branches/diff-optimizations-bytes/build.conf Wed Jan 26 21:52:08 2011
@@ -325,7 +325,7 @@ msvc-export =
svn_sorts.h svn_string.h svn_subst.h svn_time.h svn_types.h svn_user.h
svn_utf.h svn_version.h svn_xml.h
private\svn_atomic.h private\svn_cache.h private\svn_cmdline_private.h
- private\svn_debug.h
+ private\svn_debug.h private\svn_fspath.h
private\svn_log.h private\svn_mergeinfo_private.h
private\svn_opt_private.h private\svn_skel.h private\svn_sqlite.h
private\svn_utf_private.h private\svn_eol_private.h
Modified: subversion/branches/diff-optimizations-bytes/build/ac-macros/neon.m4
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/build/ac-macros/neon.m4?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/build/ac-macros/neon.m4 (original)
+++ subversion/branches/diff-optimizations-bytes/build/ac-macros/neon.m4 Wed Jan 26 21:52:08 2011
@@ -61,6 +61,10 @@ AC_DEFUN(SVN_LIB_NEON,
fi
SVN_NEON_CONFIG()
+ ],
+ [
+ AC_PATH_PROG(neon_config, neon-config)
+ SVN_NEON_CONFIG()
])
AC_SUBST(SVN_NEON_INCLUDES)
Modified: subversion/branches/diff-optimizations-bytes/build/run_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/build/run_tests.py?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/build/run_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/build/run_tests.py Wed Jan 26 21:52:08 2011
@@ -79,7 +79,7 @@ class TestHarness:
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):
+ list_tests=None, svn_bin=None, mode_filter=None):
'''Construct a TestHarness instance.
ABS_SRCDIR and ABS_BUILDDIR are the source and build directories.
@@ -91,6 +91,8 @@ class TestHarness:
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).
'''
self.srcdir = abs_srcdir
self.builddir = abs_builddir
@@ -113,6 +115,7 @@ class TestHarness:
self.config_file = os.path.abspath(config_file)
self.list_tests = list_tests
self.svn_bin = svn_bin
+ self.mode_filter = mode_filter
self.log = None
if not sys.stdout.isatty() or sys.platform == 'win32':
TextColors.disable()
@@ -151,16 +154,26 @@ class TestHarness:
sys.stdout.write('%s\n [[%s'
% (x[:wip], x[wip + len(wimptag):]))
- passed = [x for x in log_lines if x[:6] == 'PASS: ']
+ if self.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: ']
- skipped = [x for x in log_lines if x[:6] == 'SKIP: ']
- if skipped:
+ if self.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:
print('At least one test was SKIPPED, checking ' + self.logfile)
for x in skipped:
sys.stdout.write(x)
- xfailed = [x for x in log_lines if x[:6] == 'XFAIL:']
- if xfailed:
+ if self.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:
print('At least one test XFAILED, checking ' + self.logfile)
for x in xfailed:
printxfail(x)
@@ -178,21 +191,40 @@ class TestHarness:
sys.stdout.write(x)
# Print summaries, from least interesting to most interesting.
- print('Summary of test results:')
+ if self.list_tests:
+ print('Summary of test listing:')
+ else:
+ print('Summary of test results:')
if passed:
- print(' %d test%s PASSED'
- % (len(passed), 's'*min(len(passed) - 1, 1)))
+ if self.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:
- print(' %d test%s SKIPPED'
- % (len(skipped), 's'*min(len(skipped) - 1, 1)))
+ if self.list_tests:
+ print(' %d test%s are set as SKIP'
+ % (len(skipped), 's'*min(len(skipped) - 1, 1)))
+ else:
+ print(' %d test%s SKIPPED'
+ % (len(skipped), 's'*min(len(skipped) - 1, 1)))
if xfailed:
passwimp = [x for x in xfailed if 0 <= x.find(wimptag)]
if passwimp:
- print(' %d test%s XFAILED (%d WORK-IN-PROGRESS)'
- % (len(xfailed), 's'*min(len(xfailed) - 1, 1), len(passwimp)))
+ if self.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:
- print(' %d test%s XFAILED'
- % (len(xfailed), 's'*min(len(xfailed) - 1, 1)))
+ if self.list_tests:
+ print(' %d test%s are set as XFAIL'
+ % (len(xfailed), 's'*min(len(xfailed) - 1, 1)))
+ else:
+ print(' %d test%s XFAILED'
+ % (len(xfailed), 's'*min(len(xfailed) - 1, 1)))
if xpassed:
failwimp = [x for x in xpassed if 0 <= x.find(wimptag)]
if failwimp:
@@ -245,8 +277,9 @@ class TestHarness:
'Run a c test, escaping parameters as required.'
progdir, progbase = os.path.split(prog)
- sys.stdout.write('.' * dot_count)
- sys.stdout.flush()
+ if not self.list_tests:
+ sys.stdout.write('.' * dot_count)
+ sys.stdout.flush()
if os.access(progbase, os.X_OK):
progname = './' + progbase
@@ -265,18 +298,12 @@ class TestHarness:
cmdline.append('--cleanup')
if self.fs_type is not None:
cmdline.append('--fs-type=' + self.fs_type)
- if self.http_library is not None:
- cmdline.append('--http-library=' + self.http_library)
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.svn_bin is not None:
- cmdline.append('--bin=' + self.svn_bin)
- if self.fsfs_sharding is not None:
- cmdline.append('--fsfs-sharding=%d' % self.fsfs_sharding)
- if self.fsfs_packing is not None:
- cmdline.append('--fsfs-packing')
+ if self.mode_filter is not None:
+ cmdline.append('--mode-filter=' + self.mode_filter)
if test_nums:
test_nums = test_nums.split(',')
@@ -328,6 +355,8 @@ class TestHarness:
svntest.main.options.fsfs_sharding = 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
svntest.main.options.srcdir = self.srcdir
@@ -356,10 +385,16 @@ class TestHarness:
# run the tests
svntest.testcase.TextColors.disable()
+
+ if self.list_tests:
+ prog_f = None
+ else:
+ prog_f = progress_func
+
failed = svntest.main.execute_tests(prog_mod.test_list,
serial_only=serial_only,
test_name=progbase,
- progress_func=progress_func)
+ progress_func=prog_f)
# restore some values
sys.path = old_path
@@ -389,13 +424,20 @@ class TestHarness:
if self.log:
# Using write here because we don't want even a trailing space
test_info = '%s [%d/%d]' % (progbase, test_nr + 1, total_tests)
- sys.stdout.write('Running tests in %s' % (test_info, ))
+ if self.list_tests:
+ sys.stdout.write('Listing tests in %s' % (test_info, ))
+ else:
+ sys.stdout.write('Running tests in %s' % (test_info, ))
sys.stdout.flush()
else:
# ### Hack for --log-to-stdout to work (but not print any dots).
test_info = ''
- log.write('START: %s\n' % progbase)
+ if self.list_tests:
+ log.write('LISTING: %s\n' % progbase)
+ else:
+ log.write('START: %s\n' % progbase)
+
log.flush()
start_time = datetime.now()
@@ -427,18 +469,24 @@ class TestHarness:
else:
log.write('FAIL: %s: Unknown test failure.\n' % progbase)
- # Log the elapsed time.
- elapsed_time = str(datetime.now() - start_time)
- log.write('END: %s\n' % progbase)
- log.write('ELAPSED: %s %s\n' % (progbase, elapsed_time))
+ if not self.list_tests:
+ # Log the elapsed time.
+ elapsed_time = str(datetime.now() - start_time)
+ log.write('END: %s\n' % progbase)
+ log.write('ELAPSED: %s %s\n' % (progbase, elapsed_time))
+
log.write('\n')
- # If we printed a "Running all tests in ..." line, add the test result.
+ # 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 failed:
- print(TextColors.FAILURE + 'FAILURE' + TextColors.ENDC)
+ if self.list_tests:
+ print ''
else:
- print(TextColors.SUCCESS + 'success' + TextColors.ENDC)
+ if failed:
+ print(TextColors.FAILURE + 'FAILURE' + TextColors.ENDC)
+ else:
+ print(TextColors.SUCCESS + 'success' + TextColors.ENDC)
return failed
Modified: subversion/branches/diff-optimizations-bytes/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java Wed Jan 26 21:52:08 2011
@@ -2580,12 +2580,11 @@ public class BasicTests extends SVNTests
*/
public void testPatch() throws SubversionException, IOException
{
- OneTest thisTest = new OneTest(true);
- File patchInput = new File(super.localTmp, thisTest.testName);
- final String iotaPath = thisTest.getWCPath().replace('\\', '/') + "/iota";
+ OneTest thisTest = new OneTest(true);
+ File patchInput = new File(super.localTmp, thisTest.testName);
final String NL = System.getProperty("line.separator");
- final String patchText = "Index: iota" + NL +
+ final String patchText = "Index: iota" + NL +
"===================================================================" + NL +
"--- iota\t(revision 1)" + NL +
"+++ iota\t(working copy)" + NL +
@@ -2598,14 +2597,16 @@ public class BasicTests extends SVNTests
writer.flush();
writer.close();
- client.patch(patchInput.getAbsolutePath(), iotaPath, false, 0,
- false, true, true,
- new PatchCallback() {
- public boolean singlePatch(String pathFromPatchfile,
- String patchPath, String rejectPath) {
- // Do nothing, right now.
- return false;
- }
+ client.patch(patchInput.getAbsolutePath(),
+ thisTest.getWCPath().replace('\\', '/'), false, 0,
+ false, true, true,
+ new PatchCallback() {
+ public boolean singlePatch(String pathFromPatchfile,
+ String patchPath,
+ String rejectPath) {
+ // Do nothing, right now.
+ return false;
+ }
});
}
Propchange: subversion/branches/diff-optimizations-bytes/subversion/include/private/svn_adler32.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 26 21:52:08 2011
@@ -40,4 +40,4 @@
/subversion/branches/tc_url_rev/subversion/libsvn_diff/diff.h:874351-874483
/subversion/branches/tree-conflicts/subversion/libsvn_diff/diff.h:868291-873154
/subversion/branches/tree-conflicts-notify/subversion/libsvn_diff/diff.h:873926-874008
-/subversion/trunk/subversion/include/private/svn_adler32.h:1054278-1058787
+/subversion/trunk/subversion/include/private/svn_adler32.h:1054278-1063879
Modified: subversion/branches/diff-optimizations-bytes/subversion/include/private/svn_repos_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/include/private/svn_repos_private.h?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/include/private/svn_repos_private.h (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/include/private/svn_repos_private.h Wed Jan 26 21:52:08 2011
@@ -69,6 +69,24 @@ svn_repos__obliterate_path_rev(svn_repos
const char *path,
apr_pool_t *pool);
+/** Return the path to @a repos's pre-obliterate hook, allocated in
+ * @a pool.
+ *
+ * @since New in 1.7.
+ */
+const char *
+svn_repos__pre_obliterate_hook(svn_repos_t *repos,
+ apr_pool_t *pool);
+
+/** Return the path to @a repos's post-obliterate hook, allocated in
+ * @a pool.
+ *
+ * @since New in 1.7.
+ */
+const char *
+svn_repos__post_obliterate_hook(svn_repos_t *repos,
+ apr_pool_t *pool);
+
/** Validate that property @a name is valid for use in a Subversion
* repository; return @c SVN_ERR_REPOS_BAD_ARGS if it isn't. For some
Modified: subversion/branches/diff-optimizations-bytes/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/include/svn_client.h?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/include/svn_client.h (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/include/svn_client.h Wed Jan 26 21:52:08 2011
@@ -5352,7 +5352,7 @@ typedef svn_error_t *(*svn_client_patch_
/**
* Apply a unidiff patch that's located at absolute path
- * @a patch_abspath to the working copy at @a local_abspath.
+ * @a patch_abspath to the working copy directory at @a local_abspath.
*
* This function makes a best-effort attempt at applying the patch.
* It might skip patch targets which cannot be patched (e.g. targets
Modified: subversion/branches/diff-optimizations-bytes/subversion/include/svn_dirent_uri.h
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/include/svn_dirent_uri.h?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/include/svn_dirent_uri.h (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/include/svn_dirent_uri.h Wed Jan 26 21:52:08 2011
@@ -25,30 +25,32 @@
*
* This library makes a clear distinction between several path formats:
*
- * - a dirent is a path on (local) disc or a UNC path (Windows) in either
- * relative or absolute format
- * Examples: "/foo/bar", "X:/temp", "//server/share" and on Windows "A:/"
- * But not: "http://server"
- *
- * - a URI is an absolute path that starts with a '/' or a schema definition.
- * Examples: "/", "/foo", "http://server", "svn+ssh://user@host:123/file"
- * But not: "file", "dir/file", "A:/dir"
- * ### Currently the URI implementation still allows relpaths as valid
- * uris, but this will change soon.
- *
- * - a relative path (relpath) is an unrooted path that can be joined to
- * any other relative path, uri or dirent. A relative path is never
- * rooted/prefixed by a '/'.
- * Examples: "file", "dir/file", "dir/subdir/../file"
- * But not: "/file", "http://server/file"
- *
- * - a Subversion filesystem path (fspath), otherwise known as a path
- * within a repository, is a path relative to the root of the repository
- * filesystem, that starts with a slash ("/"). The rules for a fspath
- * are the same as for a relpath except for the leading '/'. A fspath
- * never ends with '/' except when the whole path is just '/'.
- *
- * The fspath API is private.
+ * - a dirent is a path on (local) disc or a UNC path (Windows) in
+ * either relative or absolute format.
+ * Examples:
+ * "/foo/bar", "X:/temp", "//server/share", "A:/" (Windows only)
+ * But not:
+ * "http://server"
+ *
+ * - a uri, for our purposes, is a percent-encoded, absolute path
+ * (URI) that starts with a schema definition. In practice, these
+ * tend to look like URLs, but never carry query strings.
+ * Examples:
+ * "http://server", "file:///path/to/repos",
+ * "svn+ssh://user@host:123/My%20Stuff/file.doc"
+ * But not:
+ * "file", "dir/file", "A:/dir", "/My%20Stuff/file.doc"
+ * ### Currently the uri implementation still allows relative URIs
+ * ### (carrying both relative and absolute path data) as valid
+ * ### uris, but this will change soon.
+ *
+ * - a relative path (relpath) is an unrooted path that can be joined
+ * to any other relative path, uri or dirent. A relative path is
+ * never rooted/prefixed by a '/'.
+ * Examples:
+ * "file", "dir/file", "dir/subdir/../file"
+ * But not:
+ * "/file", "http://server/file"
*
* This distinction is needed because on Windows we have to handle some
* dirents and URIs differently. Since it's not possible to determine from
@@ -68,7 +70,14 @@
* - @c svn_relpath_local_style()
* - @c svn_uri_canonicalize()
* - @c svn_uri_is_canonical()
- * - @c svn_fspath__is_canonical()
+ *
+ * The Subversion codebase also recognizes another class of path. A
+ * Subversion filesystem path (fspath) -- otherwise known as a path
+ * within a repository -- is a path relative to the root of the
+ * repository filesystem, that starts with a slash ("/"). The rules
+ * for a fspath are the same as for a relpath except for the leading
+ * '/'. A fspath never ends with '/' except when the whole path is
+ * just '/'. The fspath API is private (see private/svn_fspath.h).
*
* Code that works with a path-in-repository should use, in order of
* preference: a relpath (preferred), or a fspath (widely used by legacy
@@ -820,119 +829,6 @@ svn_uri_get_file_url_from_dirent(const c
const char *dirent,
apr_pool_t *pool);
-
-/** Return TRUE iff @a fspath is canonical.
- * @a fspath need not be canonical, of course.
- *
- * @since New in 1.7.
- */
-svn_boolean_t
-svn_fspath__is_canonical(const char *fspath);
-
-
-/** Return the dirname of @a fspath, defined as the path with its basename
- * removed. If @a fspath is "/", return "/".
- *
- * Allocate the result in @a pool.
- *
- * @since New in 1.7.
- */
-const char *
-svn_fspath__dirname(const char *fspath,
- apr_pool_t *pool);
-
-/** Return the last component of @a fspath. The returned value will have no
- * slashes in it. If @a fspath is "/", return "".
- *
- * If @a pool is NULL, return a pointer to within @a fspath, else allocate
- * the result in @a pool.
- *
- * @since New in 1.7.
- */
-const char *
-svn_fspath__basename(const char *fspath,
- apr_pool_t *pool);
-
-/** Divide the canonical @a fspath into @a *dirpath and @a
- * *base_name, allocated in @a pool.
- *
- * If @a dirpath or @a base_name is NULL, then don't set that one.
- *
- * Either @a dirpath or @a base_name may be @a fspath's own address, but they
- * may not both be the same address, or the results are undefined.
- *
- * If @a fspath has two or more components, the separator between @a dirpath
- * and @a base_name is not included in either of the new names.
- *
- * @since New in 1.7.
- */
-void
-svn_fspath__split(const char **dirpath,
- const char **base_name,
- const char *fspath,
- apr_pool_t *result_pool);
-
-/** Return the fspath composed of @a fspath with @a relpath appended.
- * Allocate the result in @a result_pool.
- *
- * @since New in 1.7.
- */
-char *
-svn_fspath__join(const char *fspath,
- const char *relpath,
- apr_pool_t *result_pool);
-
-
-/** Test if @a child_fspath is a child of @a parent_fspath. If not, return
- * NULL. If so, return the relpath which, if joined to @a parent_fspath,
- * would yield @a child_fspath.
- *
- * If @a child_fspath is the same as @a parent_fspath, it is not considered
- * a child, so the result is NULL; an empty string is never returned.
- *
- * If @a pool is NULL, a pointer into @a child_fspath will be returned to
- * identify the remainder fspath.
- *
- * @since New in 1.7.
- */
-const char *
-svn_fspath__is_child(const char *parent_fspath,
- const char *child_fspath,
- apr_pool_t *pool);
-
-/** Return the relative path part of @a child_fspath that is below
- * @a parent_fspath, or just "" if @a parent_fspath is equal to
- * @a child_fspath. If @a child_fspath is not below @a parent_fspath,
- * return @a child_fspath.
- *
- * ### Returning the child in the no-match case is a bad idea.
- *
- * @since New in 1.7.
- */
-const char *
-svn_fspath__skip_ancestor(const char *parent_fspath,
- const char *child_fspath);
-
-/** Return TRUE if @a parent_fspath is an ancestor of @a child_fspath or
- * the fspaths are equal, and FALSE otherwise.
- *
- * @since New in 1.7.
- */
-svn_boolean_t
-svn_fspath__is_ancestor(const char *parent_fspath,
- const char *child_fspath);
-
-/** Return the longest common path shared by two fspaths, @a fspath1 and
- * @a fspath2. If there's no common ancestor, return "/".
- *
- * @since New in 1.7.
- */
-char *
-svn_fspath__get_longest_ancestor(const char *fspath1,
- const char *fspath2,
- apr_pool_t *result_pool);
-
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/diff-optimizations-bytes/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/include/svn_repos.h?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/include/svn_repos.h (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/include/svn_repos.h Wed Jan 26 21:52:08 2011
@@ -671,24 +671,6 @@ const char *
svn_repos_post_revprop_change_hook(svn_repos_t *repos,
apr_pool_t *pool);
-/** Return the path to @a repos's pre-obliterate hook, allocated in
- * @a pool.
- *
- * @since New in 1.7.
- */
-const char *
-svn_repos_pre_obliterate_hook(svn_repos_t *repos,
- apr_pool_t *pool);
-
-/** Return the path to @a repos's post-obliterate hook, allocated in
- * @a pool.
- *
- * @since New in 1.7.
- */
-const char *
-svn_repos_post_obliterate_hook(svn_repos_t *repos,
- apr_pool_t *pool);
-
/** @defgroup svn_repos_lock_hooks Paths to lock hooks
* @{
Modified: subversion/branches/diff-optimizations-bytes/subversion/include/svn_subst.h
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/include/svn_subst.h?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/include/svn_subst.h (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/include/svn_subst.h Wed Jan 26 21:52:08 2011
@@ -615,8 +615,10 @@ svn_error_t *svn_subst_translate_string(
* *translated_line_endings to @c TRUE if at least one line ending was
* changed to LF, or to @c FALSE otherwise.
*
- * Recognized line endings are LF, CR, CRLF. If @a value has inconsistent
- * line endings, return @c SVN_ERR_IO_INCONSISTENT_EOL.
+ * If @a value has an inconsistent line ending style, then: if @a repair
+ * is @c FALSE, return @c SVN_ERR_IO_INCONSISTENT_EOL, else if @a repair is
+ * @c TRUE, convert any line ending in @a value to "\n" in
+ * @a *new_value. Recognized line endings are: "\n", "\r", and "\r\n".
*
* Set @a *new_value to the translated string, allocated in @a result_pool.
*
@@ -630,6 +632,7 @@ svn_subst_translate_string2(svn_string_t
svn_boolean_t *translated_line_endings,
const svn_string_t *value,
const char *encoding,
+ svn_boolean_t repair,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/copy.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/copy.c Wed Jan 26 21:52:08 2011
@@ -340,11 +340,18 @@ do_wc_to_wc_moves_with_locks2(void *bato
scratch_pool);
SVN_ERR(svn_wc_copy3(b->ctx->wc_ctx, b->pair->src_abspath_or_url,
- dst_abspath, FALSE /* metadata_only */,
+ dst_abspath, TRUE /* metadata_only */,
b->ctx->cancel_func, b->ctx->cancel_baton,
b->ctx->notify_func2, b->ctx->notify_baton2,
scratch_pool));
+ /* Should we be using a workqueue for this move? It's not clear.
+ What should happen if the copy above is interrupted? The user
+ may want to abort the move and a workqueue might interfere with
+ that. */
+ SVN_ERR(svn_io_file_rename(b->pair->src_abspath_or_url, dst_abspath,
+ scratch_pool));
+
SVN_ERR(svn_wc_delete4(b->ctx->wc_ctx, b->pair->src_abspath_or_url,
FALSE, FALSE,
b->ctx->cancel_func, b->ctx->cancel_baton,
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/list.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/list.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/list.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/list.c Wed Jan 26 21:52:08 2011
@@ -31,6 +31,7 @@
#include "client.h"
+#include "private/svn_fspath.h"
#include "svn_private_config.h"
/* Get the directory entries of DIR at REV (relative to the root of
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/merge.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/merge.c Wed Jan 26 21:52:08 2011
@@ -54,6 +54,7 @@
#include "private/svn_wc_private.h"
#include "private/svn_mergeinfo_private.h"
+#include "private/svn_fspath.h"
#include "svn_private_config.h"
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/mergeinfo.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/mergeinfo.c Wed Jan 26 21:52:08 2011
@@ -41,6 +41,7 @@
#include "private/svn_mergeinfo_private.h"
#include "private/svn_wc_private.h"
#include "private/svn_ra_private.h"
+#include "private/svn_fspath.h"
#include "client.h"
#include "mergeinfo.h"
#include "svn_private_config.h"
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/patch.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/patch.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/patch.c Wed Jan 26 21:52:08 2011
@@ -2736,6 +2736,7 @@ svn_client_patch(const char *patch_abspa
apr_pool_t *scratch_pool)
{
apply_patches_baton_t baton;
+ svn_node_kind_t kind;
if (strip_count < 0)
return svn_error_create(SVN_ERR_INCORRECT_PARAMS, NULL,
@@ -2745,6 +2746,22 @@ svn_client_patch(const char *patch_abspa
return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
_("'%s' is not a local path"), local_abspath);
+ SVN_ERR(svn_io_check_path(patch_abspath, &kind, scratch_pool));
+ if (kind == svn_node_none)
+ return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("'%s' does not exist"), patch_abspath);
+ if (kind != svn_node_file)
+ return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("'%s' is not a file"), patch_abspath);
+
+ SVN_ERR(svn_io_check_path(local_abspath, &kind, scratch_pool));
+ if (kind == svn_node_none)
+ return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("'%s' does not exist"), local_abspath);
+ if (kind != svn_node_dir)
+ return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("'%s' is not a directory"), local_abspath);
+
baton.patch_abspath = patch_abspath;
baton.abs_wc_path = local_abspath;
baton.dry_run = dry_run;
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/update.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/update.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/update.c Wed Jan 26 21:52:08 2011
@@ -298,7 +298,7 @@ svn_client__update_internal(svn_revnum_t
{
const char *anchor_abspath, *lockroot_abspath;
svn_error_t *err;
- svn_opt_revision_t peg_revision = *((svn_opt_revision_t *)revision);
+ svn_opt_revision_t peg_revision = *revision;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
SVN_ERR_ASSERT(! (innerupdate && make_parents));
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_delta/path_driver.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_delta/path_driver.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_delta/path_driver.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_delta/path_driver.c Wed Jan 26 21:52:08 2011
@@ -31,6 +31,7 @@
#include "svn_dirent_uri.h"
#include "svn_path.h"
#include "svn_sorts.h"
+#include "private/svn_fspath.h"
/*** Helper functions. ***/
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_base/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_base/dag.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_base/dag.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_base/dag.c Wed Jan 26 21:52:08 2011
@@ -54,6 +54,7 @@
#include "private/svn_skel.h"
#include "private/svn_fs_util.h"
+#include "private/svn_fspath.h"
#include "../libsvn_fs/fs-loader.h"
#include "svn_private_config.h"
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_base/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_base/tree.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_base/tree.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_base/tree.c Wed Jan 26 21:52:08 2011
@@ -64,6 +64,7 @@
#include "bdb/node-origins-table.h"
#include "bdb/miscellaneous-table.h"
#include "../libsvn_fs/fs-loader.h"
+#include "private/svn_fspath.h"
#include "private/svn_fs_util.h"
#include "private/svn_mergeinfo_private.h"
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/dag.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/dag.c Wed Jan 26 21:52:08 2011
@@ -36,6 +36,7 @@
#include "../libsvn_fs/fs-loader.h"
+#include "private/svn_fspath.h"
#include "svn_private_config.h"
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/fs_fs.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/fs_fs.c Wed Jan 26 21:52:08 2011
@@ -1892,7 +1892,7 @@ open_pack_or_rev_file(apr_file_t **file,
APR_READ | APR_BUFFERED, APR_OS_DEFAULT, pool);
if (err && APR_STATUS_IS_ENOENT(err->apr_err)
- && ffd->format >= SVN_FS_FS__MIN_PACKED_FORMAT)
+ && ffd->format >= SVN_FS_FS__MIN_PACKED_FORMAT)
{
/* Could not open the file. This may happen if the
* file once existed but got packed later. */
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/lock.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/lock.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/lock.c Wed Jan 26 21:52:08 2011
@@ -40,6 +40,7 @@
#include "../libsvn_fs/fs-loader.h"
#include "private/svn_fs_util.h"
+#include "private/svn_fspath.h"
#include "svn_private_config.h"
/* Names of hash keys used to store a lock for writing to disk. */
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/tree.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_fs_fs/tree.c Wed Jan 26 21:52:08 2011
@@ -60,6 +60,7 @@
#include "private/svn_mergeinfo_private.h"
#include "private/svn_fs_util.h"
+#include "private/svn_fspath.h"
#include "../libsvn_fs/fs-loader.h"
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_local/ra_plugin.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_local/ra_plugin.c Wed Jan 26 21:52:08 2011
@@ -36,6 +36,7 @@
#include "../libsvn_ra/ra_loader.h"
#include "private/svn_mergeinfo_private.h"
#include "private/svn_repos_private.h"
+#include "private/svn_fspath.h"
#define APR_WANT_STRFUNC
#include <apr_want.h>
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/fetch.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/fetch.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/fetch.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/fetch.c Wed Jan 26 21:52:08 2011
@@ -188,10 +188,11 @@ typedef struct report_baton_t {
/* Use an intermediate tmpfile for the REPORT response. */
svn_boolean_t spool_response;
- /* A modern server will understand our "send-all" attribute on the
- update report request, and will put a "send-all" attribute on
- its response. If we see that attribute, we set this to true,
- otherwise, it stays false (i.e., it's not a modern server). */
+ /* If this report is for a switch, update, or status (but not a
+ merge/diff), then we made the update report request with the "send-all"
+ attribute. The server reponds to this by putting a "send-all" attribute
+ in its response. If we see that attribute, we set this to true,
+ otherwise, it stays false. */
svn_boolean_t receiving_all;
/* Hash mapping 'const char *' paths -> 'const char *' lock tokens. */
@@ -1588,19 +1589,16 @@ start_element(int *elem, void *userdata,
/* push the new baton onto the directory baton stack */
push_dir(rb, new_dir_baton, pathbuf, subpool);
- /* Property fetching is implied in addition. This flag is only
- for parsing old-style reports; it is ignored when talking to
- a modern server. */
+ /* Property fetching is implied in addition. */
TOP_DIR(rb).fetch_props = TRUE;
bc_url = svn_xml_get_attr_value("bc-url", atts);
- /* In non-modern report responses, we're just told to fetch the
+ /* If we are not in send-all mode, we're just told to fetch the
props later. In that case, we can at least do a pre-emptive
depth-1 propfind on the directory right now; this prevents
individual propfinds on added-files later on, thus reducing
- the number of network turnarounds (though not by as much as
- simply getting a modern report response!). */
+ the number of network turnarounds. */
if ((! rb->receiving_all) && bc_url)
{
apr_hash_t *bc_children;
@@ -1711,9 +1709,7 @@ start_element(int *elem, void *userdata,
crev, rb->file_pool,
&rb->file_baton));
- /* Property fetching is implied in addition. This flag is only
- for parsing old-style reports; it is ignored when talking to
- a modern server. */
+ /* Property fetching is implied in addition. */
rb->fetch_props = TRUE;
break;
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/authz.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/authz.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/authz.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/authz.c Wed Jan 26 21:52:08 2011
@@ -391,8 +391,8 @@ authz_get_tree_access(svn_config_t *cfg,
any kind of granted access. Implements the
svn_config_section_enumerator2_t interface. */
static svn_boolean_t
-authz_global_parse_section(const char *section_name, void *baton,
- apr_pool_t *pool)
+authz_get_any_access_parser_cb(const char *section_name, void *baton,
+ apr_pool_t *pool)
{
struct authz_lookup_baton *b = baton;
@@ -422,10 +422,10 @@ authz_global_parse_section(const char *s
* to any path within the REPOSITORY. Return TRUE if so. Use POOL
* for temporary allocations. */
static svn_boolean_t
-authz_get_global_access(svn_config_t *cfg, const char *repos_name,
- const char *user,
- svn_repos_authz_access_t required_access,
- apr_pool_t *pool)
+authz_get_any_access(svn_config_t *cfg, const char *repos_name,
+ const char *user,
+ svn_repos_authz_access_t required_access,
+ apr_pool_t *pool)
{
struct authz_lookup_baton baton = { 0 };
@@ -434,8 +434,13 @@ authz_get_global_access(svn_config_t *cf
baton.required_access = required_access;
baton.access = FALSE; /* Deny access by default. */
baton.repos_path = apr_pstrcat(pool, repos_name, ":/", (char *)NULL);
-
- svn_config_enumerate_sections2(cfg, authz_global_parse_section,
+
+ /* We could have used svn_config_enumerate2 for "repos_name:/".
+ * However, this requires access for root explicitly (which the user
+ * may not always have). So we end up enumerating the sections in
+ * the authz CFG and stop on the first match with some access for
+ * this user. */
+ svn_config_enumerate_sections2(cfg, authz_get_any_access_parser_cb,
&baton, pool);
/* If walking the configuration was inconclusive, deny access. */
@@ -743,12 +748,12 @@ svn_repos_authz_check_access(svn_authz_t
{
const char *current_path = path;
- /* If PATH is NULL, do a global access lookup. */
+ /* If PATH is NULL, check if the user has *any* access. */
if (!path)
{
- *access_granted = authz_get_global_access(authz->cfg, repos_name,
- user, required_access,
- pool);
+ *access_granted = authz_get_any_access(authz->cfg, repos_name,
+ user, required_access,
+ pool);
return SVN_NO_ERROR;
}
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/hooks.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/hooks.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/hooks.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/hooks.c Wed Jan 26 21:52:08 2011
@@ -35,6 +35,7 @@
#include "repos.h"
#include "svn_private_config.h"
#include "private/svn_fs_private.h"
+#include "private/svn_repos_private.h"
@@ -592,7 +593,7 @@ svn_repos__hooks_pre_obliterate(svn_repo
const svn_string_t *obliteration_set,
apr_pool_t *pool)
{
- const char *hook = svn_repos_pre_obliterate_hook(repos, pool);
+ const char *hook = svn_repos__pre_obliterate_hook(repos, pool);
svn_boolean_t broken_link;
if ((hook = check_hook_cmd(hook, &broken_link, pool)) && broken_link)
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/load.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/load.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/load.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/load.c Wed Jan 26 21:52:08 2011
@@ -384,8 +384,9 @@ parse_format_version(const char *version
|| strncmp(versionstring,
SVN_REPOS_DUMPFILE_MAGIC_HEADER,
magic_len))
- return svn_error_create(SVN_ERR_STREAM_MALFORMED_DATA, NULL,
- _("Malformed dumpfile header"));
+ return svn_error_createf(SVN_ERR_STREAM_MALFORMED_DATA, NULL,
+ _("Malformed dumpfile header '%s'"),
+ versionstring);
SVN_ERR(svn_cstring_atoi(&value, p + 1));
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/replay.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/replay.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/replay.c Wed Jan 26 21:52:08 2011
@@ -269,11 +269,21 @@ add_subdir(svn_fs_root_t *source_root,
* I think not; when path_driver_cb_func() calls add_subdir(), it
* passes SOURCE_ROOT and SOURCE_PATH that are unreadable.
*/
- SVN_ERR(add_subdir(new_source_root, target_root, editor, edit_baton,
- new_path, *dir_baton,
- new_source_path,
- authz_read_func, authz_read_baton,
- changed_paths, subpool, &new_dir_baton));
+ if (change && change->change_kind == svn_fs_path_change_replace
+ && copyfrom_path == NULL)
+ {
+ SVN_ERR(editor->add_directory(new_path, *dir_baton,
+ NULL, SVN_INVALID_REVNUM,
+ subpool, &new_dir_baton));
+ }
+ else
+ {
+ SVN_ERR(add_subdir(new_source_root, target_root, editor, edit_baton,
+ new_path, *dir_baton,
+ new_source_path,
+ authz_read_func, authz_read_baton,
+ changed_paths, subpool, &new_dir_baton));
+ }
SVN_ERR(editor->close_directory(new_dir_baton, subpool));
}
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/reporter.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/reporter.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/reporter.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/reporter.c Wed Jan 26 21:52:08 2011
@@ -33,6 +33,7 @@
#include "repos.h"
#include "svn_private_config.h"
#include "private/svn_dep_compat.h"
+#include "private/svn_fspath.h"
#define NUM_CACHED_SOURCE_ROOTS 4
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/repos.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/repos.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/repos.c Wed Jan 26 21:52:08 2011
@@ -32,6 +32,7 @@
#include "svn_fs.h"
#include "svn_ra.h" /* for SVN_RA_CAPABILITY_* */
#include "svn_repos.h"
+#include "private/svn_repos_private.h"
#include "svn_private_config.h" /* for SVN_TEMPLATE_ROOT_DIR */
#include "repos.h"
@@ -163,7 +164,7 @@ svn_repos_post_revprop_change_hook(svn_r
const char *
-svn_repos_pre_obliterate_hook(svn_repos_t *repos, apr_pool_t *pool)
+svn_repos__pre_obliterate_hook(svn_repos_t *repos, apr_pool_t *pool)
{
return svn_dirent_join(repos->hook_path, SVN_REPOS__HOOK_PRE_OBLITERATE,
pool);
@@ -171,7 +172,7 @@ svn_repos_pre_obliterate_hook(svn_repos_
const char *
-svn_repos_post_obliterate_hook(svn_repos_t *repos, apr_pool_t *pool)
+svn_repos__post_obliterate_hook(svn_repos_t *repos, apr_pool_t *pool)
{
return svn_dirent_join(repos->hook_path, SVN_REPOS__HOOK_POST_OBLITERATE,
pool);
@@ -549,7 +550,7 @@ PREWRITTEN_HOOKS_TEXT
/* Pre-obliterate hook. */
{
this_path = apr_psprintf(pool, "%s%s",
- svn_repos_pre_obliterate_hook(repos, pool),
+ svn_repos__pre_obliterate_hook(repos, pool),
SVN_REPOS__HOOK_DESC_EXT);
#define SCRIPT_NAME SVN_REPOS__HOOK_PRE_OBLITERATE
@@ -1042,7 +1043,7 @@ PREWRITTEN_HOOKS_TEXT
/* Post-obliterate hook. */
{
this_path = apr_psprintf(pool, "%s%s",
- svn_repos_post_obliterate_hook(repos, pool),
+ svn_repos__post_obliterate_hook(repos, pool),
SVN_REPOS__HOOK_DESC_EXT);
#define SCRIPT_NAME SVN_REPOS__HOOK_POST_OBLITERATE
Propchange: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/adler32.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 26 21:52:08 2011
@@ -1 +1 @@
-/subversion/trunk/subversion/libsvn_subr/adler32.c:1054278-1058787
+/subversion/trunk/subversion/libsvn_subr/adler32.c:1054278-1063879
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/config_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/config_file.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/config_file.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/config_file.c Wed Jan 26 21:52:08 2011
@@ -1008,8 +1008,8 @@ svn_config_ensure(const char *config_dir
"### accepts the '--diff-program' option." NL
"# diff3-has-program-arg = [yes | no]" NL
"### Set merge-tool-cmd to the command used to invoke your external" NL
- "### merging tool of choice. Subversion will pass 4 arguments to" NL
- "### the specified command: base theirs mine merged" NL
+ "### merging tool of choice. Subversion will pass 5 arguments to" NL
+ "### the specified command: base theirs mine merged wcfile" NL
"# merge-tool-cmd = merge_command" NL
"" NL
"### Section for configuring tunnel agents." NL
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/deprecated.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/deprecated.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/deprecated.c Wed Jan 26 21:52:08 2011
@@ -256,7 +256,7 @@ svn_subst_translate_string(svn_string_t
apr_pool_t *pool)
{
return svn_subst_translate_string2(new_value, NULL, NULL, value,
- encoding, pool, pool);
+ encoding, FALSE, pool, pool);
}
svn_error_t *
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/dirent_uri.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/dirent_uri.c Wed Jan 26 21:52:08 2011
@@ -37,6 +37,7 @@
#include "svn_ctype.h"
#include "dirent_uri.h"
+#include "private/svn_fspath.h"
/* The canonical empty path. Can this be changed? Well, change the empty
test below and the path library will work, not so sure about the fs/wc
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/io.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/io.c Wed Jan 26 21:52:08 2011
@@ -81,22 +81,27 @@
retry loop cannot completely solve this problem either, but can
help mitigate it.
*/
+#define RETRY_MAX_ATTEMPTS 100
+#define RETRY_INITIAL_SLEEP 1000
+#define RETRY_MAX_SLEEP 128000
+
#ifndef WIN32_RETRY_LOOP
#if defined(WIN32) && !defined(SVN_NO_WIN32_RETRY_LOOP)
#define WIN32_RETRY_LOOP(err, expr) \
do \
{ \
apr_status_t os_err = APR_TO_OS_ERROR(err); \
- int sleep_count = 1000; \
+ int sleep_count = RETRY_INITIAL_SLEEP; \
int retries; \
for (retries = 0; \
- retries < 100 && (os_err == ERROR_ACCESS_DENIED \
- || os_err == ERROR_SHARING_VIOLATION \
- || os_err == ERROR_DIR_NOT_EMPTY); \
+ retries < RETRY_MAX_ATTEMPTS && \
+ (os_err == ERROR_ACCESS_DENIED \
+ || os_err == ERROR_SHARING_VIOLATION \
+ || os_err == ERROR_DIR_NOT_EMPTY); \
++retries, os_err = APR_TO_OS_ERROR(err)) \
{ \
apr_sleep(sleep_count); \
- if (sleep_count < 128000) \
+ if (sleep_count < RETRY_MAX_SLEEP) \
sleep_count *= 2; \
(err) = (expr); \
} \
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/mergeinfo.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/mergeinfo.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/mergeinfo.c Wed Jan 26 21:52:08 2011
@@ -32,6 +32,7 @@
#include "svn_error_codes.h"
#include "svn_string.h"
#include "svn_mergeinfo.h"
+#include "private/svn_fspath.h"
#include "private/svn_mergeinfo_private.h"
#include "svn_private_config.h"
#include "svn_hash.h"
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/path.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/path.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/path.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/path.c Wed Jan 26 21:52:08 2011
@@ -428,12 +428,88 @@ svn_path_compare_paths(const char *path1
return (unsigned char)(path1[i]) < (unsigned char)(path2[i]) ? -1 : 1;
}
+/* Return the string length of the longest common ancestor of PATH1 and PATH2.
+ *
+ * This function handles everything except the URL-handling logic
+ * of svn_path_get_longest_ancestor, and assumes that PATH1 and
+ * PATH2 are *not* URLs.
+ *
+ * If the two paths do not share a common ancestor, return 0.
+ *
+ * New strings are allocated in POOL.
+ */
+static apr_size_t
+get_path_ancestor_length(const char *path1,
+ const char *path2,
+ apr_pool_t *pool)
+{
+ apr_size_t path1_len, path2_len;
+ apr_size_t i = 0;
+ apr_size_t last_dirsep = 0;
+
+ path1_len = strlen(path1);
+ path2_len = strlen(path2);
+
+ if (SVN_PATH_IS_EMPTY(path1) || SVN_PATH_IS_EMPTY(path2))
+ return 0;
+
+ while (path1[i] == path2[i])
+ {
+ /* Keep track of the last directory separator we hit. */
+ if (path1[i] == '/')
+ last_dirsep = i;
+
+ i++;
+
+ /* If we get to the end of either path, break out. */
+ if ((i == path1_len) || (i == path2_len))
+ break;
+ }
+
+ /* two special cases:
+ 1. '/' is the longest common ancestor of '/' and '/foo'
+ 2. '/' is the longest common ancestor of '/rif' and '/raf' */
+ if (i == 1 && path1[0] == '/' && path2[0] == '/')
+ return 1;
+
+ /* last_dirsep is now the offset of the last directory separator we
+ crossed before reaching a non-matching byte. i is the offset of
+ that non-matching byte. */
+ if (((i == path1_len) && (path2[i] == '/'))
+ || ((i == path2_len) && (path1[i] == '/'))
+ || ((i == path1_len) && (i == path2_len)))
+ return i;
+ else
+ if (last_dirsep == 0 && path1[0] == '/' && path2[0] == '/')
+ return 1;
+ return last_dirsep;
+}
+
+
char *
svn_path_get_longest_ancestor(const char *path1,
const char *path2,
apr_pool_t *pool)
{
- return svn_uri_get_longest_ancestor(path1, path2, pool);
+ svn_boolean_t path1_is_url = svn_path_is_url(path1);
+ svn_boolean_t path2_is_url = svn_path_is_url(path2);
+
+ /* Are we messing with URLs? If we have a mix of URLs and non-URLs,
+ there's nothing common between them. */
+ if (path1_is_url && path2_is_url)
+ {
+ return svn_uri_get_longest_ancestor(path1, path2, pool);
+ }
+ else if ((! path1_is_url) && (! path2_is_url))
+ {
+ return apr_pstrndup(pool, path1,
+ get_path_ancestor_length(path1, path2, pool));
+ }
+ else
+ {
+ /* A URL and a non-URL => no common prefix */
+ return apr_pmemdup(pool, SVN_EMPTY_PATH, sizeof(SVN_EMPTY_PATH));
+ }
}
const char *
@@ -441,14 +517,70 @@ svn_path_is_child(const char *path1,
const char *path2,
apr_pool_t *pool)
{
- return svn_uri_is_child(path1, path2, pool);
+ apr_size_t i;
+
+ /* assert (is_canonical (path1, strlen (path1))); ### Expensive strlen */
+ /* assert (is_canonical (path2, strlen (path2))); ### Expensive strlen */
+
+ /* Allow "" and "foo" to be parent/child */
+ if (SVN_PATH_IS_EMPTY(path1)) /* "" is the parent */
+ {
+ if (SVN_PATH_IS_EMPTY(path2) /* "" not a child */
+ || path2[0] == '/') /* "/foo" not a child */
+ return NULL;
+ else
+ /* everything else is child */
+ return pool ? apr_pstrdup(pool, path2) : path2;
+ }
+
+ /* Reach the end of at least one of the paths. How should we handle
+ things like path1:"foo///bar" and path2:"foo/bar/baz"? It doesn't
+ appear to arise in the current Subversion code, it's not clear to me
+ if they should be parent/child or not. */
+ for (i = 0; path1[i] && path2[i]; i++)
+ if (path1[i] != path2[i])
+ return NULL;
+
+ /* There are two cases that are parent/child
+ ... path1[i] == '\0'
+ .../foo path2[i] == '/'
+ or
+ / path1[i] == '\0'
+ /foo path2[i] != '/'
+ */
+ if (path1[i] == '\0' && path2[i])
+ {
+ if (path2[i] == '/')
+ return pool ? apr_pstrdup(pool, path2 + i + 1) : path2 + i + 1;
+ else if (i == 1 && path1[0] == '/')
+ return pool ? apr_pstrdup(pool, path2 + 1) : path2 + 1;
+ }
+
+ /* Otherwise, path2 isn't a child. */
+ return NULL;
}
svn_boolean_t
svn_path_is_ancestor(const char *path1, const char *path2)
{
- return svn_uri_is_ancestor(path1, path2);
+ apr_size_t path1_len = strlen(path1);
+
+ /* If path1 is empty and path2 is not absoulte, then path1 is an ancestor. */
+ if (SVN_PATH_IS_EMPTY(path1))
+ return *path2 != '/';
+
+ /* If path1 is a prefix of path2, then:
+ - If path1 ends in a path separator,
+ - If the paths are of the same length
+ OR
+ - path2 starts a new path component after the common prefix,
+ then path1 is an ancestor. */
+ if (strncmp(path1, path2, path1_len) == 0)
+ return path1[path1_len - 1] == '/'
+ || (path2[path1_len] == '/' || path2[path1_len] == '\0');
+
+ return FALSE;
}
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/subst.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/subst.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/subst.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/subst.c Wed Jan 26 21:52:08 2011
@@ -1863,6 +1863,7 @@ svn_subst_translate_string2(svn_string_t
svn_boolean_t *translated_line_endings,
const svn_string_t *value,
const char *encoding,
+ svn_boolean_t repair,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -1892,7 +1893,7 @@ svn_subst_translate_string2(svn_string_t
translated_line_endings,
val_utf8,
"\n", /* translate to LF */
- FALSE, /* no repair */
+ repair,
NULL, /* no keywords */
FALSE, /* no expansion */
scratch_pool));
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/relocate.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/relocate.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/relocate.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/relocate.c Wed Jan 26 21:52:08 2011
@@ -35,31 +35,36 @@
#include "svn_private_config.h"
-/* */
+/* If the components of RELPATH exactly match (after being
+ URI-encoded) the final components of URL, return a copy of URL
+ minus those components allocated in RESULT_POOL; otherwise, return
+ NULL. */
static const char *
-uri_remove_components(const char *uri,
- const char *component,
- apr_pool_t *result_pool)
+url_remove_final_relpath(const char *url,
+ const char *relpath,
+ apr_pool_t *scratch_pool,
+ apr_pool_t *result_pool)
{
- char *result = apr_pstrdup(result_pool, uri);
+ char *result = apr_pstrdup(result_pool, url);
char *result_end;
- const char *component_end;
+ const char *relpath_end;
- SVN_ERR_ASSERT_NO_RETURN(svn_uri_is_absolute(uri));
- SVN_ERR_ASSERT_NO_RETURN(!svn_uri_is_absolute(component));
+ SVN_ERR_ASSERT_NO_RETURN(svn_path_is_url(url));
+ SVN_ERR_ASSERT_NO_RETURN(svn_relpath_is_canonical(relpath, scratch_pool));
- if (component[0] == 0)
+ if (relpath[0] == 0)
return result;
+ relpath = svn_path_uri_encode(relpath, scratch_pool);
result_end = result + strlen(result) - 1;
- component_end = component + strlen(component) - 1;
+ relpath_end = relpath + strlen(relpath) - 1;
- while (component_end >= component)
+ while (relpath_end >= relpath)
{
- if (*result_end != *component_end)
+ if (*result_end != *relpath_end)
return NULL;
- component_end--;
+ relpath_end--;
result_end--;
}
@@ -128,7 +133,8 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct
return svn_error_create(SVN_ERR_CLIENT_INVALID_RELOCATION, NULL,
_("Cannot relocate a single file"));
- old_url = svn_uri_join(old_repos_root, repos_relpath, scratch_pool);
+ old_url = svn_path_url_add_component2(old_repos_root, repos_relpath,
+ scratch_pool);
old_url_len = strlen(old_url);
from_len = strlen(from);
if ((from_len > old_url_len) || (strncmp(old_url, from, strlen(from)) != 0))
@@ -143,14 +149,18 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct
new_url = apr_pstrcat(scratch_pool, to, old_url + from_len, NULL);
if (! svn_path_is_url(new_url))
return svn_error_createf(SVN_ERR_WC_INVALID_RELOCATION, NULL,
- _("Invalid destination URL: '%s'"), new_url);
+ _("Invalid relocation destination: '%s' "
+ "(not a URL)"), new_url);
- new_repos_root = uri_remove_components(new_url, repos_relpath, scratch_pool);
+ new_repos_root = url_remove_final_relpath(new_url, repos_relpath,
+ scratch_pool, scratch_pool);
if (!new_repos_root)
return svn_error_createf(SVN_ERR_WC_INVALID_RELOCATION, NULL,
- _("Invalid destination URL: '%s'"), new_url);
+ _("Invalid relocation destination: '%s' "
+ "(does not point to target)" ), new_url);
- SVN_ERR(validator(validator_baton, uuid, new_url, new_repos_root, scratch_pool));
+ SVN_ERR(validator(validator_baton, uuid, new_url, new_repos_root,
+ scratch_pool));
return svn_error_return(svn_wc__db_global_relocate(wc_ctx->db, local_abspath,
new_repos_root,
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/status.c?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/status.c Wed Jan 26 21:52:08 2011
@@ -51,6 +51,7 @@
#include "tree_conflicts.h"
#include "private/svn_wc_private.h"
+#include "private/svn_fspath.h"
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/wc-metadata.sql
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/wc-metadata.sql?rev=1063881&r1=1063880&r2=1063881&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/wc-metadata.sql Wed Jan 26 21:52:08 2011
@@ -76,9 +76,12 @@ CREATE UNIQUE INDEX I_LOCAL_ABSPATH ON W
/* ------------------------------------------------------------------------- */
-/* The PRISTINE table keeps track of pristine texts. Each pristine text is
- stored in a file which may be compressed. Each pristine text is
- referenced by any number of rows in the NODES and ACTUAL_NODE tables.
+/* The PRISTINE table keeps track of pristine texts. Each row describes a
+ single pristine text. The text itself is stored in a file whose name is
+ derived from the 'checksum' column. Each pristine text is referenced by
+ any number of rows in the NODES and ACTUAL_NODE tables.
+
+ In future, the pristine text file may be compressed.
*/
CREATE TABLE PRISTINE (
/* The SHA-1 checksum of the pristine text. This is a unique key. The