You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2012/03/30 16:12:54 UTC
svn commit: r1307434 [6/6] - in /subversion/branches/revprop-packing: ./
subversion/include/ subversion/include/private/ subversion/libsvn_client/
subversion/libsvn_fs_fs/ subversion/libsvn_ra_serf/
subversion/libsvn_ra_svn/ subversion/libsvn_repos/ su...
Modified: subversion/branches/revprop-packing/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/svnserve/serve.c?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/svnserve/serve.c (original)
+++ subversion/branches/revprop-packing/subversion/svnserve/serve.c Fri Mar 30 14:12:52 2012
@@ -1470,9 +1470,9 @@ static svn_error_t *get_dir(svn_ra_svn_c
apr_array_header_t *params, void *baton)
{
server_baton_t *b = baton;
- const char *path, *full_path, *file_path, *cdate;
+ const char *path, *full_path;
svn_revnum_t rev;
- apr_hash_t *entries, *props = NULL, *file_props;
+ apr_hash_t *entries, *props = NULL;
apr_hash_index_t *hi;
svn_fs_root_t *root;
apr_pool_t *subpool;
@@ -1548,7 +1548,9 @@ static svn_error_t *get_dir(svn_ra_svn_c
/* Fetch the directory entries if requested and send them immediately. */
if (want_contents)
{
- const char *zero_date = svn_time_to_cstring(0, pool);
+ /* Use epoch for a placeholder for a missing date. */
+ const char *missing_date = svn_time_to_cstring(0, pool);
+
SVN_CMD_ERR(svn_fs_dir_entries(&entries, root, full_path, pool));
/* Transform the hash table's FS entries into dirents. This probably
@@ -1558,9 +1560,15 @@ static svn_error_t *get_dir(svn_ra_svn_c
{
const char *name = svn__apr_hash_index_key(hi);
svn_fs_dirent_t *fsent = svn__apr_hash_index_val(hi);
+ const char *file_path;
- svn_dirent_t entry;
- memset(&entry, 0, sizeof(entry));
+ /* The fields in the entry tuple. */
+ svn_node_kind_t entry_kind = svn_node_none;
+ svn_filesize_t entry_size = 0;
+ svn_boolean_t has_props = FALSE;
+ svn_revnum_t created_rev = 0; /* ### SVN_INVALID_REVNUM */
+ const char *cdate = NULL;
+ const char *last_author = NULL;
svn_pool_clear(subpool);
@@ -1570,44 +1578,49 @@ static svn_error_t *get_dir(svn_ra_svn_c
continue;
if (dirent_fields & SVN_DIRENT_KIND)
- entry.kind = fsent->kind;
+ entry_kind = fsent->kind;
if (dirent_fields & SVN_DIRENT_SIZE)
- if (entry.kind != svn_node_dir)
- SVN_CMD_ERR(svn_fs_file_length(&entry.size, root, file_path,
+ if (entry_kind != svn_node_dir)
+ SVN_CMD_ERR(svn_fs_file_length(&entry_size, root, file_path,
subpool));
if (dirent_fields & SVN_DIRENT_HAS_PROPS)
{
+ apr_hash_t *file_props;
+
/* has_props */
SVN_CMD_ERR(svn_fs_node_proplist(&file_props, root, file_path,
subpool));
- entry.has_props = (apr_hash_count(file_props) > 0);
+ has_props = (apr_hash_count(file_props) > 0);
}
- cdate = NULL;
if ((dirent_fields & SVN_DIRENT_LAST_AUTHOR)
|| (dirent_fields & SVN_DIRENT_TIME)
|| (dirent_fields & SVN_DIRENT_CREATED_REV))
{
/* created_rev, last_author, time */
- SVN_CMD_ERR(svn_repos_get_committed_info(&entry.created_rev,
+ SVN_CMD_ERR(svn_repos_get_committed_info(&created_rev,
&cdate,
- &entry.last_author,
+ &last_author,
root,
file_path,
subpool));
}
+ /* The client does not properly handle a missing CDATE. For
+ interoperability purposes, we must fill in some junk.
+
+ See libsvn_ra_svn/client.c:ra_svn_get_dir() */
if (cdate == NULL)
- cdate = zero_date;
+ cdate = missing_date;
/* Send the entry. */
SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "cwnbr(?c)(?c)", name,
- svn_node_kind_to_word(entry.kind),
- (apr_uint64_t) entry.size,
- entry.has_props, entry.created_rev,
- cdate, entry.last_author));
+ svn_node_kind_to_word(entry_kind),
+ (apr_uint64_t) entry_size,
+ has_props, created_rev,
+ cdate, last_author));
}
svn_pool_destroy(subpool);
}
Modified: subversion/branches/revprop-packing/subversion/tests/cmdline/log_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/tests/cmdline/log_tests.py?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/tests/cmdline/log_tests.py (original)
+++ subversion/branches/revprop-packing/subversion/tests/cmdline/log_tests.py Fri Mar 30 14:12:52 2012
@@ -2217,6 +2217,78 @@ def log_xml_old(sbox):
expected_paths=paths)
+@XFail()
+@Issue(4153)
+def log_diff_moved(sbox):
+ "log --diff on moved file"
+
+ sbox.build()
+
+ sbox.simple_move('A/mu', 'A/mu2')
+ svntest.main.file_append(sbox.ospath('A/mu2'), "now mu2\n")
+ sbox.simple_commit()
+ sbox.simple_move('A/mu2', 'A/mu3')
+ svntest.main.file_append(sbox.ospath('A/mu3'), "now mu3\n")
+ sbox.simple_commit()
+
+ mu_at_1 = sbox.repo_url + '/A/mu@1'
+ mu3_at_3 = sbox.repo_url + '/A/mu3@3'
+
+ r1diff = [make_diff_header('A/mu', 'revision 0', 'revision 1')
+ + ["@@ -0,0 +1 @@\n",
+ "+This is the file 'mu'.\n"]]
+
+ # The mu2@2 and mu3@3 diffs show diffs relative to the copy source
+ r2diff = [make_diff_header('mu',
+ '.../mu)\t(revision 1',
+ '.../mu2)\t(revision 2')
+ + ["@@ -1 +1,2 @@\n",
+ " This is the file 'mu'.\n",
+ "+now mu2\n"]]
+
+ r3diff = [make_diff_header('mu2',
+ '.../mu2)\t(revision 2',
+ '.../mu3)\t(revision 3')
+ + ["@@ -1,2 +1,3 @@\n",
+ " This is the file 'mu'.\n",
+ " now mu2\n",
+ "+now mu3\n"]]
+
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ 'log', '--diff',
+ mu_at_1)
+ log_chain = parse_log_output(output, with_diffs=True)
+ if len(log_chain) != 1:
+ raise SVNLogParseError("%d logs found, 1 expected" % len(log_chain))
+ compare_diff_output(r1diff, log_chain[0]['diff_lines'])
+
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ 'log', '--diff',
+ '-r3', mu3_at_3)
+ log_chain = parse_log_output(output, with_diffs=True)
+ if len(log_chain) != 1:
+ raise SVNLogParseError("%d logs found, 1 expected" % len(log_chain))
+ compare_diff_output(r3diff, log_chain[0]['diff_lines'])
+
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ 'log', '--diff',
+ '-r3:2', mu3_at_3)
+ log_chain = parse_log_output(output, with_diffs=True)
+ if len(log_chain) != 2:
+ raise SVNLogParseError("%d logs found, 2 expected" % len(log_chain))
+ compare_diff_output(r3diff, log_chain[0]['diff_lines'])
+ compare_diff_output(r2diff, log_chain[1]['diff_lines'])
+
+ # XFAIL mu3 not found at revisions 0 and 1
+ exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+ 'log', '--diff',
+ mu3_at_3)
+ log_chain = parse_log_output(output, with_diffs=True)
+ if len(log_chain) != 3:
+ raise SVNLogParseError("%d logs found, 3 expected" % len(log_chain))
+ compare_diff_output(r3diff, log_chain[0]['diff_lines'])
+ compare_diff_output(r2diff, log_chain[1]['diff_lines'])
+ compare_diff_output(r1diff, log_chain[2]['diff_lines'])
########################################################################
# Run the tests
@@ -2260,6 +2332,7 @@ test_list = [ None,
merge_sensitive_log_copied_path_inherited_mergeinfo,
log_diff,
log_xml_old,
+ log_diff_moved,
]
if __name__ == '__main__':
Modified: subversion/branches/revprop-packing/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/tests/cmdline/merge_tests.py?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/revprop-packing/subversion/tests/cmdline/merge_tests.py Fri Mar 30 14:12:52 2012
@@ -17471,7 +17471,6 @@ def merge_source_with_replacement(sbox):
# Test for issue #4144 'Reverse merge with replace in source applies
# diffs in forward order'.
@SkipUnless(server_has_mergeinfo)
-@XFail()
@Issue(4144)
def reverse_merge_with_rename(sbox):
"reverse merge applies revs in reverse order"
Modified: subversion/branches/revprop-packing/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/tests/cmdline/svnadmin_tests.py?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/revprop-packing/subversion/tests/cmdline/svnadmin_tests.py Fri Mar 30 14:12:52 2012
@@ -694,7 +694,8 @@ _0.0.t1-1 add false false /A/B/E/bravo
svntest.verify.verify_outputs(
message=None, actual_stdout=output, actual_stderr=errput,
expected_stdout=None,
- expected_stderr=".*Found malformed header '[^']*' in revision file")
+ expected_stderr=".*Found malformed header '[^']*' in revision file"
+ "|.*Missing id field in node-rev.*")
#----------------------------------------------------------------------
Modified: subversion/branches/revprop-packing/subversion/tests/cmdline/svntest/sandbox.py
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/tests/cmdline/svntest/sandbox.py?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/tests/cmdline/svntest/sandbox.py (original)
+++ subversion/branches/revprop-packing/subversion/tests/cmdline/svntest/sandbox.py Fri Mar 30 14:12:52 2012
@@ -39,10 +39,16 @@ class Sandbox:
dependents = None
def __init__(self, module, idx):
+ self.test_paths = []
+
self._set_name("%s-%d" % (module, idx))
# This flag is set to True by build() and returned by is_built()
self._is_built = False
+ # Create an empty directory for temporary files
+ self.tmp_dir = self.add_wc_path('tmp', remove=True)
+ os.mkdir(self.tmp_dir)
+
def _set_name(self, name, read_only=False):
"""A convenience method for renaming a sandbox, useful when
working with multiple repositories in the same unit test."""
@@ -50,10 +56,12 @@ class Sandbox:
self.name = name
self.read_only = read_only
self.wc_dir = os.path.join(svntest.main.general_wc_dir, self.name)
+ self.add_test_path(self.wc_dir)
if not read_only:
self.repo_dir = os.path.join(svntest.main.general_repo_dir, self.name)
self.repo_url = (svntest.main.options.test_area_url + '/'
+ urllib.pathname2url(self.repo_dir))
+ self.add_test_path(self.repo_dir)
else:
self.repo_dir = svntest.main.pristine_greek_repos_dir
self.repo_url = svntest.main.pristine_greek_repos_url
@@ -77,8 +85,6 @@ class Sandbox:
elif self.repo_url.startswith("svn"):
self.authz_file = os.path.join(self.repo_dir, "conf", "authz")
- self.test_paths = [self.wc_dir, self.repo_dir]
-
def clone_dependent(self, copy_wc=False):
"""A convenience method for creating a near-duplicate of this
sandbox, useful when working with multiple repositories in the
@@ -151,13 +157,9 @@ class Sandbox:
"""Get a stable name for a temporary file that will be removed after
running the test"""
- dir = self.add_wc_path('tmp', remove=False)
- if not os.path.exists(dir):
- os.mkdir(dir)
-
self.tempname_offs = self.tempname_offs + 1
- return os.path.join(dir, '%s-%s' % (prefix, self.tempname_offs))
+ return os.path.join(self.tmp_dir, '%s-%s' % (prefix, self.tempname_offs))
def cleanup_test_paths(self):
"Clean up detritus from this sandbox, and any dependents."
Modified: subversion/branches/revprop-packing/subversion/tests/libsvn_subr/cache-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/tests/libsvn_subr/cache-test.c?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/tests/libsvn_subr/cache-test.c (original)
+++ subversion/branches/revprop-packing/subversion/tests/libsvn_subr/cache-test.c Fri Mar 30 14:12:52 2012
@@ -36,7 +36,7 @@
/* Implements svn_cache__serialize_func_t */
static svn_error_t *
-serialize_revnum(char **data,
+serialize_revnum(void **data,
apr_size_t *data_len,
void *in,
apr_pool_t *pool)
@@ -51,7 +51,7 @@ serialize_revnum(char **data,
/* Implements svn_cache__deserialize_func_t */
static svn_error_t *
deserialize_revnum(void **out,
- char *data,
+ void *data,
apr_size_t data_len,
apr_pool_t *pool)
{
Modified: subversion/branches/revprop-packing/subversion/tests/libsvn_subr/spillbuf-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/tests/libsvn_subr/spillbuf-test.c?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/tests/libsvn_subr/spillbuf-test.c (original)
+++ subversion/branches/revprop-packing/subversion/tests/libsvn_subr/spillbuf-test.c Fri Mar 30 14:12:52 2012
@@ -33,42 +33,55 @@ static const char basic_data[] = ("abcde
"0123456789");
+/* Validate that BUF is STARTING_SIZE in length. Then read some data from
+ the buffer, which should match EXPECTED. The EXPECTED value must be
+ NUL-terminated, but the NUL is not part of the expected/verified value. */
+#define CHECK_READ(b, s, e, p) SVN_ERR(check_read(b, s, e, p))
+static svn_error_t *
+check_read(svn_spillbuf_t *buf,
+ svn_filesize_t starting_size,
+ const char *expected,
+ apr_pool_t *scratch_pool)
+{
+ apr_size_t expected_len = strlen(expected);
+ const char *readptr;
+ apr_size_t readlen;
+
+ SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) == starting_size);
+ SVN_ERR(svn_spillbuf__read(&readptr, &readlen, buf, scratch_pool));
+ SVN_TEST_ASSERT(readptr != NULL
+ && readlen == expected_len
+ && memcmp(readptr, expected, expected_len) == 0);
+ return SVN_NO_ERROR;
+}
+
+
static svn_error_t *
test_spillbuf_basic(apr_pool_t *pool)
{
- svn_spillbuf_t *buf = svn_spillbuf__create(
- sizeof(basic_data) /* blocksize */,
- 10 * sizeof(basic_data) /* maxsize */,
- pool);
+ apr_size_t len = strlen(basic_data); /* Don't include basic_data's NUL */
+ svn_spillbuf_t *buf = svn_spillbuf__create(len, 10 * len, pool);
int i;
+ const char *readptr;
+ apr_size_t readlen;
/* It starts empty. */
SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) == 0);
/* Place enough data into the buffer to cause a spill to disk. */
for (i = 20; i--; )
- SVN_ERR(svn_spillbuf__write(buf, basic_data, sizeof(basic_data), pool));
+ SVN_ERR(svn_spillbuf__write(buf, basic_data, len, pool));
/* And now has content. */
SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) > 0);
- while (TRUE)
- {
- const char *readptr;
- apr_size_t readlen;
-
- SVN_ERR(svn_spillbuf__read(&readptr, &readlen, buf, pool));
- if (readptr == NULL)
- break;
-
- /* We happen to know that the spill buffer reads data in lengths
- of BLOCKSIZE. */
- SVN_TEST_ASSERT(readlen == sizeof(basic_data));
-
- /* And it should match each block of data we put in. */
- SVN_TEST_ASSERT(memcmp(readptr, basic_data, readlen) == 0);
- }
+ /* Verify that we can read 20 copies of basic_data from the buffer. */
+ for (i = 20; i--; )
+ CHECK_READ(buf, (i + 1) * len, basic_data, pool);
+ /* And after precisely 20 reads, it should be empty. */
+ SVN_ERR(svn_spillbuf__read(&readptr, &readlen, buf, pool));
+ SVN_TEST_ASSERT(readptr == NULL);
SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) == 0);
return SVN_NO_ERROR;
@@ -197,48 +210,29 @@ test_spillbuf_interleaving(apr_pool_t *p
svn_spillbuf_t *buf = svn_spillbuf__create(8 /* blocksize */,
15 /* maxsize */,
pool);
- const char *readptr;
- apr_size_t readlen;
SVN_ERR(svn_spillbuf__write(buf, "abcdef", 6, pool));
SVN_ERR(svn_spillbuf__write(buf, "ghijkl", 6, pool));
- /* now: two blocks of 8 and 4 bytes */
+ /* now: two blocks: 8 and 4 bytes */
- SVN_ERR(svn_spillbuf__read(&readptr, &readlen, buf, pool));
- SVN_TEST_ASSERT(readptr != NULL
- && readlen == 8
- && memcmp(readptr, "abcdefgh", 8) == 0);
- /* now: one block of 4 bytes */
+ CHECK_READ(buf, 12, "abcdefgh", pool);
+ /* now: one block: 4 bytes */
SVN_ERR(svn_spillbuf__write(buf, "mnopqr", 6, pool));
- /* now: two blocks of 8 and 2 bytes */
+ /* now: two blocks: 8 and 2 bytes */
- SVN_ERR(svn_spillbuf__read(&readptr, &readlen, buf, pool));
- SVN_TEST_ASSERT(readptr != NULL
- && readlen == 8
- && memcmp(readptr, "ijklmnop", 8) == 0);
- /* now: one block of 2 bytes */
+ CHECK_READ(buf, 10, "ijklmnop", pool);
+ /* now: one block: 2 bytes */
SVN_ERR(svn_spillbuf__write(buf, "stuvwx", 6, pool));
SVN_ERR(svn_spillbuf__write(buf, "ABCDEF", 6, pool));
SVN_ERR(svn_spillbuf__write(buf, "GHIJKL", 6, pool));
- /* now: two blocks of 8 and 6 bytes, and 6 bytes spilled to a file */
+ /* now: two blocks: 8 and 6 bytes, and 6 bytes spilled to a file */
+
+ CHECK_READ(buf, 20, "qrstuvwx", pool);
+ CHECK_READ(buf, 12, "ABCDEF", pool);
+ CHECK_READ(buf, 6, "GHIJKL", pool);
- SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) > 0);
- SVN_ERR(svn_spillbuf__read(&readptr, &readlen, buf, pool));
- SVN_TEST_ASSERT(readptr != NULL
- && readlen == 8
- && memcmp(readptr, "qrstuvwx", 8) == 0);
- SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) > 0);
- SVN_ERR(svn_spillbuf__read(&readptr, &readlen, buf, pool));
- SVN_TEST_ASSERT(readptr != NULL
- && readlen == 6
- && memcmp(readptr, "ABCDEF", 6) == 0);
- SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) > 0);
- SVN_ERR(svn_spillbuf__read(&readptr, &readlen, buf, pool));
- SVN_TEST_ASSERT(readptr != NULL
- && readlen == 6
- && memcmp(readptr, "GHIJKL", 6) == 0);
SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) == 0);
return SVN_NO_ERROR;
@@ -290,26 +284,26 @@ test_spillbuf_stream(apr_pool_t *pool)
writelen = 6;
SVN_ERR(svn_stream_write(stream, "abcdef", &writelen));
SVN_ERR(svn_stream_write(stream, "ghijkl", &writelen));
- /* now: two blocks of 8 and 4 bytes */
+ /* now: two blocks: 8 and 4 bytes */
readlen = 8;
SVN_ERR(svn_stream_read(stream, readbuf, &readlen));
SVN_TEST_ASSERT(readlen == 8
&& memcmp(readbuf, "abcdefgh", 8) == 0);
- /* now: one block of 4 bytes */
+ /* now: one block: 4 bytes */
SVN_ERR(svn_stream_write(stream, "mnopqr", &writelen));
- /* now: two blocks of 8 and 2 bytes */
+ /* now: two blocks: 8 and 2 bytes */
SVN_ERR(svn_stream_read(stream, readbuf, &readlen));
SVN_TEST_ASSERT(readlen == 8
&& memcmp(readbuf, "ijklmnop", 8) == 0);
- /* now: one block of 2 bytes */
+ /* now: one block: 2 bytes */
SVN_ERR(svn_stream_write(stream, "stuvwx", &writelen));
SVN_ERR(svn_stream_write(stream, "ABCDEF", &writelen));
SVN_ERR(svn_stream_write(stream, "GHIJKL", &writelen));
- /* now: two blocks of 8 and 6 bytes, and 6 bytes spilled to a file */
+ /* now: two blocks: 8 and 6 bytes, and 6 bytes spilled to a file */
SVN_ERR(svn_stream_read(stream, readbuf, &readlen));
SVN_TEST_ASSERT(readlen == 8
@@ -326,6 +320,102 @@ test_spillbuf_stream(apr_pool_t *pool)
}
+static svn_error_t *
+test_spillbuf_rwfile(apr_pool_t *pool)
+{
+ svn_spillbuf_t *buf = svn_spillbuf__create(4 /* blocksize */,
+ 10 /* maxsize */,
+ pool);
+
+ SVN_ERR(svn_spillbuf__write(buf, "abcdef", 6, pool));
+ SVN_ERR(svn_spillbuf__write(buf, "ghijkl", 6, pool));
+ SVN_ERR(svn_spillbuf__write(buf, "mnopqr", 6, pool));
+ /* now: two blocks: 4 and 2 bytes, and 12 bytes in spill file. */
+
+ CHECK_READ(buf, 18, "abcd", pool);
+ /* now: one block: 2 bytes, and 12 bytes in spill file. */
+
+ CHECK_READ(buf, 14, "ef", pool);
+ /* now: no blocks, and 12 bytes in spill file. */
+
+ CHECK_READ(buf, 12, "ghij", pool);
+ /* now: no blocks, and 8 bytes in spill file. */
+
+ /* Write more data. It should be appended to the spill file. */
+ SVN_ERR(svn_spillbuf__write(buf, "stuvwx", 6, pool));
+ /* now: no blocks, and 14 bytes in spill file. */
+
+ CHECK_READ(buf, 14, "klmn", pool);
+ /* now: no blocks, and 10 bytes in spill file. */
+
+ CHECK_READ(buf, 10, "opqr", pool);
+ /* now: no blocks, and 6 bytes in spill file. */
+
+ CHECK_READ(buf, 6, "stuv", pool);
+ /* now: no blocks, and 2 bytes in spill file. */
+
+ CHECK_READ(buf, 2, "wx", pool);
+ /* now: no blocks, and no spill file. */
+
+ return SVN_NO_ERROR;
+}
+
+
+static svn_error_t *
+test_spillbuf_eof(apr_pool_t *pool)
+{
+ svn_spillbuf_t *buf = svn_spillbuf__create(4 /* blocksize */,
+ 10 /* maxsize */,
+ pool);
+
+ SVN_ERR(svn_spillbuf__write(buf, "abcdef", 6, pool));
+ SVN_ERR(svn_spillbuf__write(buf, "ghijkl", 6, pool));
+ /* now: two blocks: 4 and 2 bytes, and 6 bytes in spill file. */
+
+ CHECK_READ(buf, 12, "abcd", pool);
+ CHECK_READ(buf, 8, "ef", pool);
+ CHECK_READ(buf, 6, "ghij", pool);
+ CHECK_READ(buf, 2, "kl", pool);
+ /* The spill file should have been emptied and forgotten. */
+
+ /* Assuming the spill file has been forgotten, this should result in
+ precisely the same behavior. Specifically: the initial write should
+ create two blocks, and the second write should be spilled. If there
+ *was* a spill file, then this written data would go into the file. */
+ SVN_ERR(svn_spillbuf__write(buf, "abcdef", 6, pool));
+ SVN_ERR(svn_spillbuf__write(buf, "ghijkl", 6, pool));
+ CHECK_READ(buf, 12, "abcd", pool);
+ CHECK_READ(buf, 8, "ef", pool);
+ CHECK_READ(buf, 6, "ghij", pool);
+ CHECK_READ(buf, 2, "kl", pool);
+ /* The spill file should have been emptied and forgotten. */
+
+ /* Now, let's do a sequence where we arrange to hit EOF precisely on
+ a block-sized read. Note: the second write must be more than 4 bytes,
+ or it will not cause a spill. We use 8 to get the right boundary. */
+ SVN_ERR(svn_spillbuf__write(buf, "abcdef", 6, pool));
+ SVN_ERR(svn_spillbuf__write(buf, "ghijklmn", 8, pool));
+ CHECK_READ(buf, 14, "abcd", pool);
+ CHECK_READ(buf, 10, "ef", pool);
+ CHECK_READ(buf, 8, "ghij", pool);
+ CHECK_READ(buf, 4, "klmn", pool);
+ /* We discard the spill file when we know it has no data, rather than
+ upon hitting EOF (upon a read attempt). Thus, the spill file should
+ be gone. */
+
+ /* Verify the forgotten spill file. */
+ SVN_ERR(svn_spillbuf__write(buf, "abcdef", 6, pool));
+ SVN_ERR(svn_spillbuf__write(buf, "ghijkl", 6, pool));
+ CHECK_READ(buf, 12, "abcd", pool);
+ CHECK_READ(buf, 8, "ef", pool);
+ CHECK_READ(buf, 6, "ghij", pool);
+ /* Two unread bytes remaining in the spill file. */
+ SVN_TEST_ASSERT(svn_spillbuf__get_size(buf) == 2);
+
+ return SVN_NO_ERROR;
+}
+
+
/* The test table. */
struct svn_test_descriptor_t test_funcs[] =
{
@@ -337,5 +427,7 @@ struct svn_test_descriptor_t test_funcs[
"interleaving reads and writes"),
SVN_TEST_PASS2(test_spillbuf_reader, "spill buffer reader test"),
SVN_TEST_PASS2(test_spillbuf_stream, "spill buffer stream test"),
+ SVN_TEST_PASS2(test_spillbuf_rwfile, "read/write spill file"),
+ SVN_TEST_PASS2(test_spillbuf_eof, "validate reaching EOF of spill file"),
SVN_TEST_NULL
};
Modified: subversion/branches/revprop-packing/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/tests/libsvn_wc/op-depth-test.c?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/branches/revprop-packing/subversion/tests/libsvn_wc/op-depth-test.c Fri Mar 30 14:12:52 2012
@@ -342,12 +342,12 @@ print_row(const nodes_row_t *row,
return "(null)";
if (row->moved_to)
- moved_to_str = apr_psprintf(result_pool, ", to %s", row->moved_to);
+ moved_to_str = apr_psprintf(result_pool, ", moved-to %s", row->moved_to);
else
moved_to_str = "";
if (row->moved_here)
- moved_here_str = ", here";
+ moved_here_str = ", moved-here";
else
moved_here_str = "";
@@ -362,8 +362,9 @@ print_row(const nodes_row_t *row,
moved_here_str, moved_to_str,
file_external_str);
else
- return apr_psprintf(result_pool, "%d, %s, %s, from ^/%s@%d%s%s%s",
+ return apr_psprintf(result_pool, "%d, %s, %s, %s ^/%s@%d%s%s%s",
row->op_depth, row->local_relpath, row->presence,
+ row->op_depth == 0 ? "base" : "copyfrom",
row->repo_relpath, (int)row->repo_revnum,
moved_here_str, moved_to_str,
file_external_str);
@@ -4495,7 +4496,7 @@ move_added(const svn_test_opts_t *opts,
{1, "A/B", "base-deleted", NO_COPY_FROM},
{1, "A2", "normal", 1, "A", MOVED_HERE},
{1, "A2/B", "normal", 1, "A/B", MOVED_HERE},
- {3, "A2/B/C", "normal", NO_COPY_FROM}, /* XFAIL */
+ {3, "A2/B/C", "normal", NO_COPY_FROM},
{3, "A2/B/C2", "normal", NO_COPY_FROM},
{0}
};
@@ -4665,7 +4666,7 @@ struct svn_test_descriptor_t test_funcs[
"move_on_move"),
SVN_TEST_OPTS_PASS(move_on_move2,
"move_on_move2"),
- SVN_TEST_OPTS_XFAIL(move_added,
+ SVN_TEST_OPTS_PASS(move_added,
"move_added"),
SVN_TEST_OPTS_XFAIL(move_update,
"move_update"),
Modified: subversion/branches/revprop-packing/tools/dev/unix-build/Makefile.svn
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/tools/dev/unix-build/Makefile.svn?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/branches/revprop-packing/tools/dev/unix-build/Makefile.svn Fri Mar 30 14:12:52 2012
@@ -62,16 +62,16 @@ BDB_MAJOR_VER = 4.7
BDB_VER = $(BDB_MAJOR_VER).25
APR_VER = 1.4.5
APR_ICONV_VER = 1.2.1
-GNU_ICONV_VER = 1.13.1
+GNU_ICONV_VER = 1.14
APR_UTIL_VER = 1.3.12
-HTTPD_VER = 2.2.19
+HTTPD_VER = 2.2.22
NEON_VER = 0.29.6
-SERF_VER = 1.0.0
+SERF_VER = 1.0.3
SERF_OLD_VER = 0.3.1
-CYRUS_SASL_VER = 2.1.23
-SQLITE_VER = 3070603
+CYRUS_SASL_VER = 2.1.25
+SQLITE_VER = 3071100
LIBMAGIC_VER = 5.11
-RUBY_VER = 1.8.7-p334
+RUBY_VER = 1.8.7-p358
BZ2_VER = 1.0.6
PYTHON_VER = 2.7.2
Modified: subversion/branches/revprop-packing/tools/dist/dist.sh
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/tools/dist/dist.sh?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/tools/dist/dist.sh (original)
+++ subversion/branches/revprop-packing/tools/dist/dist.sh Fri Mar 30 14:12:52 2012
@@ -247,6 +247,11 @@ if [ "$ver_major" -eq "1" -a "$ver_minor
rm -rf "$DISTPATH/packages"
fi
+# Remove www/ from the tarball for 1.6.x and earlier releases
+if [ "$ver_major" -eq "1" -a "$ver_minor" -le "6" ]; then
+ rm -rf "$DISTPATH/www"
+fi
+
# Check for a recent enough Python
# Instead of attempting to deal with various line ending issues, just export
# the find_python script manually.
Modified: subversion/branches/revprop-packing/tools/dist/make-deps-tarball.sh
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/tools/dist/make-deps-tarball.sh?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/tools/dist/make-deps-tarball.sh (original)
+++ subversion/branches/revprop-packing/tools/dist/make-deps-tarball.sh Fri Mar 30 14:12:52 2012
@@ -21,7 +21,9 @@
#
set -e
-APR=apr-1.4.6
+# NOTE: Before bumping the default APR dependency the 1.6.x test suite
+# should be adjusted to cope with hash ordering changes from APR 1.4.6.
+APR=apr-1.4.5
APR_UTIL=apr-util-1.4.1
NEON=neon-0.29.6
SERF=serf-0.3.1
Propchange: subversion/branches/revprop-packing/tools/dist/make-deps-tarball.sh
------------------------------------------------------------------------------
Merged /subversion/trunk/tools/dist/make-deps-tarball.sh:r1304609-1306300
Modified: subversion/branches/revprop-packing/tools/dist/release.py
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/tools/dist/release.py?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/tools/dist/release.py (original)
+++ subversion/branches/revprop-packing/tools/dist/release.py Fri Mar 30 14:12:52 2012
@@ -21,10 +21,10 @@
# About this script:
-# This script is intended to simplify creating Subversion releases, by
-# automating as much as is possible. It works well with our Apache
-# infrastructure, and should make rolling, posting, and announcing
-# releases dirt simple.
+# This script is intended to simplify creating Subversion releases for
+# any of the supported release lines of Subversion.
+# It works well with our Apache infrastructure, and should make rolling,
+# posting, and announcing releases dirt simple.
#
# This script may be run on a number of platforms, but it is intended to
# be run on people.apache.org. As such, it may have dependencies (such