Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/libsvn_wc/wc_db.c view on Meta::CPAN
svn_error_t *
svn_wc__db_temp_close_access(svn_wc__db_t *db,
const char *local_dir_abspath,
svn_wc_adm_access_t *adm_access,
apr_pool_t *scratch_pool)
{
const char *local_relpath;
svn_wc__db_wcroot_t *wcroot;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_dir_abspath));
/* ### assert that we were passed a directory? */
SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
local_dir_abspath, scratch_pool, scratch_pool));
svn_hash_sets(wcroot->access_cache, local_dir_abspath, NULL);
return SVN_NO_ERROR;
}
/* ### temporary API. remove before release. */
void
svn_wc__db_temp_clear_access(svn_wc__db_t *db,
const char *local_dir_abspath,
apr_pool_t *scratch_pool)
{
const char *local_relpath;
svn_wc__db_wcroot_t *wcroot;
svn_error_t *err;
SVN_ERR_ASSERT_NO_RETURN(svn_dirent_is_absolute(local_dir_abspath));
/* ### assert that we were passed a directory? */
err = svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
db, local_dir_abspath, scratch_pool, scratch_pool);
if (err)
{
svn_error_clear(err);
return;
}
svn_hash_sets(wcroot->access_cache, local_dir_abspath, NULL);
}
apr_hash_t *
svn_wc__db_temp_get_all_access(svn_wc__db_t *db,
apr_pool_t *result_pool)
{
apr_hash_t *result = apr_hash_make(result_pool);
apr_hash_index_t *hi;
for (hi = apr_hash_first(result_pool, db->dir_data);
hi;
hi = apr_hash_next(hi))
{
const svn_wc__db_wcroot_t *wcroot = svn__apr_hash_index_val(hi);
/* This is highly redundant, 'cause the same WCROOT will appear many
times in dir_data. */
result = apr_hash_overlay(result_pool, result, wcroot->access_cache);
}
return result;
}
svn_error_t *
svn_wc__db_temp_borrow_sdb(svn_sqlite__db_t **sdb,
svn_wc__db_t *db,
const char *local_dir_abspath,
apr_pool_t *scratch_pool)
{
svn_wc__db_wcroot_t *wcroot;
const char *local_relpath;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_dir_abspath));
SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
local_dir_abspath, scratch_pool, scratch_pool));
VERIFY_USABLE_WCROOT(wcroot);
*sdb = wcroot->sdb;
return SVN_NO_ERROR;
}
svn_error_t *
svn_wc__db_read_conflict_victims(const apr_array_header_t **victims,
svn_wc__db_t *db,
const char *local_abspath,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
svn_wc__db_wcroot_t *wcroot;
const char *local_relpath;
svn_sqlite__stmt_t *stmt;
svn_boolean_t have_row;
apr_array_header_t *new_victims;
/* The parent should be a working copy directory. */
SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
local_abspath, scratch_pool, scratch_pool));
VERIFY_USABLE_WCROOT(wcroot);
/* ### This will be much easier once we have all conflicts in one
field of actual*/
/* Look for text, tree and property conflicts in ACTUAL */
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
STMT_SELECT_CONFLICT_VICTIMS));
SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
new_victims = apr_array_make(result_pool, 0, sizeof(const char *));
SVN_ERR(svn_sqlite__step(&have_row, stmt));
while (have_row)
{
const char *child_relpath = svn_sqlite__column_text(stmt, 0, NULL);
( run in 1.313 second using v1.01-cache-2.11-cpan-9e1a9122474 )