summaryrefslogtreecommitdiff
path: root/subversion/tests/libsvn_wc/db-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/tests/libsvn_wc/db-test.c')
-rw-r--r--subversion/tests/libsvn_wc/db-test.c363
1 files changed, 220 insertions, 143 deletions
diff --git a/subversion/tests/libsvn_wc/db-test.c b/subversion/tests/libsvn_wc/db-test.c
index 462fcb7..45e9c4d 100644
--- a/subversion/tests/libsvn_wc/db-test.c
+++ b/subversion/tests/libsvn_wc/db-test.c
@@ -97,91 +97,91 @@ static const char * const TESTING_DATA = (
"insert into nodes values ("
" 1, '', 0, null, 1, '', 1, 'normal',"
" null, null, 'dir', '()', 'infinity', null, null, 1, " TIME_1s ", '" AUTHOR_1 "',"
- " null, null, null, null);"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'A', 0, '', 1, 'A', 1, 'normal',"
" null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "',"
- " 10, null, null, null);"
+ " 10, null, null, null, null);"
"insert into nodes values ("
" 1, 'B', 0, '', 1, 'B', null, 'excluded',"
" null, null, 'symlink', null, null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, null, null, null);"
"insert into nodes values ("
- " 1, 'C', 0, '', 1, 'C', null, 'absent',"
+ " 1, 'C', 0, '', 1, 'C', null, 'server-excluded',"
" null, null, 'unknown', null, null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'D', 0, '', 1, 'D', null, 'not-present',"
" null, null, 'unknown', null, null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'E', 0, '', 1, 'E', null, 'incomplete',"
" null, null, 'unknown', null, null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'F', 0, '', 1, 'F', 1, 'normal',"
" null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "',"
- " 15, null, null, null);"
+ " 15, null, null, null, null);"
"insert into nodes values ("
" 1, 'G', 0, '', 2, 'G-alt', 1, 'normal',"
" null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 2, " TIME_2s ", '" AUTHOR_2 "',"
- " 15, null, null, null);"
+ " 15, null, null, null, null);"
"insert into nodes values ("
" 1, 'H', 0, '', 1, 'H', 1, 'normal',"
" null, null, 'symlink', '()', null, null, 'H-target', 1, " TIME_1s ", '" AUTHOR_1 "',"
- " null, null, null, null);"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'I', 0, '', 1, 'I', 1, 'normal',"
" null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "',"
- " null, null, null, null);"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J', 0, '', 1, 'J', 1, 'normal',"
" null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "',"
- " null, null, null, null);"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-e', 0, 'J', 1, 'J/J-e', 1, 'normal',"
- " null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "',"
- " null, null, null, null);"
+ " null, 'other/place', 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "',"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-e/J-e-a', 0, 'J/J-e', 1, 'J/J-e/J-e-a', 1, 'normal',"
" null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "',"
- " 15, null, null, null);"
+ " 15, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-e/J-e-b', 0, 'J/J-e', 1, 'J/J-e/J-e-b', 1, 'normal',"
" null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "',"
- " null, null, null, null);"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-e/J-e-b/Jeba', 0, 'J/J-e/J-e-b', 1, 'J/J-e/J-e-b/Jeba', 1, 'normal',"
" null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "',"
- " 15, null, null, null);"
+ " 15, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-f', 0, 'J', 1, 'J/J-f', 1, 'normal',"
" null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "',"
- " null, null, null, null);"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-f/J-f-a', 0, 'J/J-f', 1, 'J/J-f/J-f-a', 1, 'normal',"
" null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "',"
- " null, null, null, null);"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'K', 0, '', 1, 'K', 1, 'normal',"
" null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "',"
- " null, null, null, null);"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'K/K-a', 0, 'K', 1, 'K/K-a', 1, 'normal',"
" null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "',"
- " 15, null, null, null);"
+ " 15, null, null, null, null);"
"insert into nodes values ("
" 1, 'K/K-b', 0, 'K', 1, 'K/K-b', 1, 'normal',"
- " null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "',"
- " 15, null, null, null);"
+ " null, 'moved/away', 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "',"
+ " 15, null, null, null, null);"
""
/* Load data into NODES table;
### op_depths have not been calculated by me yet;
the value 1 is just 'good enough' to make the nodes WORKING nodes. */
"insert into nodes values ("
" 1, 'I', 1, '', 2, 'some/dir', 2, 'normal',"
- " 0, null, 'dir', '()', 'immediates', null, null, 2, " TIME_2s ", '" AUTHOR_2 "',"
- " null, null, null, null);"
+ " null, null, 'dir', '()', 'immediates', null, null, 2, " TIME_2s ", '" AUTHOR_2 "',"
+ " null, null, null, null, null);"
/* I'm not sure what the working J is supposed to represent. It
replaces the base J, but is it a copy or not? It has no
@@ -189,112 +189,136 @@ static const char * const TESTING_DATA = (
implies they are children of a copied J. */
"insert into nodes values ("
" 1, 'J', 1, '', null, null, null, 'normal',"
- " 0, null, 'dir', '()', 'immediates', null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'dir', '()', 'immediates', null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-a', 1, 'J', null, null, null, 'normal',"
- " 0, null, 'file', '()', null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'file', '()', null, null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-b', 2, 'J', 2, 'some/dir', 2, 'normal',"
- " 0, null, 'dir', '()', 'infinity', null, null, 2, " TIME_2s ", '" AUTHOR_2 "',"
- " null, null, null, null);"
+ " null, null, 'dir', '()', 'infinity', null, null, 2, " TIME_2s ", '" AUTHOR_2 "',"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-b/J-b-a', 3, 'J/J-b', 2, 'another/dir', 2, 'normal',"
- " 0, null, 'dir', '()', 'infinity', null, null, 2, " TIME_2s ", '" AUTHOR_2 "',"
- " null, null, null, null);"
+ " null, null, 'dir', '()', 'infinity', null, null, 2, " TIME_2s ", '" AUTHOR_2 "',"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-b/J-b-b', 2, 'J/J-b', null, null, 2, 'normal',"
- " 0, null, 'file', '()', null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'file', '()', null, null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-c', 1, 'J', null, null, null, 'normal',"
- " 0, null, 'dir', '()', null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'dir', '()', null, null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-c/J-c-a', 1, 'J/J-c', null, null, null, 'normal',"
- " 0, null, 'dir', '()', null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'dir', '()', null, null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-c', 2, 'J', null, null, null, 'base-deleted',"
- " 0, null, 'dir', '()', null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'dir', '()', null, null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-c/J-c-a', 2, 'J/J-c', null, null, null, 'base-deleted',"
- " 0, null, 'dir', '()', null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'dir', '()', null, null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-d', 2, 'J', 2, 'moved/file', 2, 'normal',"
" 1, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 2, " TIME_2s ", '" AUTHOR_2 "',"
- " 10, null, null, null);"
+ " 10, null, null, null, null);"
+ "insert into nodes values ("
+ " 1, 'moved/file', 0, 'moved', 2, 'moved/file', 2, 'normal',"
+ " null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 2, " TIME_2s ", '" AUTHOR_2 "',"
+ " 10, null, null, null, null);"
+ "insert into nodes values ("
+ " 1, 'moved/file', 2, 'moved', 2, 'moved/file', 2, 'base-deleted',"
+ " null, 'J/J-d', 'file', '()', null, null, null, null, null, null,"
+ " 10, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-e', 1, 'J', null, null, null, 'normal',"
- " 0, 'other/place', 'dir', '()', null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'dir', '()', null, null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-e/J-e-a', 1, 'J/J-e', null, null, null, 'normal',"
- " 0, null, 'file', '()', null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'file', '()', null, null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-e/J-e-b', 1, 'J/J-e', null, null, null, 'normal',"
- " 0, null, 'dir', '()', null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'dir', '()', null, null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-e', 2, 'J', null, null, null, 'base-deleted',"
- " 0, 'other/place', 'dir', '()', null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'dir', '()', null, null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-e/J-e-a', 2, 'J/J-e', null, null, null, 'base-deleted',"
- " 0, null, 'file', '()', null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'file', '()', null, null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-e/J-e-b', 2, 'J/J-e', null, null, null, 'base-deleted',"
- " 0, null, 'dir', '()', null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'dir', '()', null, null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-e/J-e-b/Jeba', 1, 'J/J-e/J-e-b', null, null, null, 'base-deleted',"
- " 0, null, 'file', '()', null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'file', '()', null, null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-f', 1, 'J', null, null, null, 'normal',"
- " 0, null, 'dir', '()', 'immediates', null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'dir', '()', 'immediates', null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'J/J-f/J-f-a', 1, 'J/J-f', null, null, null, 'base-deleted',"
- " 0, null, 'dir', '()', 'immediates', null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'dir', '()', 'immediates', null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'K', 1, '', null, null, null, 'base-deleted',"
- " 0, null, 'dir', '()', null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'dir', '()', null, null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'K/K-a', 1, 'K', null, null, null, 'base-deleted',"
- " 0, null, 'file', '()', null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'file', '()', null, null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'K/K-b', 1, 'K', null, null, null, 'base-deleted',"
- " 0, 'moved/away', 'file', '()', null, null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'file', '()', null, null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'L', 1, '', null, null, null, 'normal',"
- " 0, null, 'dir', '()', 'immediates', null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'dir', '()', 'immediates', null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'L/L-a', 1, 'L', null, null, null, 'normal',"
- " 0, null, 'dir', '()', 'immediates', null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'dir', '()', 'immediates', null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'L/L-a/L-a-a', 1, 'L/L-a', null, null, null, 'normal',"
- " 0, null, 'dir', '()', 'immediates', null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'dir', '()', 'immediates', null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'L/L-a', 2, 'L', null, null, null, 'base-deleted',"
- " 0, null, 'dir', '()', 'immediates', null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'dir', '()', 'immediates', null, null, null, null, null,"
+ " null, null, null, null, null);"
"insert into nodes values ("
" 1, 'L/L-a/L-a-a', 2, 'L/L-a', null, null, null, 'base-deleted',"
- " 0, null, 'dir', '()', 'immediates', null, null, null, null, null,"
- " null, null, null, null);"
+ " null, null, 'dir', '()', 'immediates', null, null, null, null, null,"
+ " null, null, null, null, null);"
+ "insert into nodes values ("
+ " 1, 'other/place', 2, 'other', null, null, null, 'normal',"
+ " 1, null, 'dir', '()', 'immediates', null, null, null, null, null,"
+ " null, null, null, null, null);"
+ "insert into nodes values ("
+ " 1, 'other/place/J-e-a', 2, 'other/place', null, null, null, 'normal',"
+ " null, null, 'dir', '()', 'immediates', null, null, null, null, null,"
+ " null, null, null, null, null);"
+ "insert into nodes values ("
+ " 1, 'other/place/J-e-b', 2, 'other/place', null, null, null, 'normal',"
+ " null, null, 'dir', '()', null, null, null, 1, " TIME_1s ", '" AUTHOR_1 "',"
+ " null, null, null, null, null);"
+ "insert into nodes values ("
+ " 1, 'other/place/J-e-b/Jeba', 0, 'other/place/J-e-b', null, null, null, 'normal',"
+ " null, null, 'file', '()', null, '$sha1$" SHA1_1 "', null, 1, " TIME_1s ", '" AUTHOR_1 "',"
+ " 15, null, null, null, null);"
"insert into actual_node values ("
" 1, 'I', '', null, null, null, null, null, 'changelist', null, "
" null, null, null, null, null);"
@@ -316,9 +340,11 @@ create_open(svn_wc__db_t **db,
SVN_ERR(svn_dirent_get_absolute(local_abspath,
svn_dirent_join("fake-wc", subdir, pool),
pool));
- SVN_ERR(svn_wc__db_open(db, NULL, TRUE, TRUE, pool, pool));
+ SVN_ERR(svn_wc__db_open(db, NULL, FALSE, TRUE, pool, pool));
SVN_ERR(svn_test__create_fake_wc(*local_abspath, TESTING_DATA, pool, pool));
+ svn_test_add_dir_cleanup(*local_abspath);
+
return SVN_NO_ERROR;
}
@@ -354,7 +380,7 @@ static svn_error_t *
test_getting_info(apr_pool_t *pool)
{
const char *local_abspath;
- svn_wc__db_kind_t kind;
+ svn_node_kind_t kind;
svn_wc__db_status_t status;
svn_revnum_t revision;
const char *repos_relpath;
@@ -367,6 +393,7 @@ test_getting_info(apr_pool_t *pool)
const svn_checksum_t *checksum;
const char *target;
svn_boolean_t had_props;
+ apr_hash_t *props;
svn_boolean_t update_root;
svn_wc__db_lock_t *lock;
svn_wc__db_t *db;
@@ -379,11 +406,11 @@ test_getting_info(apr_pool_t *pool)
&status, &kind, &revision,
&repos_relpath, &repos_root_url, &repos_uuid,
&changed_rev, &changed_date, &changed_author,&depth, &checksum,
- &target, &lock, &had_props,
+ &target, &lock, &had_props, &props,
&update_root,
db, local_abspath,
pool, pool));
- SVN_TEST_ASSERT(kind == svn_wc__db_kind_dir);
+ SVN_TEST_ASSERT(kind == svn_node_dir);
SVN_TEST_ASSERT(status == svn_wc__db_status_normal);
SVN_TEST_ASSERT(revision == 1);
SVN_TEST_STRING_ASSERT(repos_relpath, "");
@@ -396,6 +423,9 @@ test_getting_info(apr_pool_t *pool)
SVN_TEST_ASSERT(checksum == NULL);
SVN_TEST_ASSERT(target == NULL);
SVN_TEST_ASSERT(lock == NULL);
+ SVN_TEST_ASSERT(!had_props);
+ SVN_TEST_ASSERT(apr_hash_count(props) == 0);
+ /* SVN_TEST_ASSERT(update_root == ???); */
/* Test: file-specific values. */
SVN_ERR(svn_wc__db_base_get_info(
@@ -403,10 +433,10 @@ test_getting_info(apr_pool_t *pool)
&repos_relpath, &repos_root_url, &repos_uuid,
NULL, NULL, NULL, NULL,
&checksum, NULL, NULL,
- NULL, NULL,
+ NULL, NULL, NULL,
db, svn_dirent_join(local_abspath, "A", pool),
pool, pool));
- SVN_TEST_ASSERT(kind == svn_wc__db_kind_file);
+ SVN_TEST_ASSERT(kind == svn_node_file);
SVN_TEST_STRING_ASSERT(SHA1_1, svn_checksum_to_cstring(checksum, pool));
SVN_TEST_STRING_ASSERT(repos_relpath, "A");
SVN_TEST_STRING_ASSERT(repos_root_url, ROOT_ONE);
@@ -418,10 +448,10 @@ test_getting_info(apr_pool_t *pool)
&repos_relpath, &repos_root_url, &repos_uuid,
&changed_rev, &changed_date, &changed_author,
&depth, &checksum, &target, &lock,
- NULL, NULL,
+ NULL, NULL, NULL,
db, svn_dirent_join(local_abspath, "B", pool),
pool, pool));
- SVN_TEST_ASSERT(kind == svn_wc__db_kind_symlink);
+ SVN_TEST_ASSERT(kind == svn_node_symlink);
SVN_TEST_ASSERT(status == svn_wc__db_status_excluded);
SVN_TEST_ASSERT(!SVN_IS_VALID_REVNUM(revision));
SVN_TEST_STRING_ASSERT(repos_relpath, "B");
@@ -435,16 +465,16 @@ test_getting_info(apr_pool_t *pool)
SVN_TEST_ASSERT(target == NULL);
SVN_TEST_ASSERT(lock == NULL);
- /* Test: unknown kind, absent presence. */
+ /* Test: unknown kind, server-excluded presence. */
SVN_ERR(svn_wc__db_base_get_info(
&status, &kind, NULL,
NULL, NULL, NULL,
NULL, NULL, NULL,
NULL, NULL, NULL,
- NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
db, svn_dirent_join(local_abspath, "C", pool),
pool, pool));
- SVN_TEST_ASSERT(kind == svn_wc__db_kind_unknown);
+ SVN_TEST_ASSERT(kind == svn_node_unknown);
SVN_TEST_ASSERT(status == svn_wc__db_status_server_excluded);
/* Test: not-present presence. */
@@ -453,7 +483,7 @@ test_getting_info(apr_pool_t *pool)
NULL, NULL, NULL,
NULL, NULL, NULL,
NULL, NULL, NULL,
- NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
db, svn_dirent_join(local_abspath, "D", pool),
pool, pool));
SVN_TEST_ASSERT(status == svn_wc__db_status_not_present);
@@ -464,7 +494,7 @@ test_getting_info(apr_pool_t *pool)
NULL, NULL, NULL,
NULL, NULL, NULL,
NULL, NULL, NULL,
- NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
db, svn_dirent_join(local_abspath, "E", pool),
pool, pool));
SVN_TEST_ASSERT(status == svn_wc__db_status_incomplete);
@@ -475,7 +505,7 @@ test_getting_info(apr_pool_t *pool)
NULL, NULL, NULL,
NULL, NULL, NULL,
NULL, &checksum, NULL,
- NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
db, svn_dirent_join(local_abspath, "F", pool),
pool, pool));
SVN_TEST_STRING_ASSERT(SHA1_1,
@@ -487,7 +517,7 @@ test_getting_info(apr_pool_t *pool)
&repos_relpath, &repos_root_url, &repos_uuid,
&changed_rev, &changed_date, &changed_author,
NULL, NULL, NULL,
- NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
db, svn_dirent_join(local_abspath, "G", pool),
pool, pool));
SVN_TEST_STRING_ASSERT(repos_relpath, "G-alt");
@@ -503,7 +533,7 @@ test_getting_info(apr_pool_t *pool)
NULL, NULL, NULL,
NULL, NULL, NULL,
NULL, &checksum, &target,
- NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
db, svn_dirent_join(local_abspath, "H", pool),
pool, pool));
SVN_TEST_ASSERT(checksum == NULL);
@@ -515,11 +545,10 @@ test_getting_info(apr_pool_t *pool)
NULL, NULL, NULL,
NULL, NULL, NULL,
NULL, NULL, NULL,
- NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
db, svn_dirent_join(local_abspath, "missing-file", pool),
pool, pool);
- SVN_TEST_ASSERT(err != NULL && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND);
- svn_error_clear(err);
+ SVN_TEST_ASSERT_ERROR(err, SVN_ERR_WC_PATH_NOT_FOUND);
return SVN_NO_ERROR;
}
@@ -529,12 +558,12 @@ static svn_error_t *
validate_node(svn_wc__db_t *db,
const char *local_abspath,
const char *relpath,
- svn_wc__db_kind_t expected_kind,
+ svn_node_kind_t expected_kind,
svn_wc__db_status_t expected_status,
apr_pool_t *scratch_pool)
{
const char *path = svn_dirent_join(local_abspath, relpath, scratch_pool);
- svn_wc__db_kind_t kind;
+ svn_node_kind_t kind;
svn_wc__db_status_t status;
apr_hash_t *props;
const svn_string_t *value;
@@ -544,14 +573,12 @@ validate_node(svn_wc__db_t *db,
NULL, NULL, NULL,
NULL, NULL, NULL,
NULL, NULL, NULL,
- NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
db, path,
scratch_pool, scratch_pool));
SVN_TEST_ASSERT(kind == expected_kind);
SVN_TEST_ASSERT(status == expected_status);
- SVN_ERR(svn_wc__db_base_get_props(&props, db, path,
- scratch_pool, scratch_pool));
switch (status)
{
case svn_wc__db_status_server_excluded:
@@ -559,13 +586,18 @@ validate_node(svn_wc__db_t *db,
case svn_wc__db_status_incomplete:
case svn_wc__db_status_not_present:
/* Our tests aren't setting properties on these node types, so
- short-circuit examination of name/value pairs. */
+ short-circuit examination of name/value pairs, to avoid having
+ to handle the error from svn_wc__db_base_get_props(). */
return SVN_NO_ERROR;
-
default:
- SVN_TEST_ASSERT(props != NULL);
+ break; /* Fall through */
}
+ SVN_ERR(svn_wc__db_base_get_props(&props, db, path,
+ scratch_pool, scratch_pool));
+
+ SVN_TEST_ASSERT(props != NULL);
+
value = apr_hash_get(props, "p1", APR_HASH_KEY_STRING);
SVN_TEST_STRING_ASSERT(value->data, "v1");
@@ -628,7 +660,7 @@ test_inserting_nodes(apr_pool_t *pool)
props,
1, TIME_1a, AUTHOR_1,
children, svn_depth_infinity,
- NULL, NULL, FALSE, NULL, NULL,
+ NULL, NULL, FALSE, NULL, NULL, NULL,
pool));
/* Replace an incomplete node with a file node. */
@@ -640,7 +672,8 @@ test_inserting_nodes(apr_pool_t *pool)
props,
1, TIME_1a, AUTHOR_1,
checksum,
- NULL, NULL, FALSE, NULL, FALSE, FALSE, NULL,
+ NULL, FALSE, FALSE, NULL, NULL, FALSE, FALSE,
+ NULL, NULL,
pool));
/* Create a new symlink node. */
@@ -652,14 +685,15 @@ test_inserting_nodes(apr_pool_t *pool)
props,
1, TIME_1a, AUTHOR_1,
"O-target",
- NULL, NULL, FALSE, NULL, NULL,
+ NULL, FALSE, FALSE, NULL, NULL, FALSE, FALSE,
+ NULL, NULL,
pool));
- /* Replace an incomplete node with an absent file node. */
+ /* Replace an incomplete node with an server-excluded file node. */
SVN_ERR(svn_wc__db_base_add_excluded_node(
db, svn_dirent_join(local_abspath, "N/N-b", pool),
"N/N-b", ROOT_ONE, UUID_ONE, 3,
- svn_wc__db_kind_file, svn_wc__db_status_server_excluded,
+ svn_node_file, svn_wc__db_status_server_excluded,
NULL, NULL,
pool));
@@ -667,7 +701,7 @@ test_inserting_nodes(apr_pool_t *pool)
SVN_ERR(svn_wc__db_base_add_excluded_node(
db, svn_dirent_join(local_abspath, "P", pool),
"P", ROOT_ONE, UUID_ONE, 3,
- svn_wc__db_kind_dir, svn_wc__db_status_excluded,
+ svn_node_dir, svn_wc__db_status_excluded,
NULL, NULL,
pool));
@@ -675,44 +709,44 @@ test_inserting_nodes(apr_pool_t *pool)
SVN_ERR(svn_wc__db_base_add_not_present_node(
db, svn_dirent_join(local_abspath, "Q", pool),
"Q", ROOT_ONE, UUID_ONE, 3,
- svn_wc__db_kind_symlink,
+ svn_node_symlink,
NULL, NULL,
pool));
- /* Create a new absent unknown-kind node. */
+ /* Create a new server-excluded unknown-kind node. */
SVN_ERR(svn_wc__db_base_add_excluded_node(
db, svn_dirent_join(local_abspath, "R", pool),
"R", ROOT_ONE, UUID_ONE, 3,
- svn_wc__db_kind_unknown, svn_wc__db_status_server_excluded,
+ svn_node_unknown, svn_wc__db_status_server_excluded,
NULL, NULL,
pool));
/* Are all the nodes where we expect them to be? */
SVN_ERR(validate_node(db, local_abspath, "N",
- svn_wc__db_kind_dir, svn_wc__db_status_normal,
+ svn_node_dir, svn_wc__db_status_normal,
pool));
SVN_ERR(validate_node(db, local_abspath, "N/N-a",
- svn_wc__db_kind_file, svn_wc__db_status_normal,
+ svn_node_file, svn_wc__db_status_normal,
pool));
SVN_ERR(validate_node(db, local_abspath, "N/N-b",
- svn_wc__db_kind_file,
+ svn_node_file,
svn_wc__db_status_server_excluded,
pool));
SVN_ERR(validate_node(db, local_abspath, "N/N-c",
- svn_wc__db_kind_unknown, svn_wc__db_status_incomplete,
+ svn_node_unknown, svn_wc__db_status_incomplete,
pool));
SVN_ERR(validate_node(db, local_abspath, "O",
- svn_wc__db_kind_symlink, svn_wc__db_status_normal,
+ svn_node_symlink, svn_wc__db_status_normal,
pool));
SVN_ERR(validate_node(db, local_abspath, "P",
- svn_wc__db_kind_dir, svn_wc__db_status_excluded,
+ svn_node_dir, svn_wc__db_status_excluded,
pool));
SVN_ERR(validate_node(db, local_abspath, "Q",
- svn_wc__db_kind_symlink, svn_wc__db_status_not_present,
+ svn_node_symlink, svn_wc__db_status_not_present,
pool));
SVN_ERR(validate_node(db, local_abspath, "R",
- svn_wc__db_kind_unknown,
+ svn_node_unknown,
svn_wc__db_status_server_excluded,
pool));
@@ -768,7 +802,7 @@ static svn_error_t *
test_working_info(apr_pool_t *pool)
{
const char *local_abspath;
- svn_wc__db_kind_t kind;
+ svn_node_kind_t kind;
svn_wc__db_status_t status;
svn_revnum_t revision;
const char *repos_relpath;
@@ -777,10 +811,10 @@ test_working_info(apr_pool_t *pool)
svn_revnum_t changed_rev;
apr_time_t changed_date;
const char *changed_author;
- apr_time_t last_mod_time;
+ apr_time_t recorded_time;
svn_depth_t depth;
const svn_checksum_t *checksum;
- svn_filesize_t translated_size;
+ svn_filesize_t recorded_size;
const char *target;
const char *changelist;
const char *original_repos_relpath;
@@ -806,13 +840,13 @@ test_working_info(apr_pool_t *pool)
&changed_rev, &changed_date, &changed_author,
&depth, &checksum, &target, &original_repos_relpath,
&original_root_url, &original_uuid, &original_revnum,
- &lock, &translated_size, &last_mod_time, &changelist,
+ &lock, &recorded_size, &recorded_time, &changelist,
&conflicted, &op_root, &had_props, &props_mod,
&have_base, &have_more_work, &have_work,
db, svn_dirent_join(local_abspath, "I", pool),
pool, pool));
SVN_TEST_ASSERT(status == svn_wc__db_status_added);
- SVN_TEST_ASSERT(kind == svn_wc__db_kind_dir);
+ SVN_TEST_ASSERT(kind == svn_node_dir);
SVN_TEST_ASSERT(revision == SVN_INVALID_REVNUM);
SVN_TEST_ASSERT(repos_relpath == NULL);
SVN_TEST_ASSERT(repos_root_url == NULL);
@@ -822,18 +856,22 @@ test_working_info(apr_pool_t *pool)
SVN_TEST_STRING_ASSERT(changed_author, AUTHOR_2);
SVN_TEST_ASSERT(depth == svn_depth_immediates);
SVN_TEST_ASSERT(checksum == NULL);
- SVN_TEST_ASSERT(translated_size == SVN_INVALID_FILESIZE);
+ SVN_TEST_ASSERT(recorded_size == SVN_INVALID_FILESIZE);
SVN_TEST_ASSERT(target == NULL);
SVN_TEST_STRING_ASSERT(changelist, "changelist");
SVN_TEST_STRING_ASSERT(original_repos_relpath, "some/dir");
SVN_TEST_STRING_ASSERT(original_root_url, ROOT_TWO);
SVN_TEST_STRING_ASSERT(original_uuid, UUID_TWO);
SVN_TEST_ASSERT(original_revnum == 2);
- SVN_TEST_ASSERT(props_mod == FALSE);
- SVN_TEST_ASSERT(have_base == TRUE);
- SVN_TEST_ASSERT(have_work == TRUE);
- SVN_TEST_ASSERT(conflicted == FALSE);
+ SVN_TEST_ASSERT(!had_props);
+ SVN_TEST_ASSERT(!props_mod);
+ SVN_TEST_ASSERT(have_base);
+ /* SVN_TEST_ASSERT(have_more_work...); */
+ SVN_TEST_ASSERT(have_work);
+ SVN_TEST_ASSERT(!conflicted);
SVN_TEST_ASSERT(lock == NULL);
+ /* SVN_TEST_ASSERT(last_mod_time...); */
+ /* SVN_TEST_ASSERT(op_root...); */
/* ### we need a hojillion more tests in here. I just want to get this
@@ -859,14 +897,14 @@ test_pdh(apr_pool_t *pool)
SVN_ERR(svn_wc__db_base_add_excluded_node(
db, svn_dirent_join(local_abspath, "sub", pool),
"sub", ROOT_ONE, UUID_ONE, 1,
- svn_wc__db_kind_file, svn_wc__db_status_server_excluded,
+ svn_node_file, svn_wc__db_status_server_excluded,
NULL, NULL,
pool));
SVN_ERR(svn_wc__db_base_add_excluded_node(
db, svn_dirent_join(local_abspath, "sub/A", pool),
"sub/A", ROOT_ONE, UUID_ONE, 1,
- svn_wc__db_kind_file, svn_wc__db_status_server_excluded,
+ svn_node_file, svn_wc__db_status_server_excluded,
NULL, NULL,
pool));
@@ -888,6 +926,10 @@ test_scan_addition(apr_pool_t *pool)
const char *original_root_url;
const char *original_uuid;
svn_revnum_t original_revision;
+ const char *moved_from_abspath;
+ const char *move_op_root_abspath;
+ const char *move_op_root_src;
+ const char *delete_op_root_abspath;
SVN_ERR(create_open(&db, &local_abspath, "test_scan_addition", pool));
@@ -935,9 +977,24 @@ test_scan_addition(apr_pool_t *pool)
&original_revision,
db, svn_dirent_join(local_abspath, "J/J-d", pool),
pool, pool));
+ SVN_ERR(svn_wc__db_scan_moved(
+ &moved_from_abspath,
+ &move_op_root_abspath,
+ &move_op_root_src,
+ &delete_op_root_abspath,
+ db, svn_dirent_join(local_abspath, "J/J-d", pool),
+ pool, pool));
SVN_TEST_ASSERT(status == svn_wc__db_status_moved_here);
SVN_TEST_ASSERT(validate_abspath(local_abspath, "J/J-d",
op_root_abspath, pool));
+ SVN_TEST_ASSERT(validate_abspath(local_abspath, "moved/file",
+ moved_from_abspath, pool));
+ SVN_TEST_ASSERT(validate_abspath(local_abspath, "J/J-d",
+ move_op_root_abspath, pool));
+ SVN_TEST_ASSERT(validate_abspath(local_abspath, "moved/file",
+ move_op_root_src, pool));
+ SVN_TEST_ASSERT(validate_abspath(local_abspath, "moved/file",
+ delete_op_root_abspath, pool));
SVN_TEST_STRING_ASSERT(repos_relpath, "J/J-d");
SVN_TEST_STRING_ASSERT(repos_root_url, ROOT_ONE);
SVN_TEST_STRING_ASSERT(repos_uuid, UUID_ONE);
@@ -1015,6 +1072,7 @@ test_scan_deletion(apr_pool_t *pool)
const char *base_del_abspath;
const char *work_del_abspath;
const char *moved_to_abspath;
+ const char *copy_op_root_abspath;
SVN_ERR(create_open(&db, &local_abspath, "test_scan_deletion", pool));
@@ -1023,34 +1081,41 @@ test_scan_deletion(apr_pool_t *pool)
&base_del_abspath,
&moved_to_abspath,
&work_del_abspath,
+ &copy_op_root_abspath,
db, svn_dirent_join(local_abspath, "J/J-e", pool),
pool, pool));
- SVN_TEST_ASSERT(validate_abspath(local_abspath, "J/J-e",
+ SVN_TEST_ASSERT(validate_abspath(local_abspath, "J",
base_del_abspath, pool));
SVN_TEST_ASSERT(validate_abspath(local_abspath, "other/place",
moved_to_abspath, pool));
SVN_TEST_ASSERT(validate_abspath(local_abspath, "J/J-e",
work_del_abspath, pool));
+ SVN_TEST_ASSERT(validate_abspath(local_abspath, "other/place",
+ copy_op_root_abspath, pool));
/* Node was moved elsewhere (child of operation root). */
SVN_ERR(svn_wc__db_scan_deletion(
&base_del_abspath,
&moved_to_abspath,
&work_del_abspath,
+ &copy_op_root_abspath,
db, svn_dirent_join(local_abspath, "J/J-e/J-e-a", pool),
pool, pool));
- SVN_TEST_ASSERT(validate_abspath(local_abspath, "J/J-e",
+ SVN_TEST_ASSERT(validate_abspath(local_abspath, "J",
base_del_abspath, pool));
- SVN_TEST_ASSERT(validate_abspath(local_abspath, "other/place",
+ SVN_TEST_ASSERT(validate_abspath(local_abspath, "other/place/J-e-a",
moved_to_abspath, pool));
SVN_TEST_ASSERT(validate_abspath(local_abspath, "J/J-e",
work_del_abspath, pool));
+ SVN_TEST_ASSERT(validate_abspath(local_abspath, "other/place",
+ copy_op_root_abspath, pool));
/* Root of delete. Parent is a WORKING node. */
SVN_ERR(svn_wc__db_scan_deletion(
&base_del_abspath,
&moved_to_abspath,
&work_del_abspath,
+ NULL,
db, svn_dirent_join(local_abspath, "J/J-c", pool),
pool, pool));
/* Implicit delete of "J" (via replacement). */
@@ -1065,6 +1130,7 @@ test_scan_deletion(apr_pool_t *pool)
&base_del_abspath,
&moved_to_abspath,
&work_del_abspath,
+ NULL,
db, svn_dirent_join(local_abspath, "J/J-c/J-c-a", pool),
pool, pool));
/* Implicit delete of "J" (via replacement). */
@@ -1079,14 +1145,15 @@ test_scan_deletion(apr_pool_t *pool)
&base_del_abspath,
&moved_to_abspath,
&work_del_abspath,
+ NULL,
db, svn_dirent_join(local_abspath, "J/J-e/J-e-b/Jeba", pool),
pool, pool));
/* ### I don't understand this. "J/J-e/J-e-b/Jeba" is a deleted
base node that is not overlayed by the replacement rooted at "J".
Why does base_del_abspath refer to "J-e"? */
- SVN_TEST_ASSERT(validate_abspath(local_abspath, "J/J-e",
+ SVN_TEST_ASSERT(validate_abspath(local_abspath, "J",
base_del_abspath, pool));
- SVN_TEST_ASSERT(validate_abspath(local_abspath, "other/place",
+ SVN_TEST_ASSERT(validate_abspath(local_abspath, "other/place/J-e-b/Jeba",
moved_to_abspath, pool));
SVN_TEST_ASSERT(work_del_abspath == NULL);
@@ -1095,6 +1162,7 @@ test_scan_deletion(apr_pool_t *pool)
&base_del_abspath,
&moved_to_abspath,
&work_del_abspath,
+ NULL,
db, svn_dirent_join(local_abspath, "J/J-f/J-f-a", pool),
pool, pool));
/* Implicit delete of "J" (via replacement). */
@@ -1108,6 +1176,7 @@ test_scan_deletion(apr_pool_t *pool)
&base_del_abspath,
&moved_to_abspath,
&work_del_abspath,
+ NULL,
db, svn_dirent_join(local_abspath, "K", pool),
pool, pool));
SVN_TEST_ASSERT(validate_abspath(local_abspath, "K",
@@ -1120,6 +1189,7 @@ test_scan_deletion(apr_pool_t *pool)
&base_del_abspath,
&moved_to_abspath,
&work_del_abspath,
+ NULL,
db, svn_dirent_join(local_abspath, "K/K-a", pool),
pool, pool));
SVN_TEST_ASSERT(validate_abspath(local_abspath, "K",
@@ -1132,12 +1202,15 @@ test_scan_deletion(apr_pool_t *pool)
&base_del_abspath,
&moved_to_abspath,
&work_del_abspath,
+ &copy_op_root_abspath,
db, svn_dirent_join(local_abspath, "K/K-b", pool),
pool, pool));
- SVN_TEST_ASSERT(validate_abspath(local_abspath, "K/K-b",
+ SVN_TEST_ASSERT(validate_abspath(local_abspath, "K",
base_del_abspath, pool));
SVN_TEST_ASSERT(validate_abspath(local_abspath, "moved/away",
moved_to_abspath, pool));
+ SVN_TEST_ASSERT(validate_abspath(local_abspath, "moved/away",
+ copy_op_root_abspath, pool));
SVN_TEST_ASSERT(work_del_abspath == NULL);
/* Subtree deletion of added tree. Start at child. */
@@ -1145,6 +1218,7 @@ test_scan_deletion(apr_pool_t *pool)
&base_del_abspath,
&moved_to_abspath,
&work_del_abspath,
+ NULL,
db, svn_dirent_join(local_abspath, "L/L-a/L-a-a", pool),
pool, pool));
SVN_TEST_ASSERT(base_del_abspath == NULL);
@@ -1157,6 +1231,7 @@ test_scan_deletion(apr_pool_t *pool)
&base_del_abspath,
&moved_to_abspath,
&work_del_abspath,
+ NULL,
db, svn_dirent_join(local_abspath, "L/L-a", pool),
pool, pool));
SVN_TEST_ASSERT(base_del_abspath == NULL);
@@ -1356,6 +1431,7 @@ test_externals_store(apr_pool_t *pool)
"not-a-uuid",
12,
props,
+ NULL,
10,
987654,
"somebody",
@@ -1368,6 +1444,7 @@ test_externals_store(apr_pool_t *pool)
FALSE, NULL,
FALSE,
NULL,
+ NULL,
pool));
SVN_ERR(svn_wc__db_external_add_dir(db,
@@ -1384,7 +1461,7 @@ test_externals_store(apr_pool_t *pool)
{
svn_wc__db_status_t status;
- svn_wc__db_kind_t kind;
+ svn_node_kind_t kind;
const char *repos_root_url;
const char *repos_uuid;
const char *defining_abspath;
@@ -1401,7 +1478,7 @@ test_externals_store(apr_pool_t *pool)
pool, pool));
SVN_TEST_ASSERT(status == svn_wc__db_status_normal);
- SVN_TEST_ASSERT(kind == svn_wc__db_kind_file);
+ SVN_TEST_ASSERT(kind == svn_node_file);
SVN_TEST_STRING_ASSERT(repos_root_url, "svn://some-repos/svn");
SVN_TEST_STRING_ASSERT(repos_uuid, "not-a-uuid");
SVN_TEST_STRING_ASSERT(defining_abspath, subdir);
@@ -1432,7 +1509,7 @@ test_externals_store(apr_pool_t *pool)
pool, pool));
SVN_TEST_ASSERT(status == svn_wc__db_status_normal);
- SVN_TEST_ASSERT(kind == svn_wc__db_kind_dir);
+ SVN_TEST_ASSERT(kind == svn_node_dir);
SVN_TEST_STRING_ASSERT(repos_root_url, "svn://other-repos/nsv");
SVN_TEST_STRING_ASSERT(repos_uuid, "no-uuid-either");
SVN_TEST_STRING_ASSERT(defining_abspath, subdir);