You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/07/20 01:06:07 UTC
svn commit: r1148581 [5/12] - in
/subversion/branches/gpg-agent-password-store: ./ build/ build/ac-macros/
build/generator/ build/generator/templates/ contrib/hook-scripts/
contrib/hook-scripts/enforcer/ contrib/server-side/
contrib/server-side/fsfsfix...
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/fs_fs.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/fs_fs.c Tue Jul 19 23:05:44 2011
@@ -59,8 +59,6 @@
#include "rep-cache.h"
#include "temp_serializer.h"
-#include "revprops-db.h"
-
#include "private/svn_fs_util.h"
#include "../libsvn_fs/fs-loader.h"
@@ -139,9 +137,6 @@ static txn_vtable_t txn_vtable = {
svn_fs_fs__change_txn_props
};
-/* SQL bits for revprops. */
-REVPROPS_DB_SQL_DECLARE_STATEMENTS(statements);
-
/* Declarations. */
static svn_error_t *
@@ -152,9 +147,6 @@ read_min_unpacked_rev(svn_revnum_t *min_
static svn_error_t *
update_min_unpacked_rev(svn_fs_t *fs, apr_pool_t *pool);
-static svn_error_t *
-update_min_unpacked_revprop(svn_fs_t *fs, apr_pool_t *pool);
-
/* Pathname helper functions */
/* Return TRUE is REV is packed in FS, FALSE otherwise. */
@@ -166,6 +158,19 @@ is_packed_rev(svn_fs_t *fs, svn_revnum_t
return (rev < ffd->min_unpacked_rev);
}
+/* Return TRUE is REV is packed in FS, FALSE otherwise. */
+static svn_boolean_t
+is_packed_revprop(svn_fs_t *fs, svn_revnum_t rev)
+{
+#if 0
+ fs_fs_data_t *ffd = fs->fsap_data;
+
+ return (rev < ffd->min_unpacked_revprop);
+#else
+ return FALSE;
+#endif
+}
+
static const char *
path_format(svn_fs_t *fs, apr_pool_t *pool)
{
@@ -330,12 +335,6 @@ path_min_unpacked_rev(svn_fs_t *fs, apr_
return svn_dirent_join(fs->path, PATH_MIN_UNPACKED_REV, pool);
}
-static APR_INLINE const char *
-path_min_unpacked_revprop(svn_fs_t *fs, apr_pool_t *pool)
-{
- return svn_dirent_join(fs->path, PATH_MIN_UNPACKED_REVPROP, pool);
-}
-
static APR_INLINE const char *
path_txn_proto_rev(svn_fs_t *fs, const char *txn_id, apr_pool_t *pool)
@@ -591,8 +590,6 @@ with_some_lock(svn_fs_t *fs,
fs_fs_data_t *ffd = fs->fsap_data;
if (ffd->format >= SVN_FS_FS__MIN_PACKED_FORMAT)
SVN_ERR(update_min_unpacked_rev(fs, pool));
- if (ffd->format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT)
- SVN_ERR(update_min_unpacked_revprop(fs, pool));
#if 0 /* Might be a good idea? */
SVN_ERR(get_youngest(&ffd->youngest_rev_cache, fs->path,
pool));
@@ -1068,6 +1065,16 @@ write_format(const char *path, int forma
static svn_error_t *
check_format(int format)
{
+ /* Blacklist. These formats may be either younger or older than
+ SVN_FS_FS__FORMAT_NUMBER, but we don't support them. */
+ if (format == SVN_FS_FS__PACKED_REVPROP_SQLITE_DEV_FORMAT)
+ return svn_error_createf(SVN_ERR_FS_UNSUPPORTED_FORMAT, NULL,
+ _("Found format '%d', only created by "
+ "unreleased dev builds; see "
+ "http://subversion.apache.org"
+ "/docs/release-notes/1.7#revprop-packing"),
+ format);
+
/* We support all formats from 1-current simultaneously */
if (1 <= format && format <= SVN_FS_FS__FORMAT_NUMBER)
return SVN_NO_ERROR;
@@ -1147,6 +1154,7 @@ write_config(svn_fs_t *fs,
"### The following parameter enables rep-sharing in the repository. It can" NL
"### be switched on and off at will, but for best space-saving results" NL
"### should be enabled consistently over the life of the repository." NL
+"### 'svnadmin verify' will check the rep-cache regardless of this setting." NL
"### rep-sharing is enabled by default." NL
"# " CONFIG_OPTION_ENABLE_REP_SHARING " = true" NL
@@ -1188,40 +1196,6 @@ update_min_unpacked_rev(svn_fs_t *fs, ap
}
static svn_error_t *
-update_min_unpacked_revprop(svn_fs_t *fs, apr_pool_t *pool)
-{
- fs_fs_data_t *ffd = fs->fsap_data;
-
- SVN_ERR_ASSERT(ffd->format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT);
-
- return read_min_unpacked_rev(&ffd->min_unpacked_revprop,
- path_min_unpacked_revprop(fs, pool),
- pool);
-}
-
-/* Create a new SQLite database for storing the revprops in filesystem FS.
- * Leave the DB open and set *SDB to its handle. Also create the "min
- * unpacked revprop" file. */
-static svn_error_t *
-create_packed_revprops_db(svn_sqlite__db_t **sdb,
- svn_fs_t *fs,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- SVN_ERR(svn_io_file_create(path_min_unpacked_revprop(fs, scratch_pool),
- "0\n", scratch_pool));
- SVN_ERR(svn_sqlite__open(sdb,
- svn_dirent_join_many(scratch_pool, fs->path,
- PATH_REVPROPS_DIR,
- PATH_REVPROPS_DB,
- NULL),
- svn_sqlite__mode_rwcreate, statements,
- 0, NULL, result_pool, scratch_pool));
- SVN_ERR(svn_sqlite__exec_statements(*sdb, STMT_CREATE_SCHEMA));
- return SVN_NO_ERROR;
-}
-
-static svn_error_t *
get_youngest(svn_revnum_t *youngest_p, const char *fs_path, apr_pool_t *pool);
svn_error_t *
@@ -1238,11 +1212,11 @@ svn_fs_fs__open(svn_fs_t *fs, const char
/* Read the FS format number. */
SVN_ERR(read_format(&format, &max_files_per_dir,
path_format(fs, pool), pool));
+ SVN_ERR(check_format(format));
/* Now we've got a format number no matter what. */
ffd->format = format;
ffd->max_files_per_dir = max_files_per_dir;
- SVN_ERR(check_format(format));
/* Read in and cache the repository uuid. */
SVN_ERR(svn_io_file_open(&uuid_file, path_uuid(fs, pool),
@@ -1261,21 +1235,6 @@ svn_fs_fs__open(svn_fs_t *fs, const char
/* Read the configuration file. */
SVN_ERR(read_config(fs, pool));
- /* Open the revprops db. */
- if (ffd->format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT)
- {
- SVN_ERR(update_min_unpacked_revprop(fs, pool));
-
- SVN_ERR(svn_sqlite__open(&ffd->revprop_db, svn_dirent_join_many(
- pool, path,
- PATH_REVPROPS_DIR,
- PATH_REVPROPS_DB,
- NULL),
- svn_sqlite__mode_readwrite, statements,
- 0, NULL,
- fs->pool, pool));
- }
-
return get_youngest(&(ffd->youngest_rev_cache), path, pool);
}
@@ -1298,13 +1257,13 @@ static svn_error_t *
upgrade_body(void *baton, apr_pool_t *pool)
{
svn_fs_t *fs = baton;
- fs_fs_data_t *ffd = fs->fsap_data;
int format, max_files_per_dir;
const char *format_path = path_format(fs, pool);
svn_node_kind_t kind;
/* Read the FS format number and max-files-per-dir setting. */
SVN_ERR(read_format(&format, &max_files_per_dir, format_path, pool));
+ SVN_ERR(check_format(format));
/* If the config file does not exist, create one. */
SVN_ERR(svn_io_check_path(svn_dirent_join(fs->path, PATH_CONFIG, pool),
@@ -1352,13 +1311,6 @@ upgrade_body(void *baton, apr_pool_t *po
if (format < SVN_FS_FS__MIN_PACKED_FORMAT)
SVN_ERR(svn_io_file_create(path_min_unpacked_rev(fs, pool), "0\n", pool));
- /* If our filesystem is new enough, write the min unpacked revprop file,
- and create the database. */
- if (format < SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT)
- {
- SVN_ERR(create_packed_revprops_db(&ffd->revprop_db, fs, fs->pool, pool));
- }
-
/* Bump the format file. */
return write_format(format_path, SVN_FS_FS__FORMAT_NUMBER, max_files_per_dir,
TRUE, pool);
@@ -1519,7 +1471,7 @@ svn_fs_fs__hotcopy(const char *src_path,
apr_pool_t *pool)
{
const char *src_subdir, *dst_subdir;
- svn_revnum_t youngest, rev, min_unpacked_rev, min_unpacked_revprop;
+ svn_revnum_t youngest, rev, min_unpacked_rev;
apr_pool_t *iterpool;
svn_node_kind_t kind;
int format, max_files_per_dir;
@@ -1674,40 +1626,13 @@ svn_fs_fs__hotcopy(const char *src_path,
svn_pool_clear(iterpool);
}
- /* Copy the min unpacked revprop file, and read its value. */
- if (format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT)
- {
- const char *min_unpacked_revprop_path;
- min_unpacked_revprop_path = svn_dirent_join(src_path,
- PATH_MIN_UNPACKED_REVPROP,
- pool);
- SVN_ERR(svn_io_dir_file_copy(src_path, dst_path,
- PATH_MIN_UNPACKED_REVPROP, pool));
- SVN_ERR(read_min_unpacked_rev(&min_unpacked_revprop,
- min_unpacked_revprop_path, pool));
- }
- else
- {
- min_unpacked_revprop = 0;
- }
-
/* Copy the necessary revprop files. */
src_subdir = svn_dirent_join(src_path, PATH_REVPROPS_DIR, pool);
dst_subdir = svn_dirent_join(dst_path, PATH_REVPROPS_DIR, pool);
SVN_ERR(svn_io_make_dir_recursively(dst_subdir, pool));
- /* Copy the packed revprop db. */
- if (format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT)
- {
- const char *src_file = svn_dirent_join(src_subdir, PATH_REVPROPS_DB,
- pool);
- const char *dst_file = svn_dirent_join(dst_subdir, PATH_REVPROPS_DB,
- pool);
- SVN_ERR(svn_sqlite__hotcopy(src_file, dst_file, pool));
- }
-
- for (rev = min_unpacked_revprop; rev <= youngest; rev++)
+ for (rev = 0; rev <= youngest; rev++)
{
const char *src_subdir_shard = src_subdir,
*dst_subdir_shard = dst_subdir;
@@ -3016,13 +2941,9 @@ set_revision_proplist(svn_fs_t *fs,
apr_hash_t *proplist,
apr_pool_t *pool)
{
- fs_fs_data_t *ffd = fs->fsap_data;
- svn_sqlite__stmt_t *stmt;
-
SVN_ERR(ensure_revision_exists(fs, rev, pool));
- if (ffd->format < SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT ||
- rev >= ffd->min_unpacked_revprop)
+ if (1)
{
const char *final_path = path_revprops(fs, rev, pool);
const char *tmp_path;
@@ -3047,12 +2968,7 @@ set_revision_proplist(svn_fs_t *fs,
return SVN_NO_ERROR;
}
- SVN_ERR(svn_sqlite__get_statement(&stmt, ffd->revprop_db, STMT_SET_REVPROP));
-
- SVN_ERR(svn_sqlite__bind_int64(stmt, 1, rev));
- SVN_ERR(svn_sqlite__bind_properties(stmt, 2, proplist, pool));
-
- return svn_error_trace(svn_sqlite__insert(NULL, stmt));
+ return SVN_NO_ERROR;
}
static svn_error_t *
@@ -3061,13 +2977,11 @@ revision_proplist(apr_hash_t **proplist_
svn_revnum_t rev,
apr_pool_t *pool)
{
- fs_fs_data_t *ffd = fs->fsap_data;
apr_hash_t *proplist;
SVN_ERR(ensure_revision_exists(fs, rev, pool));
- if (ffd->format < SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT ||
- rev >= ffd->min_unpacked_revprop)
+ if (1)
{
apr_file_t *revprop_file = NULL;
svn_error_t *err = SVN_NO_ERROR;
@@ -3120,22 +3034,6 @@ revision_proplist(apr_hash_t **proplist_
return svn_error_trace(err);
svn_pool_destroy(iterpool);
}
- else
- {
- svn_sqlite__stmt_t *stmt;
- svn_boolean_t have_row;
-
- SVN_ERR(svn_sqlite__get_statement(&stmt, ffd->revprop_db,
- STMT_GET_REVPROP));
- SVN_ERR(svn_sqlite__bind_int64(stmt, 1, rev));
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- if (!have_row)
- return svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL,
- _("No such revision %ld"), rev);
-
- SVN_ERR(svn_sqlite__column_properties(&proplist, stmt, 0, pool, pool));
- SVN_ERR(svn_sqlite__reset(stmt));
- }
*proplist_p = proplist;
@@ -3148,22 +3046,7 @@ svn_fs_fs__revision_proplist(apr_hash_t
svn_revnum_t rev,
apr_pool_t *pool)
{
- svn_error_t *err;
- fs_fs_data_t *ffd = fs->fsap_data;
-
- err = revision_proplist(proplist_p, fs, rev, pool);
- if (err && err->apr_err == SVN_ERR_FS_NO_SUCH_REVISION
- && ffd->format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT)
- {
- /* If a pack is occurring simultaneously, the min-unpacked-revprop value
- could change, so reload it and then attempt to fetch these revprops
- again. */
- svn_error_clear(err);
- SVN_ERR(update_min_unpacked_revprop(fs, pool));
- SVN_ERR(revision_proplist(proplist_p, fs, rev, pool));
- }
- else if (err)
- return svn_error_trace(err);
+ SVN_ERR(revision_proplist(proplist_p, fs, rev, pool));
return SVN_NO_ERROR;
}
@@ -3249,8 +3132,10 @@ create_rep_state(struct rep_state **rep_
### going to jump straight to this comment anyway! */
return svn_error_createf(SVN_ERR_FS_CORRUPT, err,
"Corrupt representation '%s'",
- representation_string(rep, ffd->format, TRUE,
- pool));
+ rep
+ ? representation_string(rep, ffd->format, TRUE,
+ pool)
+ : "(null)");
}
/* ### Call representation_string() ? */
return svn_error_trace(err);
@@ -5448,7 +5333,7 @@ write_change_entry(apr_file_t *file,
if (include_node_kind)
{
- assert(change->node_kind == svn_node_dir
+ SVN_ERR_ASSERT(change->node_kind == svn_node_dir
|| change->node_kind == svn_node_file);
kind_string = apr_psprintf(pool, "-%s",
change->node_kind == svn_node_dir
@@ -6475,24 +6360,26 @@ commit_body(void *baton, apr_pool_t *poo
fails because the shard already existed for some reason. */
if (ffd->max_files_per_dir && new_rev % ffd->max_files_per_dir == 0)
{
- svn_error_t *err;
- const char *new_dir = path_rev_shard(cb->fs, new_rev, pool);
- err = svn_io_dir_make(new_dir, APR_OS_DEFAULT, pool);
- if (err && !APR_STATUS_IS_EEXIST(err->apr_err))
- return svn_error_trace(err);
- svn_error_clear(err);
- SVN_ERR(svn_io_copy_perms(svn_dirent_join(cb->fs->path,
- PATH_REVS_DIR,
- pool),
- new_dir, pool));
+ if (1)
+ {
+ const char *new_dir = path_rev_shard(cb->fs, new_rev, pool);
+ svn_error_t *err = svn_io_dir_make(new_dir, APR_OS_DEFAULT, pool);
+ if (err && !APR_STATUS_IS_EEXIST(err->apr_err))
+ return svn_error_trace(err);
+ svn_error_clear(err);
+ SVN_ERR(svn_io_copy_perms(svn_dirent_join(cb->fs->path,
+ PATH_REVS_DIR,
+ pool),
+ new_dir, pool));
+ }
- if (ffd->format < SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT ||
- new_rev >= ffd->min_unpacked_revprop)
+ /* Create the revprops shard. */
+ SVN_ERR_ASSERT(! is_packed_revprop(cb->fs, new_rev));
{
- new_dir = path_revprops_shard(cb->fs, new_rev, pool);
- err = svn_io_dir_make(new_dir, APR_OS_DEFAULT, pool);
+ const char *new_dir = path_revprops_shard(cb->fs, new_rev, pool);
+ svn_error_t *err = svn_io_dir_make(new_dir, APR_OS_DEFAULT, pool);
if (err && !APR_STATUS_IS_EEXIST(err->apr_err))
- SVN_ERR(err);
+ return svn_error_trace(err);
svn_error_clear(err);
SVN_ERR(svn_io_copy_perms(svn_dirent_join(cb->fs->path,
PATH_REVPROPS_DIR,
@@ -6522,29 +6409,12 @@ commit_body(void *baton, apr_pool_t *poo
SVN_ERR(svn_fs_fs__change_txn_prop(cb->txn, SVN_PROP_REVISION_DATE,
&date, pool));
- if (ffd->format < SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT ||
- new_rev >= ffd->min_unpacked_revprop)
- {
- /* Move the revprops file into place. */
- revprop_filename = path_txn_props(cb->fs, cb->txn->id, pool);
- final_revprop = path_revprops(cb->fs, new_rev, pool);
- SVN_ERR(move_into_place(revprop_filename, final_revprop,
- old_rev_filename, pool));
- }
- else
- {
- /* Read the revprops, and commit them to the permenant sqlite db. */
- apr_hash_t *proplist = apr_hash_make(pool);
- svn_sqlite__stmt_t *stmt;
-
- SVN_ERR(get_txn_proplist(proplist, cb->fs, cb->txn->id, pool));
-
- SVN_ERR(svn_sqlite__get_statement(&stmt, ffd->revprop_db,
- STMT_SET_REVPROP));
- SVN_ERR(svn_sqlite__bind_int64(stmt, 1, new_rev));
- SVN_ERR(svn_sqlite__bind_properties(stmt, 2, proplist, pool));
- SVN_ERR(svn_sqlite__insert(NULL, stmt));
- }
+ /* Move the revprops file into place. */
+ SVN_ERR_ASSERT(! is_packed_revprop(cb->fs, new_rev));
+ revprop_filename = path_txn_props(cb->fs, cb->txn->id, pool);
+ final_revprop = path_revprops(cb->fs, new_rev, pool);
+ SVN_ERR(move_into_place(revprop_filename, final_revprop,
+ old_rev_filename, pool));
/* Update the 'current' file. */
SVN_ERR(write_final_current(cb->fs, cb->txn->id, new_rev, start_node_id,
@@ -6717,9 +6587,6 @@ svn_fs_fs__create(svn_fs_t *fs,
else if (apr_hash_get(fs->config, SVN_FS_CONFIG_PRE_1_6_COMPATIBLE,
APR_HASH_KEY_STRING))
format = 3;
- else if (apr_hash_get(fs->config, SVN_FS_CONFIG_PRE_1_7_COMPATIBLE,
- APR_HASH_KEY_STRING))
- format = 4;
}
ffd->format = format;
@@ -6745,12 +6612,6 @@ svn_fs_fs__create(svn_fs_t *fs,
pool),
pool));
- /* Write the min unpacked revprop file, and create the database. */
- if (format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT)
- {
- SVN_ERR(create_packed_revprops_db(&ffd->revprop_db, fs, fs->pool, pool));
- }
-
/* Create the transaction directory. */
SVN_ERR(svn_io_make_dir_recursively(svn_dirent_join(path, PATH_TXNS_DIR,
pool),
@@ -7020,12 +6881,12 @@ recover_find_max_ids(svn_fs_t *fs, svn_r
if (svn_fs_fs__key_compare(node_id, max_node_id) > 0)
{
- assert(strlen(node_id) < MAX_KEY_SIZE);
+ SVN_ERR_ASSERT(strlen(node_id) < MAX_KEY_SIZE);
apr_cpystrn(max_node_id, node_id, MAX_KEY_SIZE);
}
if (svn_fs_fs__key_compare(copy_id, max_copy_id) > 0)
{
- assert(strlen(copy_id) < MAX_KEY_SIZE);
+ SVN_ERR_ASSERT(strlen(copy_id) < MAX_KEY_SIZE);
apr_cpystrn(max_copy_id, copy_id, MAX_KEY_SIZE);
}
@@ -7154,25 +7015,7 @@ recover_body(void *baton, apr_pool_t *po
&youngest_revprops_kind, pool));
if (youngest_revprops_kind == svn_node_none)
{
- svn_boolean_t uhohs = TRUE;
-
- /* No file? Hrm... maybe that's because this repository is
- packed and the youngest revision is in the revprops.db
- file? We can at least see if that's a possibility.
-
- ### TODO: Could we check for revprops in the revprops.db?
- ### What if rNNN legitimately has no revprops? */
- if (ffd->format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT)
- {
- svn_revnum_t min_unpacked_revprop;
-
- SVN_ERR(read_min_unpacked_rev(&min_unpacked_revprop,
- path_min_unpacked_revprop(fs, pool),
- pool));
- if (min_unpacked_revprop == (max_rev + 1))
- uhohs = FALSE;
- }
- if (uhohs)
+ if (1)
{
return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
_("Revision %ld has a revs file but no "
@@ -7834,69 +7677,6 @@ pack_shard(const char *revs_dir,
return SVN_NO_ERROR;
}
-static svn_error_t *
-pack_revprop_shard(svn_fs_t *fs,
- const char *revprops_dir,
- const char *fs_path,
- apr_int64_t shard,
- int max_files_per_dir,
- svn_fs_pack_notify_t notify_func,
- void *notify_baton,
- svn_cancel_func_t cancel_func,
- void *cancel_baton,
- apr_pool_t *pool)
-{
- fs_fs_data_t *ffd = fs->fsap_data;
- const char *shard_path;
- svn_revnum_t start_rev, end_rev, rev;
- svn_sqlite__stmt_t *stmt;
- apr_pool_t *iterpool;
-
- shard_path = svn_dirent_join(revprops_dir,
- apr_psprintf(pool, "%" APR_INT64_T_FMT, shard),
- pool);
-
- /* Notify caller we're starting to pack this shard. */
- if (notify_func)
- SVN_ERR(notify_func(notify_baton, shard, svn_fs_pack_notify_start_revprop,
- pool));
-
- start_rev = (svn_revnum_t) (shard * max_files_per_dir);
- end_rev = (svn_revnum_t) ((shard + 1) * (max_files_per_dir) - 1);
- iterpool = svn_pool_create(pool);
-
- /* Iterate over the revisions in this shard, squashing them together. */
- SVN_ERR(svn_sqlite__get_statement(&stmt, ffd->revprop_db, STMT_SET_REVPROP));
- for (rev = start_rev; rev <= end_rev; rev++)
- {
- apr_hash_t *proplist;
- svn_pool_clear(iterpool);
-
- SVN_ERR(svn_fs_fs__revision_proplist(&proplist, fs, rev, iterpool));
- SVN_ERR(svn_sqlite__bind_int64(stmt, 1, rev));
- SVN_ERR(svn_sqlite__bind_properties(stmt, 2, proplist, pool));
- SVN_ERR(svn_sqlite__insert(NULL, stmt));
- }
-
- /* Update the min-unpacked-revprop file to reflect our newly packed shard.
- * (This doesn't update ffd->min_unpacked_revprop.) */
- SVN_ERR(write_revnum_file(fs_path, PATH_MIN_UNPACKED_REVPROP,
- (svn_revnum_t)((shard + 1) * max_files_per_dir),
- iterpool));
- svn_pool_destroy(iterpool);
-
- /* Finally, remove the existing shard directory. */
- SVN_ERR(svn_io_remove_dir2(shard_path, TRUE, cancel_func, cancel_baton,
- pool));
-
- /* Notify caller we're starting to pack this shard. */
- if (notify_func)
- SVN_ERR(notify_func(notify_baton, shard, svn_fs_pack_notify_end_revprop,
- pool));
-
- return SVN_NO_ERROR;
-}
-
struct pack_baton
{
svn_fs_t *fs;
@@ -7932,12 +7712,12 @@ pack_body(void *baton,
apr_int64_t i;
svn_revnum_t youngest;
apr_pool_t *iterpool;
- const char *data_path, *revprops_path;
+ const char *data_path;
svn_revnum_t min_unpacked_rev;
- svn_revnum_t min_unpacked_revprop;
SVN_ERR(read_format(&format, &max_files_per_dir, path_format(pb->fs, pool),
pool));
+ SVN_ERR(check_format(format));
/* If the repository isn't a new enough format, we don't support packing.
Return a friendly error to that effect. */
@@ -7954,27 +7734,14 @@ pack_body(void *baton,
path_min_unpacked_rev(pb->fs, pool),
pool));
- if (format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT)
- {
- SVN_ERR(read_min_unpacked_rev(&min_unpacked_revprop,
- path_min_unpacked_revprop(pb->fs, pool),
- pool));
- }
- else
- {
- min_unpacked_revprop = 0;
- }
-
SVN_ERR(get_youngest(&youngest, pb->fs->path, pool));
completed_shards = (youngest + 1) / max_files_per_dir;
/* See if we've already completed all possible shards thus far. */
- if (min_unpacked_rev == (completed_shards * max_files_per_dir) &&
- min_unpacked_revprop == (completed_shards * max_files_per_dir))
+ if (min_unpacked_rev == (completed_shards * max_files_per_dir))
return SVN_NO_ERROR;
data_path = svn_dirent_join(pb->fs->path, PATH_REVS_DIR, pool);
- revprops_path = svn_dirent_join(pb->fs->path, PATH_REVPROPS_DIR, pool);
iterpool = svn_pool_create(pool);
for (i = min_unpacked_rev / max_files_per_dir; i < completed_shards; i++)
@@ -7989,21 +7756,6 @@ pack_body(void *baton,
pb->cancel_func, pb->cancel_baton, iterpool));
}
- if (format >= SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT)
- for (i = min_unpacked_revprop / max_files_per_dir; i < completed_shards; i++)
- {
- svn_pool_clear(iterpool);
-
- if (pb->cancel_func)
- SVN_ERR(pb->cancel_func(pb->cancel_baton));
-
- SVN_ERR(pack_revprop_shard(pb->fs,
- revprops_path, pb->fs->path, i,
- max_files_per_dir,
- pb->notify_func, pb->notify_baton,
- pb->cancel_func, pb->cancel_baton, iterpool));
- }
-
svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}
@@ -8024,3 +7776,42 @@ svn_fs_fs__pack(svn_fs_t *fs,
pb.cancel_baton = cancel_baton;
return svn_fs_fs__with_write_lock(fs, pack_body, &pb, pool);
}
+
+
+/** Verifying. **/
+
+/* Body of svn_fs_fs__verify().
+ Implements svn_fs_fs__walk_rep_reference().walker. */
+static svn_error_t *
+verify_walker(representation_t *rep,
+ void *baton,
+ svn_fs_t *fs,
+ apr_pool_t *scratch_pool)
+{
+ struct rep_state *rs;
+ struct rep_args *rep_args;
+
+ /* ### Should this be using read_rep_line() directly? */
+ SVN_ERR(create_rep_state(&rs, &rep_args, rep, fs, scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_fs_fs__verify(svn_fs_t *fs,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool)
+{
+ fs_fs_data_t *ffd = fs->fsap_data;
+
+ if (ffd->format < SVN_FS_FS__MIN_REP_SHARING_FORMAT)
+ return SVN_NO_ERROR;
+
+ /* Don't take any lock. */
+ SVN_ERR(svn_fs_fs__walk_rep_reference(fs, verify_walker, NULL,
+ cancel_func, cancel_baton,
+ pool));
+
+ return SVN_NO_ERROR;
+}
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/fs_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/fs_fs.h?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/fs_fs.h (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/fs_fs.h Tue Jul 19 23:05:44 2011
@@ -38,6 +38,12 @@ svn_error_t *svn_fs_fs__open(svn_fs_t *f
svn_error_t *svn_fs_fs__upgrade(svn_fs_t *fs,
apr_pool_t *pool);
+/* Verify the fsfs filesystem FS. Use POOL for temporary allocations. */
+svn_error_t *svn_fs_fs__verify(svn_fs_t *fs,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool);
+
/* Copy the fsfs filesystem at SRC_PATH into a new copy at DST_PATH.
Use POOL for temporary allocations. */
svn_error_t *svn_fs_fs__hotcopy(const char *src_path,
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/id.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/id.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/id.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/id.c Tue Jul 19 23:05:44 2011
@@ -337,7 +337,7 @@ serialize_id_private(svn_temp_serializer
svn_temp_serializer__pop(context);
}
-/* Serialize an ID within the serialization CONTECT.
+/* Serialize an ID within the serialization CONTEXT.
*/
void
svn_fs_fs__id_serialize(svn_temp_serializer__context_t *context,
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/rep-cache-db.sql
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/rep-cache-db.sql?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/rep-cache-db.sql (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/rep-cache-db.sql Tue Jul 19 23:05:44 2011
@@ -45,3 +45,10 @@ WHERE hash = ?1
-- STMT_SET_REP
INSERT OR FAIL INTO rep_cache (hash, revision, offset, size, expanded_size)
VALUES (?1, ?2, ?3, ?4, ?5)
+
+
+-- STMT_GET_ALL_REPS
+SELECT hash, revision, offset, size, expanded_size
+FROM rep_cache
+
+
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/rep-cache.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/rep-cache.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/rep-cache.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/rep-cache.c Tue Jul 19 23:05:44 2011
@@ -20,6 +20,8 @@
* ====================================================================
*/
+#include "svn_pools.h"
+
#include "svn_private_config.h"
#include "fs_fs.h"
@@ -39,6 +41,45 @@
REP_CACHE_DB_SQL_DECLARE_STATEMENTS(statements);
+
+/** Helper functions. **/
+
+
+/* Check that REP refers to a revision that exists in FS. */
+static svn_error_t *
+rep_has_been_born(representation_t *rep,
+ svn_fs_t *fs,
+ apr_pool_t *pool)
+{
+ fs_fs_data_t *ffd = fs->fsap_data;
+ svn_revnum_t youngest;
+
+ SVN_ERR_ASSERT(rep);
+
+ youngest = ffd->youngest_rev_cache;
+ if (youngest < rep->revision)
+ {
+ /* Stale cache. */
+ SVN_ERR(svn_fs_fs__youngest_rev(&youngest, fs, pool));
+
+ /* Fresh cache. */
+ if (youngest < rep->revision)
+ return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
+ _("Youngest revision is r%ld, but "
+ "rep-cache contains r%ld"),
+ youngest, rep->revision);
+ }
+
+ return SVN_NO_ERROR;
+}
+
+
+
+/** Library-private API's. **/
+
+/* Body of svn_fs_fs__open_rep_cache().
+ Implements svn_atomic__init_once().init_func.
+ */
static svn_error_t *
open_rep_cache(void *baton,
apr_pool_t *pool)
@@ -78,6 +119,77 @@ svn_fs_fs__open_rep_cache(svn_fs_t *fs,
return svn_error_quick_wrap(err, _("Couldn't open rep-cache database"));
}
+svn_error_t *
+svn_fs_fs__walk_rep_reference(svn_fs_t *fs,
+ svn_error_t *(*walker)(representation_t *,
+ void *,
+ svn_fs_t *,
+ apr_pool_t *),
+ void *walker_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool)
+{
+ fs_fs_data_t *ffd = fs->fsap_data;
+ svn_sqlite__stmt_t *stmt;
+ svn_boolean_t have_row;
+ int iterations = 0;
+
+ apr_pool_t *iterpool = svn_pool_create(pool);
+
+ /* Don't check ffd->rep_sharing_allowed. */
+ SVN_ERR_ASSERT(ffd->format >= SVN_FS_FS__MIN_REP_SHARING_FORMAT);
+
+ if (! ffd->rep_cache_db)
+ SVN_ERR(svn_fs_fs__open_rep_cache(fs, pool));
+
+ /* Get the statement. (There are no arguments to bind.) */
+ SVN_ERR(svn_sqlite__get_statement(&stmt, ffd->rep_cache_db,
+ STMT_GET_ALL_REPS));
+
+ /* Walk the cache entries. */
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+ while (have_row)
+ {
+ representation_t *rep;
+ const char *sha1_digest;
+
+ /* Clear ITERPOOL occasionally. */
+ if (iterations++ % 16 == 0)
+ svn_pool_clear(iterpool);
+
+ /* Check for cancellation. */
+ if (cancel_func)
+ SVN_ERR(cancel_func(cancel_baton));
+
+ /* Construct a representation_t. */
+ rep = apr_pcalloc(iterpool, sizeof(*rep));
+ sha1_digest = svn_sqlite__column_text(stmt, 0, iterpool);
+ SVN_ERR(svn_checksum_parse_hex(&rep->sha1_checksum,
+ svn_checksum_sha1, sha1_digest,
+ iterpool));
+ rep->revision = svn_sqlite__column_revnum(stmt, 1);
+ rep->offset = svn_sqlite__column_int64(stmt, 2);
+ rep->size = svn_sqlite__column_int64(stmt, 3);
+ rep->expanded_size = svn_sqlite__column_int64(stmt, 4);
+
+ /* Sanity check. */
+ if (rep)
+ SVN_ERR(rep_has_been_born(rep, fs, iterpool));
+
+ /* Walk. */
+ SVN_ERR(walker(rep, walker_baton, fs, iterpool));
+
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+ }
+
+ SVN_ERR(svn_sqlite__reset(stmt));
+ svn_pool_destroy(iterpool);
+
+ return SVN_NO_ERROR;
+}
+
+
/* This function's caller ignores most errors it returns.
If you extend this function, check the callsite to see if you have
to make it not-ignore additional error codes. */
@@ -118,25 +230,8 @@ svn_fs_fs__get_rep_reference(representat
else
*rep = NULL;
- /* Sanity check. */
if (*rep)
- {
- svn_revnum_t youngest;
-
- youngest = ffd->youngest_rev_cache;
- if (youngest < (*rep)->revision)
- {
- /* Stale cache. */
- SVN_ERR(svn_fs_fs__youngest_rev(&youngest, fs, pool));
-
- /* Fresh cache. */
- if (youngest < (*rep)->revision)
- return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
- _("Youngest revision is r%ld, but "
- "rep-cache contains r%ld"),
- youngest, (*rep)->revision);
- }
- }
+ SVN_ERR(rep_has_been_born(*rep, fs, pool));
return svn_sqlite__reset(stmt);
}
@@ -148,7 +243,6 @@ svn_fs_fs__set_rep_reference(svn_fs_t *f
apr_pool_t *pool)
{
fs_fs_data_t *ffd = fs->fsap_data;
- representation_t *old_rep;
svn_sqlite__stmt_t *stmt;
svn_error_t *err;
@@ -173,6 +267,8 @@ svn_fs_fs__set_rep_reference(svn_fs_t *f
err = svn_sqlite__insert(NULL, stmt);
if (err)
{
+ representation_t *old_rep;
+
if (err->apr_err != SVN_ERR_SQLITE_CONSTRAINT)
return svn_error_trace(err);
@@ -207,10 +303,12 @@ svn_fs_fs__set_rep_reference(svn_fs_t *f
else
return SVN_NO_ERROR;
}
-
- /* Something really odd at this point, we failed to insert the
- checksum AND failed to read an existing checksum. Do we need
- to flag this? */
+ else
+ {
+ /* Something really odd at this point, we failed to insert the
+ checksum AND failed to read an existing checksum. Do we need
+ to flag this? */
+ }
}
return SVN_NO_ERROR;
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/rep-cache.h
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/rep-cache.h?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/rep-cache.h (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/rep-cache.h Tue Jul 19 23:05:44 2011
@@ -40,6 +40,18 @@ svn_error_t *
svn_fs_fs__open_rep_cache(svn_fs_t *fs,
apr_pool_t *pool);
+/* Iterate all representations currently in FS's cache. */
+svn_error_t *
+svn_fs_fs__walk_rep_reference(svn_fs_t *fs,
+ svn_error_t *(*walker)(representation_t *rep,
+ void *walker_baton,
+ svn_fs_t *fs,
+ apr_pool_t *scratch_pool),
+ void *walker_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool);
+
/* Return the representation REP in FS which has fulltext CHECKSUM.
REP is allocated in POOL. If the rep cache database has not been
opened, just set *REP to NULL. */
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/structure
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/structure?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/structure (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/structure Tue Jul 19 23:05:44 2011
@@ -34,12 +34,13 @@ repository) is:
revs/ Subdirectory containing revs
<shard>/ Shard directory, if sharding is in use (see below)
<revnum> File containing rev <revnum>
- <shard>.pack Pack directory, if the repo has been packed (see below)
+ <shard>.pack/ Pack directory, if the repo has been packed (see below)
pack Pack file, if the repository has been packed (see below)
manifest Pack manifest file, if a pack file exists (see below)
revprops/ Subdirectory containing rev-props
<shard>/ Shard directory, if sharding is in use (see below)
<revnum> File containing rev-props for <revnum>
+ revprops.db SQLite database of the packed revision properties
transactions/ Subdirectory containing transactions
<txnid>.txn/ Directory containing transaction <txnid>
txn-protorevs/ Subdirectory containing transaction proto-revision files
@@ -61,7 +62,6 @@ repository) is:
min-unpacked-rev File containing the oldest revision not in a pack file
min-unpacked-revprop File containing the oldest revision of unpacked revprop
rep-cache.db SQLite database mapping rep checksums to locations
- revprops.db SQLite database of the packed revision properties
Files in the revprops directory are in the hash dump format used by
svn_hash_write.
@@ -102,8 +102,10 @@ When representation sharing is enabled,
representation checksum and location mappings using a SQLite database in
"rep-cache.db". The database has a single table, which stores the sha1
hash text as the primary key, mapped to the representation revision, offset,
-size and expanded size. This file is not required, and may be removed at an
-abritrary time, with the subsequent loss of rep-sharing capabilities.
+size and expanded size. This file is only consulted during writes and never
+during reads. Consequently, it is not required, and may be removed at an
+abritrary time, with the subsequent loss of rep-sharing capabilities for
+revisions written thereafter.
Filesystem formats
------------------
@@ -131,45 +133,47 @@ The formats are:
Format 2, understood by Subversion 1.4+
Format 3, understood by Subversion 1.5+
Format 4, understood by Subversion 1.6+
- Format 5, understood by Subversion 1.7+
+ Format 5, understood by Subversion 1.7-dev, never released
The differences between the formats are:
Delta representation in revision files
Format 1: svndiff0 only
- Formats 2-5: svndiff0 or svndiff1
+ Formats 2+: svndiff0 or svndiff1
Format options
Formats 1-2: none permitted
- Format 3-5: "layout" option
+ Format 3+: "layout" option
Transaction name reuse
Formats 1-2: transaction names may be reused
- Format 3-5: transaction names generated using txn-current file
+ Format 3+: transaction names generated using txn-current file
Location of proto-rev file and its lock
Formats 1-2: transactions/<txnid>/rev and
transactions/<txnid>/rev-lock.
- Format 3-5: txn-protorevs/<txnid>.rev and
+ Format 3+: txn-protorevs/<txnid>.rev and
txn-protorevs/<txnid>.rev-lock.
Node-ID and copy-ID generation
Formats 1-2: Node-IDs and copy-IDs are guaranteed to form a
monotonically increasing base36 sequence using the "current"
file.
- Format 3-5: Node-IDs and copy-IDs use the new revision number to
+ Format 3+: Node-IDs and copy-IDs use the new revision number to
ensure uniqueness and the "current" file just contains the
youngest revision.
Mergeinfo metadata:
Format 1-2: minfo-here and minfo-count node-revision fields are not
stored. svn_fs_get_mergeinfo returns an error.
- Format 3-5: minfo-here and minfo-count node-revision fields are
+ Format 3+: minfo-here and minfo-count node-revision fields are
maintained. svn_fs_get_mergeinfo works.
Revision changed paths list:
Format 1-3: Does not contain the node's kind.
- Format 4-5: Contains the node's kind.
+ Format 4+: Contains the node's kind.
+
+# Incomplete list. See SVN_FS_FS__MIN_*_FORMAT
Filesystem format options
@@ -205,10 +209,10 @@ The known layouts, and the parameters th
revs/0/ directory will contain revisions 0-999, revs/1/ will contain
1000-1999, and so on.
-Packing
--------
+Packing revisions
+-----------------
-A repository can optionally be "packed" to conserve space on disk. The
+A filesystem can optionally be "packed" to conserve space on disk. The
packing process concatenates all the revision files in each full shard to
create pack files. A manifest file is also created for each shard which
records the indexes of the corresponding revision files in the pack file.
@@ -219,6 +223,15 @@ The manifest file consists of a list of
pack file. The offsets are stored as ASCII decimal, and separated by a newline
character.
+Packing revision properties (format 5: SQLite)
+---------------------------
+
+This was supported by 1.7-dev builds but never included in a blessed release.
+
+See r1143829 of this file:
+http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/structure?view=markup&pathrev=1143829
+
+
Node-revision IDs
-----------------
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/temp_serializer.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/temp_serializer.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/temp_serializer.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/temp_serializer.c Tue Jul 19 23:05:44 2011
@@ -719,7 +719,7 @@ svn_fs_fs__get_sharded_offset(void **out
apr_off_t *manifest = (apr_off_t *)data;
apr_int64_t shard_pos = *(apr_int64_t *)baton;
- *(apr_int64_t *)out = manifest[shard_pos];
+ *(apr_off_t *)out = manifest[shard_pos];
return SVN_NO_ERROR;
}
Propchange: subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/temp_serializer.c
('svn:mergeinfo' removed)
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/temp_serializer.h
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/temp_serializer.h?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/temp_serializer.h (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/temp_serializer.h Tue Jul 19 23:05:44 2011
@@ -93,8 +93,8 @@ svn_fs_fs__deserialize_txdelta_window(vo
apr_pool_t *pool);
/**
- * Implements #svn_cache__serialize_func_t for manifests
- * (#apr_array_header_t).
+ * Implements #svn_cache__serialize_func_t for a manifest
+ * (@a in is an #apr_array_header_t of apr_off_t elements).
*/
svn_error_t *
svn_fs_fs__serialize_manifest(char **data,
@@ -103,8 +103,8 @@ svn_fs_fs__serialize_manifest(char **dat
apr_pool_t *pool);
/**
- * Implements #svn_cache__deserialize_func_t for manifests
- * (#apr_array_header_t).
+ * Implements #svn_cache__deserialize_func_t for a manifest
+ * (@a *out is an #apr_array_header_t of apr_off_t elements).
*/
svn_error_t *
svn_fs_fs__deserialize_manifest(void **out,
@@ -167,9 +167,9 @@ svn_fs_fs__deserialize_dir_entries(void
apr_pool_t *pool);
/**
- * Implements #svn_cache__partial_getter_func_t for a single element
- * identified by its offset in @a baton within a serialized manifest array.
- */
+ * Implements #svn_cache__partial_getter_func_t. Set (apr_off_t) @a *out
+ * to the element indexed by (apr_int64_t) @a *baton within the
+ * serialized manifest array @a data and @a data_len. */
svn_error_t *
svn_fs_fs__get_sharded_offset(void **out,
const char *data,
@@ -180,7 +180,7 @@ svn_fs_fs__get_sharded_offset(void **out
/**
* Implements #svn_cache__partial_getter_func_t for a single
* #svn_fs_dirent_t within a serialized directory contents hash,
- * identified by its name in @a baton.
+ * identified by its name (const char @a *baton).
*/
svn_error_t *
svn_fs_fs__extract_dir_entry(void **out,
Propchange: subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/temp_serializer.h
('svn:mergeinfo' removed)
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/tree.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/tree.c Tue Jul 19 23:05:44 2011
@@ -2110,7 +2110,7 @@ fs_copy(svn_fs_root_t *from_root,
apr_pool_t *pool)
{
return svn_error_trace(copy_helper(from_root, from_path, to_root, to_path,
- TRUE, pool));
+ TRUE, pool));
}
@@ -2127,7 +2127,7 @@ fs_revision_link(svn_fs_root_t *from_roo
return SVN_FS__NOT_TXN(to_root);
return svn_error_trace(copy_helper(from_root, path, to_root, path,
- FALSE, pool));
+ FALSE, pool));
}
@@ -3105,7 +3105,6 @@ history_prev(void *baton, apr_pool_t *po
dag_node_t *node;
svn_fs_root_t *root;
svn_boolean_t reported = fhd->is_interesting;
- svn_boolean_t retry = FALSE;
svn_revnum_t copyroot_rev;
const char *copyroot_path;
@@ -3224,6 +3223,8 @@ history_prev(void *baton, apr_pool_t *po
'copy-style' history object. */
if (src_path && SVN_IS_VALID_REVNUM(src_rev))
{
+ svn_boolean_t retry = FALSE;
+
/* It's possible for us to find a copy location that is the same
as the history point we've just reported. If that happens,
we simply need to take another trip through this history
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra/deprecated.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra/deprecated.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra/deprecated.c Tue Jul 19 23:05:44 2011
@@ -426,10 +426,8 @@ svn_error_t *svn_ra_get_mergeinfo(svn_ra
svn_boolean_t include_descendants,
apr_pool_t *pool)
{
- svn_boolean_t validate_inherited_mergeinfo = FALSE;
-
return svn_error_trace(svn_ra_get_mergeinfo2(session, catalog, paths,
- revision, inherit, &validate_inherited_mergeinfo,
+ revision, inherit, FALSE,
include_descendants, pool));
}
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra/ra_loader.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra/ra_loader.c Tue Jul 19 23:05:44 2011
@@ -201,14 +201,13 @@ load_ra_module(svn_ra__init_func_t *func
return SVN_NO_ERROR;
}
-/* If DEFN may support URL, return the scheme. Else, return NULL. */
+/* If SCHEMES contains URL, return the scheme. Else, return NULL. */
static const char *
-has_scheme_of(const struct ra_lib_defn *defn, const char *url)
+has_scheme_of(const char * const *schemes, const char *url)
{
- const char * const *schemes;
apr_size_t len;
- for (schemes = defn->schemes; *schemes != NULL; ++schemes)
+ for ( ; *schemes != NULL; ++schemes)
{
const char *scheme = *schemes;
len = strlen(scheme);
@@ -454,7 +453,7 @@ svn_error_t *svn_ra_open4(svn_ra_session
{
const char *scheme;
- if ((scheme = has_scheme_of(defn, repos_URL)))
+ if ((scheme = has_scheme_of(defn->schemes, repos_URL)))
{
svn_ra__init_func_t initfunc = defn->initfunc;
@@ -475,6 +474,11 @@ svn_error_t *svn_ra_open4(svn_ra_session
SVN_ERR(check_ra_version(vtable->get_version(), scheme));
+ if (! has_scheme_of(vtable->get_schemes(sesspool), repos_URL))
+ /* Library doesn't support the scheme at runtime. */
+ continue;
+
+
break;
}
}
@@ -771,7 +775,7 @@ svn_error_t *svn_ra_get_mergeinfo2(svn_r
const apr_array_header_t *paths,
svn_revnum_t revision,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t *validate_inherited_mergeinfo,
+ svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool)
{
@@ -1332,7 +1336,7 @@ svn_ra_get_ra_library(svn_ra_plugin_t **
for (defn = ra_libraries; defn->ra_name != NULL; ++defn)
{
const char *scheme;
- if ((scheme = has_scheme_of(defn, url)))
+ if ((scheme = has_scheme_of(defn->schemes, url)))
{
svn_ra_init_func_t compat_initfunc = defn->compat_initfunc;
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra/ra_loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra/ra_loader.h?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra/ra_loader.h (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra/ra_loader.h Tue Jul 19 23:05:44 2011
@@ -131,7 +131,7 @@ typedef struct svn_ra__vtable_t {
const apr_array_header_t *paths,
svn_revnum_t revision,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t *validate_inherited_mergeinfo,
+ svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_merged_revisions,
apr_pool_t *pool);
/* See svn_ra_do_update2(). */
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_local/ra_plugin.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_local/ra_plugin.c Tue Jul 19 23:05:44 2011
@@ -238,6 +238,15 @@ static const svn_ra_reporter3_t ra_local
};
+/* ...
+ *
+ * Wrap a cancellation editor using SESSION's cancellation function around
+ * the supplied EDITOR. ### Some callers (via svn_ra_do_update2() etc.)
+ * don't appear to know that we do this, and are supplying an editor that
+ * they have already wrapped with the same cancellation editor, so it ends
+ * up double-wrapped.
+ *
+ * ... */
static svn_error_t *
make_reporter(svn_ra_session_t *session,
const svn_ra_reporter3_t **reporter,
@@ -256,7 +265,6 @@ make_reporter(svn_ra_session_t *session,
svn_ra_local__session_baton_t *sess = session->priv;
void *rbaton;
const char *other_fs_path = NULL;
- const char *repos_url_decoded;
/* Get the HEAD revision if one is not supplied. */
if (! SVN_IS_VALID_REVNUM(revision))
@@ -266,22 +274,19 @@ make_reporter(svn_ra_session_t *session,
regular filesystem path. */
if (other_url)
{
- size_t repos_url_len;
-
- other_url = svn_path_uri_decode(other_url, pool);
- repos_url_decoded = svn_path_uri_decode(sess->repos_url, pool);
- repos_url_len = strlen(repos_url_decoded);
+ const char *other_relpath
+ = svn_uri_skip_ancestor(sess->repos_url, other_url, pool);
/* Sanity check: the other_url better be in the same repository as
the original session url! */
- if (strncmp(other_url, repos_url_decoded, repos_url_len) != 0)
+ if (! other_relpath)
return svn_error_createf
(SVN_ERR_RA_ILLEGAL_URL, NULL,
_("'%s'\n"
"is not the same repository as\n"
"'%s'"), other_url, sess->repos_url);
- other_fs_path = other_url + repos_url_len;
+ other_fs_path = apr_pstrcat(pool, "/", other_relpath, (char *)NULL);
}
/* Pass back our reporter */
@@ -700,7 +705,7 @@ svn_ra_local__get_mergeinfo(svn_ra_sessi
const apr_array_header_t *paths,
svn_revnum_t revision,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t *validate_inherited_mergeinfo,
+ svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool)
{
@@ -719,7 +724,7 @@ svn_ra_local__get_mergeinfo(svn_ra_sessi
SVN_ERR(svn_repos_fs_get_mergeinfo2(&tmp_catalog, sess->repos, abs_paths,
revision, inherit,
- *validate_inherited_mergeinfo,
+ validate_inherited_mergeinfo,
include_descendants,
NULL, NULL, pool));
if (apr_hash_count(tmp_catalog) > 0)
@@ -1422,7 +1427,9 @@ svn_ra_local__has_capability(svn_ra_sess
{
*has = TRUE;
}
- else if (strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
+ else if ((strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
+ || (strcmp(capability,
+ SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO) == 0))
{
/* With mergeinfo, the code's capabilities may not reflect the
repository's, so inquire further. */
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/commit.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/commit.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/commit.c Tue Jul 19 23:05:44 2011
@@ -603,11 +603,11 @@ static svn_error_t * do_proppatch(resour
apr_psprintf(pool, "(<%s>)", rb->token));
return svn_error_trace(svn_ra_neon__do_proppatch(rb->cc->ras,
- proppatch_target,
- rb->prop_changes,
- rb->prop_deletes,
- NULL, extra_headers,
- pool));
+ proppatch_target,
+ rb->prop_changes,
+ rb->prop_deletes,
+ NULL, extra_headers,
+ pool));
}
@@ -710,8 +710,8 @@ apply_revprops(commit_ctx_t *cc,
}
return svn_error_trace(svn_ra_neon__do_proppatch(cc->ras, proppatch_url,
- cc->revprop_table,
- NULL, NULL, NULL, pool));
+ cc->revprop_table,
+ NULL, NULL, NULL, pool));
}
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/fetch.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/fetch.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/fetch.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/fetch.c Tue Jul 19 23:05:44 2011
@@ -249,27 +249,6 @@ static svn_error_t *simple_store_vsn_url
return NULL;
}
-static svn_error_t *get_delta_base(const char **delta_base,
- const char *relpath,
- svn_ra_get_wc_prop_func_t get_wc_prop,
- void *cb_baton,
- apr_pool_t *pool)
-{
- const svn_string_t *value;
-
- if (relpath == NULL || get_wc_prop == NULL)
- {
- *delta_base = NULL;
- return SVN_NO_ERROR;
- }
-
- SVN_ERR((*get_wc_prop)(cb_baton, relpath, SVN_RA_NEON__LP_VSN_URL,
- &value, pool));
-
- *delta_base = value ? value->data : NULL;
- return SVN_NO_ERROR;
-}
-
/* helper func which maps certain DAV: properties to svn:wc:
properties. Used during checkouts and updates. */
static svn_error_t *set_special_wc_prop(const char *key,
@@ -355,7 +334,7 @@ static svn_error_t *add_props(apr_hash_t
static svn_error_t *custom_get_request(svn_ra_neon__session_t *ras,
const char *url,
- const char *relpath,
+ const char *editor_relpath,
svn_ra_neon__block_reader reader,
void *subctx,
svn_ra_get_wc_prop_func_t get_wc_prop,
@@ -364,21 +343,26 @@ static svn_error_t *custom_get_request(s
apr_pool_t *pool)
{
custom_get_ctx_t cgc = { 0 };
- const char *delta_base;
+ const char *delta_base = NULL;
svn_ra_neon__request_t *request;
svn_error_t *err;
- if (use_base)
+ if (use_base && editor_relpath != NULL)
{
/* See if we can get a version URL for this resource. This will
refer to what we already have in the working copy, thus we
can get a diff against this particular resource. */
- SVN_ERR(get_delta_base(&delta_base, relpath,
- get_wc_prop, cb_baton, pool));
- }
- else
- {
- delta_base = NULL;
+
+ if (get_wc_prop != NULL)
+ {
+ const svn_string_t *value;
+
+ SVN_ERR(get_wc_prop(cb_baton, editor_relpath,
+ SVN_RA_NEON__LP_VSN_URL,
+ &value, pool));
+
+ delta_base = value ? value->data : NULL;
+ }
}
SVN_ERR(svn_ra_neon__request_create(&request, ras, "GET", url, pool));
@@ -2056,8 +2040,7 @@ end_element(void *userdata, int state,
rb->file_baton,
NULL, /* no base checksum in an add */
rb->editor,
- rb->ras->callbacks->get_wc_prop,
- rb->ras->callback_baton,
+ NULL, NULL, /* dav_prop callback */
rb->file_pool));
/* fetch node props as necessary. */
@@ -2290,7 +2273,8 @@ static svn_error_t * reporter_set_path(v
"%s</S:entry>" DEBUG_CR,
revision, depthstring, tokenstring, qpath->data);
- return svn_io_file_write_full(rb->tmpfile, entry, strlen(entry), NULL, pool);
+ return svn_error_trace(svn_io_file_write_full(rb->tmpfile, entry,
+ strlen(entry), NULL, pool));
}
@@ -2343,7 +2327,8 @@ static svn_error_t * reporter_link_path(
revision, depthstring, tokenstring,
qlinkpath->data, qpath->data);
- return svn_io_file_write_full(rb->tmpfile, entry, strlen(entry), NULL, pool);
+ return svn_error_trace(svn_io_file_write_full(rb->tmpfile, entry,
+ strlen(entry), NULL, pool));
}
@@ -2360,7 +2345,8 @@ static svn_error_t * reporter_delete_pat
"<S:missing>%s</S:missing>" DEBUG_CR,
qpath->data);
- return svn_io_file_write_full(rb->tmpfile, s, strlen(s), NULL, pool);
+ return svn_error_trace(svn_io_file_write_full(rb->tmpfile, s, strlen(s),
+ NULL, pool));
}
@@ -2369,7 +2355,7 @@ static svn_error_t * reporter_abort_repo
{
report_baton_t *rb = report_baton;
- (void) apr_file_close(rb->tmpfile);
+ SVN_ERR(svn_io_file_close(rb->tmpfile, pool));
return SVN_NO_ERROR;
}
@@ -2414,8 +2400,10 @@ static svn_error_t * reporter_finish_rep
/* We're done with the file. this should delete it. Note: it
isn't a big deal if this line is never executed -- the pool
will eventually get it. We're just being proactive here. */
- (void) apr_file_close(rb->tmpfile);
- return err;
+ return svn_error_trace(
+ svn_error_compose_create(err,
+ svn_io_file_close(rb->tmpfile,
+ pool)));
}
/* dispatch the REPORT. */
@@ -2429,17 +2417,16 @@ static svn_error_t * reporter_finish_rep
rb->spool_response, pool);
/* We're done with the file. Proactively close/delete the thing. */
- (void) apr_file_close(rb->tmpfile);
-
- SVN_ERR(err);
+ SVN_ERR(svn_error_compose_create(err,
+ svn_io_file_close(rb->tmpfile, pool)));
/* We got the whole HTTP response thing done. *Whew*. Our edit
baton should have been closed by now, so return a failure if it
hasn't been. */
if (rb->edit_baton)
{
- return svn_error_createf
- (SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
+ return svn_error_createf(
+ SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
_("REPORT response handling failed to complete the editor drive"));
}
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/mergeinfo.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/mergeinfo.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/mergeinfo.c Tue Jul 19 23:05:44 2011
@@ -51,7 +51,6 @@ struct mergeinfo_baton
svn_stringbuf_t *curr_path;
svn_stringbuf_t *curr_info;
svn_mergeinfo_catalog_t catalog;
- svn_boolean_t validated_inherited_mergeinfo;
svn_error_t *err;
};
@@ -63,8 +62,6 @@ static const svn_ra_neon__xml_elm_t merg
SVN_RA_NEON__XML_CDATA },
{ SVN_XML_NAMESPACE, SVN_DAV__MERGEINFO_INFO, ELEM_mergeinfo_info,
SVN_RA_NEON__XML_CDATA },
- { SVN_XML_NAMESPACE, SVN_DAV__VALIDATE_INHERITED,
- ELEM_validate_inherited_mergeinfo, SVN_RA_NEON__XML_CDATA },
{ NULL }
};
@@ -96,10 +93,6 @@ start_element(int *elem, void *baton, in
svn_stringbuf_setempty(mb->curr_info);
svn_stringbuf_setempty(mb->curr_path);
}
- else if (elm->id == ELEM_validate_inherited_mergeinfo)
- {
- mb->validated_inherited_mergeinfo = TRUE;
- }
SVN_ERR(mb->err);
@@ -170,7 +163,7 @@ svn_ra_neon__get_mergeinfo(svn_ra_sessio
const apr_array_header_t *paths,
svn_revnum_t revision,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t *validate_inherited_mergeinfo,
+ svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool)
{
@@ -202,7 +195,7 @@ svn_ra_neon__get_mergeinfo(svn_ra_sessio
"</S:inherit>",
svn_inheritance_to_word(inherit)));
- if (*validate_inherited_mergeinfo)
+ if (validate_inherited_mergeinfo)
{
/* Send it only if true; server will default to "no". */
svn_stringbuf_appendcstr(request_body,
@@ -240,7 +233,6 @@ svn_ra_neon__get_mergeinfo(svn_ra_sessio
mb.curr_path = svn_stringbuf_create("", pool);
mb.curr_info = svn_stringbuf_create("", pool);
mb.catalog = apr_hash_make(pool);
- mb.validated_inherited_mergeinfo = FALSE;
mb.err = SVN_NO_ERROR;
/* ras's URL may not exist in HEAD, and thus it's not safe to send
@@ -268,7 +260,5 @@ svn_ra_neon__get_mergeinfo(svn_ra_sessio
if (mb.err == SVN_NO_ERROR && apr_hash_count(mb.catalog))
*catalog = mb.catalog;
- *validate_inherited_mergeinfo = mb.validated_inherited_mergeinfo;
-
return mb.err;
}
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/options.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/options.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/options.c Tue Jul 19 23:05:44 2011
@@ -34,6 +34,8 @@
#include "ra_neon.h"
+/* In a debug build, setting this environment variable to "yes" will force
+ the client to speak v1, even if the server is capable of speaking v2. */
#define SVN_IGNORE_V2_ENV_VAR "SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2"
static const svn_ra_neon__xml_elm_t options_elements[] =
@@ -134,9 +136,9 @@ static const char *capability_server_yes
information discovered from REQ's headers. Use POOL for temporary
allocation only.
- Also, set *YOUNGEST_REV to the current youngest revision if we can
- detect that from the OPTIONS exchange; set it to SVN_INVALID_REVNUM
- otherwise. */
+ Also, if YOUNGEST_REV is not NULL, set *YOUNGEST_REV to the current
+ youngest revision if we can detect that from the OPTIONS exchange, or
+ to SVN_INVALID_REVNUM otherwise. */
static void
parse_capabilities(ne_request *req,
svn_ra_neon__session_t *ras,
@@ -145,7 +147,8 @@ parse_capabilities(ne_request *req,
{
const char *val;
- *youngest_rev = SVN_INVALID_REVNUM;
+ if (youngest_rev)
+ *youngest_rev = SVN_INVALID_REVNUM;
/* Start out assuming all capabilities are unsupported. */
apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_PARTIAL_REPLAY,
@@ -195,11 +198,16 @@ parse_capabilities(ne_request *req,
apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_DEPTH,
APR_HASH_KEY_STRING, capability_yes);
+ /* For mergeinfo capabilities, the server doesn't know what repository
+ we're referring to, so it can't just say capability_yes. */
if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_MERGEINFO, vals))
- /* The server doesn't know what repository we're referring
- to, so it can't just say capability_yes. */
apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_MERGEINFO,
APR_HASH_KEY_STRING, capability_server_yes);
+ if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_MERGEINFO_VALIDATION,
+ vals))
+ apr_hash_set(ras->capabilities,
+ SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO,
+ APR_HASH_KEY_STRING, capability_server_yes);
if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_LOG_REVPROPS, vals))
apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_LOG_REVPROPS,
@@ -217,7 +225,8 @@ parse_capabilities(ne_request *req,
/* Not strictly capabilities, but while we're here, we might as well... */
if ((val = ne_get_response_header(req, SVN_DAV_YOUNGEST_REV_HEADER)))
{
- *youngest_rev = SVN_STR_TO_REV(val);
+ if (youngest_rev)
+ *youngest_rev = SVN_STR_TO_REV(val);
}
if ((val = ne_get_response_header(req, SVN_DAV_REPOS_UUID_HEADER)))
{
@@ -235,17 +244,13 @@ parse_capabilities(ne_request *req,
if ((val = ne_get_response_header(req, SVN_DAV_ME_RESOURCE_HEADER)))
{
#ifdef SVN_DEBUG
- /* ### This section is throw in here for development use. It
- ### allows devs the chance to force the client to speak v1,
- ### even if the server is capable of speaking v2. We should
- ### probably remove it before 1.7 goes final. */
char *ignore_v2_env_var = getenv(SVN_IGNORE_V2_ENV_VAR);
if (! (ignore_v2_env_var
&& apr_strnatcasecmp(ignore_v2_env_var, "yes") == 0))
ras->me_resource = apr_pstrdup(ras->pool, val);
#else
- ras->me_resource = apr_pstrdup(ras->pool, val);
+ ras->me_resource = apr_pstrdup(ras->pool, val);
#endif
}
if ((val = ne_get_response_header(req, SVN_DAV_REV_ROOT_STUB_HEADER)))
@@ -290,7 +295,8 @@ svn_ra_neon__exchange_capabilities(svn_r
oc.pool = pool;
oc.cdata = svn_stringbuf_create("", pool);
- *youngest_rev = SVN_INVALID_REVNUM;
+ if (youngest_rev)
+ *youngest_rev = SVN_INVALID_REVNUM;
if (relocation_location)
*relocation_location = NULL;
@@ -354,10 +360,8 @@ svn_ra_neon__get_activity_collection(con
svn_ra_neon__session_t *ras,
apr_pool_t *pool)
{
- svn_revnum_t ignored_revnum;
if (! ras->act_coll)
- SVN_ERR(svn_ra_neon__exchange_capabilities(ras, NULL,
- &ignored_revnum, pool));
+ SVN_ERR(svn_ra_neon__exchange_capabilities(ras, NULL, NULL, pool));
*activity_coll = svn_string_create(ras->act_coll, pool);
return SVN_NO_ERROR;
}
@@ -386,9 +390,7 @@ svn_ra_neon__has_capability(svn_ra_sessi
/* If any capability is unknown, they're all unknown, so ask. */
if (cap_result == NULL)
{
- svn_revnum_t ignored_revnum;
- SVN_ERR(svn_ra_neon__exchange_capabilities(ras, NULL,
- &ignored_revnum, pool));
+ SVN_ERR(svn_ra_neon__exchange_capabilities(ras, NULL, NULL, pool));
}
@@ -397,12 +399,13 @@ svn_ra_neon__has_capability(svn_ra_sessi
capability, APR_HASH_KEY_STRING);
/* Some capabilities depend on the repository as well as the server.
- NOTE: ../libsvn_ra_serf/serf.c:svn_ra_serf__has_capability()
- has a very similar code block. If you change something here,
- check there as well. */
+ NOTE: svn_ra_serf__has_capability() has a very similar code block. If
+ you change something here, check there as well. */
if (cap_result == capability_server_yes)
{
- if (strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
+ if ((strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
+ || (strcmp(capability,
+ SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO) == 0))
{
/* Handle mergeinfo specially. Mergeinfo depends on the
repository as well as the server, but the server routine
@@ -410,7 +413,7 @@ svn_ra_neon__has_capability(svn_ra_sessi
above didn't even know which repository we were interested in
-- it just told us whether the server supports mergeinfo.
If the answer was 'no', there's no point checking the
- particular repository; but if it was 'yes, we still must
+ particular repository; but if it was 'yes', we still must
change it to 'no' iff the repository itself doesn't
support mergeinfo. */
svn_mergeinfo_catalog_t ignored;
@@ -422,7 +425,7 @@ svn_ra_neon__has_capability(svn_ra_sessi
err = svn_ra_neon__get_mergeinfo(session, &ignored, paths, 0,
FALSE,
- &validate_inherited_mergeinfo,
+ validate_inherited_mergeinfo,
FALSE, pool);
if (err)
@@ -447,9 +450,14 @@ svn_ra_neon__has_capability(svn_ra_sessi
else
cap_result = capability_yes;
- apr_hash_set(ras->capabilities,
- SVN_RA_CAPABILITY_MERGEINFO, APR_HASH_KEY_STRING,
- cap_result);
+ if (strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
+ apr_hash_set(ras->capabilities,
+ SVN_RA_CAPABILITY_MERGEINFO, APR_HASH_KEY_STRING,
+ cap_result);
+ else
+ apr_hash_set(ras->capabilities,
+ SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO,
+ APR_HASH_KEY_STRING, cap_result);
}
else
{
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/props.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/props.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/props.c Tue Jul 19 23:05:44 2011
@@ -1011,9 +1011,13 @@ svn_error_t *svn_ra_neon__get_baseline_i
}
if (bc_relative_p)
{
- const char *relpath = svn_uri__is_child(sess->repos_root, url, pool);
+ const char *relpath = svn_uri_skip_ancestor(sess->repos_root, url,
+ pool);
if (! relpath)
- relpath = "";
+ return svn_error_createf(SVN_ERR_RA_REPOS_ROOT_URL_MISMATCH, NULL,
+ _("Url '%s' is not in repository '%s'"),
+ url, sess->repos_root);
+
*bc_relative_p = relpath;
}
if (latest_rev)
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/ra_neon.h
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/ra_neon.h?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/ra_neon.h (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/ra_neon.h Tue Jul 19 23:05:44 2011
@@ -308,7 +308,7 @@ svn_error_t * svn_ra_neon__get_mergeinfo
const apr_array_header_t *paths,
svn_revnum_t revision,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t *validate_inherited_mergeinfo,
+ svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool);
@@ -1125,7 +1125,8 @@ svn_ra_neon__has_capability(svn_ra_sessi
If the server is kind enough to tell us the current youngest
revision of the target repository, set *YOUNGEST_REV to that value;
- set it to SVN_INVALID_REVNUM otherwise.
+ set it to SVN_INVALID_REVNUM otherwise. YOUNGEST_REV may be NULL if
+ the caller is not interested in receiving this information.
NOTE: This function also expects the server to announce the
activity collection. */
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/session.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/session.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/session.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_neon/session.c Tue Jul 19 23:05:44 2011
@@ -451,8 +451,12 @@ static svn_error_t *get_server_settings(
apr_pool_t *pool)
{
const char *exceptions, *port_str, *timeout_str, *server_group;
- const char *debug_str, *http_auth_types;
+ const char *debug_str;
svn_boolean_t is_exception = FALSE;
+#ifdef SVN_NEON_0_26
+ const char *http_auth_types = NULL;
+#endif
+
/* If we find nothing, default to nulls. */
*proxy_host = NULL;
*proxy_port = (unsigned int) -1;
@@ -461,7 +465,6 @@ static svn_error_t *get_server_settings(
port_str = NULL;
timeout_str = NULL;
debug_str = NULL;
- http_auth_types = NULL;
*pk11_provider = NULL;
/* Use the default proxy-specific settings if and only if
@@ -791,7 +794,6 @@ svn_ra_neon__open(svn_ra_session_t *sess
const char *pkcs11_provider;
const char *useragent = NULL;
const char *client_string = NULL;
- svn_revnum_t ignored_revnum;
SVN_ERR_ASSERT(svn_uri_is_canonical(repos_URL, pool));
@@ -1076,8 +1078,7 @@ svn_ra_neon__open(svn_ra_session_t *sess
session->priv = ras;
- return svn_ra_neon__exchange_capabilities(ras, corrected_url,
- &ignored_revnum, pool);
+ return svn_ra_neon__exchange_capabilities(ras, corrected_url, NULL, pool);
}
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/mergeinfo.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/mergeinfo.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/mergeinfo.c Tue Jul 19 23:05:44 2011
@@ -44,8 +44,7 @@ typedef enum mergeinfo_state_e {
MERGEINFO_REPORT,
MERGEINFO_ITEM,
MERGEINFO_PATH,
- MERGEINFO_INFO,
- MERGEINFO_VALIDATED
+ MERGEINFO_INFO
} mergeinfo_state_e;
/* Baton for accumulating mergeinfo. RESULT_CATALOG stores the final
@@ -63,7 +62,6 @@ typedef struct mergeinfo_context_t {
svn_revnum_t revision;
svn_mergeinfo_inheritance_t inherit;
svn_boolean_t validate_inherited_mergeinfo;
- svn_boolean_t validated_inherited_mergeinfo;
svn_boolean_t include_descendants;
} mergeinfo_context_t;
@@ -82,11 +80,6 @@ start_element(svn_ra_serf__xml_parser_t
svn_ra_serf__xml_push_state(parser, MERGEINFO_REPORT);
}
else if (state == MERGEINFO_REPORT &&
- strcmp(name.name, SVN_DAV__VALIDATE_INHERITED) == 0)
- {
- svn_ra_serf__xml_push_state(parser, MERGEINFO_VALIDATED);
- }
- else if (state == MERGEINFO_REPORT &&
strcmp(name.name, SVN_DAV__MERGEINFO_ITEM) == 0)
{
svn_ra_serf__xml_push_state(parser, MERGEINFO_ITEM);
@@ -176,11 +169,6 @@ cdata_handler(svn_ra_serf__xml_parser_t
svn_stringbuf_appendbytes(mergeinfo_ctx->curr_info, data, len);
break;
- case MERGEINFO_VALIDATED:
- if (strncmp(data, "yes", 3) == 0)
- mergeinfo_ctx->validated_inherited_mergeinfo = TRUE;
- break;
-
default:
break;
}
@@ -254,7 +242,7 @@ svn_ra_serf__get_mergeinfo(svn_ra_sessio
const apr_array_header_t *paths,
svn_revnum_t revision,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t *validate_inherited_mergeinfo,
+ svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool)
{
@@ -284,8 +272,7 @@ svn_ra_serf__get_mergeinfo(svn_ra_sessio
mergeinfo_ctx->paths = paths;
mergeinfo_ctx->revision = revision;
mergeinfo_ctx->inherit = inherit;
- mergeinfo_ctx->validate_inherited_mergeinfo = *validate_inherited_mergeinfo;
- mergeinfo_ctx->validated_inherited_mergeinfo = FALSE;
+ mergeinfo_ctx->validate_inherited_mergeinfo = validate_inherited_mergeinfo;
mergeinfo_ctx->include_descendants = include_descendants;
handler = apr_pcalloc(pool, sizeof(*handler));
@@ -325,9 +312,6 @@ svn_ra_serf__get_mergeinfo(svn_ra_sessio
SVN_ERR(err);
- *validate_inherited_mergeinfo =
- mergeinfo_ctx->validated_inherited_mergeinfo;
-
if (mergeinfo_ctx->done && apr_hash_count(mergeinfo_ctx->result_catalog))
*catalog = mergeinfo_ctx->result_catalog;
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/options.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/options.c Tue Jul 19 23:05:44 2011
@@ -39,6 +39,9 @@
#include "ra_serf.h"
+
+/* In a debug build, setting this environment variable to "yes" will force
+ the client to speak v1, even if the server is capable of speaking v2. */
#define SVN_IGNORE_V2_ENV_VAR "SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2"
@@ -296,13 +299,22 @@ capabilities_headers_iterator_callback(v
apr_hash_set(orc->session->capabilities, SVN_RA_CAPABILITY_DEPTH,
APR_HASH_KEY_STRING, capability_yes);
}
+
+ /* For mergeinfo capabilities, the server doesn't know what repository
+ we're referring to, so it can't just say capability_yes. */
if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_MERGEINFO, vals))
{
- /* The server doesn't know what repository we're referring
- to, so it can't just say capability_yes. */
apr_hash_set(orc->session->capabilities, SVN_RA_CAPABILITY_MERGEINFO,
APR_HASH_KEY_STRING, capability_server_yes);
}
+ if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_MERGEINFO_VALIDATION,
+ vals))
+ {
+ apr_hash_set(orc->session->capabilities,
+ SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO,
+ APR_HASH_KEY_STRING, capability_server_yes);
+ }
+
if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_LOG_REVPROPS, vals))
{
apr_hash_set(orc->session->capabilities,
@@ -340,10 +352,6 @@ capabilities_headers_iterator_callback(v
else if (svn_cstring_casecmp(key, SVN_DAV_ME_RESOURCE_HEADER) == 0)
{
#ifdef SVN_DEBUG
- /* ### This section is throw in here for development use. It
- ### allows devs the chance to force the client to speak v1,
- ### even if the server is capable of speaking v2. We should
- ### probably remove it before 1.7 goes final. */
char *ignore_v2_env_var = getenv(SVN_IGNORE_V2_ENV_VAR);
if (!(ignore_v2_env_var
@@ -553,12 +561,13 @@ svn_ra_serf__has_capability(svn_ra_sessi
capability, APR_HASH_KEY_STRING);
/* Some capabilities depend on the repository as well as the server.
- NOTE: ../libsvn_ra_neon/session.c:svn_ra_neon__has_capability()
- has a very similar code block. If you change something here,
- check there as well. */
+ NOTE: svn_ra_neon__has_capability() has a very similar code block. If
+ you change something here, check there as well. */
if (cap_result == capability_server_yes)
{
- if (strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
+ if ((strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
+ || (strcmp(capability,
+ SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO) == 0))
{
/* Handle mergeinfo specially. Mergeinfo depends on the
repository as well as the server, but the server routine
@@ -566,7 +575,7 @@ svn_ra_serf__has_capability(svn_ra_sessi
didn't even know which repository we were interested in
-- it just told us whether the server supports mergeinfo.
If the answer was 'no', there's no point checking the
- particular repository; but if it was 'yes, we still must
+ particular repository; but if it was 'yes', we still must
change it to 'no' iff the repository itself doesn't
support mergeinfo. */
svn_mergeinfo_catalog_t ignored;
@@ -578,7 +587,7 @@ svn_ra_serf__has_capability(svn_ra_sessi
err = svn_ra_serf__get_mergeinfo(ra_session, &ignored, paths, 0,
FALSE,
- &validate_inherited_mergeinfo,
+ validate_inherited_mergeinfo,
FALSE, pool);
if (err)
@@ -602,9 +611,14 @@ svn_ra_serf__has_capability(svn_ra_sessi
else
cap_result = capability_yes;
- apr_hash_set(serf_sess->capabilities,
- SVN_RA_CAPABILITY_MERGEINFO, APR_HASH_KEY_STRING,
- cap_result);
+ if (strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
+ apr_hash_set(serf_sess->capabilities,
+ SVN_RA_CAPABILITY_MERGEINFO, APR_HASH_KEY_STRING,
+ cap_result);
+ else
+ apr_hash_set(serf_sess->capabilities,
+ SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO,
+ APR_HASH_KEY_STRING, cap_result);
}
else
{
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/ra_serf.h?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_ra_serf/ra_serf.h Tue Jul 19 23:05:44 2011
@@ -1376,7 +1376,7 @@ svn_error_t * svn_ra_serf__get_mergeinfo
const apr_array_header_t *paths,
svn_revnum_t revision,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t *validate_inherited_mergeinfo,
+ svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool);