You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2013/05/10 16:58:56 UTC
svn commit: r1481041 [26/38] - in /subversion/branches/master-passphrase: ./
build/ build/ac-macros/ build/generator/ build/generator/templates/
contrib/client-side/svncopy/ contrib/hook-scripts/
contrib/server-side/fsfsfixer/ contrib/server-side/fsfsf...
Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.c?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.c Fri May 10 14:58:47 2013
@@ -122,7 +122,7 @@ svn_wc__db_op_depth_for_upgrade(const ch
typedef struct insert_base_baton_t {
/* common to all insertions into BASE */
svn_wc__db_status_t status;
- svn_kind_t kind;
+ svn_node_kind_t kind;
apr_int64_t repos_id;
const char *repos_relpath;
svn_revnum_t revision;
@@ -181,7 +181,7 @@ typedef struct insert_base_baton_t {
typedef struct insert_working_baton_t {
/* common to all insertions into WORKING (including NODE_DATA) */
svn_wc__db_status_t presence;
- svn_kind_t kind;
+ svn_node_kind_t kind;
int op_depth;
/* common to all "normal" presence insertions */
@@ -222,7 +222,7 @@ typedef struct insert_working_baton_t {
/* Representation of a new row for the EXTERNALS table */
typedef struct insert_external_baton_t {
/* common to all insertions into EXTERNALS */
- svn_kind_t kind;
+ svn_node_kind_t kind;
svn_wc__db_status_t presence;
/* The repository of the external */
@@ -304,7 +304,7 @@ db_read_pristine_props(apr_hash_t **prop
static svn_error_t *
read_info(svn_wc__db_status_t *status,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_revnum_t *revision,
const char **repos_relpath,
apr_int64_t *repos_id,
@@ -362,7 +362,7 @@ wclock_owns_lock(svn_boolean_t *own_lock
static svn_error_t *
db_is_switched(svn_boolean_t *is_switched,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
apr_pool_t *scratch_pool);
@@ -578,7 +578,7 @@ blank_ibb(insert_base_baton_t *pibb)
svn_error_t *
svn_wc__db_extend_parent_delete(svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
- svn_kind_t kind,
+ svn_node_kind_t kind,
int op_depth,
apr_pool_t *scratch_pool)
{
@@ -647,16 +647,13 @@ svn_wc__db_retract_parent_delete(svn_wc_
-/* Insert the base row represented by (insert_base_baton_t *) BATON.
- *
- * Implements svn_wc__db_txn_callback_t. */
+/* Insert the base row represented by (insert_base_baton_t *) BATON. */
static svn_error_t *
-insert_base_node(void *baton,
+insert_base_node(const insert_base_baton_t *pibb,
svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
apr_pool_t *scratch_pool)
{
- const insert_base_baton_t *pibb = baton;
apr_int64_t repos_id = pibb->repos_id;
svn_sqlite__stmt_t *stmt;
svn_filesize_t recorded_size = SVN_INVALID_FILESIZE;
@@ -703,15 +700,15 @@ insert_base_node(void *baton,
pibb->repos_relpath,
pibb->revision,
presence_map, pibb->status, /* 8 */
- (pibb->kind == svn_kind_dir) ? /* 9 */
+ (pibb->kind == svn_node_dir) ? /* 9 */
svn_token__to_word(depth_map, pibb->depth) : NULL,
kind_map, pibb->kind, /* 10 */
pibb->changed_rev, /* 11 */
pibb->changed_date, /* 12 */
pibb->changed_author, /* 13 */
- (pibb->kind == svn_kind_symlink) ?
+ (pibb->kind == svn_node_symlink) ?
pibb->target : NULL)); /* 19 */
- if (pibb->kind == svn_kind_file)
+ if (pibb->kind == svn_node_file)
{
if (!pibb->checksum
&& pibb->status != svn_wc__db_status_not_present
@@ -774,7 +771,7 @@ insert_base_node(void *baton,
wcroot->sdb, scratch_pool));
}
- if (pibb->kind == svn_kind_dir && pibb->children)
+ if (pibb->kind == svn_node_dir && pibb->children)
SVN_ERR(insert_incomplete_children(wcroot->sdb, wcroot->wc_id,
local_relpath,
repos_id,
@@ -891,8 +888,8 @@ insert_incomplete_children(svn_sqlite__d
iterpool)));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
if (have_row && !svn_sqlite__column_is_null(stmt, 14))
- apr_hash_set(moved_to_relpaths, name, APR_HASH_KEY_STRING,
- svn_sqlite__column_text(stmt, 14, scratch_pool));
+ svn_hash_sets(moved_to_relpaths, name,
+ svn_sqlite__column_text(stmt, 14, scratch_pool));
SVN_ERR(svn_sqlite__reset(stmt));
}
@@ -916,8 +913,7 @@ insert_incomplete_children(svn_sqlite__d
"incomplete", /* 8, presence */
"unknown", /* 10, kind */
/* 21, moved_to */
- apr_hash_get(moved_to_relpaths, name,
- APR_HASH_KEY_STRING)));
+ svn_hash_gets(moved_to_relpaths, name)));
if (repos_id != INVALID_REPOS_ID)
{
SVN_ERR(svn_sqlite__bind_int64(stmt, 5, repos_id));
@@ -935,16 +931,13 @@ insert_incomplete_children(svn_sqlite__d
}
-/* Insert the working row represented by (insert_working_baton_t *) BATON.
- *
- * Implements svn_wc__db_txn_callback_t. */
+/* Insert the working row represented by (insert_working_baton_t *) BATON. */
static svn_error_t *
-insert_working_node(void *baton,
+insert_working_node(const insert_working_baton_t *piwb,
svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
apr_pool_t *scratch_pool)
{
- const insert_working_baton_t *piwb = baton;
const char *parent_relpath;
const char *moved_to_relpath = NULL;
svn_sqlite__stmt_t *stmt;
@@ -965,7 +958,7 @@ insert_working_node(void *baton,
SVN_ERR(svn_sqlite__step(&have_row, stmt));
if (have_row)
moved_to_relpath = svn_sqlite__column_text(stmt, 0, scratch_pool);
- SVN_ERR(svn_sqlite__reset(stmt));
+ SVN_ERR(svn_sqlite__reset(stmt));
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, STMT_INSERT_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "isdsnnntstrisn"
@@ -975,14 +968,14 @@ insert_working_node(void *baton,
piwb->op_depth,
parent_relpath,
presence_map, piwb->presence,
- (piwb->kind == svn_kind_dir)
+ (piwb->kind == svn_node_dir)
? svn_token__to_word(depth_map, piwb->depth) : NULL,
kind_map, piwb->kind,
piwb->changed_rev,
piwb->changed_date,
piwb->changed_author,
/* Note: incomplete nodes may have a NULL target. */
- (piwb->kind == svn_kind_symlink)
+ (piwb->kind == svn_node_symlink)
? piwb->target : NULL,
moved_to_relpath));
@@ -991,7 +984,7 @@ insert_working_node(void *baton,
SVN_ERR(svn_sqlite__bind_int(stmt, 8, TRUE));
}
- if (piwb->kind == svn_kind_file)
+ if (piwb->kind == svn_node_file)
{
SVN_ERR(svn_sqlite__bind_checksum(stmt, 14, piwb->checksum,
scratch_pool));
@@ -1016,7 +1009,7 @@ insert_working_node(void *baton,
The children are part of the same op and so have the same op_depth.
(The only time we'd want a different depth is during a recursive
simple add, but we never insert children here during a simple add.) */
- if (piwb->kind == svn_kind_dir && piwb->children)
+ if (piwb->kind == svn_node_dir && piwb->children)
SVN_ERR(insert_incomplete_children(wcroot->sdb, wcroot->wc_id,
local_relpath,
INVALID_REPOS_ID /* inherit repos_id */,
@@ -1049,7 +1042,7 @@ insert_working_node(void *baton,
wcroot->sdb, scratch_pool));
}
- if (piwb->kind == svn_kind_dir)
+ if (piwb->kind == svn_node_dir)
{
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
STMT_UPDATE_ACTUAL_CLEAR_CHANGELIST));
@@ -1113,7 +1106,7 @@ add_children_to_hash(apr_hash_t *childre
const char *child_relpath = svn_sqlite__column_text(stmt, 0, NULL);
const char *name = svn_relpath_basename(child_relpath, result_pool);
- apr_hash_set(children, name, APR_HASH_KEY_STRING, name);
+ svn_hash_sets(children, name, name);
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
@@ -1230,12 +1223,12 @@ svn_wc__db_get_children_op_depth(apr_has
while (have_row)
{
const char *child_relpath = svn_sqlite__column_text(stmt, 0, NULL);
- svn_kind_t *child_kind = apr_palloc(result_pool, sizeof(svn_kind_t));
+ svn_node_kind_t *child_kind = apr_palloc(result_pool, sizeof(svn_node_kind_t));
*child_kind = svn_sqlite__column_token(stmt, 1, kind_map);
- apr_hash_set(*children,
- svn_relpath_basename(child_relpath, result_pool),
- APR_HASH_KEY_STRING, child_kind);
+ svn_hash_sets(*children,
+ svn_relpath_basename(child_relpath, result_pool),
+ child_kind);
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
@@ -1266,7 +1259,7 @@ remove_from_access_cache(apr_hash_t *acc
{
svn_wc_adm_access_t *adm_access;
- adm_access = apr_hash_get(access_cache, local_abspath, APR_HASH_KEY_STRING);
+ adm_access = svn_hash_gets(access_cache, local_abspath);
if (adm_access)
svn_wc__adm_access_set_entries(adm_access, NULL);
}
@@ -1448,7 +1441,7 @@ init_db(/* output values */
presence_map, status, /* 8 */
svn_token__to_word(depth_map,
root_node_depth),
- kind_map, svn_kind_dir /* 10 */));
+ kind_map, svn_node_dir /* 10 */));
SVN_ERR(svn_sqlite__insert(NULL, stmt));
}
@@ -1527,7 +1520,7 @@ svn_wc__db_init(svn_wc__db_t *db,
/* Create the SDB and insert the basic rows. */
SVN_ERR(create_db(&sdb, &repos_id, &wc_id, local_abspath, repos_root_url,
- repos_uuid, SDB_FILE,
+ repos_uuid, SDB_FILE,
repos_relpath, initial_rev, depth, sqlite_exclusive,
db->state_pool, scratch_pool));
@@ -1540,7 +1533,7 @@ svn_wc__db_init(svn_wc__db_t *db,
db->state_pool, scratch_pool));
/* The WCROOT is complete. Stash it into DB. */
- apr_hash_set(db->dir_data, wcroot->abspath, APR_HASH_KEY_STRING, wcroot);
+ svn_hash_sets(db->dir_data, wcroot->abspath, wcroot);
return SVN_NO_ERROR;
}
@@ -1681,7 +1674,7 @@ svn_wc__db_base_add_directory(svn_wc__db
ibb.repos_uuid = repos_uuid;
ibb.status = svn_wc__db_status_normal;
- ibb.kind = svn_kind_dir;
+ ibb.kind = svn_node_dir;
ibb.repos_relpath = repos_relpath;
ibb.revision = revision;
@@ -1708,8 +1701,9 @@ svn_wc__db_base_add_directory(svn_wc__db
Note: old children can stick around, even if they are no longer present
in this directory's revision. */
- SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_base_node, &ibb,
- scratch_pool));
+ SVN_WC__DB_WITH_TXN(
+ insert_base_node(&ibb, wcroot, local_relpath, scratch_pool),
+ wcroot);
SVN_ERR(flush_entries(wcroot, local_abspath, depth, scratch_pool));
return SVN_NO_ERROR;
@@ -1750,7 +1744,7 @@ svn_wc__db_base_add_incomplete_directory
ibb.repos_uuid = repos_uuid;
ibb.status = svn_wc__db_status_incomplete;
- ibb.kind = svn_kind_dir;
+ ibb.kind = svn_node_dir;
ibb.repos_relpath = repos_relpath;
ibb.revision = revision;
ibb.depth = depth;
@@ -1760,9 +1754,9 @@ svn_wc__db_base_add_incomplete_directory
ibb.conflict = conflict;
ibb.work_items = work_items;
- SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath,
- insert_base_node,
- &ibb, scratch_pool));
+ SVN_WC__DB_WITH_TXN(
+ insert_base_node(&ibb, wcroot, local_relpath, scratch_pool),
+ wcroot);
SVN_ERR(flush_entries(wcroot, local_abspath, svn_depth_empty, scratch_pool));
@@ -1819,7 +1813,7 @@ svn_wc__db_base_add_file(svn_wc__db_t *d
ibb.repos_uuid = repos_uuid;
ibb.status = svn_wc__db_status_normal;
- ibb.kind = svn_kind_file;
+ ibb.kind = svn_node_file;
ibb.repos_relpath = repos_relpath;
ibb.revision = revision;
@@ -1846,8 +1840,9 @@ svn_wc__db_base_add_file(svn_wc__db_t *d
ibb.conflict = conflict;
ibb.work_items = work_items;
- SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_base_node, &ibb,
- scratch_pool));
+ SVN_WC__DB_WITH_TXN(
+ insert_base_node(&ibb, wcroot, local_relpath, scratch_pool),
+ wcroot);
/* If this used to be a directory we should remove children so pass
* depth infinity. */
@@ -1905,7 +1900,7 @@ svn_wc__db_base_add_symlink(svn_wc__db_t
ibb.repos_uuid = repos_uuid;
ibb.status = svn_wc__db_status_normal;
- ibb.kind = svn_kind_symlink;
+ ibb.kind = svn_node_symlink;
ibb.repos_relpath = repos_relpath;
ibb.revision = revision;
@@ -1932,8 +1927,9 @@ svn_wc__db_base_add_symlink(svn_wc__db_t
ibb.conflict = conflict;
ibb.work_items = work_items;
- SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_base_node, &ibb,
- scratch_pool));
+ SVN_WC__DB_WITH_TXN(
+ insert_base_node(&ibb, wcroot, local_relpath, scratch_pool),
+ wcroot);
/* If this used to be a directory we should remove children so pass
* depth infinity. */
@@ -1950,7 +1946,7 @@ add_excluded_or_not_present_node(svn_wc_
const char *repos_root_url,
const char *repos_uuid,
svn_revnum_t revision,
- svn_kind_t kind,
+ svn_node_kind_t kind,
svn_wc__db_status_t status,
const svn_skel_t *conflict,
const svn_skel_t *work_items,
@@ -2003,8 +1999,9 @@ add_excluded_or_not_present_node(svn_wc_
ibb.conflict = conflict;
ibb.work_items = work_items;
- SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_base_node, &ibb,
- scratch_pool));
+ SVN_WC__DB_WITH_TXN(
+ insert_base_node(&ibb, wcroot, local_relpath, scratch_pool),
+ wcroot);
/* If this used to be a directory we should remove children so pass
* depth infinity. */
@@ -2022,7 +2019,7 @@ svn_wc__db_base_add_excluded_node(svn_wc
const char *repos_root_url,
const char *repos_uuid,
svn_revnum_t revision,
- svn_kind_t kind,
+ svn_node_kind_t kind,
svn_wc__db_status_t status,
const svn_skel_t *conflict,
const svn_skel_t *work_items,
@@ -2044,7 +2041,7 @@ svn_wc__db_base_add_not_present_node(svn
const char *repos_root_url,
const char *repos_uuid,
svn_revnum_t revision,
- svn_kind_t kind,
+ svn_node_kind_t kind,
const svn_skel_t *conflict,
const svn_skel_t *work_items,
apr_pool_t *scratch_pool)
@@ -2099,7 +2096,7 @@ db_base_remove(svn_wc__db_wcroot_t *wcro
svn_wc__db_status_t status;
apr_int64_t repos_id;
const char *repos_relpath;
- svn_kind_t kind;
+ svn_node_kind_t kind;
svn_boolean_t keep_working;
SVN_ERR(svn_wc__db_base_get_info_internal(&status, &kind, NULL,
@@ -2142,7 +2139,7 @@ db_base_remove(svn_wc__db_wcroot_t *wcro
local_abspath = svn_dirent_join(wcroot->abspath, local_relpath,
scratch_pool);
- if (kind == svn_kind_dir)
+ if (kind == svn_node_dir)
{
apr_pool_t *iterpool;
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
@@ -2156,7 +2153,7 @@ db_base_remove(svn_wc__db_wcroot_t *wcro
while (have_row)
{
const char *node_relpath = svn_sqlite__column_text(stmt, 0, NULL);
- svn_kind_t node_kind = svn_sqlite__column_token(stmt, 1,
+ svn_node_kind_t node_kind = svn_sqlite__column_token(stmt, 1,
kind_map);
const char *node_abspath;
svn_error_t *err;
@@ -2166,7 +2163,7 @@ db_base_remove(svn_wc__db_wcroot_t *wcro
node_abspath = svn_dirent_join(wcroot->abspath, node_relpath,
iterpool);
- if (node_kind == svn_kind_dir)
+ if (node_kind == svn_node_dir)
err = svn_wc__wq_build_dir_remove(&work_item,
db, wcroot->abspath,
node_abspath, FALSE,
@@ -2229,7 +2226,7 @@ db_base_remove(svn_wc__db_wcroot_t *wcro
{
apr_pool_t *iterpool;
- /*
+ /*
* When deleting a conflicted node, moves of any moved-outside children
* of the node must be broken. Else, the destination will still be marked
* moved-here after the move source disappears from the working copy.
@@ -2252,7 +2249,7 @@ db_base_remove(svn_wc__db_wcroot_t *wcro
{
const char *child_relpath;
svn_error_t *err;
-
+
svn_pool_clear(iterpool);
child_relpath = svn_sqlite__column_text(stmt, 0, iterpool);
err = clear_moved_here(child_relpath, wcroot, iterpool);
@@ -2367,7 +2364,7 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
svn_error_t *
svn_wc__db_base_get_info_internal(svn_wc__db_status_t *status,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_revnum_t *revision,
const char **repos_relpath,
apr_int64_t *repos_id,
@@ -2400,7 +2397,7 @@ svn_wc__db_base_get_info_internal(svn_wc
{
svn_wc__db_status_t node_status = svn_sqlite__column_token(stmt, 2,
presence_map);
- svn_kind_t node_kind = svn_sqlite__column_token(stmt, 3, kind_map);
+ svn_node_kind_t node_kind = svn_sqlite__column_token(stmt, 3, kind_map);
if (kind)
{
@@ -2433,7 +2430,7 @@ svn_wc__db_base_get_info_internal(svn_wc
}
if (depth)
{
- if (node_kind != svn_kind_dir)
+ if (node_kind != svn_node_dir)
{
*depth = svn_depth_unknown;
}
@@ -2445,7 +2442,7 @@ svn_wc__db_base_get_info_internal(svn_wc
}
if (checksum)
{
- if (node_kind != svn_kind_file)
+ if (node_kind != svn_node_file)
{
*checksum = NULL;
}
@@ -2463,7 +2460,7 @@ svn_wc__db_base_get_info_internal(svn_wc
}
if (target)
{
- if (node_kind != svn_kind_symlink)
+ if (node_kind != svn_node_symlink)
*target = NULL;
else
*target = svn_sqlite__column_text(stmt, 11, result_pool);
@@ -2509,7 +2506,7 @@ svn_wc__db_base_get_info_internal(svn_wc
svn_error_t *
svn_wc__db_base_get_info(svn_wc__db_status_t *status,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_revnum_t *revision,
const char **repos_relpath,
const char **repos_root_url,
@@ -2612,7 +2609,7 @@ svn_wc__db_base_get_children_info(apr_ha
svn_sqlite__reset(stmt)));
- apr_hash_set(*nodes, name, APR_HASH_KEY_STRING, info);
+ svn_hash_sets(*nodes, name, info);
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
@@ -2751,7 +2748,7 @@ svn_wc__db_base_clear_dav_cache_recursiv
svn_error_t *
svn_wc__db_depth_get_info(svn_wc__db_status_t *status,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_revnum_t *revision,
const char **repos_relpath,
apr_int64_t *repos_id,
@@ -2783,7 +2780,7 @@ svn_wc__db_depth_get_info(svn_wc__db_sta
{
svn_wc__db_status_t node_status = svn_sqlite__column_token(stmt, 2,
presence_map);
- svn_kind_t node_kind = svn_sqlite__column_token(stmt, 3, kind_map);
+ svn_node_kind_t node_kind = svn_sqlite__column_token(stmt, 3, kind_map);
if (kind)
{
@@ -2814,7 +2811,7 @@ svn_wc__db_depth_get_info(svn_wc__db_sta
}
if (depth)
{
- if (node_kind != svn_kind_dir)
+ if (node_kind != svn_node_dir)
{
*depth = svn_depth_unknown;
}
@@ -2826,7 +2823,7 @@ svn_wc__db_depth_get_info(svn_wc__db_sta
}
if (checksum)
{
- if (node_kind != svn_kind_file)
+ if (node_kind != svn_node_file)
{
*checksum = NULL;
}
@@ -2844,7 +2841,7 @@ svn_wc__db_depth_get_info(svn_wc__db_sta
}
if (target)
{
- if (node_kind != svn_kind_symlink)
+ if (node_kind != svn_node_symlink)
*target = NULL;
else
*target = svn_sqlite__column_text(stmt, 11, result_pool);
@@ -2994,12 +2991,11 @@ blank_ieb(insert_external_baton_t *ieb)
*
* Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
-insert_external_node(void *baton,
+insert_external_node(const insert_external_baton_t *ieb,
svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
apr_pool_t *scratch_pool)
{
- const insert_external_baton_t *ieb = baton;
svn_wc__db_status_t status;
svn_error_t *err;
svn_boolean_t update_root;
@@ -3028,8 +3024,8 @@ insert_external_node(void *baton,
else if (status == svn_wc__db_status_normal && !update_root)
return svn_error_create(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL, NULL);
- if (ieb->kind == svn_kind_file
- || ieb->kind == svn_kind_symlink)
+ if (ieb->kind == svn_node_file
+ || ieb->kind == svn_node_symlink)
{
struct insert_base_baton_t ibb;
@@ -3153,7 +3149,7 @@ svn_wc__db_external_add_file(svn_wc__db_
blank_ieb(&ieb);
- ieb.kind = svn_kind_file;
+ ieb.kind = svn_node_file;
ieb.presence = svn_wc__db_status_normal;
ieb.repos_root_url = repos_root_url;
@@ -3188,9 +3184,11 @@ svn_wc__db_external_add_file(svn_wc__db_
ieb.conflict = conflict;
ieb.work_items = work_items;
- return svn_error_trace(
- svn_wc__db_with_txn(wcroot, local_relpath, insert_external_node,
- &ieb, scratch_pool));
+ SVN_WC__DB_WITH_TXN(
+ insert_external_node(&ieb, wcroot, local_relpath, scratch_pool),
+ wcroot);
+
+ return SVN_NO_ERROR;
}
svn_error_t *
@@ -3239,7 +3237,7 @@ svn_wc__db_external_add_symlink(svn_wc__
blank_ieb(&ieb);
- ieb.kind = svn_kind_symlink;
+ ieb.kind = svn_node_symlink;
ieb.presence = svn_wc__db_status_normal;
ieb.repos_root_url = repos_root_url;
@@ -3272,9 +3270,11 @@ svn_wc__db_external_add_symlink(svn_wc__
ieb.work_items = work_items;
- return svn_error_trace(
- svn_wc__db_with_txn(wcroot, local_relpath, insert_external_node,
- &ieb, scratch_pool));
+ SVN_WC__DB_WITH_TXN(
+ insert_external_node(&ieb, wcroot, local_relpath, scratch_pool),
+ wcroot);
+
+ return SVN_NO_ERROR;
}
svn_error_t *
@@ -3312,7 +3312,7 @@ svn_wc__db_external_add_dir(svn_wc__db_t
blank_ieb(&ieb);
- ieb.kind = svn_kind_dir;
+ ieb.kind = svn_node_dir;
ieb.presence = svn_wc__db_status_normal;
ieb.repos_root_url = repos_root_url;
@@ -3327,9 +3327,11 @@ svn_wc__db_external_add_dir(svn_wc__db_t
ieb.work_items = work_items;
- return svn_error_trace(
- svn_wc__db_with_txn(wcroot, local_relpath, insert_external_node,
- &ieb, scratch_pool));
+ SVN_WC__DB_WITH_TXN(
+ insert_external_node(&ieb, wcroot, local_relpath, scratch_pool),
+ wcroot);
+
+ return SVN_NO_ERROR;
}
/* The body of svn_wc__db_external_remove(). */
@@ -3384,7 +3386,7 @@ svn_wc__db_external_remove(svn_wc__db_t
svn_error_t *
svn_wc__db_external_read(svn_wc__db_status_t *status,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
const char **definining_abspath,
const char **repos_root_url,
const char **repos_uuid,
@@ -3484,7 +3486,7 @@ svn_wc__db_committable_externals_below(a
const char *local_relpath;
svn_boolean_t have_row;
svn_wc__committable_external_info_t *info;
- svn_kind_t db_kind;
+ svn_node_kind_t db_kind;
apr_array_header_t *result = NULL;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
@@ -3495,7 +3497,7 @@ svn_wc__db_committable_externals_below(a
SVN_ERR(svn_sqlite__get_statement(
&stmt, wcroot->sdb,
- immediates_only
+ immediates_only
? STMT_SELECT_COMMITTABLE_EXTERNALS_IMMEDIATELY_BELOW
: STMT_SELECT_COMMITTABLE_EXTERNALS_BELOW));
@@ -3516,7 +3518,7 @@ svn_wc__db_committable_externals_below(a
result_pool);
db_kind = svn_sqlite__column_token(stmt, 1, kind_map);
- SVN_ERR_ASSERT(db_kind == svn_kind_file || db_kind == svn_kind_dir);
+ SVN_ERR_ASSERT(db_kind == svn_node_file || db_kind == svn_node_dir);
info->kind = db_kind;
info->repos_relpath = svn_sqlite__column_text(stmt, 2, result_pool);
@@ -3564,12 +3566,11 @@ svn_wc__db_externals_defined_below(apr_h
local_relpath = svn_sqlite__column_text(stmt, 0, NULL);
def_local_relpath = svn_sqlite__column_text(stmt, 1, NULL);
- apr_hash_set(*externals,
- svn_dirent_join(wcroot->abspath, local_relpath,
- result_pool),
- APR_HASH_KEY_STRING,
- svn_dirent_join(wcroot->abspath, def_local_relpath,
- result_pool));
+ svn_hash_sets(*externals,
+ svn_dirent_join(wcroot->abspath, local_relpath,
+ result_pool),
+ svn_dirent_join(wcroot->abspath, def_local_relpath,
+ result_pool));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
@@ -3631,8 +3632,8 @@ svn_wc__db_externals_gather_definitions(
node_abspath = svn_dirent_join(wcroot->abspath, node_relpath,
result_pool);
- apr_hash_set(*externals, node_abspath, APR_HASH_KEY_STRING,
- apr_pstrdup(result_pool, external_value));
+ svn_hash_sets(*externals, node_abspath,
+ apr_pstrdup(result_pool, external_value));
if (depths)
{
@@ -3640,10 +3641,9 @@ svn_wc__db_externals_gather_definitions(
= svn_sqlite__column_token_null(stmt, 2, depth_map,
svn_depth_unknown);
- apr_hash_set(*depths, node_abspath,
- APR_HASH_KEY_STRING,
- svn_token__to_word(depth_map,
- depth)); /* Use static string */
+ svn_hash_sets(*depths, node_abspath,
+ /* Use static string */
+ svn_token__to_word(depth_map, depth));
}
}
@@ -3711,7 +3711,7 @@ cross_db_copy(svn_wc__db_wcroot_t *src_w
svn_wc__db_status_t dst_status,
int dst_op_depth,
int dst_np_op_depth,
- svn_kind_t kind,
+ svn_node_kind_t kind,
const apr_array_header_t *children,
apr_int64_t copyfrom_id,
const char *copyfrom_relpath,
@@ -3726,8 +3726,8 @@ cross_db_copy(svn_wc__db_wcroot_t *src_w
apr_hash_t *props;
svn_depth_t depth;
- SVN_ERR_ASSERT(kind == svn_kind_file
- || kind == svn_kind_dir
+ SVN_ERR_ASSERT(kind == svn_node_file
+ || kind == svn_node_dir
);
SVN_ERR(read_info(NULL, NULL, NULL, NULL, NULL,
@@ -4045,7 +4045,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
const char **copyfrom_relpath,
svn_revnum_t *copyfrom_rev,
svn_wc__db_status_t *status,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_boolean_t *op_root,
svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
@@ -4303,7 +4303,7 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcro
int dst_op_depth;
int dst_np_op_depth;
int dst_parent_op_depth;
- svn_kind_t kind;
+ svn_node_kind_t kind;
const apr_array_header_t *children;
SVN_ERR(get_info_for_copy(©from_id, ©from_relpath, ©from_rev,
@@ -4315,7 +4315,7 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcro
copyfrom_id, copyfrom_relpath, copyfrom_rev,
dst_wcroot, dst_relpath, scratch_pool));
- SVN_ERR_ASSERT(kind == svn_kind_file || kind == svn_kind_dir);
+ SVN_ERR_ASSERT(kind == svn_node_file || kind == svn_node_dir);
/* ### New status, not finished, see notes/wc-ng/copying */
switch (status)
@@ -4403,7 +4403,7 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcro
scratch_pool));
}
- if (kind == svn_kind_dir)
+ if (kind == svn_node_dir)
{
int src_op_depth;
@@ -4518,7 +4518,7 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcro
The children are part of the same op and so have the same op_depth.
(The only time we'd want a different depth is during a recursive
simple add, but we never insert children here during a simple add.) */
- if (kind == svn_kind_dir
+ if (kind == svn_node_dir
&& dst_presence == svn_wc__db_status_normal)
SVN_ERR(insert_incomplete_children(
dst_wcroot->sdb,
@@ -4875,7 +4875,7 @@ db_op_copy_shadowed_layer(svn_wc__db_wcr
const apr_array_header_t *children;
apr_pool_t *iterpool;
svn_wc__db_status_t status;
- svn_kind_t kind;
+ svn_node_kind_t kind;
svn_revnum_t node_revision;
const char *node_repos_relpath;
apr_int64_t node_repos_id;
@@ -5247,7 +5247,7 @@ svn_wc__db_op_copy_dir(svn_wc__db_t *db,
blank_iwb(&iwb);
iwb.presence = svn_wc__db_status_normal;
- iwb.kind = svn_kind_dir;
+ iwb.kind = svn_node_dir;
iwb.props = props;
iwb.changed_rev = changed_rev;
@@ -5277,8 +5277,9 @@ svn_wc__db_op_copy_dir(svn_wc__db_t *db,
iwb.work_items = work_items;
iwb.conflict = conflict;
- SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_working_node, &iwb,
- scratch_pool));
+ SVN_WC__DB_WITH_TXN(
+ insert_working_node(&iwb, wcroot, local_relpath, scratch_pool),
+ wcroot);
SVN_ERR(flush_entries(wcroot, local_abspath, depth, scratch_pool));
return SVN_NO_ERROR;
@@ -5326,7 +5327,7 @@ svn_wc__db_op_copy_file(svn_wc__db_t *db
blank_iwb(&iwb);
iwb.presence = svn_wc__db_status_normal;
- iwb.kind = svn_kind_file;
+ iwb.kind = svn_node_file;
iwb.props = props;
iwb.changed_rev = changed_rev;
@@ -5361,8 +5362,9 @@ svn_wc__db_op_copy_file(svn_wc__db_t *db
iwb.work_items = work_items;
iwb.conflict = conflict;
- SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_working_node, &iwb,
- scratch_pool));
+ SVN_WC__DB_WITH_TXN(
+ insert_working_node(&iwb, wcroot, local_relpath, scratch_pool),
+ wcroot);
SVN_ERR(flush_entries(wcroot, local_abspath, svn_depth_empty, scratch_pool));
return SVN_NO_ERROR;
@@ -5403,7 +5405,7 @@ svn_wc__db_op_copy_symlink(svn_wc__db_t
blank_iwb(&iwb);
iwb.presence = svn_wc__db_status_normal;
- iwb.kind = svn_kind_symlink;
+ iwb.kind = svn_node_symlink;
iwb.props = props;
iwb.changed_rev = changed_rev;
@@ -5431,8 +5433,9 @@ svn_wc__db_op_copy_symlink(svn_wc__db_t
iwb.work_items = work_items;
iwb.conflict = conflict;
- SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_working_node, &iwb,
- scratch_pool));
+ SVN_WC__DB_WITH_TXN(
+ insert_working_node(&iwb, wcroot, local_relpath, scratch_pool),
+ wcroot);
SVN_ERR(flush_entries(wcroot, local_abspath, svn_depth_empty, scratch_pool));
return SVN_NO_ERROR;
@@ -5464,7 +5467,7 @@ svn_wc__db_op_add_directory(svn_wc__db_t
local_relpath = svn_relpath_join(local_relpath, name, scratch_pool);
iwb.presence = svn_wc__db_status_normal;
- iwb.kind = svn_kind_dir;
+ iwb.kind = svn_node_dir;
iwb.op_depth = relpath_depth(local_relpath);
if (props && apr_hash_count((apr_hash_t *)props))
{
@@ -5474,8 +5477,9 @@ svn_wc__db_op_add_directory(svn_wc__db_t
iwb.work_items = work_items;
- SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_working_node, &iwb,
- scratch_pool));
+ SVN_WC__DB_WITH_TXN(
+ insert_working_node(&iwb, wcroot, local_relpath, scratch_pool),
+ wcroot);
/* Use depth infinity to make sure we have no invalid cached information
* about children of this dir. */
SVN_ERR(flush_entries(wcroot, local_abspath, svn_depth_infinity,
@@ -5510,7 +5514,7 @@ svn_wc__db_op_add_file(svn_wc__db_t *db,
local_relpath = svn_relpath_join(local_relpath, name, scratch_pool);
iwb.presence = svn_wc__db_status_normal;
- iwb.kind = svn_kind_file;
+ iwb.kind = svn_node_file;
iwb.op_depth = relpath_depth(local_relpath);
if (props && apr_hash_count((apr_hash_t *)props))
{
@@ -5520,8 +5524,9 @@ svn_wc__db_op_add_file(svn_wc__db_t *db,
iwb.work_items = work_items;
- SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_working_node, &iwb,
- scratch_pool));
+ SVN_WC__DB_WITH_TXN(
+ insert_working_node(&iwb, wcroot, local_relpath, scratch_pool),
+ wcroot);
SVN_ERR(flush_entries(wcroot, local_abspath, svn_depth_empty, scratch_pool));
return SVN_NO_ERROR;
@@ -5557,7 +5562,7 @@ svn_wc__db_op_add_symlink(svn_wc__db_t *
local_relpath = svn_relpath_join(local_relpath, name, scratch_pool);
iwb.presence = svn_wc__db_status_normal;
- iwb.kind = svn_kind_symlink;
+ iwb.kind = svn_node_symlink;
iwb.op_depth = relpath_depth(local_relpath);
if (props && apr_hash_count((apr_hash_t *)props))
{
@@ -5569,8 +5574,9 @@ svn_wc__db_op_add_symlink(svn_wc__db_t *
iwb.work_items = work_items;
- SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, insert_working_node, &iwb,
- scratch_pool));
+ SVN_WC__DB_WITH_TXN(
+ insert_working_node(&iwb, wcroot, local_relpath, scratch_pool),
+ wcroot);
SVN_ERR(flush_entries(wcroot, local_abspath, svn_depth_empty, scratch_pool));
return SVN_NO_ERROR;
@@ -6647,8 +6653,8 @@ svn_wc__db_op_revert(svn_wc__db_t *db,
db, local_abspath, scratch_pool, scratch_pool));
VERIFY_USABLE_WCROOT(wcroot);
- SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, with_triggers, &wtb,
- scratch_pool));
+ SVN_WC__DB_WITH_TXN(with_triggers(&wtb, wcroot, local_relpath, scratch_pool),
+ wcroot);
SVN_ERR(flush_entries(wcroot, local_abspath, depth, scratch_pool));
@@ -6661,7 +6667,7 @@ static svn_error_t *
revert_list_read(svn_boolean_t *reverted,
const apr_array_header_t **marker_paths,
svn_boolean_t *copied_here,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
svn_wc__db_t *db,
@@ -6674,7 +6680,7 @@ revert_list_read(svn_boolean_t *reverted
*reverted = FALSE;
*marker_paths = NULL;
*copied_here = FALSE;
- *kind = svn_kind_unknown;
+ *kind = svn_node_unknown;
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
STMT_SELECT_REVERT_LIST));
@@ -6740,7 +6746,7 @@ svn_error_t *
svn_wc__db_revert_list_read(svn_boolean_t *reverted,
const apr_array_header_t **marker_files,
svn_boolean_t *copied_here,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_wc__db_t *db,
const char *local_abspath,
apr_pool_t *result_pool,
@@ -6910,7 +6916,7 @@ remove_node_txn(svn_boolean_t *left_chan
svn_boolean_t destroy_changes,
svn_revnum_t not_present_rev,
svn_wc__db_status_t not_present_status,
- svn_kind_t not_present_kind,
+ svn_node_kind_t not_present_kind,
const svn_skel_t *conflict,
const svn_skel_t *work_items,
svn_cancel_func_t cancel_func,
@@ -6933,7 +6939,7 @@ remove_node_txn(svn_boolean_t *left_chan
/* Need info for not_present node? */
if (SVN_IS_VALID_REVNUM(not_present_rev))
- SVN_ERR(svn_wc__db_base_get_info_internal(NULL, NULL, NULL,
+ SVN_ERR(svn_wc__db_base_get_info_internal(NULL, NULL, NULL,
&repos_relpath, &repos_id,
NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL,
@@ -6961,7 +6967,7 @@ remove_node_txn(svn_boolean_t *left_chan
{
const char *child_relpath;
const char *child_abspath;
- svn_kind_t child_kind;
+ svn_node_kind_t child_kind;
svn_boolean_t have_checksum;
svn_filesize_t recorded_size;
apr_int64_t recorded_time;
@@ -6977,7 +6983,7 @@ remove_node_txn(svn_boolean_t *left_chan
child_abspath = svn_dirent_join(wcroot->abspath, child_relpath,
iterpool);
- if (child_kind == svn_kind_file)
+ if (child_kind == svn_node_file)
{
have_checksum = !svn_sqlite__column_is_null(stmt, 2);
recorded_size = get_recorded_size(stmt, 3);
@@ -6990,20 +6996,20 @@ remove_node_txn(svn_boolean_t *left_chan
if (err)
break;
- err = svn_io_stat_dirent(&dirent, child_abspath, TRUE,
- iterpool, iterpool);
+ err = svn_io_stat_dirent2(&dirent, child_abspath, FALSE, TRUE,
+ iterpool, iterpool);
if (err)
break;
if (destroy_changes
|| dirent->kind != svn_node_file
- || child_kind != svn_kind_file)
+ || child_kind != svn_node_file)
{
/* Not interested in keeping changes */
- modified_p = FALSE;
+ modified_p = FALSE;
}
- else if (child_kind == svn_kind_file
+ else if (child_kind == svn_node_file
&& dirent->kind == svn_node_file
&& dirent->filesize == recorded_size
&& dirent->mtime == recorded_time)
@@ -7023,14 +7029,14 @@ remove_node_txn(svn_boolean_t *left_chan
if (left_changes)
*left_changes = TRUE;
}
- else if (child_kind == svn_kind_dir)
+ else if (child_kind == svn_node_dir)
{
err = svn_wc__wq_build_dir_remove(&work_item,
db, wcroot->abspath,
child_abspath, FALSE,
iterpool, iterpool);
}
- else /* svn_kind_file || svn_kind_symlink */
+ else /* svn_node_file || svn_node_symlink */
{
err = svn_wc__wq_build_file_remove(&work_item,
db, wcroot->abspath,
@@ -7059,7 +7065,7 @@ remove_node_txn(svn_boolean_t *left_chan
{
/* Create work item for destroying the root */
svn_wc__db_status_t status;
- svn_kind_t kind;
+ svn_node_kind_t kind;
SVN_ERR(read_info(&status, &kind, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -7075,7 +7081,7 @@ remove_node_txn(svn_boolean_t *left_chan
local_relpath,
scratch_pool);
- if (kind == svn_kind_dir)
+ if (kind == svn_node_dir)
{
SVN_ERR(svn_wc__wq_build_dir_remove(&work_item,
db, wcroot->abspath,
@@ -7172,7 +7178,7 @@ svn_wc__db_op_remove_node(svn_boolean_t
svn_boolean_t destroy_changes,
svn_revnum_t not_present_revision,
svn_wc__db_status_t not_present_status,
- svn_kind_t not_present_kind,
+ svn_node_kind_t not_present_kind,
const svn_skel_t *conflict,
const svn_skel_t *work_items,
svn_cancel_func_t cancel_func,
@@ -7449,7 +7455,7 @@ delete_node(void *baton,
svn_sqlite__stmt_t *stmt;
int select_depth; /* Depth of what is to be deleted */
svn_boolean_t refetch_depth = FALSE;
- svn_kind_t kind;
+ svn_node_kind_t kind;
apr_array_header_t *moved_nodes = NULL;
int delete_depth = relpath_depth(local_relpath);
@@ -7466,7 +7472,7 @@ delete_node(void *baton,
return SVN_NO_ERROR;
/* Don't copy BASE directories with server excluded nodes */
- if (status == svn_wc__db_status_normal && kind == svn_kind_dir)
+ if (status == svn_wc__db_status_normal && kind == svn_node_dir)
{
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
STMT_HAS_SERVER_EXCLUDED_DESCENDANTS));
@@ -7526,9 +7532,16 @@ delete_node(void *baton,
if (op_root && moved_from_relpath)
{
+ const char *part = svn_relpath_skip_ancestor(local_relpath,
+ moved_from_relpath);
+
/* Existing move-root is moved to another location */
moved_node = apr_palloc(scratch_pool, sizeof(struct moved_node_t));
- moved_node->local_relpath = moved_from_relpath;
+ if (!part)
+ moved_node->local_relpath = moved_from_relpath;
+ else
+ moved_node->local_relpath = svn_relpath_join(b->moved_to_relpath,
+ part, scratch_pool);
moved_node->op_depth = move_op_depth;
moved_node->moved_to_relpath = b->moved_to_relpath;
@@ -7938,9 +7951,9 @@ svn_wc__db_op_delete(svn_wc__db_t *db,
{
/* Avoid the trigger work */
odb.notify = FALSE;
- SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath,
- delete_node, &odb,
- scratch_pool));
+ SVN_WC__DB_WITH_TXN(
+ delete_node(&odb, wcroot, local_relpath, scratch_pool),
+ wcroot);
}
SVN_ERR(flush_entries(wcroot, local_abspath, svn_depth_infinity,
@@ -8019,7 +8032,7 @@ svn_wc__db_op_delete_many(svn_wc__db_t *
DB+LOCAL_ABSPATH, and outputting repos ids instead of URL+UUID. */
static svn_error_t *
read_info(svn_wc__db_status_t *status,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_revnum_t *revision,
const char **repos_relpath,
apr_int64_t *repos_id,
@@ -8078,7 +8091,7 @@ read_info(svn_wc__db_status_t *status,
if (have_info)
{
int op_depth;
- svn_kind_t node_kind;
+ svn_node_kind_t node_kind;
op_depth = svn_sqlite__column_int(stmt_info, 0);
node_kind = svn_sqlite__column_token(stmt_info, 4, kind_map);
@@ -8136,7 +8149,7 @@ read_info(svn_wc__db_status_t *status,
}
if (depth)
{
- if (node_kind != svn_kind_dir)
+ if (node_kind != svn_node_dir)
{
*depth = svn_depth_unknown;
}
@@ -8148,7 +8161,7 @@ read_info(svn_wc__db_status_t *status,
}
if (checksum)
{
- if (node_kind != svn_kind_file)
+ if (node_kind != svn_node_file)
{
*checksum = NULL;
}
@@ -8166,7 +8179,7 @@ read_info(svn_wc__db_status_t *status,
}
if (target)
{
- if (node_kind != svn_kind_symlink)
+ if (node_kind != svn_node_symlink)
*target = NULL;
else
*target = svn_sqlite__column_text(stmt_info, 12, result_pool);
@@ -8278,7 +8291,7 @@ read_info(svn_wc__db_status_t *status,
if (status)
*status = svn_wc__db_status_normal; /* What! No it's not! */
if (kind)
- *kind = svn_kind_unknown;
+ *kind = svn_node_unknown;
if (revision)
*revision = SVN_INVALID_REVNUM;
if (repos_relpath)
@@ -8349,7 +8362,7 @@ read_info(svn_wc__db_status_t *status,
svn_error_t *
svn_wc__db_read_info_internal(svn_wc__db_status_t *status,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_revnum_t *revision,
const char **repos_relpath,
apr_int64_t *repos_id,
@@ -8392,7 +8405,7 @@ svn_wc__db_read_info_internal(svn_wc__db
svn_error_t *
svn_wc__db_read_info(svn_wc__db_status_t *status,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_revnum_t *revision,
const char **repos_relpath,
const char **repos_root_url,
@@ -8495,7 +8508,7 @@ read_children_info(svn_wc__db_wcroot_t *
int op_depth;
svn_boolean_t new_child;
- child_item = apr_hash_get(nodes, name, APR_HASH_KEY_STRING);
+ child_item = svn_hash_gets(nodes, name);
if (child_item)
new_child = FALSE;
else
@@ -8586,7 +8599,7 @@ read_children_info(svn_wc__db_wcroot_t *
child->changed_author = svn_sqlite__column_text(stmt, 10,
result_pool);
- if (child->kind != svn_kind_dir)
+ if (child->kind != svn_node_dir)
child->depth = svn_depth_unknown;
else
{
@@ -8612,8 +8625,7 @@ read_children_info(svn_wc__db_wcroot_t *
SVN_ERR(svn_error_compose_create(err, svn_sqlite__reset(stmt)));
child->special = (child->had_props
- && apr_hash_get(properties, SVN_PROP_SPECIAL,
- APR_HASH_KEY_STRING));
+ && svn_hash_gets(properties, SVN_PROP_SPECIAL));
}
#endif
if (op_depth == 0)
@@ -8621,8 +8633,7 @@ read_children_info(svn_wc__db_wcroot_t *
else
child->op_root = (op_depth == relpath_depth(child_relpath));
- apr_hash_set(nodes, apr_pstrdup(result_pool, name),
- APR_HASH_KEY_STRING, child);
+ svn_hash_sets(nodes, apr_pstrdup(result_pool, name), child);
}
if (op_depth == 0)
@@ -8675,7 +8686,7 @@ read_children_info(svn_wc__db_wcroot_t *
const char *child_relpath = svn_sqlite__column_text(stmt, 0, NULL);
const char *name = svn_relpath_basename(child_relpath, NULL);
- child_item = apr_hash_get(nodes, name, APR_HASH_KEY_STRING);
+ child_item = svn_hash_gets(nodes, name);
if (!child_item)
{
child_item = apr_pcalloc(result_pool, sizeof(*child_item));
@@ -8697,16 +8708,15 @@ read_children_info(svn_wc__db_wcroot_t *
scratch_pool, scratch_pool);
if (err)
SVN_ERR(svn_error_compose_create(err, svn_sqlite__reset(stmt)));
- child->special = (NULL != apr_hash_get(properties, SVN_PROP_SPECIAL,
- APR_HASH_KEY_STRING));
+ child->special = (NULL != svn_hash_gets(properties,
+ SVN_PROP_SPECIAL));
}
#endif
child->conflicted = !svn_sqlite__column_is_null(stmt, 3); /* conflict */
if (child->conflicted)
- apr_hash_set(conflicts, apr_pstrdup(result_pool, name),
- APR_HASH_KEY_STRING, "");
+ svn_hash_sets(conflicts, apr_pstrdup(result_pool, name), "");
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
@@ -8746,7 +8756,7 @@ svn_wc__db_read_children_info(apr_hash_t
svn_error_t *
svn_wc__db_read_pristine_info(svn_wc__db_status_t *status,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_revnum_t *changed_rev,
apr_time_t *changed_date,
const char **changed_author,
@@ -8767,7 +8777,7 @@ svn_wc__db_read_pristine_info(svn_wc__db
svn_error_t *err = NULL;
int op_depth;
svn_wc__db_status_t raw_status;
- svn_kind_t node_kind;
+ svn_node_kind_t node_kind;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
@@ -8837,7 +8847,7 @@ svn_wc__db_read_pristine_info(svn_wc__db
}
if (depth)
{
- if (node_kind != svn_kind_dir)
+ if (node_kind != svn_node_dir)
{
*depth = svn_depth_unknown;
}
@@ -8849,7 +8859,7 @@ svn_wc__db_read_pristine_info(svn_wc__db
}
if (checksum)
{
- if (node_kind != svn_kind_file)
+ if (node_kind != svn_node_file)
{
*checksum = NULL;
}
@@ -8875,7 +8885,7 @@ svn_wc__db_read_pristine_info(svn_wc__db
}
if (target)
{
- if (node_kind != svn_kind_symlink)
+ if (node_kind != svn_node_symlink)
*target = NULL;
else
*target = svn_sqlite__column_text(stmt, 12, result_pool);
@@ -8948,8 +8958,7 @@ svn_wc__db_read_children_walker_info(apr
SVN_ERR(svn_error_compose_create(err, svn_sqlite__reset(stmt)));
}
child->kind = svn_sqlite__column_token(stmt, 3, kind_map);
- apr_hash_set(*nodes, apr_pstrdup(result_pool, name),
- APR_HASH_KEY_STRING, child);
+ svn_hash_sets(*nodes, apr_pstrdup(result_pool, name), child);
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
@@ -9010,7 +9019,7 @@ svn_wc__db_read_node_install_info(const
if (have_row)
{
- if (!err && sha1_checksum)
+ if (sha1_checksum)
err = svn_sqlite__column_checksum(sha1_checksum, stmt, 6, result_pool);
if (!err && pristine_props)
@@ -9525,17 +9534,16 @@ svn_wc__db_prop_retrieve_recursive(apr_h
iterpool, iterpool));
value = (node_props
- ? apr_hash_get(node_props, propname, APR_HASH_KEY_STRING)
+ ? svn_hash_gets(node_props, propname)
: NULL);
if (value)
{
- apr_hash_set(*values,
- svn_dirent_join(wcroot->abspath,
- svn_sqlite__column_text(stmt, 1, NULL),
- result_pool),
- APR_HASH_KEY_STRING,
- svn_string_dup(value, result_pool));
+ svn_hash_sets(*values,
+ svn_dirent_join(wcroot->abspath,
+ svn_sqlite__column_text(stmt, 1, NULL),
+ result_pool),
+ svn_string_dup(value, result_pool));
}
SVN_ERR(svn_sqlite__step(&have_row, stmt));
@@ -9624,15 +9632,39 @@ filter_unwanted_props(apr_hash_t *prop_h
const char *ipropname = svn__apr_hash_index_key(hi);
if (strcmp(ipropname, propname) != 0)
- apr_hash_set(prop_hash, ipropname, APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(prop_hash, ipropname, NULL);
}
return;
}
-/* The body of svn_wc__db_read_inherited_props().
- */
+/* Get the changed properties as stored in the ACTUAL table */
static svn_error_t *
-db_read_inherited_props(apr_array_header_t **iprops,
+db_get_changed_props(apr_hash_t **actual_props,
+ svn_wc__db_wcroot_t *wcroot,
+ const char *local_relpath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_sqlite__stmt_t *stmt;
+ svn_boolean_t have_row;
+ SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+ STMT_SELECT_ACTUAL_PROPS));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+
+ if (have_row && !svn_sqlite__column_is_null(stmt, 0))
+ SVN_ERR(svn_sqlite__column_properties(actual_props, stmt, 0,
+ result_pool, scratch_pool));
+ else
+ *actual_props = NULL; /* Cached when we read that record */
+
+ return svn_error_trace(svn_sqlite__reset(stmt));
+}
+
+/* The body of svn_wc__db_read_inherited_props(). */
+static svn_error_t *
+db_read_inherited_props(apr_array_header_t **inherited_props,
+ apr_hash_t **actual_props,
svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
const char *propname,
@@ -9641,81 +9673,152 @@ db_read_inherited_props(apr_array_header
{
int i;
apr_array_header_t *cached_iprops = NULL;
- const char *parent_relpath = local_relpath;
- svn_boolean_t is_wc_root = FALSE;
+ apr_array_header_t *iprops;
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+ svn_sqlite__stmt_t *stmt;
+ const char *relpath;
+ const char *expected_parent_repos_relpath = NULL;
+ const char *parent_relpath;
- *iprops = apr_array_make(result_pool, 1,
+ iprops = apr_array_make(result_pool, 1,
sizeof(svn_prop_inherited_item_t *));
+ *inherited_props = iprops;
+
+ if (actual_props)
+ *actual_props = NULL;
+
+ SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+ STMT_SELECT_NODE_INFO));
+
+ relpath = local_relpath;
/* Walk up to the root of the WC looking for inherited properties. When we
reach the WC root also check for cached inherited properties. */
- while (TRUE)
+ for (relpath = local_relpath; relpath; relpath = parent_relpath)
{
- apr_hash_t *actual_props;
- svn_boolean_t is_switched;
+ svn_boolean_t have_row;
+ int op_depth;
+ svn_wc__db_status_t status;
+ apr_hash_t *node_props;
+
+ parent_relpath = relpath[0] ? svn_relpath_dirname(relpath, scratch_pool)
+ : NULL;
svn_pool_clear(iterpool);
- if (*parent_relpath == '\0')
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, relpath));
+
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+
+ if (!have_row)
+ return svn_error_createf(
+ SVN_ERR_WC_PATH_NOT_FOUND, svn_sqlite__reset(stmt),
+ _("The node '%s' was not found."),
+ path_for_error_message(wcroot, relpath,
+ scratch_pool));
+
+ op_depth = svn_sqlite__column_int(stmt, 0);
+
+ status = svn_sqlite__column_token(stmt, 3, presence_map);
+
+ if (status != svn_wc__db_status_normal
+ && status != svn_wc__db_status_incomplete)
+ return svn_error_createf(
+ SVN_ERR_WC_PATH_UNEXPECTED_STATUS, svn_sqlite__reset(stmt),
+ _("The node '%s' has a status that has no properties."),
+ path_for_error_message(wcroot, relpath,
+ scratch_pool));
+
+ if (op_depth > 0)
{
- is_switched = FALSE;
- is_wc_root = TRUE;
+ /* WORKING node. Nothing to check */
}
- else
- SVN_ERR(db_is_switched(&is_switched, NULL, wcroot, parent_relpath,
- scratch_pool));
+ else if (expected_parent_repos_relpath)
+ {
+ const char *repos_relpath = svn_sqlite__column_text(stmt, 2, NULL);
- if (is_switched || is_wc_root)
+ if (strcmp(expected_parent_repos_relpath, repos_relpath) != 0)
+ {
+ /* The child of this node has a different parent than this node
+ (It is "switched"), so we can stop here. Note that switched
+ with the same parent is not interesting for us here. */
+ SVN_ERR(svn_sqlite__reset(stmt));
+ break;
+ }
+
+ expected_parent_repos_relpath =
+ svn_relpath_dirname(expected_parent_repos_relpath, scratch_pool);
+ }
+ else
{
- is_wc_root = TRUE;
+ const char *repos_relpath = svn_sqlite__column_text(stmt, 2, NULL);
- /* If the WC root is also the root of the repository then by
- definition there are no inheritable properties to be had,
- but checking for that is just as expensive as fetching them
- anyway. */
+ expected_parent_repos_relpath =
+ svn_relpath_dirname(repos_relpath, scratch_pool);
+ }
+
+ if (op_depth == 0
+ && !svn_sqlite__column_is_null(stmt, 16))
+ {
+ /* The node contains a cache. No reason to look further */
+ SVN_ERR(svn_sqlite__column_iprops(&cached_iprops, stmt, 16,
+ result_pool, iterpool));
- /* Grab the cached inherited properties for the WC root. */
- SVN_ERR(db_read_cached_iprops(&cached_iprops,
- wcroot, parent_relpath,
- result_pool, iterpool));
+ parent_relpath = NULL; /* Stop after this */
}
- /* If PARENT_ABSPATH is a true parent of LOCAL_ABSPATH, then
- LOCAL_ABSPATH can inherit properties from it. */
- if (strcmp(local_relpath, parent_relpath) != 0)
+ SVN_ERR(svn_sqlite__column_properties(&node_props, stmt, 14,
+ iterpool, iterpool));
+
+ SVN_ERR(svn_sqlite__reset(stmt));
+
+ /* If PARENT_ABSPATH is a parent of LOCAL_ABSPATH, then LOCAL_ABSPATH
+ can inherit properties from it. */
+ if (relpath != local_relpath)
{
- SVN_ERR(db_read_props(&actual_props, wcroot, parent_relpath,
- result_pool, iterpool));
+ apr_hash_t *changed_props;
+
+ SVN_ERR(db_get_changed_props(&changed_props, wcroot, relpath,
+ result_pool, iterpool));
- if (actual_props)
+ if (changed_props)
+ node_props = changed_props;
+ else if (node_props)
+ node_props = svn_prop_hash_dup(node_props, result_pool);
+
+ if (node_props && apr_hash_count(node_props))
{
/* If we only want PROPNAME filter out any other properties. */
if (propname)
- filter_unwanted_props(actual_props, propname, iterpool);
+ filter_unwanted_props(node_props, propname, iterpool);
- if (apr_hash_count(actual_props))
+ if (apr_hash_count(node_props))
{
svn_prop_inherited_item_t *iprop_elt =
apr_pcalloc(result_pool,
sizeof(svn_prop_inherited_item_t));
iprop_elt->path_or_url = svn_dirent_join(wcroot->abspath,
- parent_relpath,
+ relpath,
result_pool);
- iprop_elt->prop_hash = actual_props;
+ iprop_elt->prop_hash = node_props;
/* Build the output array in depth-first order. */
- svn_sort__array_insert(&iprop_elt, *iprops, 0);
+ svn_sort__array_insert(&iprop_elt, iprops, 0);
}
}
}
+ else if (actual_props)
+ {
+ apr_hash_t *changed_props;
- /* Inheritance only goes as far as the nearest WC root. */
- if (is_wc_root)
- break;
+ SVN_ERR(db_get_changed_props(&changed_props, wcroot, relpath,
+ result_pool, iterpool));
- /* Keep looking for the WC root. */
- parent_relpath = svn_relpath_dirname(parent_relpath, scratch_pool);
+ if (changed_props)
+ *actual_props = changed_props;
+ else if (node_props)
+ *actual_props = svn_prop_hash_dup(node_props, result_pool);
+ }
}
if (cached_iprops)
@@ -9736,16 +9839,20 @@ db_read_inherited_props(apr_array_header
/* If we didn't filter everything then keep this iprop. */
if (apr_hash_count(cached_iprop->prop_hash))
- svn_sort__array_insert(&cached_iprop, *iprops, 0);
+ svn_sort__array_insert(&cached_iprop, iprops, 0);
}
}
+ if (actual_props && !*actual_props)
+ *actual_props = apr_hash_make(result_pool);
+
svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}
svn_error_t *
svn_wc__db_read_inherited_props(apr_array_header_t **iprops,
+ apr_hash_t **actual_props,
svn_wc__db_t *db,
const char *local_abspath,
const char *propname,
@@ -9762,7 +9869,7 @@ svn_wc__db_read_inherited_props(apr_arra
scratch_pool, scratch_pool));
VERIFY_USABLE_WCROOT(wcroot);
- SVN_WC__DB_WITH_TXN(db_read_inherited_props(iprops,
+ SVN_WC__DB_WITH_TXN(db_read_inherited_props(iprops, actual_props,
wcroot, local_relpath, propname,
result_pool, scratch_pool),
wcroot);
@@ -9798,8 +9905,8 @@ get_children_with_cached_iprops(apr_hash
const char *abspath_with_cache = svn_dirent_join(wcroot->abspath,
relpath_with_cache,
result_pool);
- apr_hash_set(*iprop_paths, abspath_with_cache, APR_HASH_KEY_STRING,
- svn_sqlite__column_text(stmt, 1, result_pool));
+ svn_hash_sets(*iprop_paths, abspath_with_cache,
+ svn_sqlite__column_text(stmt, 1, result_pool));
}
SVN_ERR(svn_sqlite__reset(stmt));
@@ -9829,8 +9936,8 @@ get_children_with_cached_iprops(apr_hash
const char *abspath_with_cache = svn_dirent_join(wcroot->abspath,
relpath_with_cache,
result_pool);
- apr_hash_set(*iprop_paths, abspath_with_cache, APR_HASH_KEY_STRING,
- svn_sqlite__column_text(stmt, 1, result_pool));
+ svn_hash_sets(*iprop_paths, abspath_with_cache,
+ svn_sqlite__column_text(stmt, 1, result_pool));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
@@ -9848,7 +9955,7 @@ get_children_with_cached_iprops(apr_hash
{
const char *child_abspath = svn__apr_hash_index_key(hi);
const char *child_relpath;
- svn_kind_t child_kind;
+ svn_node_kind_t child_kind;
svn_pool_clear(iterpool);
@@ -9869,10 +9976,9 @@ get_children_with_cached_iprops(apr_hash
scratch_pool));
/* Filter if not a file */
- if (child_kind != svn_kind_file)
+ if (child_kind != svn_node_file)
{
- apr_hash_set(*iprop_paths, child_abspath, APR_HASH_KEY_STRING,
- NULL);
+ svn_hash_sets(*iprop_paths, child_abspath, NULL);
}
}
@@ -10328,7 +10434,7 @@ determine_repos_info(apr_int64_t *repos_
This code is only valid to fix-up a move from an old location, to a new
location during a commit.
- Assumptions:
+ Assumptions:
* local_relpath is not the working copy root (can't be moved)
* repos_relpath is not the repository root (can't be moved)
*/
@@ -10431,7 +10537,7 @@ moved_descendant_commit(svn_wc__db_wcroo
Makes all nodes below LOCAL_RELPATH represent the descendants of repository
location repos_id:repos_relpath@revision.
- Assumptions:
+ Assumptions:
* local_relpath is not the working copy root (can't be replaced)
* repos_relpath is not the repository root (can't be replaced)
*/
@@ -10489,7 +10595,7 @@ commit_node(svn_wc__db_wcroot_t *wcroot,
const char *changelist = NULL;
const char *parent_relpath;
svn_wc__db_status_t new_presence;
- svn_kind_t new_kind;
+ svn_node_kind_t new_kind;
const char *new_depth_str = NULL;
svn_sqlite__stmt_t *stmt;
apr_int64_t repos_id;
@@ -10528,7 +10634,7 @@ commit_node(svn_wc__db_wcroot_t *wcroot,
new_kind = svn_sqlite__column_token(stmt_info, 4, kind_map);
/* What will the new depth be? */
- if (new_kind == svn_kind_dir)
+ if (new_kind == svn_node_dir)
new_depth_str = svn_sqlite__column_text(stmt_info, 11, scratch_pool);
/* Check that the repository information is not being changed. */
@@ -10692,7 +10798,7 @@ commit_node(svn_wc__db_wcroot_t *wcroot,
}
}
- if (new_kind == svn_kind_dir)
+ if (new_kind == svn_node_dir)
{
/* When committing a directory, we should have its new children. */
/* ### one day. just not today. */
@@ -10763,7 +10869,7 @@ svn_wc__db_global_commit(svn_wc__db_t *d
svn_error_t *
svn_wc__db_global_update(svn_wc__db_t *db,
const char *local_abspath,
- svn_kind_t new_kind,
+ svn_node_kind_t new_kind,
const char *new_repos_relpath,
svn_revnum_t new_revision,
const apr_hash_t *new_props,
@@ -10911,7 +11017,7 @@ bump_node_revision(svn_wc__db_wcroot_t *
const apr_array_header_t *children;
int i;
svn_wc__db_status_t status;
- svn_kind_t db_kind;
+ svn_node_kind_t db_kind;
svn_revnum_t revision;
const char *repos_relpath;
apr_int64_t repos_id;
@@ -10921,7 +11027,7 @@ bump_node_revision(svn_wc__db_wcroot_t *
apr_array_header_t *iprops = NULL;
/* Skip an excluded path and its descendants. */
- if (apr_hash_get(exclude_relpaths, local_relpath, APR_HASH_KEY_STRING))
+ if (svn_hash_gets(exclude_relpaths, local_relpath))
return SVN_NO_ERROR;
SVN_ERR(svn_wc__db_base_get_info_internal(&status, &db_kind, &revision,
@@ -10933,11 +11039,11 @@ bump_node_revision(svn_wc__db_wcroot_t *
/* Skip file externals */
if (update_root
- && db_kind == svn_kind_file
+ && db_kind == svn_node_file
&& !is_root)
return SVN_NO_ERROR;
- if (skip_when_dir && db_kind == svn_kind_dir)
+ if (skip_when_dir && db_kind == svn_node_dir)
return SVN_NO_ERROR;
/* If the node is still marked 'not-present', then the server did not
@@ -10961,10 +11067,9 @@ bump_node_revision(svn_wc__db_wcroot_t *
set_repos_relpath = TRUE;
if (wcroot_iprops)
- iprops = apr_hash_get(wcroot_iprops,
- svn_dirent_join(wcroot->abspath, local_relpath,
- scratch_pool),
- APR_HASH_KEY_STRING);
+ iprops = svn_hash_gets(wcroot_iprops,
+ svn_dirent_join(wcroot->abspath, local_relpath,
+ scratch_pool));
if (iprops
|| set_repos_relpath
@@ -10980,7 +11085,7 @@ bump_node_revision(svn_wc__db_wcroot_t *
/* Early out */
if (depth <= svn_depth_empty
- || db_kind != svn_kind_dir
+ || db_kind != svn_node_dir
|| status == svn_wc__db_status_server_excluded
|| status == svn_wc__db_status_excluded
|| status == svn_wc__db_status_not_present)
@@ -11046,7 +11151,7 @@ bump_revisions_post_update(svn_wc__db_wc
apr_pool_t *scratch_pool)
{
svn_wc__db_status_t status;
- svn_kind_t kind;
+ svn_node_kind_t kind;
svn_error_t *err;
apr_int64_t new_repos_id = INVALID_REPOS_ID;
@@ -11119,7 +11224,7 @@ svn_wc__db_op_bump_revisions_post_update
VERIFY_USABLE_WCROOT(wcroot);
- if (apr_hash_get(exclude_relpaths, local_relpath, APR_HASH_KEY_STRING))
+ if (svn_hash_gets(exclude_relpaths, local_relpath))
return SVN_NO_ERROR;
if (depth == svn_depth_unknown)
@@ -11804,7 +11909,7 @@ svn_wc__db_scan_moved(const char **moved
: NULL,
wcroot, local_relpath, scratch_pool, scratch_pool));
- if (status != svn_wc__db_status_moved_here)
+ if (status != svn_wc__db_status_moved_here || !moved_from_relpath)
return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
_("Path '%s' was not moved here"),
path_for_error_message(wcroot, local_relpath,
@@ -12187,7 +12292,7 @@ svn_wc__db_upgrade_begin(svn_sqlite__db_
wc_db->state_pool, scratch_pool));
/* The WCROOT is complete. Stash it into DB. */
- apr_hash_set(wc_db->dir_data, wcroot->abspath, APR_HASH_KEY_STRING, wcroot);
+ svn_hash_sets(wc_db->dir_data, wcroot->abspath, wcroot);
return SVN_NO_ERROR;
}
@@ -12380,7 +12485,7 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
svn_error_t *
svn_wc__db_upgrade_insert_external(svn_wc__db_t *db,
const char *local_abspath,
- svn_kind_t kind,
+ svn_node_kind_t kind,
const char *parent_abspath,
const char *def_local_abspath,
const char *repos_relpath,
@@ -12708,8 +12813,7 @@ svn_wc__db_temp_get_access(svn_wc__db_t
if (!wcroot)
return NULL;
- return apr_hash_get(wcroot->access_cache, local_dir_abspath,
- APR_HASH_KEY_STRING);
+ return svn_hash_gets(wcroot->access_cache, local_dir_abspath);
}
@@ -12737,11 +12841,10 @@ svn_wc__db_temp_set_access(svn_wc__db_t
}
/* Better not override something already there. */
- SVN_ERR_ASSERT_NO_RETURN(apr_hash_get(wcroot->access_cache,
- local_dir_abspath,
- APR_HASH_KEY_STRING) == NULL);
- apr_hash_set(wcroot->access_cache, local_dir_abspath,
- APR_HASH_KEY_STRING, adm_access);
+ SVN_ERR_ASSERT_NO_RETURN(
+ svn_hash_gets(wcroot->access_cache, local_dir_abspath) == NULL
+ );
+ svn_hash_sets(wcroot->access_cache, local_dir_abspath, adm_access);
}
@@ -12760,8 +12863,7 @@ svn_wc__db_temp_close_access(svn_wc__db_
SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
local_dir_abspath, scratch_pool, scratch_pool));
- apr_hash_set(wcroot->access_cache, local_dir_abspath,
- APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(wcroot->access_cache, local_dir_abspath, NULL);
return SVN_NO_ERROR;
}
@@ -12788,8 +12890,7 @@ svn_wc__db_temp_clear_access(svn_wc__db_
return;
}
- apr_hash_set(wcroot->access_cache, local_dir_abspath,
- APR_HASH_KEY_STRING, NULL);
+ svn_hash_sets(wcroot->access_cache, local_dir_abspath, NULL);
}
@@ -12919,7 +13020,7 @@ get_conflict_marker_files(apr_hash_t **m
{
const char *marker_abspath = APR_ARRAY_IDX(markers, i, const char*);
- apr_hash_set(marker_files, marker_abspath, APR_HASH_KEY_STRING, "");
+ svn_hash_sets(marker_files, marker_abspath, "");
}
}
SVN_ERR(svn_sqlite__reset(stmt));
@@ -12950,7 +13051,7 @@ get_conflict_marker_files(apr_hash_t **m
{
const char *marker_abspath = APR_ARRAY_IDX(markers, i, const char*);
- apr_hash_set(marker_files, marker_abspath, APR_HASH_KEY_STRING, "");
+ svn_hash_sets(marker_files, marker_abspath, "");
}
}
@@ -13083,7 +13184,7 @@ svn_wc__db_read_conflict_internal(svn_sk
svn_error_t *
-svn_wc__db_read_kind(svn_kind_t *kind,
+svn_wc__db_read_kind(svn_node_kind_t *kind,
svn_wc__db_t *db,
const char *local_abspath,
svn_boolean_t allow_missing,
@@ -13111,7 +13212,7 @@ svn_wc__db_read_kind(svn_kind_t *kind,
{
if (allow_missing)
{
- *kind = svn_kind_unknown;
+ *kind = svn_node_unknown;
SVN_ERR(svn_sqlite__reset(stmt_info));
return SVN_NO_ERROR;
}
@@ -13157,7 +13258,7 @@ svn_wc__db_read_kind(svn_kind_t *kind,
if (report_none)
{
- *kind = svn_kind_none;
+ *kind = svn_node_none;
return svn_error_trace(svn_sqlite__reset(stmt_info));
}
}
@@ -13231,7 +13332,7 @@ svn_wc__db_is_wcroot(svn_boolean_t *is_w
*/
static svn_error_t *
db_is_switched(svn_boolean_t *is_switched,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
apr_pool_t *scratch_pool)
@@ -13301,7 +13402,7 @@ db_is_switched(svn_boolean_t *is_switche
svn_error_t *
svn_wc__db_is_switched(svn_boolean_t *is_wcroot,
svn_boolean_t *is_switched,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_wc__db_t *db,
const char *local_abspath,
apr_pool_t *scratch_pool)
@@ -13323,9 +13424,9 @@ svn_wc__db_is_switched(svn_boolean_t *is
/* Easy out */
if (is_wcroot)
*is_wcroot = TRUE;
-
+
if (kind)
- *kind = svn_kind_dir;
+ *kind = svn_node_dir;
return SVN_NO_ERROR;
}
@@ -14446,8 +14547,7 @@ svn_wc__db_get_excluded_subtrees(apr_has
svn_dirent_join(wcroot->abspath,
svn_sqlite__column_text(stmt, 0, NULL),
result_pool);
- apr_hash_set(*excluded_subtrees, abs_path, APR_HASH_KEY_STRING,
- abs_path);
+ svn_hash_sets(*excluded_subtrees, abs_path, abs_path);
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
@@ -14538,8 +14638,8 @@ has_local_mods(svn_boolean_t *is_modifie
{
const svn_io_dirent2_t *dirent;
- err = svn_io_stat_dirent(&dirent, node_abspath, TRUE,
- iterpool, iterpool);
+ err = svn_io_stat_dirent2(&dirent, node_abspath, FALSE, TRUE,
+ iterpool, iterpool);
if (err)
return svn_error_trace(svn_error_compose_create(
err,
@@ -14768,12 +14868,10 @@ svn_wc__db_base_get_lock_tokens_recursiv
}
SVN_ERR_ASSERT(last_repos_root_url != NULL);
- apr_hash_set(*lock_tokens,
- svn_path_url_add_component2(last_repos_root_url,
- child_relpath,
- result_pool),
- APR_HASH_KEY_STRING,
- lock_token);
+ svn_hash_sets(*lock_tokens,
+ svn_path_url_add_component2(last_repos_root_url,
+ child_relpath, result_pool),
+ lock_token);
SVN_ERR(svn_sqlite__step(&have_row, stmt));
}
Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.h?rev=1481041&r1=1481040&r2=1481041&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db.h Fri May 10 14:58:47 2013
@@ -640,7 +640,7 @@ svn_wc__db_base_add_excluded_node(svn_wc
const char *repos_root_url,
const char *repos_uuid,
svn_revnum_t revision,
- svn_kind_t kind,
+ svn_node_kind_t kind,
svn_wc__db_status_t status,
const svn_skel_t *conflict,
const svn_skel_t *work_items,
@@ -671,7 +671,7 @@ svn_wc__db_base_add_not_present_node(svn
const char *repos_root_url,
const char *repos_uuid,
svn_revnum_t revision,
- svn_kind_t kind,
+ svn_node_kind_t kind,
const svn_skel_t *conflict,
const svn_skel_t *work_items,
apr_pool_t *scratch_pool);
@@ -775,7 +775,7 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
*/
svn_error_t *
svn_wc__db_base_get_info(svn_wc__db_status_t *status,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_revnum_t *revision,
const char **repos_relpath,
const char **repos_root_url,
@@ -799,7 +799,7 @@ svn_wc__db_base_get_info(svn_wc__db_stat
fields needed by the adm crawler. */
struct svn_wc__db_base_info_t {
svn_wc__db_status_t status;
- svn_kind_t kind;
+ svn_node_kind_t kind;
svn_revnum_t revnum;
const char *repos_relpath;
const char *repos_root_url;
@@ -1197,7 +1197,7 @@ svn_wc__db_external_remove(svn_wc__db_t
*/
svn_error_t *
svn_wc__db_external_read(svn_wc__db_status_t *status,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
const char **defining_abspath,
const char **repos_root_url,
@@ -1635,7 +1635,7 @@ svn_error_t *
svn_wc__db_revert_list_read(svn_boolean_t *reverted,
const apr_array_header_t **marker_files,
svn_boolean_t *copied_here,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_wc__db_t *db,
const char *local_abspath,
apr_pool_t *result_pool,
@@ -1645,7 +1645,7 @@ svn_wc__db_revert_list_read(svn_boolean_
* svn_wc__db_revert_list_read_copied_children(). */
typedef struct svn_wc__db_revert_list_copied_child_info_t {
const char *abspath;
- svn_kind_t kind;
+ svn_node_kind_t kind;
} svn_wc__db_revert_list_copied_child_info_t ;
/* Return in *CHILDREN a list of reverted copied nodes at or within
@@ -1712,7 +1712,7 @@ svn_wc__db_revert_list_done(svn_wc__db_t
The OUT parameters, and their "not available" values are:
STATUS n/a (always available)
- KIND svn_kind_unknown (For ACTUAL only nodes)
+ KIND svn_node_unknown (For ACTUAL only nodes)
REVISION SVN_INVALID_REVNUM
REPOS_RELPATH NULL
REPOS_ROOT_URL NULL
@@ -1861,7 +1861,7 @@ svn_wc__db_revert_list_done(svn_wc__db_t
*/
svn_error_t *
svn_wc__db_read_info(svn_wc__db_status_t *status, /* ### derived */
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_revnum_t *revision,
const char **repos_relpath,
const char **repos_root_url,
@@ -1909,7 +1909,7 @@ svn_wc__db_read_info(svn_wc__db_status_t
fields needed by status. */
struct svn_wc__db_info_t {
svn_wc__db_status_t status;
- svn_kind_t kind;
+ svn_node_kind_t kind;
svn_revnum_t revnum;
const char *repos_relpath;
const char *repos_root_url;
@@ -1968,7 +1968,7 @@ svn_wc__db_read_children_info(apr_hash_t
fields needed by svn_wc__internal_walk_children(). */
struct svn_wc__db_walker_info_t {
svn_wc__db_status_t status;
- svn_kind_t kind;
+ svn_node_kind_t kind;
};
/* When a node is deleted in WORKING, some of its information is no longer
@@ -1992,7 +1992,7 @@ struct svn_wc__db_walker_info_t {
*/
svn_error_t *
svn_wc__db_read_pristine_info(svn_wc__db_status_t *status,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_revnum_t *changed_rev,
apr_time_t *changed_date,
const char **changed_author,
@@ -2120,11 +2120,15 @@ svn_wc__db_read_pristine_props(apr_hash_
* paths relative to the repository root URL for cached inherited
* properties and absolute working copy paths otherwise.
*
+ * If ACTUAL_PROPS is not NULL, then set *ACTUAL_PROPS to the actual
+ * properties stored on LOCAL_ABSPATH.
+ *
* Allocate @a *iprops in @a result_pool. Use @a scratch_pool
* for temporary allocations.
*/
svn_error_t *
svn_wc__db_read_inherited_props(apr_array_header_t **iprops,
+ apr_hash_t **actual_props,
svn_wc__db_t *db,
const char *local_abspath,
const char *propname,
@@ -2266,7 +2270,7 @@ svn_wc__db_read_conflict(svn_skel_t **co
/* Return the kind of the node in DB at LOCAL_ABSPATH. The WORKING tree will
be examined first, then the BASE tree. If the node is not present in either
- tree and ALLOW_MISSING is TRUE, then svn_kind_unknown is returned.
+ tree and ALLOW_MISSING is TRUE, then svn_node_unknown is returned.
If the node is missing and ALLOW_MISSING is FALSE, then it will return
SVN_ERR_WC_PATH_NOT_FOUND.
@@ -2280,12 +2284,12 @@ svn_wc__db_read_conflict(svn_skel_t **co
svn_wc__db_status_deleted when show_deleted
- In other cases these nodes are reported with *KIND as svn_kind_none.
+ In other cases these nodes are reported with *KIND as svn_node_none.
(See also svn_wc_read_kind2()'s documentation)
Uses SCRATCH_POOL for temporary allocations. */
svn_error_t *
-svn_wc__db_read_kind(svn_kind_t *kind,
+svn_wc__db_read_kind(svn_node_kind_t *kind,
svn_wc__db_t *db,
const char *local_abspath,
svn_boolean_t allow_missing,
@@ -2356,7 +2360,7 @@ svn_wc__db_is_wcroot(svn_boolean_t *is_w
svn_error_t *
svn_wc__db_is_switched(svn_boolean_t *is_wcroot,
svn_boolean_t *is_switched,
- svn_kind_t *kind,
+ svn_node_kind_t *kind,
svn_wc__db_t *db,
const char *local_abspath,
apr_pool_t *scratch_pool);
@@ -2467,7 +2471,7 @@ svn_wc__db_global_commit(svn_wc__db_t *d
svn_error_t *
svn_wc__db_global_update(svn_wc__db_t *db,
const char *local_abspath,
- svn_kind_t new_kind,
+ svn_node_kind_t new_kind,
const char *new_repos_relpath,
svn_revnum_t new_revision,
const apr_hash_t *new_props,
@@ -2871,7 +2875,7 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
svn_error_t *
svn_wc__db_upgrade_insert_external(svn_wc__db_t *db,
const char *local_abspath,
- svn_kind_t kind,
+ svn_node_kind_t kind,
const char *parent_abspath,
const char *def_local_abspath,
const char *repos_relpath,
@@ -3054,7 +3058,7 @@ svn_wc__db_op_remove_node(svn_boolean_t
svn_boolean_t destroy_changes,
svn_revnum_t not_present_revision,
svn_wc__db_status_t not_present_status,
- svn_kind_t not_present_kind,
+ svn_node_kind_t not_present_kind,
const svn_skel_t *conflict,
const svn_skel_t *work_items,
svn_cancel_func_t cancel_func,
@@ -3326,18 +3330,14 @@ svn_wc__db_follow_moved_to(apr_array_hea
apr_pool_t *scratch_pool);
/* Update a moved-away tree conflict victim at VICTIM_ABSPATH with changes
- * brought in by the update operation which flagged the tree conflict.
- * Set *WORK_ITEMS to a list of work items, allocated in RESULT_POOL, that
- * need to run as part of marking the conflict resolved. */
+ * brought in by the update operation which flagged the tree conflict. */
svn_error_t *
-svn_wc__db_update_moved_away_conflict_victim(svn_skel_t **work_items,
- svn_wc__db_t *db,
+svn_wc__db_update_moved_away_conflict_victim(svn_wc__db_t *db,
const char *victim_abspath,
svn_wc_notify_func2_t notify_func,
void *notify_baton,
svn_cancel_func_t cancel_func,
void *cancel_baton,
- apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
/* LOCAL_ABSPATH is moved to MOVE_DST_ABSPATH. MOVE_SRC_ROOT_ABSPATH
@@ -3354,7 +3354,7 @@ svn_wc__db_base_moved_to(const char **mo
const char *local_abspath,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-
+
/* Recover space from the database file for LOCAL_ABSPATH by running
* the "vacuum" command. */
svn_error_t *