You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/08/16 12:18:03 UTC
svn commit: r1373783 [14/50] - in /subversion/branches/compressed-pristines:
./ build/ build/ac-macros/ build/generator/ build/generator/templates/
build/win32/ contrib/client-side/emacs/ contrib/client-side/svn-push/
contrib/client-side/svnmerge/ cont...
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_base/bdb/txn-table.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_base/bdb/txn-table.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_base/bdb/txn-table.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_base/bdb/txn-table.c Thu Aug 16 10:17:48 2012
@@ -96,7 +96,7 @@ svn_fs_bdb__put_txn(svn_fs_t *fs,
svn_fs_base__str_to_dbt(&key, txn_name);
svn_fs_base__skel_to_dbt(&value, txn_skel, pool);
svn_fs_base__trail_debug(trail, "transactions", "put");
- return BDB_WRAP(fs, _("storing transaction record"),
+ return BDB_WRAP(fs, N_("storing transaction record"),
bfd->transactions->put(bfd->transactions, trail->db_txn,
&key, &value, 0));
}
@@ -120,7 +120,7 @@ allocate_txn_id(const char **id_p,
/* Get the current value associated with the `next-key' key in the table. */
svn_fs_base__trail_debug(trail, "transactions", "get");
- SVN_ERR(BDB_WRAP(fs, "allocating new transaction ID (getting 'next-key')",
+ SVN_ERR(BDB_WRAP(fs, N_("allocating new transaction ID (getting 'next-key')"),
bfd->transactions->get(bfd->transactions, trail->db_txn,
&query,
svn_fs_base__result_dbt(&result),
@@ -139,7 +139,7 @@ allocate_txn_id(const char **id_p,
db_err = bfd->transactions->put(bfd->transactions, trail->db_txn,
&query, &result, 0);
- return BDB_WRAP(fs, "bumping next transaction key", db_err);
+ return BDB_WRAP(fs, N_("bumping next transaction key"), db_err);
}
@@ -185,7 +185,7 @@ svn_fs_bdb__delete_txn(svn_fs_t *fs,
/* Delete the transaction from the `transactions' table. */
svn_fs_base__str_to_dbt(&key, txn_name);
svn_fs_base__trail_debug(trail, "transactions", "del");
- return BDB_WRAP(fs, "deleting entry from 'transactions' table",
+ return BDB_WRAP(fs, N_("deleting entry from 'transactions' table"),
bfd->transactions->del(bfd->transactions,
trail->db_txn, &key, 0));
}
@@ -215,7 +215,7 @@ svn_fs_bdb__get_txn(transaction_t **txn_
if (db_err == DB_NOTFOUND)
return svn_fs_base__err_no_such_txn(fs, txn_name);
- SVN_ERR(BDB_WRAP(fs, "reading transaction", db_err));
+ SVN_ERR(BDB_WRAP(fs, N_("reading transaction"), db_err));
/* Parse TRANSACTION skel */
skel = svn_skel__parse(value.data, value.size, pool);
@@ -248,7 +248,7 @@ svn_fs_bdb__get_txn_list(apr_array_heade
/* Create a database cursor to list the transaction names. */
svn_fs_base__trail_debug(trail, "transactions", "cursor");
- SVN_ERR(BDB_WRAP(fs, "reading transaction list (opening cursor)",
+ SVN_ERR(BDB_WRAP(fs, N_("reading transaction list (opening cursor)"),
bfd->transactions->cursor(bfd->transactions,
trail->db_txn, &cursor, 0)));
@@ -311,10 +311,10 @@ svn_fs_bdb__get_txn_list(apr_array_heade
db_c_err = svn_bdb_dbc_close(cursor);
if (db_err != DB_NOTFOUND)
{
- SVN_ERR(BDB_WRAP(fs, "reading transaction list (listing keys)",
+ SVN_ERR(BDB_WRAP(fs, N_("reading transaction list (listing keys)"),
db_err));
}
- SVN_ERR(BDB_WRAP(fs, "reading transaction list (closing cursor)",
+ SVN_ERR(BDB_WRAP(fs, N_("reading transaction list (closing cursor)"),
db_c_err));
/* Destroy the per-iteration subpool */
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_base/bdb/uuids-table.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_base/bdb/uuids-table.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_base/bdb/uuids-table.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_base/bdb/uuids-table.c Thu Aug 16 10:17:48 2012
@@ -116,7 +116,7 @@ svn_error_t *svn_fs_bdb__get_uuid(svn_fs
value.flags |= DB_DBT_USERMEM;
svn_fs_base__trail_debug(trail, "uuids", "get");
- SVN_ERR(BDB_WRAP(fs, _("get repository uuid"),
+ SVN_ERR(BDB_WRAP(fs, N_("get repository uuid"),
uuids->get(uuids, trail->db_txn, &key, &value, 0)));
*uuid = apr_pstrmemdup(pool, value.data, value.size);
@@ -144,6 +144,6 @@ svn_error_t *svn_fs_bdb__set_uuid(svn_fs
value.data = apr_pstrmemdup(pool, uuid, value.size + 1);
svn_fs_base__trail_debug(trail, "uuids", "put");
- return BDB_WRAP(fs, _("set repository uuid"),
+ return BDB_WRAP(fs, N_("set repository uuid"),
uuids->put(uuids, trail->db_txn, &key, &value, 0));
}
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_base/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_base/dag.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_base/dag.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_base/dag.c Thu Aug 16 10:17:48 2012
@@ -1632,7 +1632,7 @@ svn_fs_base__things_different(svn_boolea
if (! props_changed && ! contents_changed)
return SVN_NO_ERROR;
- /* The the node revision skels for these two nodes. */
+ /* The node revision skels for these two nodes. */
SVN_ERR(svn_fs_bdb__get_node_revision(&noderev1, node1->fs, node1->id,
trail, pool));
SVN_ERR(svn_fs_bdb__get_node_revision(&noderev2, node2->fs, node2->id,
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_base/err.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_base/err.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_base/err.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_base/err.c Thu Aug 16 10:17:48 2012
@@ -62,10 +62,11 @@ svn_fs_base__err_dangling_id(svn_fs_t *f
svn_error_t *
svn_fs_base__err_dangling_rev(svn_fs_t *fs, svn_revnum_t rev)
{
+ /* Log the UUID as this error may be reported to the client. */
return svn_error_createf
(SVN_ERR_FS_NO_SUCH_REVISION, 0,
_("No such revision %ld in filesystem '%s'"),
- rev, fs->path);
+ rev, fs->uuid);
}
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_base/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_base/fs.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_base/fs.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_base/fs.c Thu Aug 16 10:17:48 2012
@@ -473,15 +473,6 @@ bdb_write_config(svn_fs_t *fs)
-static svn_error_t *
-base_serialized_init(svn_fs_t *fs, apr_pool_t *common_pool, apr_pool_t *pool)
-{
- /* Nothing to do here. */
- return SVN_NO_ERROR;
-}
-
-
-
/* Creating a new filesystem */
static fs_vtable_t fs_vtable = {
@@ -489,7 +480,6 @@ static fs_vtable_t fs_vtable = {
svn_fs_base__revision_prop,
svn_fs_base__revision_proplist,
svn_fs_base__change_rev_prop,
- svn_fs_base__get_uuid,
svn_fs_base__set_uuid,
svn_fs_base__revision_root,
svn_fs_base__begin_txn,
@@ -562,62 +552,62 @@ open_databases(svn_fs_t *fs,
/* Create the databases in the environment. */
SVN_ERR(BDB_WRAP(fs, (create
- ? "creating 'nodes' table"
- : "opening 'nodes' table"),
+ ? N_("creating 'nodes' table")
+ : N_("opening 'nodes' table")),
svn_fs_bdb__open_nodes_table(&bfd->nodes,
bfd->bdb->env,
create)));
SVN_ERR(BDB_WRAP(fs, (create
- ? "creating 'revisions' table"
- : "opening 'revisions' table"),
+ ? N_("creating 'revisions' table")
+ : N_("opening 'revisions' table")),
svn_fs_bdb__open_revisions_table(&bfd->revisions,
bfd->bdb->env,
create)));
SVN_ERR(BDB_WRAP(fs, (create
- ? "creating 'transactions' table"
- : "opening 'transactions' table"),
+ ? N_("creating 'transactions' table")
+ : N_("opening 'transactions' table")),
svn_fs_bdb__open_transactions_table(&bfd->transactions,
bfd->bdb->env,
create)));
SVN_ERR(BDB_WRAP(fs, (create
- ? "creating 'copies' table"
- : "opening 'copies' table"),
+ ? N_("creating 'copies' table")
+ : N_("opening 'copies' table")),
svn_fs_bdb__open_copies_table(&bfd->copies,
bfd->bdb->env,
create)));
SVN_ERR(BDB_WRAP(fs, (create
- ? "creating 'changes' table"
- : "opening 'changes' table"),
+ ? N_("creating 'changes' table")
+ : N_("opening 'changes' table")),
svn_fs_bdb__open_changes_table(&bfd->changes,
bfd->bdb->env,
create)));
SVN_ERR(BDB_WRAP(fs, (create
- ? "creating 'representations' table"
- : "opening 'representations' table"),
+ ? N_("creating 'representations' table")
+ : N_("opening 'representations' table")),
svn_fs_bdb__open_reps_table(&bfd->representations,
bfd->bdb->env,
create)));
SVN_ERR(BDB_WRAP(fs, (create
- ? "creating 'strings' table"
- : "opening 'strings' table"),
+ ? N_("creating 'strings' table")
+ : N_("opening 'strings' table")),
svn_fs_bdb__open_strings_table(&bfd->strings,
bfd->bdb->env,
create)));
SVN_ERR(BDB_WRAP(fs, (create
- ? "creating 'uuids' table"
- : "opening 'uuids' table"),
+ ? N_("creating 'uuids' table")
+ : N_("opening 'uuids' table")),
svn_fs_bdb__open_uuids_table(&bfd->uuids,
bfd->bdb->env,
create)));
SVN_ERR(BDB_WRAP(fs, (create
- ? "creating 'locks' table"
- : "opening 'locks' table"),
+ ? N_("creating 'locks' table")
+ : N_("opening 'locks' table")),
svn_fs_bdb__open_locks_table(&bfd->locks,
bfd->bdb->env,
create)));
SVN_ERR(BDB_WRAP(fs, (create
- ? "creating 'lock-tokens' table"
- : "opening 'lock-tokens' table"),
+ ? N_("creating 'lock-tokens' table")
+ : N_("opening 'lock-tokens' table")),
svn_fs_bdb__open_lock_tokens_table(&bfd->lock_tokens,
bfd->bdb->env,
create)));
@@ -625,8 +615,8 @@ open_databases(svn_fs_t *fs,
if (format >= SVN_FS_BASE__MIN_NODE_ORIGINS_FORMAT)
{
SVN_ERR(BDB_WRAP(fs, (create
- ? "creating 'node-origins' table"
- : "opening 'node-origins' table"),
+ ? N_("creating 'node-origins' table")
+ : N_("opening 'node-origins' table")),
svn_fs_bdb__open_node_origins_table(&bfd->node_origins,
bfd->bdb->env,
create)));
@@ -635,8 +625,8 @@ open_databases(svn_fs_t *fs,
if (format >= SVN_FS_BASE__MIN_MISCELLANY_FORMAT)
{
SVN_ERR(BDB_WRAP(fs, (create
- ? "creating 'miscellaneous' table"
- : "opening 'miscellaneous' table"),
+ ? N_("creating 'miscellaneous' table")
+ : N_("opening 'miscellaneous' table")),
svn_fs_bdb__open_miscellaneous_table(&bfd->miscellaneous,
bfd->bdb->env,
create)));
@@ -645,8 +635,8 @@ open_databases(svn_fs_t *fs,
if (format >= SVN_FS_BASE__MIN_REP_SHARING_FORMAT)
{
SVN_ERR(BDB_WRAP(fs, (create
- ? "creating 'checksum-reps' table"
- : "opening 'checksum-reps' table"),
+ ? N_("creating 'checksum-reps' table")
+ : N_("opening 'checksum-reps' table")),
svn_fs_bdb__open_checksum_reps_table(&bfd->checksum_reps,
bfd->bdb->env,
create)));
@@ -656,6 +646,15 @@ open_databases(svn_fs_t *fs,
}
+/* Called by functions that initialize an svn_fs_t struct, after that
+ initialization is done, to populate svn_fs_t->uuid. */
+static svn_error_t *
+populate_opened_fs(svn_fs_t *fs, apr_pool_t *scratch_pool)
+{
+ SVN_ERR(svn_fs_base__populate_uuid(fs, scratch_pool));
+ return SVN_NO_ERROR;
+}
+
static svn_error_t *
base_create(svn_fs_t *fs, const char *path, apr_pool_t *pool,
apr_pool_t *common_pool)
@@ -691,7 +690,9 @@ base_create(svn_fs_t *fs, const char *pa
if (svn_err) goto error;
((base_fs_data_t *) fs->fsap_data)->format = format;
- return base_serialized_init(fs, common_pool, pool);
+
+ SVN_ERR(populate_opened_fs(fs, pool));
+ return SVN_NO_ERROR;;
error:
svn_error_clear(cleanup_fs(fs));
@@ -775,7 +776,8 @@ base_open(svn_fs_t *fs, const char *path
if (svn_err) goto error;
}
- return base_serialized_init(fs, common_pool, pool);
+ SVN_ERR(populate_opened_fs(fs, pool));
+ return SVN_NO_ERROR;
error:
svn_error_clear(cleanup_fs(fs));
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_base/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_base/fs.h?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_base/fs.h (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_base/fs.h Thu Aug 16 10:17:48 2012
@@ -108,9 +108,6 @@ typedef struct base_fs_data_t
transaction trail alive. */
svn_boolean_t in_txn_trail;
- /* The filesystem UUID (or NULL if not-yet-known; see svn_fs_get_uuid). */
- const char *uuid;
-
/* The format number of this FS. */
int format;
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_base/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_base/lock.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_base/lock.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_base/lock.c Thu Aug 16 10:17:48 2012
@@ -36,6 +36,7 @@
#include "util/fs_skels.h"
#include "../libsvn_fs/fs-loader.h"
#include "private/svn_fs_util.h"
+#include "private/svn_subr_private.h"
/* Add LOCK and its associated LOCK_TOKEN (associated with PATH) as
@@ -93,7 +94,7 @@ txn_body_lock(void *baton, trail_t *trai
/* Until we implement directory locks someday, we only allow locks
on files or non-existent paths. */
if (kind == svn_node_dir)
- return SVN_FS__ERR_NOT_FILE(trail->fs, args->path, trail->pool);
+ return SVN_FS__ERR_NOT_FILE(trail->fs, args->path);
/* While our locking implementation easily supports the locking of
nonexistent paths, we deliberately choose not to allow such madness. */
@@ -113,7 +114,7 @@ txn_body_lock(void *baton, trail_t *trai
/* There better be a username attached to the fs. */
if (!trail->fs->access_ctx || !trail->fs->access_ctx->username)
- return SVN_FS__ERR_NO_USER(trail->fs, trail->pool);
+ return SVN_FS__ERR_NO_USER(trail->fs);
/* Is the caller attempting to lock an out-of-date working file? */
if (SVN_IS_VALID_REVNUM(args->current_rev))
@@ -179,8 +180,7 @@ txn_body_lock(void *baton, trail_t *trai
{
/* Sorry, the path is already locked. */
return SVN_FS__ERR_PATH_ALREADY_LOCKED(trail->fs,
- existing_lock,
- trail->pool);
+ existing_lock);
}
else
{
@@ -282,22 +282,21 @@ txn_body_unlock(void *baton, trail_t *tr
if (args->token == NULL)
return svn_fs_base__err_no_lock_token(trail->fs, args->path);
else if (strcmp(lock_token, args->token) != 0)
- return SVN_FS__ERR_NO_SUCH_LOCK(trail->fs, args->path, trail->pool);
+ return SVN_FS__ERR_NO_SUCH_LOCK(trail->fs, args->path);
SVN_ERR(svn_fs_bdb__lock_get(&lock, trail->fs, lock_token,
trail, trail->pool));
/* There better be a username attached to the fs. */
if (!trail->fs->access_ctx || !trail->fs->access_ctx->username)
- return SVN_FS__ERR_NO_USER(trail->fs, trail->pool);
+ return SVN_FS__ERR_NO_USER(trail->fs);
/* And that username better be the same as the lock's owner. */
if (strcmp(trail->fs->access_ctx->username, lock->owner) != 0)
return SVN_FS__ERR_LOCK_OWNER_MISMATCH(
trail->fs,
trail->fs->access_ctx->username,
- lock->owner,
- trail->pool);
+ lock->owner);
}
/* Remove a row from each of the locking tables. */
@@ -396,9 +395,9 @@ svn_fs_base__get_lock(svn_lock_t **lock,
}
/* Implements `svn_fs_get_locks_callback_t', spooling lock information
- to disk as the filesystem provides it. BATON is an 'apr_file_t *'
- object pointing to open, writable spool file. We'll write the
- spool file with a format like so:
+ to a stream as the filesystem provides it. BATON is an 'svn_stream_t *'
+ object pointing to the stream. We'll write the spool stream with a
+ format like so:
SKEL1_LEN "\n" SKEL1 "\n" SKEL2_LEN "\n" SKEL2 "\n" ...
@@ -410,18 +409,20 @@ spool_locks_info(void *baton,
apr_pool_t *pool)
{
svn_skel_t *lock_skel;
- apr_file_t *spool_file = (apr_file_t *)baton;
+ svn_stream_t *stream = baton;
const char *skel_len;
svn_stringbuf_t *skel_buf;
+ apr_size_t len;
SVN_ERR(svn_fs_base__unparse_lock_skel(&lock_skel, lock, pool));
skel_buf = svn_skel__unparse(lock_skel, pool);
skel_len = apr_psprintf(pool, "%" APR_SIZE_T_FMT "\n", skel_buf->len);
- SVN_ERR(svn_io_file_write_full(spool_file, skel_len, strlen(skel_len),
- NULL, pool));
- SVN_ERR(svn_io_file_write_full(spool_file, skel_buf->data,
- skel_buf->len, NULL, pool));
- return svn_io_file_write_full(spool_file, "\n", 1, NULL, pool);
+ len = strlen(skel_len);
+ SVN_ERR(svn_stream_write(stream, skel_len, &len));
+ len = skel_buf->len;
+ SVN_ERR(svn_stream_write(stream, skel_buf->data, &len));
+ len = 1;
+ return svn_stream_write(stream, "\n", &len);
}
@@ -429,7 +430,7 @@ struct locks_get_args
{
const char *path;
svn_depth_t depth;
- apr_file_t *spool_file;
+ svn_stream_t *stream;
};
@@ -438,7 +439,7 @@ txn_body_get_locks(void *baton, trail_t
{
struct locks_get_args *args = baton;
return svn_fs_bdb__locks_get(trail->fs, args->path, args->depth,
- spool_locks_info, args->spool_file,
+ spool_locks_info, args->stream,
trail, trail->pool);
}
@@ -452,7 +453,6 @@ svn_fs_base__get_locks(svn_fs_t *fs,
apr_pool_t *pool)
{
struct locks_get_args args;
- apr_off_t offset = 0;
svn_stream_t *stream;
svn_stringbuf_t *buf;
svn_boolean_t eof;
@@ -462,14 +462,14 @@ svn_fs_base__get_locks(svn_fs_t *fs,
args.path = svn_fs__canonicalize_abspath(path, pool);
args.depth = depth;
- SVN_ERR(svn_io_open_uniquely_named(&(args.spool_file), NULL, NULL, NULL,
- NULL, svn_io_file_del_on_close,
- pool, pool));
+ /* Enough for 100+ locks if the comments are small. */
+ args.stream = svn_stream__from_spillbuf(4 * 1024 /* blocksize */,
+ 64 * 1024 /* maxsize */,
+ pool);
SVN_ERR(svn_fs_base__retry_txn(fs, txn_body_get_locks, &args, FALSE, pool));
- /* Rewind the spool file, then re-read it, calling GET_LOCKS_FUNC(). */
- SVN_ERR(svn_io_file_seek(args.spool_file, APR_SET, &offset, pool));
- stream = svn_stream_from_aprfile2(args.spool_file, FALSE, pool);
+ /* Read the stream calling GET_LOCKS_FUNC(). */
+ stream = args.stream;
while (1)
{
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_base/trail.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_base/trail.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_base/trail.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_base/trail.c Thu Aug 16 10:17:48 2012
@@ -96,7 +96,7 @@ begin_trail(trail_t **trail_p,
a coding problem (and will likely hang the repository anyway). */
SVN_ERR_ASSERT(! bfd->in_txn_trail);
- SVN_ERR(BDB_WRAP(fs, "beginning Berkeley DB transaction",
+ SVN_ERR(BDB_WRAP(fs, N_("beginning Berkeley DB transaction"),
bfd->bdb->env->txn_begin(bfd->bdb->env, 0,
&trail->db_txn, 0)));
bfd->in_txn_trail = TRUE;
@@ -131,7 +131,7 @@ abort_trail(trail_t *trail)
see the returned error than to abort. An obvious example is
when DB_TXN->abort() returns DB_RUNRECOVERY. */
bfd->in_txn_trail = FALSE;
- SVN_ERR(BDB_WRAP(fs, "aborting Berkeley DB transaction",
+ SVN_ERR(BDB_WRAP(fs, N_("aborting Berkeley DB transaction"),
trail->db_txn->abort(trail->db_txn)));
}
svn_pool_destroy(trail->pool);
@@ -155,7 +155,7 @@ commit_trail(trail_t *trail)
/* See comment [**] in abort_trail() above.
An error during txn commit will abort the transaction anyway. */
bfd->in_txn_trail = FALSE;
- SVN_ERR(BDB_WRAP(fs, "committing Berkeley DB transaction",
+ SVN_ERR(BDB_WRAP(fs, N_("committing Berkeley DB transaction"),
trail->db_txn->commit(trail->db_txn, 0)));
}
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_base/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_base/tree.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_base/tree.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_base/tree.c Thu Aug 16 10:17:48 2012
@@ -431,7 +431,7 @@ mutable_root_node(dag_node_t **node_p,
trail, pool);
else
/* If it's not a transaction root, we can't change its contents. */
- return SVN_FS__ERR_NOT_MUTABLE(root->fs, root->rev, error_path, pool);
+ return SVN_FS__ERR_NOT_MUTABLE(root->fs, root->rev, error_path);
}
@@ -769,7 +769,7 @@ open_path(parent_path_t **parent_path_p,
/* The path isn't finished yet; we'd better be in a directory. */
if (svn_fs_base__dag_node_kind(child) != svn_node_dir)
- SVN_ERR_W(SVN_FS__ERR_NOT_DIRECTORY(fs, path_so_far, pool),
+ SVN_ERR_W(SVN_FS__ERR_NOT_DIRECTORY(fs, path_so_far),
apr_psprintf(pool, _("Failure opening '%s'"), path));
rest = next;
@@ -2926,7 +2926,7 @@ txn_body_make_dir(void *baton,
/* If there's already a sub-directory by that name, complain. This
also catches the case of trying to make a subdirectory named `/'. */
if (parent_path->node)
- return SVN_FS__ALREADY_EXISTS(root, path, trail->pool);
+ return SVN_FS__ALREADY_EXISTS(root, path);
/* Check to see if some lock is 'reserving' a file-path or dir-path
at that location, or even some child-path; if so, check that we
@@ -3192,17 +3192,7 @@ fs_same_p(svn_boolean_t *same_p,
svn_fs_t *fs2,
apr_pool_t *pool)
{
- const char *uuid1;
- const char *uuid2;
-
- /* Random thought: if fetching UUIDs to compare filesystems is too
- expensive, one solution would be to cache the UUID in each fs
- object (copying the UUID into fs->pool, of course). */
-
- SVN_ERR(fs1->vtable->get_uuid(fs1, &uuid1, pool));
- SVN_ERR(fs2->vtable->get_uuid(fs2, &uuid2, pool));
-
- *same_p = ! strcmp(uuid1, uuid2);
+ *same_p = ! strcmp(fs1->uuid, fs2->uuid);
return SVN_NO_ERROR;
}
@@ -3379,7 +3369,7 @@ txn_body_make_file(void *baton,
/* If there's already a file by that name, complain.
This also catches the case of trying to make a file named `/'. */
if (parent_path->node)
- return SVN_FS__ALREADY_EXISTS(root, path, trail->pool);
+ return SVN_FS__ALREADY_EXISTS(root, path);
/* Check to see if some lock is 'reserving' a file-path or dir-path
at that location, or even some child-path; if so, check that we
@@ -3793,16 +3783,8 @@ base_apply_textdelta(svn_txdelta_window_
tb->root = root;
tb->path = path;
tb->pool = pool;
-
- if (base_checksum)
- tb->base_checksum = svn_checksum_dup(base_checksum, pool);
- else
- tb->base_checksum = NULL;
-
- if (result_checksum)
- tb->result_checksum = svn_checksum_dup(result_checksum, pool);
- else
- tb->result_checksum = NULL;
+ tb->base_checksum = svn_checksum_dup(base_checksum, pool);
+ tb->result_checksum = svn_checksum_dup(result_checksum, pool);
SVN_ERR(svn_fs_base__retry_txn(root->fs, txn_body_apply_textdelta, tb,
FALSE, pool));
@@ -3943,11 +3925,7 @@ base_apply_text(svn_stream_t **contents_
tb->root = root;
tb->path = path;
tb->pool = pool;
-
- if (result_checksum)
- tb->result_checksum = svn_checksum_dup(result_checksum, pool);
- else
- tb->result_checksum = NULL;
+ tb->result_checksum = svn_checksum_dup(result_checksum, pool);
SVN_ERR(svn_fs_base__retry_txn(root->fs, txn_body_apply_text, tb,
FALSE, pool));
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_base/util/fs_skels.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_base/util/fs_skels.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_base/util/fs_skels.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_base/util/fs_skels.c Thu Aug 16 10:17:48 2012
@@ -32,6 +32,7 @@
#include "private/svn_skel.h"
#include "private/svn_dep_compat.h"
+#include "private/svn_subr_private.h"
#include "svn_checksum.h"
#include "fs_skels.h"
@@ -511,18 +512,18 @@ svn_fs_base__parse_representation_skel(r
{
svn_skel_t *checksum_skel = header_skel->children->next->next;
rep->md5_checksum =
- svn_checksum__from_digest((const unsigned char *)
- (checksum_skel->children->next->data),
- svn_checksum_md5, pool);
+ svn_checksum__from_digest_md5((const unsigned char *)
+ (checksum_skel->children->next->data),
+ pool);
/* SHA1 */
if (header_skel->children->next->next->next)
{
checksum_skel = header_skel->children->next->next->next;
rep->sha1_checksum =
- svn_checksum__from_digest((const unsigned char *)
- (checksum_skel->children->next->data),
- svn_checksum_sha1, pool);
+ svn_checksum__from_digest_sha1(
+ (const unsigned char *)(checksum_skel->children->next->data),
+ pool);
}
}
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_base/uuid.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_base/uuid.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_base/uuid.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_base/uuid.c Thu Aug 16 10:17:48 2012
@@ -48,39 +48,27 @@ txn_body_get_uuid(void *baton, trail_t *
svn_error_t *
-svn_fs_base__get_uuid(svn_fs_t *fs,
- const char **uuid,
- apr_pool_t *pool)
+svn_fs_base__populate_uuid(svn_fs_t *fs,
+ apr_pool_t *scratch_pool)
{
- base_fs_data_t *bfd = fs->fsap_data;
SVN_ERR(svn_fs__check_fs(fs, TRUE));
- /* Check for a cached UUID first. Failing that, we hit the
- database. */
- if (bfd->uuid)
- {
- *uuid = apr_pstrdup(pool, bfd->uuid);
- }
- else
+ /* We hit the database. */
{
+ const char *uuid;
struct get_uuid_args args;
- apr_pool_t *scratch_pool = svn_pool_create(pool);
args.idx = 1;
- args.uuid = uuid;
+ args.uuid = &uuid;
SVN_ERR(svn_fs_base__retry_txn(fs, txn_body_get_uuid, &args,
FALSE, scratch_pool));
- if (*uuid)
+ if (uuid)
{
- *uuid = apr_pstrdup(pool, *uuid);
-
/* Toss what we find into the cache. */
- bfd->uuid = apr_pstrdup(fs->pool, *uuid);
+ fs->uuid = apr_pstrdup(fs->pool, uuid);
}
-
- svn_pool_destroy(scratch_pool);
}
return SVN_NO_ERROR;
@@ -109,7 +97,6 @@ svn_fs_base__set_uuid(svn_fs_t *fs,
apr_pool_t *pool)
{
struct set_uuid_args args;
- base_fs_data_t *bfd = fs->fsap_data;
SVN_ERR(svn_fs__check_fs(fs, TRUE));
@@ -122,7 +109,7 @@ svn_fs_base__set_uuid(svn_fs_t *fs,
/* Toss our value into the cache. */
if (uuid)
- bfd->uuid = apr_pstrdup(fs->pool, uuid);
+ fs->uuid = apr_pstrdup(fs->pool, uuid);
return SVN_NO_ERROR;
}
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_base/uuid.h
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_base/uuid.h?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_base/uuid.h (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_base/uuid.h Thu Aug 16 10:17:48 2012
@@ -29,12 +29,15 @@ extern "C" {
+/* Set FS->UUID to the value read from the database, allocated
+ in FS->POOL. Use SCRATCH_POOL for temporary allocations. */
+svn_error_t *svn_fs_base__populate_uuid(svn_fs_t *fs,
+ apr_pool_t *scratch_pool);
+
+
/* These functions implement some of the calls in the FS loader
library's fs vtable. */
-svn_error_t *svn_fs_base__get_uuid(svn_fs_t *fs, const char **uuid,
- apr_pool_t *pool);
-
svn_error_t *svn_fs_base__set_uuid(svn_fs_t *fs, const char *uuid,
apr_pool_t *pool);
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/caching.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/caching.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/caching.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/caching.c Thu Aug 16 10:17:48 2012
@@ -33,6 +33,7 @@
#include "svn_private_config.h"
#include "svn_hash.h"
#include "private/svn_debug.h"
+#include "private/svn_subr_private.h"
/* Return a memcache in *MEMCACHE_P for FS if it's configured to use
memcached, or NULL otherwise. Also, sets *FAIL_STOP to a boolean
@@ -44,6 +45,7 @@ read_config(svn_memcache_t **memcache_p,
svn_boolean_t *fail_stop,
svn_boolean_t *cache_txdeltas,
svn_boolean_t *cache_fulltexts,
+ svn_boolean_t *cache_revprops,
svn_fs_t *fs,
apr_pool_t *pool)
{
@@ -74,6 +76,16 @@ read_config(svn_memcache_t **memcache_p,
SVN_FS_CONFIG_FSFS_CACHE_FULLTEXTS,
TRUE);
+ /* don't cache revprops by default.
+ * Revprop caching significantly speeds up operations like
+ * svn ls -v. However, it requires synchronization that may
+ * not be available or efficient in the current server setup.
+ */
+ *cache_revprops
+ = svn_hash__get_bool(fs->config,
+ SVN_FS_CONFIG_FSFS_CACHE_REVPROPS,
+ FALSE);
+
return svn_config_get_bool(ffd->config, fail_stop,
CONFIG_SECTION_CACHES, CONFIG_OPTION_FAIL_STOP,
FALSE);
@@ -241,7 +253,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
{
fs_fs_data_t *ffd = fs->fsap_data;
const char *prefix = apr_pstrcat(pool,
- "fsfs:", ffd->uuid,
+ "fsfs:", fs->uuid,
"/", fs->path, ":",
(char *)NULL);
svn_memcache_t *memcache;
@@ -249,12 +261,14 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
svn_boolean_t no_handler;
svn_boolean_t cache_txdeltas;
svn_boolean_t cache_fulltexts;
+ svn_boolean_t cache_revprops;
/* Evaluating the cache configuration. */
SVN_ERR(read_config(&memcache,
&no_handler,
&cache_txdeltas,
&cache_fulltexts,
+ &cache_revprops,
fs,
pool));
@@ -339,6 +353,27 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
SVN_ERR(init_callbacks(ffd->fulltext_cache, fs, no_handler, pool));
+ /* initialize revprop cache, if full-text caching has been enabled */
+ if (cache_revprops)
+ {
+ SVN_ERR(create_cache(&(ffd->revprop_cache),
+ NULL,
+ membuffer,
+ 0, 0, /* Do not use inprocess cache */
+ svn_fs_fs__serialize_properties,
+ svn_fs_fs__deserialize_properties,
+ APR_HASH_KEY_STRING,
+ apr_pstrcat(pool, prefix, "REVPROP",
+ (char *)NULL),
+ fs->pool));
+ }
+ else
+ {
+ ffd->revprop_cache = NULL;
+ }
+
+ SVN_ERR(init_callbacks(ffd->revprop_cache, fs, no_handler, pool));
+
/* initialize txdelta window cache, if that has been enabled */
if (cache_txdeltas)
{
@@ -461,7 +496,7 @@ svn_fs_fs__initialize_txn_caches(svn_fs_
to start a new transaction later that receives the same id.
Therefore, throw in a uuid as well - just to be sure. */
const char *prefix = apr_pstrcat(pool,
- "fsfs:", ffd->uuid,
+ "fsfs:", fs->uuid,
"/", fs->path,
":", txn_id,
":", svn_uuid_generate(pool), ":",
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/dag.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/dag.c Thu Aug 16 10:17:48 2012
@@ -749,7 +749,6 @@ svn_fs_fs__dag_delete(dag_node_t *parent
apr_pool_t *pool)
{
node_revision_t *parent_noderev;
- apr_hash_t *entries;
svn_fs_t *fs = parent->fs;
svn_fs_dirent_t *dirent;
svn_fs_id_t *id;
@@ -778,11 +777,9 @@ svn_fs_fs__dag_delete(dag_node_t *parent
subpool = svn_pool_create(pool);
- /* Get a dirent hash for this directory. */
- SVN_ERR(svn_fs_fs__rep_contents_dir(&entries, fs, parent_noderev, subpool));
-
- /* Find name in the ENTRIES hash. */
- dirent = apr_hash_get(entries, name, APR_HASH_KEY_STRING);
+ /* Search this directory for a dirent with that NAME. */
+ SVN_ERR(svn_fs_fs__rep_contents_dir_entry(&dirent, fs, parent_noderev,
+ name, subpool, subpool));
/* If we never found ID in ENTRIES (perhaps because there are no
ENTRIES, perhaps because ID just isn't in the existing ENTRIES
@@ -1146,7 +1143,7 @@ svn_fs_fs__dag_open(dag_node_t **child_p
const svn_fs_id_t *node_id;
/* Ensure that NAME exists in PARENT's entry list. */
- SVN_ERR(dir_entry_id_from_node(&node_id, parent, name,
+ SVN_ERR(dir_entry_id_from_node(&node_id, parent, name,
scratch_pool, scratch_pool));
if (! node_id)
return svn_error_createf
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/fs.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/fs.c Thu Aug 16 10:17:48 2012
@@ -73,7 +73,8 @@ fs_serialized_init(svn_fs_t *fs, apr_poo
know of a better way of associating such data with the
repository. */
- key = apr_pstrcat(pool, SVN_FSFS_SHARED_USERDATA_PREFIX, ffd->uuid,
+ SVN_ERR_ASSERT(fs->uuid);
+ key = apr_pstrcat(pool, SVN_FSFS_SHARED_USERDATA_PREFIX, fs->uuid,
(char *) NULL);
status = apr_pool_userdata_get(&val, key, common_pool);
if (status)
@@ -130,7 +131,6 @@ static fs_vtable_t fs_vtable = {
svn_fs_fs__revision_prop,
svn_fs_fs__revision_proplist,
svn_fs_fs__change_rev_prop,
- svn_fs_fs__get_uuid,
svn_fs_fs__set_uuid,
svn_fs_fs__revision_root,
svn_fs_fs__begin_txn,
@@ -294,10 +294,18 @@ fs_hotcopy(svn_fs_t *src_fs,
void *cancel_baton,
apr_pool_t *pool)
{
+ SVN_ERR(svn_fs__check_fs(src_fs, FALSE));
SVN_ERR(initialize_fs_struct(src_fs));
+ SVN_ERR(svn_fs_fs__open(src_fs, src_path, pool));
+ SVN_ERR(svn_fs_fs__initialize_caches(src_fs, pool));
SVN_ERR(fs_serialized_init(src_fs, pool, pool));
+
+ SVN_ERR(svn_fs__check_fs(dst_fs, FALSE));
SVN_ERR(initialize_fs_struct(dst_fs));
- SVN_ERR(fs_serialized_init(dst_fs, pool, pool));
+ /* In INCREMENTAL mode, svn_fs_fs__hotcopy() will open DST_FS.
+ Otherwise, it's not an FS yet --- possibly just an empty dir --- so
+ can't be opened.
+ */
return svn_fs_fs__hotcopy(src_fs, dst_fs, src_path, dst_path,
incremental, cancel_func, cancel_baton, pool);
}
Modified: subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/fs.h?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_fs_fs/fs.h Thu Aug 16 10:17:48 2012
@@ -34,6 +34,7 @@
#include "private/svn_fs_private.h"
#include "private/svn_sqlite.h"
#include "private/svn_mutex.h"
+#include "private/svn_named_atomic.h"
#ifdef __cplusplus
extern "C" {
@@ -60,6 +61,12 @@ extern "C" {
#define PATH_LOCKS_DIR "locks" /* Directory of locks */
#define PATH_MIN_UNPACKED_REV "min-unpacked-rev" /* Oldest revision which
has not been packed. */
+#define PATH_REVPROP_GENERATION "revprop-generation"
+ /* Current revprop generation*/
+#define PATH_MANIFEST "manifest" /* Manifest file name */
+#define PATH_PACKED "pack" /* Packed revision data file */
+#define PATH_EXT_PACKED_SHARD ".pack" /* Extension for packed
+ shards */
/* If you change this, look at tests/svn_test_fs.c(maybe_install_fsfs_conf) */
#define PATH_CONFIG "fsfs.conf" /* Configuration */
@@ -87,11 +94,14 @@ extern "C" {
#define CONFIG_OPTION_ENABLE_PROPS_DELTIFICATION "enable-props-deltification"
#define CONFIG_OPTION_MAX_DELTIFICATION_WALK "max-deltification-walk"
#define CONFIG_OPTION_MAX_LINEAR_DELTIFICATION "max-linear-deltification"
+#define CONFIG_SECTION_PACKED_REVPROPS "packed-revprops"
+#define CONFIG_OPTION_REVPROP_PACK_SIZE "revprop-pack-size"
+#define CONFIG_OPTION_COMPRESS_PACKED_REVPROPS "compress-packed-revprops"
/* The format number of this filesystem.
This is independent of the repository format number, and
independent of any other FS back ends. */
-#define SVN_FS_FS__FORMAT_NUMBER 4
+#define SVN_FS_FS__FORMAT_NUMBER 6
/* The minimum format number that supports svndiff version 1. */
#define SVN_FS_FS__MIN_SVNDIFF1_FORMAT 2
@@ -131,8 +141,8 @@ extern "C" {
revprops.db . */
#define SVN_FS_FS__PACKED_REVPROP_SQLITE_DEV_FORMAT 5
-/* The minimum format number that supports packed revprop shards. */
-#define SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT SVN_FS_FS__PACKED_REVPROP_SQLITE_DEV_FORMAT
+/* The minimum format number that supports packed revprops. */
+#define SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT 6
/* The minimum format number that supports a configuration file (fsfs.conf) */
#define SVN_FS_FS__MIN_CONFIG_FILE 4
@@ -207,7 +217,8 @@ typedef struct fs_fs_shared_data_t
apr_pool_t *common_pool;
} fs_fs_shared_data_t;
-/* Private (non-shared) FSFS-specific data for each svn_fs_t object. */
+/* Private (non-shared) FSFS-specific data for each svn_fs_t object.
+ Any caches in here may be NULL. */
typedef struct fs_fs_data_t
{
/* The format number of this FS. */
@@ -216,9 +227,6 @@ typedef struct fs_fs_data_t
layouts) or zero (for linear layouts). */
int max_files_per_dir;
- /* The uuid of this FS. */
- const char *uuid;
-
/* The revision that was youngest, last time we checked. */
svn_revnum_t youngest_rev_cache;
@@ -246,6 +254,21 @@ typedef struct fs_fs_data_t
rep key (revision/offset) to svn_string_t. */
svn_cache__t *fulltext_cache;
+ /* Access object to the atomics namespace used by revprop caching.
+ Will be NULL until the first access. */
+ svn_atomic_namespace__t *revprop_namespace;
+
+ /* Access object to the revprop "generation". Will be NULL until
+ the first access. */
+ svn_named_atomic__t *revprop_generation;
+
+ /* Access object to the revprop update timeout. Will be NULL until
+ the first access. */
+ svn_named_atomic__t *revprop_timeout;
+
+ /* Revision property cache. Maps from (rev,generation) to apr_hash_t. */
+ svn_cache__t *revprop_cache;
+
/* Pack manifest cache; a cache mapping (svn_revnum_t) shard number to
a manifest; and a manifest is a mapping from (svn_revnum_t) revision
number offset within a shard to (apr_off_t) byte-offset in the
@@ -278,13 +301,21 @@ typedef struct fs_fs_data_t
/* Thread-safe boolean */
svn_atomic_t rep_cache_db_opened;
- /* The oldest revision not in a pack file. */
+ /* The oldest revision not in a pack file. It also applies to revprops
+ * if revprop packing has been enabled by the FSFS format version. */
svn_revnum_t min_unpacked_rev;
/* Whether rep-sharing is supported by the filesystem
* and allowed by the configuration. */
svn_boolean_t rep_sharing_allowed;
+ /* File size limit in bytes up to which multiple revprops shall be packed
+ * into a single file. */
+ apr_int64_t revprop_pack_size;
+
+ /* Whether packed revprop files shall be compressed. */
+ svn_boolean_t compress_packed_revprops;
+
/* Whether directory nodes shall be deltified just like file nodes. */
svn_boolean_t deltify_directories;