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 [4/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_client/ra.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/ra.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/ra.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/ra.c Tue Jul 19 23:05:44 2011
@@ -89,7 +89,8 @@ get_wc_prop(void *baton,
apr_pool_t *pool)
{
callback_baton_t *cb = baton;
- const char *local_abspath;
+ const char *local_abspath = NULL;
+ svn_error_t *err;
*value = NULL;
@@ -101,29 +102,39 @@ get_wc_prop(void *baton,
for (i = 0; i < cb->commit_items->nelts; i++)
{
svn_client_commit_item3_t *item
- = APR_ARRAY_IDX(cb->commit_items, i,
- svn_client_commit_item3_t *);
+ = APR_ARRAY_IDX(cb->commit_items, i, svn_client_commit_item3_t *);
if (! strcmp(relpath, item->session_relpath))
{
SVN_ERR_ASSERT(svn_dirent_is_absolute(item->path));
- return svn_error_trace(svn_wc_prop_get2(value, cb->ctx->wc_ctx,
- item->path, name,
- pool, pool));
+ local_abspath = item->path;
+ break;
}
}
- return SVN_NO_ERROR;
+ /* Commits can only query relpaths in the commit_items list
+ since the commit driver traverses paths as they are, or will
+ be, in the repository. Non-commits query relpaths in the
+ working copy. */
+ if (! local_abspath)
+ return SVN_NO_ERROR;
}
/* If we don't have a base directory, then there are no properties. */
else if (cb->base_dir_abspath == NULL)
return SVN_NO_ERROR;
- local_abspath = svn_dirent_join(cb->base_dir_abspath, relpath, pool);
+ else
+ local_abspath = svn_dirent_join(cb->base_dir_abspath, relpath, pool);
- return svn_error_trace(svn_wc_prop_get2(value, cb->ctx->wc_ctx,
- local_abspath, name, pool, pool));
+ err = svn_wc_prop_get2(value, cb->ctx->wc_ctx, local_abspath, name,
+ pool, pool);
+ if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+ {
+ svn_error_clear(err);
+ err = NULL;
+ }
+ return svn_error_trace(err);
}
/* This implements the 'svn_ra_push_wc_prop_func_t' interface. */
@@ -194,13 +205,13 @@ set_wc_prop(void *baton,
Unfortunately, we don't have a clean mechanism for doing that
here, so we just set the property and hope for the best. */
return svn_error_trace(svn_wc_prop_set4(cb->ctx->wc_ctx, local_abspath,
- name,
- value, svn_depth_empty,
- TRUE /* skip_checks */,
- NULL /* changelist_filter */,
- NULL, NULL /* cancellation */,
- NULL, NULL /* notification */,
- pool));
+ name,
+ value, svn_depth_empty,
+ TRUE /* skip_checks */,
+ NULL /* changelist_filter */,
+ NULL, NULL /* cancellation */,
+ NULL, NULL /* notification */,
+ pool));
}
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/relocate.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/relocate.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/relocate.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/relocate.c Tue Jul 19 23:05:44 2011
@@ -242,8 +242,8 @@ svn_client_relocate2(const char *wcroot_
if (ignore_externals)
{
return svn_error_trace(svn_wc_relocate4(ctx->wc_ctx, local_abspath,
- from_prefix, to_prefix,
- validator_func, &vb, pool));
+ from_prefix, to_prefix,
+ validator_func, &vb, pool));
}
/* Fetch our current root URL. */
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/status.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/status.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/status.c Tue Jul 19 23:05:44 2011
@@ -282,13 +282,12 @@ svn_client_status5(svn_revnum_t *result_
SVN_ERR(svn_dirent_get_absolute(&target_abspath, path, pool));
{
- svn_node_kind_t kind, disk_kind;
+ svn_node_kind_t kind;
- SVN_ERR(svn_io_check_path(target_abspath, &disk_kind, pool));
SVN_ERR(svn_wc_read_kind(&kind, ctx->wc_ctx, target_abspath, FALSE, pool));
- /* Dir must be an existing directory or the status editor fails */
- if (kind == svn_node_dir && disk_kind == svn_node_dir)
+ /* Dir must be a working copy directory or the status editor fails */
+ if (kind == svn_node_dir)
{
dir_abspath = target_abspath;
target_basename = "";
@@ -313,15 +312,6 @@ svn_client_status5(svn_revnum_t *result_
_("'%s' is not a working copy"),
svn_dirent_local_style(path, pool));
}
-
- /* Check for issue #1617 and stat_tests.py 14
- "status on '..' where '..' is not versioned". */
- if (strcmp(path, "..") == 0)
- {
- return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
- _("'%s' is not a working copy"),
- svn_dirent_local_style(path, pool));
- }
}
}
}
@@ -377,7 +367,8 @@ svn_client_status5(svn_revnum_t *result_
&edit_revision, ctx->wc_ctx,
dir_abspath, target_basename,
depth, get_all,
- no_ignore, server_supports_depth,
+ no_ignore, depth_as_sticky,
+ server_supports_depth,
ignores, tweak_status, &sb,
ctx->cancel_func, ctx->cancel_baton,
pool, pool));
@@ -456,10 +447,11 @@ svn_client_status5(svn_revnum_t *result_
working copy and HEAD. */
SVN_ERR(svn_wc_crawl_revisions5(ctx->wc_ctx,
target_abspath,
- &lock_fetch_reporter, &rb, FALSE,
- depth, TRUE,
+ &lock_fetch_reporter, &rb,
+ FALSE /* restore_files */,
+ depth, (! depth_as_sticky),
(! server_supports_depth),
- FALSE,
+ FALSE /* use_commit_times */,
ctx->cancel_func, ctx->cancel_baton,
NULL, NULL, pool));
}
@@ -542,6 +534,9 @@ svn_client_status_dup(const svn_client_s
if (status->repos_root_url)
st->repos_root_url = apr_pstrdup(result_pool, status->repos_root_url);
+ if (status->repos_uuid)
+ st->repos_uuid = apr_pstrdup(result_pool, status->repos_uuid);
+
if (status->repos_relpath)
st->repos_relpath = apr_pstrdup(result_pool, status->repos_relpath);
@@ -603,6 +598,7 @@ svn_client__create_status(svn_client_sta
(*cst)->changed_author = status->changed_author;
(*cst)->repos_root_url = status->repos_root_url;
+ (*cst)->repos_uuid = status->repos_uuid;
(*cst)->repos_relpath = status->repos_relpath;
(*cst)->switched = status->switched;
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/update.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/update.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/update.c Tue Jul 19 23:05:44 2011
@@ -255,7 +255,7 @@ update_internal(svn_revnum_t *result_rev
nt = svn_wc_create_notify(local_abspath,
tree_conflicted
- ? svn_wc_notify_skip
+ ? svn_wc_notify_skip_conflicted
: svn_wc_notify_update_skip_working_only,
pool);
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_client/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_client/util.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_client/util.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_client/util.c Tue Jul 19 23:05:44 2011
@@ -25,7 +25,6 @@
#include <apr_strings.h>
#include "svn_pools.h"
-#include "svn_string.h"
#include "svn_error.h"
#include "svn_types.h"
#include "svn_opt.h"
@@ -42,25 +41,6 @@
#include "svn_private_config.h"
-/* Duplicate a HASH containing (char * -> svn_string_t *) key/value
- pairs using POOL. */
-static apr_hash_t *
-string_hash_dup(apr_hash_t *hash, apr_pool_t *pool)
-{
- apr_hash_index_t *hi;
- apr_hash_t *new_hash = apr_hash_make(pool);
-
- for (hi = apr_hash_first(pool, hash); hi; hi = apr_hash_next(hi))
- {
- const char *key = apr_pstrdup(pool, svn__apr_hash_index_key(hi));
- apr_ssize_t klen = svn__apr_hash_index_klen(hi);
- svn_string_t *val = svn_string_dup(svn__apr_hash_index_val(hi), pool);
-
- apr_hash_set(new_hash, key, klen, val);
- }
- return new_hash;
-}
-
svn_client_commit_item3_t *
svn_client_commit_item3_create(apr_pool_t *pool)
{
@@ -95,21 +75,6 @@ svn_client_commit_item3_dup(const svn_cl
return new_item;
}
-svn_client_proplist_item_t *
-svn_client_proplist_item_dup(const svn_client_proplist_item_t *item,
- apr_pool_t * pool)
-{
- svn_client_proplist_item_t *new_item = apr_pcalloc(pool, sizeof(*new_item));
-
- if (item->node_name)
- new_item->node_name = svn_stringbuf_dup(item->node_name, pool);
-
- if (item->prop_hash)
- new_item->prop_hash = string_hash_dup(item->prop_hash, pool);
-
- return new_item;
-}
-
svn_error_t *
svn_client__path_relative_to_root(const char **rel_path,
svn_wc_context_t *wc_ctx,
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_delta/svndiff.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_delta/svndiff.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_delta/svndiff.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_delta/svndiff.c Tue Jul 19 23:05:44 2011
@@ -144,7 +144,13 @@ zlib_encode(const char *data,
append_encoded_int(out, len);
intlen = out->len;
- if (len < MIN_COMPRESS_SIZE)
+ /* Compression initialization overhead is considered to large for
+ short buffers. Also, if we don't actually want to compress data,
+ ZLIB will produce an output no shorter than the input. Hence,
+ the DATA would directly appended to OUT, so we can do that directly
+ without calling ZLIB before. */
+ if ( (len < MIN_COMPRESS_SIZE)
+ || (compression_level == SVN_DELTA_COMPRESSION_LEVEL_NONE))
{
svn_stringbuf_appendbytes(out, data, len);
}
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_diff/diff3.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_diff/diff3.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_diff/diff3.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_diff/diff3.c Tue Jul 19 23:05:44 2011
@@ -41,208 +41,208 @@ svn_diff__resolve_conflict(svn_diff_t *h
svn_diff__token_index_t num_tokens,
apr_pool_t *pool)
{
- apr_off_t modified_start = hunk->modified_start + 1;
- apr_off_t latest_start = hunk->latest_start + 1;
- apr_off_t common_length;
- apr_off_t modified_length = hunk->modified_length;
- apr_off_t latest_length = hunk->latest_length;
- svn_diff__position_t *start_position[2];
- svn_diff__position_t *position[2];
- svn_diff__token_index_t *token_counts[2];
- svn_diff__lcs_t *lcs = NULL;
- svn_diff__lcs_t **lcs_ref = &lcs;
- svn_diff_t **diff_ref = &hunk->resolved_diff;
- apr_pool_t *subpool;
-
- /* First find the starting positions for the
- * comparison
- */
-
- start_position[0] = *position_list1;
- start_position[1] = *position_list2;
-
- while (start_position[0]->offset < modified_start)
- start_position[0] = start_position[0]->next;
-
- while (start_position[1]->offset < latest_start)
- start_position[1] = start_position[1]->next;
+ apr_off_t modified_start = hunk->modified_start + 1;
+ apr_off_t latest_start = hunk->latest_start + 1;
+ apr_off_t common_length;
+ apr_off_t modified_length = hunk->modified_length;
+ apr_off_t latest_length = hunk->latest_length;
+ svn_diff__position_t *start_position[2];
+ svn_diff__position_t *position[2];
+ svn_diff__token_index_t *token_counts[2];
+ svn_diff__lcs_t *lcs = NULL;
+ svn_diff__lcs_t **lcs_ref = &lcs;
+ svn_diff_t **diff_ref = &hunk->resolved_diff;
+ apr_pool_t *subpool;
- position[0] = start_position[0];
- position[1] = start_position[1];
+ /* First find the starting positions for the
+ * comparison
+ */
+
+ start_position[0] = *position_list1;
+ start_position[1] = *position_list2;
+
+ while (start_position[0]->offset < modified_start)
+ start_position[0] = start_position[0]->next;
+
+ while (start_position[1]->offset < latest_start)
+ start_position[1] = start_position[1]->next;
+
+ position[0] = start_position[0];
+ position[1] = start_position[1];
+
+ common_length = modified_length < latest_length
+ ? modified_length : latest_length;
+
+ while (common_length > 0
+ && position[0]->token_index == position[1]->token_index)
+ {
+ position[0] = position[0]->next;
+ position[1] = position[1]->next;
+
+ common_length--;
+ }
+
+ if (common_length == 0
+ && modified_length == latest_length)
+ {
+ hunk->type = svn_diff__type_diff_common;
+ hunk->resolved_diff = NULL;
+
+ *position_list1 = position[0];
+ *position_list2 = position[1];
+
+ return;
+ }
+
+ hunk->type = svn_diff__type_conflict;
+
+ /* ### If we have a conflict we can try to find the
+ * ### common parts in it by getting an lcs between
+ * ### modified (start to start + length) and
+ * ### latest (start to start + length).
+ * ### We use this lcs to create a simple diff. Only
+ * ### where there is a diff between the two, we have
+ * ### a conflict.
+ * ### This raises a problem; several common diffs and
+ * ### conflicts can occur within the same original
+ * ### block. This needs some thought.
+ * ###
+ * ### NB: We can use the node _pointers_ to identify
+ * ### different tokens
+ */
- common_length = modified_length < latest_length
- ? modified_length : latest_length;
+ subpool = svn_pool_create(pool);
- while (common_length > 0
- && position[0]->token_index == position[1]->token_index)
- {
+ /* Calculate how much of the two sequences was
+ * actually the same.
+ */
+ common_length = (modified_length < latest_length
+ ? modified_length : latest_length)
+ - common_length;
+
+ /* If there were matching symbols at the start of
+ * both sequences, record that fact.
+ */
+ if (common_length > 0)
+ {
+ lcs = apr_palloc(subpool, sizeof(*lcs));
+ lcs->next = NULL;
+ lcs->position[0] = start_position[0];
+ lcs->position[1] = start_position[1];
+ lcs->length = common_length;
+
+ lcs_ref = &lcs->next;
+ }
+
+ modified_length -= common_length;
+ latest_length -= common_length;
+
+ modified_start = start_position[0]->offset;
+ latest_start = start_position[1]->offset;
+
+ start_position[0] = position[0];
+ start_position[1] = position[1];
+
+ /* Create a new ring for svn_diff__lcs to grok.
+ * We can safely do this given we don't need the
+ * positions we processed anymore.
+ */
+ if (modified_length == 0)
+ {
+ *position_list1 = position[0];
+ position[0] = NULL;
+ }
+ else
+ {
+ while (--modified_length)
position[0] = position[0]->next;
- position[1] = position[1]->next;
-
- common_length--;
- }
-
- if (common_length == 0
- && modified_length == latest_length)
- {
- hunk->type = svn_diff__type_diff_common;
- hunk->resolved_diff = NULL;
-
- *position_list1 = position[0];
- *position_list2 = position[1];
-
- return;
- }
-
- hunk->type = svn_diff__type_conflict;
-
- /* ### If we have a conflict we can try to find the
- * ### common parts in it by getting an lcs between
- * ### modified (start to start + length) and
- * ### latest (start to start + length).
- * ### We use this lcs to create a simple diff. Only
- * ### where there is a diff between the two, we have
- * ### a conflict.
- * ### This raises a problem; several common diffs and
- * ### conflicts can occur within the same original
- * ### block. This needs some thought.
- * ###
- * ### NB: We can use the node _pointers_ to identify
- * ### different tokens
- */
-
- subpool = svn_pool_create(pool);
-
- /* Calculate how much of the two sequences was
- * actually the same.
- */
- common_length = (modified_length < latest_length
- ? modified_length : latest_length)
- - common_length;
-
- /* If there were matching symbols at the start of
- * both sequences, record that fact.
- */
- if (common_length > 0)
- {
- lcs = apr_palloc(subpool, sizeof(*lcs));
- lcs->next = NULL;
- lcs->position[0] = start_position[0];
- lcs->position[1] = start_position[1];
- lcs->length = common_length;
-
- lcs_ref = &lcs->next;
- }
-
- modified_length -= common_length;
- latest_length -= common_length;
-
- modified_start = start_position[0]->offset;
- latest_start = start_position[1]->offset;
-
- start_position[0] = position[0];
- start_position[1] = position[1];
-
- /* Create a new ring for svn_diff__lcs to grok.
- * We can safely do this given we don't need the
- * positions we processed anymore.
- */
- if (modified_length == 0)
- {
- *position_list1 = position[0];
- position[0] = NULL;
- }
- else
- {
- while (--modified_length)
- position[0] = position[0]->next;
-
- *position_list1 = position[0]->next;
- position[0]->next = start_position[0];
- }
-
- if (latest_length == 0)
- {
- *position_list2 = position[1];
- position[1] = NULL;
- }
- else
- {
- while (--latest_length)
- position[1] = position[1]->next;
-
- *position_list2 = position[1]->next;
- position[1]->next = start_position[1];
- }
-
- token_counts[0] = svn_diff__get_token_counts(position[0], num_tokens,
- subpool);
- token_counts[1] = svn_diff__get_token_counts(position[1], num_tokens,
- subpool);
-
- *lcs_ref = svn_diff__lcs(position[0], position[1], token_counts[0],
- token_counts[1], num_tokens, 0, 0, subpool);
-
- /* Fix up the EOF lcs element in case one of
- * the two sequences was NULL.
- */
- if ((*lcs_ref)->position[0]->offset == 1)
- (*lcs_ref)->position[0] = *position_list1;
-
- if ((*lcs_ref)->position[1]->offset == 1)
- (*lcs_ref)->position[1] = *position_list2;
-
- /* Produce the resolved diff */
- while (1)
- {
- if (modified_start < lcs->position[0]->offset
- || latest_start < lcs->position[1]->offset)
- {
- (*diff_ref) = apr_palloc(pool, sizeof(**diff_ref));
-
- (*diff_ref)->type = svn_diff__type_conflict;
- (*diff_ref)->original_start = hunk->original_start;
- (*diff_ref)->original_length = hunk->original_length;
- (*diff_ref)->modified_start = modified_start - 1;
- (*diff_ref)->modified_length = lcs->position[0]->offset
- - modified_start;
- (*diff_ref)->latest_start = latest_start - 1;
- (*diff_ref)->latest_length = lcs->position[1]->offset
- - latest_start;
- (*diff_ref)->resolved_diff = NULL;
-
- diff_ref = &(*diff_ref)->next;
- }
- /* Detect the EOF */
- if (lcs->length == 0)
- break;
+ *position_list1 = position[0]->next;
+ position[0]->next = start_position[0];
+ }
+
+ if (latest_length == 0)
+ {
+ *position_list2 = position[1];
+ position[1] = NULL;
+ }
+ else
+ {
+ while (--latest_length)
+ position[1] = position[1]->next;
- modified_start = lcs->position[0]->offset;
- latest_start = lcs->position[1]->offset;
+ *position_list2 = position[1]->next;
+ position[1]->next = start_position[1];
+ }
- (*diff_ref) = apr_palloc(pool, sizeof(**diff_ref));
+ token_counts[0] = svn_diff__get_token_counts(position[0], num_tokens,
+ subpool);
+ token_counts[1] = svn_diff__get_token_counts(position[1], num_tokens,
+ subpool);
- (*diff_ref)->type = svn_diff__type_diff_common;
- (*diff_ref)->original_start = hunk->original_start;
- (*diff_ref)->original_length = hunk->original_length;
- (*diff_ref)->modified_start = modified_start - 1;
- (*diff_ref)->modified_length = lcs->length;
- (*diff_ref)->latest_start = latest_start - 1;
- (*diff_ref)->latest_length = lcs->length;
- (*diff_ref)->resolved_diff = NULL;
+ *lcs_ref = svn_diff__lcs(position[0], position[1], token_counts[0],
+ token_counts[1], num_tokens, 0, 0, subpool);
- diff_ref = &(*diff_ref)->next;
+ /* Fix up the EOF lcs element in case one of
+ * the two sequences was NULL.
+ */
+ if ((*lcs_ref)->position[0]->offset == 1)
+ (*lcs_ref)->position[0] = *position_list1;
+
+ if ((*lcs_ref)->position[1]->offset == 1)
+ (*lcs_ref)->position[1] = *position_list2;
+
+ /* Produce the resolved diff */
+ while (1)
+ {
+ if (modified_start < lcs->position[0]->offset
+ || latest_start < lcs->position[1]->offset)
+ {
+ (*diff_ref) = apr_palloc(pool, sizeof(**diff_ref));
+
+ (*diff_ref)->type = svn_diff__type_conflict;
+ (*diff_ref)->original_start = hunk->original_start;
+ (*diff_ref)->original_length = hunk->original_length;
+ (*diff_ref)->modified_start = modified_start - 1;
+ (*diff_ref)->modified_length = lcs->position[0]->offset
+ - modified_start;
+ (*diff_ref)->latest_start = latest_start - 1;
+ (*diff_ref)->latest_length = lcs->position[1]->offset
+ - latest_start;
+ (*diff_ref)->resolved_diff = NULL;
+
+ diff_ref = &(*diff_ref)->next;
+ }
+
+ /* Detect the EOF */
+ if (lcs->length == 0)
+ break;
+
+ modified_start = lcs->position[0]->offset;
+ latest_start = lcs->position[1]->offset;
+
+ (*diff_ref) = apr_palloc(pool, sizeof(**diff_ref));
+
+ (*diff_ref)->type = svn_diff__type_diff_common;
+ (*diff_ref)->original_start = hunk->original_start;
+ (*diff_ref)->original_length = hunk->original_length;
+ (*diff_ref)->modified_start = modified_start - 1;
+ (*diff_ref)->modified_length = lcs->length;
+ (*diff_ref)->latest_start = latest_start - 1;
+ (*diff_ref)->latest_length = lcs->length;
+ (*diff_ref)->resolved_diff = NULL;
+
+ diff_ref = &(*diff_ref)->next;
- modified_start += lcs->length;
- latest_start += lcs->length;
+ modified_start += lcs->length;
+ latest_start += lcs->length;
- lcs = lcs->next;
- }
+ lcs = lcs->next;
+ }
- *diff_ref = NULL;
+ *diff_ref = NULL;
- svn_pool_destroy(subpool);
+ svn_pool_destroy(subpool);
}
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_diff/diff_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_diff/diff_file.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_diff/diff_file.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_diff/diff_file.c Tue Jul 19 23:05:44 2011
@@ -528,9 +528,11 @@ find_identical_suffix(apr_off_t *suffix_
apr_off_t suffix_min_offset0;
apr_off_t min_file_size;
int suffix_lines_to_keep = SUFFIX_LINES_TO_KEEP;
- svn_boolean_t is_match, reached_prefix;
+ svn_boolean_t is_match;
+ svn_boolean_t reached_prefix;
apr_off_t lines = 0;
- svn_boolean_t had_cr, had_nl;
+ svn_boolean_t had_cr;
+ svn_boolean_t had_nl;
apr_size_t i;
/* Initialize file_for_suffix[].
@@ -586,6 +588,7 @@ find_identical_suffix(apr_off_t *suffix_
/* Count an extra line for the last line not ending in an eol. */
lines++;
+ had_nl = FALSE;
while (is_match)
{
/* Initialize the minimum pointer positions. */
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_diff/parse-diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_diff/parse-diff.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_diff/parse-diff.c Tue Jul 19 23:05:44 2011
@@ -1394,5 +1394,5 @@ svn_diff_close_patch_file(svn_patch_file
apr_pool_t *scratch_pool)
{
return svn_error_trace(svn_io_file_close(patch_file->apr_file,
- scratch_pool));
+ scratch_pool));
}
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_fs/fs-loader.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_fs/fs-loader.c Tue Jul 19 23:05:44 2011
@@ -459,6 +459,31 @@ svn_fs_upgrade(const char *path, apr_poo
return svn_error_trace(err2);
}
+svn_error_t *
+svn_fs_verify(const char *path,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool)
+{
+ svn_error_t *err;
+ svn_error_t *err2;
+ fs_library_vtable_t *vtable;
+ svn_fs_t *fs;
+
+ SVN_ERR(fs_library_vtable(&vtable, path, pool));
+ fs = fs_new(NULL, pool);
+ SVN_ERR(acquire_fs_mutex());
+ err = vtable->verify_fs(fs, path, cancel_func, cancel_baton,
+ pool, common_pool);
+ err2 = release_fs_mutex();
+ if (err)
+ {
+ svn_error_clear(err2);
+ return svn_error_trace(err);
+ }
+ return svn_error_trace(err2);
+}
+
const char *
svn_fs_path(svn_fs_t *fs, apr_pool_t *pool)
{
@@ -603,7 +628,7 @@ svn_fs_hotcopy_berkeley(const char *src_
svn_boolean_t clean_logs, apr_pool_t *pool)
{
return svn_error_trace(svn_fs_hotcopy(src_path, dest_path, clean_logs,
- pool));
+ pool));
}
svn_error_t *
@@ -629,7 +654,7 @@ svn_fs_berkeley_logfiles(apr_array_heade
SVN_ERR(fs_library_vtable(&vtable, path, pool));
return svn_error_trace(vtable->bdb_logfiles(logfiles, path, only_unused,
- pool));
+ pool));
}
@@ -863,7 +888,7 @@ svn_fs_node_history(svn_fs_history_t **h
const char *path, apr_pool_t *pool)
{
return svn_error_trace(root->vtable->node_history(history_p, root, path,
- pool));
+ pool));
}
svn_error_t *
@@ -900,7 +925,7 @@ svn_fs_node_created_rev(svn_revnum_t *re
const char *path, apr_pool_t *pool)
{
return svn_error_trace(root->vtable->node_created_rev(revision, root, path,
- pool));
+ pool));
}
svn_error_t *
@@ -908,7 +933,7 @@ svn_fs_node_origin_rev(svn_revnum_t *rev
const char *path, apr_pool_t *pool)
{
return svn_error_trace(root->vtable->node_origin_rev(revision, root, path,
- pool));
+ pool));
}
svn_error_t *
@@ -916,7 +941,7 @@ svn_fs_node_created_path(const char **cr
const char *path, apr_pool_t *pool)
{
return svn_error_trace(root->vtable->node_created_path(created_path, root,
- path, pool));
+ path, pool));
}
svn_error_t *
@@ -924,7 +949,7 @@ svn_fs_node_prop(svn_string_t **value_p,
const char *path, const char *propname, apr_pool_t *pool)
{
return svn_error_trace(root->vtable->node_prop(value_p, root, path,
- propname, pool));
+ propname, pool));
}
svn_error_t *
@@ -932,7 +957,7 @@ svn_fs_node_proplist(apr_hash_t **table_
const char *path, apr_pool_t *pool)
{
return svn_error_trace(root->vtable->node_proplist(table_p, root, path,
- pool));
+ pool));
}
svn_error_t *
@@ -941,7 +966,7 @@ svn_fs_change_node_prop(svn_fs_root_t *r
apr_pool_t *pool)
{
return svn_error_trace(root->vtable->change_node_prop(root, path, name,
- value, pool));
+ value, pool));
}
svn_error_t *
@@ -950,9 +975,9 @@ svn_fs_props_changed(svn_boolean_t *chan
const char *path2, apr_pool_t *pool)
{
return svn_error_trace(root1->vtable->props_changed(changed_p,
- root1, path1,
- root2, path2,
- pool));
+ root1, path1,
+ root2, path2,
+ pool));
}
svn_error_t *
@@ -960,7 +985,7 @@ svn_fs_copied_from(svn_revnum_t *rev_p,
svn_fs_root_t *root, const char *path, apr_pool_t *pool)
{
return svn_error_trace(root->vtable->copied_from(rev_p, path_p, root, path,
- pool));
+ pool));
}
svn_error_t *
@@ -968,7 +993,7 @@ svn_fs_closest_copy(svn_fs_root_t **root
svn_fs_root_t *root, const char *path, apr_pool_t *pool)
{
return svn_error_trace(root->vtable->closest_copy(root_p, path_p,
- root, path, pool));
+ root, path, pool));
}
svn_error_t *
@@ -981,10 +1006,10 @@ svn_fs_get_mergeinfo2(svn_mergeinfo_cata
apr_pool_t *pool)
{
return svn_error_trace(root->vtable->get_mergeinfo(catalog, root, paths,
- inherit,
- validate_inherited_mergeinfo,
- include_descendants,
- pool));
+ inherit,
+ validate_inherited_mergeinfo,
+ include_descendants,
+ pool));
}
svn_error_t *
@@ -996,10 +1021,10 @@ svn_fs_get_mergeinfo(svn_mergeinfo_catal
apr_pool_t *pool)
{
return svn_error_trace(svn_fs_get_mergeinfo2(catalog, root, paths,
- inherit,
- FALSE,
- include_descendants,
- pool));
+ inherit,
+ FALSE,
+ include_descendants,
+ pool));
}
svn_error_t *
@@ -1010,9 +1035,9 @@ svn_fs_validate_mergeinfo(svn_mergeinfo_
apr_pool_t *scratch_pool)
{
return svn_error_trace(fs->vtable->validate_mergeinfo(validated_mergeinfo,
- fs, mergeinfo,
- result_pool,
- scratch_pool));
+ fs, mergeinfo,
+ result_pool,
+ scratch_pool));
}
svn_error_t *
@@ -1022,10 +1047,10 @@ svn_fs_merge(const char **conflict_p, sv
const char *ancestor_path, apr_pool_t *pool)
{
return svn_error_trace(target_root->vtable->merge(conflict_p,
- source_root, source_path,
- target_root, target_path,
- ancestor_root,
- ancestor_path, pool));
+ source_root, source_path,
+ target_root, target_path,
+ ancestor_root,
+ ancestor_path, pool));
}
svn_error_t *
@@ -1033,7 +1058,7 @@ svn_fs_dir_entries(apr_hash_t **entries_
const char *path, apr_pool_t *pool)
{
return svn_error_trace(root->vtable->dir_entries(entries_p, root, path,
- pool));
+ pool));
}
svn_error_t *
@@ -1055,7 +1080,7 @@ svn_fs_copy(svn_fs_root_t *from_root, co
{
SVN_ERR(svn_fs__path_valid(to_path, pool));
return svn_error_trace(to_root->vtable->copy(from_root, from_path,
- to_root, to_path, pool));
+ to_root, to_path, pool));
}
svn_error_t *
@@ -1063,7 +1088,7 @@ svn_fs_revision_link(svn_fs_root_t *from
const char *path, apr_pool_t *pool)
{
return svn_error_trace(to_root->vtable->revision_link(from_root, to_root,
- path, pool));
+ path, pool));
}
svn_error_t *
@@ -1071,7 +1096,7 @@ svn_fs_file_length(svn_filesize_t *lengt
const char *path, apr_pool_t *pool)
{
return svn_error_trace(root->vtable->file_length(length_p, root, path,
- pool));
+ pool));
}
svn_error_t *
@@ -1120,7 +1145,7 @@ svn_fs_file_contents(svn_stream_t **cont
const char *path, apr_pool_t *pool)
{
return svn_error_trace(root->vtable->file_contents(contents, root, path,
- pool));
+ pool));
}
svn_error_t *
@@ -1146,12 +1171,12 @@ svn_fs_apply_textdelta(svn_txdelta_windo
pool));
return svn_error_trace(root->vtable->apply_textdelta(contents_p,
- contents_baton_p,
- root,
- path,
- base,
- result,
- pool));
+ contents_baton_p,
+ root,
+ path,
+ base,
+ result,
+ pool));
}
svn_error_t *
@@ -1167,7 +1192,7 @@ svn_fs_apply_text(svn_stream_t **content
pool));
return svn_error_trace(root->vtable->apply_text(contents_p, root, path,
- result, pool));
+ result, pool));
}
svn_error_t *
@@ -1176,9 +1201,9 @@ svn_fs_contents_changed(svn_boolean_t *c
const char *path2, apr_pool_t *pool)
{
return svn_error_trace(root1->vtable->contents_changed(changed_p,
- root1, path1,
- root2, path2,
- pool));
+ root1, path1,
+ root2, path2,
+ pool));
}
svn_error_t *
@@ -1198,7 +1223,7 @@ svn_fs_revision_prop(svn_string_t **valu
const char *propname, apr_pool_t *pool)
{
return svn_error_trace(fs->vtable->revision_prop(value_p, fs, rev,
- propname, pool));
+ propname, pool));
}
svn_error_t *
@@ -1206,7 +1231,7 @@ svn_fs_revision_proplist(apr_hash_t **ta
apr_pool_t *pool)
{
return svn_error_trace(fs->vtable->revision_proplist(table_p, fs, rev,
- pool));
+ pool));
}
svn_error_t *
@@ -1215,8 +1240,8 @@ svn_fs_change_rev_prop2(svn_fs_t *fs, sv
const svn_string_t *value, apr_pool_t *pool)
{
return svn_error_trace(fs->vtable->change_rev_prop(fs, rev, name,
- old_value_p,
- value, pool));
+ old_value_p,
+ value, pool));
}
svn_error_t *
@@ -1235,9 +1260,9 @@ svn_fs_get_file_delta_stream(svn_txdelta
const char *target_path, apr_pool_t *pool)
{
return svn_error_trace(target_root->vtable->get_file_delta_stream(
- stream_p,
- source_root, source_path,
- target_root, target_path, pool));
+ stream_p,
+ source_root, source_path,
+ target_root, target_path, pool));
}
svn_error_t *
@@ -1286,8 +1311,8 @@ svn_fs_lock(svn_lock_t **lock, svn_fs_t
_("Negative expiration date passed to svn_fs_lock"));
return svn_error_trace(fs->vtable->lock(lock, fs, path, token, comment,
- is_dav_comment, expiration_date,
- current_rev, steal_lock, pool));
+ is_dav_comment, expiration_date,
+ current_rev, steal_lock, pool));
}
svn_error_t *
@@ -1301,7 +1326,7 @@ svn_fs_unlock(svn_fs_t *fs, const char *
svn_boolean_t break_lock, apr_pool_t *pool)
{
return svn_error_trace(fs->vtable->unlock(fs, path, token, break_lock,
- pool));
+ pool));
}
svn_error_t *
@@ -1321,8 +1346,8 @@ svn_fs_get_locks2(svn_fs_t *fs, const ch
(depth == svn_depth_immediates) ||
(depth == svn_depth_infinity));
return svn_error_trace(fs->vtable->get_locks(fs, path, depth,
- get_locks_func,
- get_locks_baton, pool));
+ get_locks_func,
+ get_locks_baton, pool));
}
svn_error_t *
@@ -1331,8 +1356,8 @@ svn_fs_get_locks(svn_fs_t *fs, const cha
void *get_locks_baton, apr_pool_t *pool)
{
return svn_error_trace(svn_fs_get_locks2(fs, path, svn_depth_infinity,
- get_locks_func, get_locks_baton,
- pool));
+ get_locks_func, get_locks_baton,
+ pool));
}
@@ -1344,7 +1369,7 @@ svn_fs_history_prev(svn_fs_history_t **p
apr_pool_t *pool)
{
return svn_error_trace(history->vtable->prev(prev_history_p, history,
- cross_copies, pool));
+ cross_copies, pool));
}
svn_error_t *
@@ -1352,7 +1377,7 @@ svn_fs_history_location(const char **pat
svn_fs_history_t *history, apr_pool_t *pool)
{
return svn_error_trace(history->vtable->location(path, revision, history,
- pool));
+ pool));
}
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_fs/fs-loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_fs/fs-loader.h?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_fs/fs-loader.h (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_fs/fs-loader.h Tue Jul 19 23:05:44 2011
@@ -86,6 +86,11 @@ typedef struct fs_library_vtable_t
apr_pool_t *common_pool);
svn_error_t *(*upgrade_fs)(svn_fs_t *fs, const char *path, apr_pool_t *pool,
apr_pool_t *common_pool);
+ svn_error_t *(*verify_fs)(svn_fs_t *fs, const char *path,
+ /* ### notification? */
+ svn_cancel_func_t cancel_func, void *cancel_baton,
+ apr_pool_t *pool,
+ apr_pool_t *common_pool);
svn_error_t *(*delete_fs)(const char *path, apr_pool_t *pool);
svn_error_t *(*hotcopy)(const char *src_path, const char *dest_path,
svn_boolean_t clean, apr_pool_t *pool);
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_base/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_base/fs.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_base/fs.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_base/fs.c Tue Jul 19 23:05:44 2011
@@ -669,9 +669,6 @@ base_create(svn_fs_t *fs, const char *pa
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;
}
/* Create the environment and databases. */
@@ -877,6 +874,18 @@ base_upgrade(svn_fs_t *fs, const char *p
}
static svn_error_t *
+base_verify(svn_fs_t *fs, const char *path,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool,
+ apr_pool_t *common_pool)
+{
+ /* ### Any boilerplate needed here? */
+ /* Verifying is currently a no op for BDB. */
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
base_bdb_recover(svn_fs_t *fs,
svn_cancel_func_t cancel_func, void *cancel_baton,
apr_pool_t *pool)
@@ -1345,6 +1354,7 @@ static fs_library_vtable_t library_vtabl
base_open,
base_open_for_recovery,
base_upgrade,
+ base_verify,
base_delete_fs,
base_hotcopy,
base_get_description,
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/caching.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/caching.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/caching.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/caching.c Tue Jul 19 23:05:44 2011
@@ -28,7 +28,6 @@
#include "../libsvn_fs/fs-loader.h"
#include "svn_config.h"
-#include "svn_cmdline.h"
#include "svn_cache_config.h"
#include "svn_private_config.h"
@@ -190,6 +189,52 @@ init_callbacks(svn_cache__t *cache,
return SVN_NO_ERROR;
}
+/* Sets *CACHE_P to cache instance based on provided options.
+ * Creates memcache if MEMCACHE is not NULL. Creates membuffer cache if
+ * MEMBUFFER is not NULL. Fallbacks to inprocess cache if MEMCACHE and
+ * MEMBUFFER are NULL and pages is non-zero. Sets *CACHE_P to NULL
+ * otherwise.
+ *
+ * Cache is allocated in POOL.
+ * */
+static svn_error_t *
+create_cache(svn_cache__t **cache_p,
+ svn_memcache_t *memcache,
+ svn_membuffer_t *membuffer,
+ apr_int64_t pages,
+ apr_int64_t items_per_page,
+ svn_cache__serialize_func_t serializer,
+ svn_cache__deserialize_func_t deserializer,
+ apr_ssize_t klen,
+ const char *prefix,
+ apr_pool_t *pool)
+{
+ if (memcache)
+ {
+ SVN_ERR(svn_cache__create_memcache(cache_p, memcache,
+ serializer, deserializer, klen,
+ prefix, pool));
+ }
+ else if (membuffer)
+ {
+ SVN_ERR(svn_cache__create_membuffer_cache(
+ cache_p, membuffer, serializer, deserializer,
+ klen, prefix, pool));
+ }
+ else if (pages)
+ {
+ SVN_ERR(svn_cache__create_inprocess(
+ cache_p, serializer, deserializer, klen, pages,
+ items_per_page, FALSE, prefix, pool));
+ }
+ else
+ {
+ *cache_p = NULL;
+ }
+
+ return SVN_NO_ERROR;
+}
+
svn_error_t *
svn_fs_fs__initialize_caches(svn_fs_t *fs,
apr_pool_t *pool)
@@ -200,6 +245,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
"/", fs->path, ":",
(char *)NULL);
svn_memcache_t *memcache;
+ svn_membuffer_t *membuffer;
svn_boolean_t no_handler;
svn_boolean_t cache_txdeltas;
svn_boolean_t cache_fulltexts;
@@ -212,6 +258,8 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
fs,
pool));
+ membuffer = svn_cache__get_global_membuffer_cache();
+
/* Make the cache for revision roots. For the vast majority of
* commands, this is only going to contain a few entries (svnadmin
* dump/verify is an exception here), so to reduce overhead let's
@@ -220,92 +268,57 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
* id_private_t + 3 strings for value, and the cache_entry); the
* default pool size is 8192, so about a hundred should fit
* comfortably. */
- if (svn_cache__get_global_membuffer_cache())
- SVN_ERR(svn_cache__create_membuffer_cache(&(ffd->rev_root_id_cache),
- svn_cache__get_global_membuffer_cache(),
- svn_fs_fs__serialize_id,
- svn_fs_fs__deserialize_id,
- sizeof(svn_revnum_t),
- apr_pstrcat(pool, prefix, "RRI",
- (char *)NULL),
- fs->pool));
- else
- SVN_ERR(svn_cache__create_inprocess(&(ffd->rev_root_id_cache),
- svn_fs_fs__serialize_id,
- svn_fs_fs__deserialize_id,
- sizeof(svn_revnum_t),
- 1, 100, FALSE,
- apr_pstrcat(pool, prefix, "RRI",
- (char *)NULL),
- fs->pool));
+ SVN_ERR(create_cache(&(ffd->rev_root_id_cache),
+ NULL,
+ membuffer,
+ 1, 100,
+ svn_fs_fs__serialize_id,
+ svn_fs_fs__deserialize_id,
+ sizeof(svn_revnum_t),
+ apr_pstrcat(pool, prefix, "RRI", (char *)NULL),
+ fs->pool));
SVN_ERR(init_callbacks(ffd->rev_root_id_cache, fs, no_handler, pool));
/* Rough estimate: revision DAG nodes have size around 320 bytes, so
* let's put 16 on a page. */
- if (svn_cache__get_global_membuffer_cache())
- SVN_ERR(svn_cache__create_membuffer_cache(&(ffd->rev_node_cache),
- svn_cache__get_global_membuffer_cache(),
- svn_fs_fs__dag_serialize,
- svn_fs_fs__dag_deserialize,
- APR_HASH_KEY_STRING,
- apr_pstrcat(pool, prefix, "DAG",
- (char *)NULL),
- fs->pool));
- else
- SVN_ERR(svn_cache__create_inprocess(&(ffd->rev_node_cache),
- svn_fs_fs__dag_serialize,
- svn_fs_fs__dag_deserialize,
- APR_HASH_KEY_STRING,
- 1024, 16, FALSE,
- apr_pstrcat(pool, prefix, "DAG",
- (char *)NULL),
- fs->pool));
+ SVN_ERR(create_cache(&(ffd->rev_node_cache),
+ NULL,
+ membuffer,
+ 1024, 16,
+ svn_fs_fs__dag_serialize,
+ svn_fs_fs__dag_deserialize,
+ APR_HASH_KEY_STRING,
+ apr_pstrcat(pool, prefix, "DAG", (char *)NULL),
+ fs->pool));
SVN_ERR(init_callbacks(ffd->rev_node_cache, fs, no_handler, pool));
/* Very rough estimate: 1K per directory. */
- if (svn_cache__get_global_membuffer_cache())
- SVN_ERR(svn_cache__create_membuffer_cache(&(ffd->dir_cache),
- svn_cache__get_global_membuffer_cache(),
- svn_fs_fs__serialize_dir_entries,
- svn_fs_fs__deserialize_dir_entries,
- APR_HASH_KEY_STRING,
- apr_pstrcat(pool, prefix, "DIR",
- (char *)NULL),
- fs->pool));
- else
- SVN_ERR(svn_cache__create_inprocess(&(ffd->dir_cache),
- svn_fs_fs__serialize_dir_entries,
- svn_fs_fs__deserialize_dir_entries,
- APR_HASH_KEY_STRING,
- 1024, 8, FALSE,
- apr_pstrcat(pool, prefix, "DIR",
- (char *)NULL),
- fs->pool));
+ SVN_ERR(create_cache(&(ffd->dir_cache),
+ NULL,
+ membuffer,
+ 1024, 8,
+ svn_fs_fs__serialize_dir_entries,
+ svn_fs_fs__deserialize_dir_entries,
+ APR_HASH_KEY_STRING,
+ apr_pstrcat(pool, prefix, "DIR", (char *)NULL),
+ fs->pool));
SVN_ERR(init_callbacks(ffd->dir_cache, fs, no_handler, pool));
/* Only 16 bytes per entry (a revision number + the corresponding offset).
Since we want ~8k pages, that means 512 entries per page. */
- if (svn_cache__get_global_membuffer_cache())
- SVN_ERR(svn_cache__create_membuffer_cache(&(ffd->packed_offset_cache),
- svn_cache__get_global_membuffer_cache(),
- svn_fs_fs__serialize_manifest,
- svn_fs_fs__deserialize_manifest,
- sizeof(svn_revnum_t),
- apr_pstrcat(pool, prefix, "PACK-MANIFEST",
- (char *)NULL),
- fs->pool));
- else
- SVN_ERR(svn_cache__create_inprocess(&(ffd->packed_offset_cache),
- svn_fs_fs__serialize_manifest,
- svn_fs_fs__deserialize_manifest,
- sizeof(svn_revnum_t),
- 32, 1, FALSE,
- apr_pstrcat(pool, prefix, "PACK-MANIFEST",
- (char *)NULL),
- fs->pool));
+ SVN_ERR(create_cache(&(ffd->packed_offset_cache),
+ NULL,
+ membuffer,
+ 32, 1,
+ svn_fs_fs__serialize_manifest,
+ svn_fs_fs__deserialize_manifest,
+ sizeof(svn_revnum_t),
+ apr_pstrcat(pool, prefix, "PACK-MANIFEST",
+ (char *)NULL),
+ fs->pool));
SVN_ERR(init_callbacks(ffd->packed_offset_cache, fs, no_handler, pool));
@@ -313,43 +326,32 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
ffd->fulltext_cache = NULL;
if (cache_fulltexts)
{
- if (memcache)
- {
- SVN_ERR(svn_cache__create_memcache(&(ffd->fulltext_cache),
- memcache,
- /* Values are svn_string_t */
- NULL, NULL,
- APR_HASH_KEY_STRING,
- apr_pstrcat(pool, prefix, "TEXT",
- (char *)NULL),
- fs->pool));
- }
- else if (svn_cache__get_global_membuffer_cache())
- {
- SVN_ERR(svn_cache__create_membuffer_cache(&(ffd->fulltext_cache),
- svn_cache__get_global_membuffer_cache(),
- /* Values are svn_string_t */
- NULL, NULL,
- APR_HASH_KEY_STRING,
- apr_pstrcat(pool, prefix, "TEXT",
- (char *)NULL),
- fs->pool));
- }
+ SVN_ERR(create_cache(&(ffd->fulltext_cache),
+ memcache,
+ membuffer,
+ 0, 0, /* Do not use inprocess cache */
+ /* Values are svn_string_t */
+ NULL, NULL,
+ APR_HASH_KEY_STRING,
+ apr_pstrcat(pool, prefix, "TEXT", (char *)NULL),
+ fs->pool));
}
SVN_ERR(init_callbacks(ffd->fulltext_cache, fs, no_handler, pool));
/* initialize txdelta window cache, if that has been enabled */
- if (svn_cache__get_global_membuffer_cache() && cache_txdeltas)
+ if (cache_txdeltas)
{
- SVN_ERR(svn_cache__create_membuffer_cache
- (&(ffd->txdelta_window_cache),
- svn_cache__get_global_membuffer_cache(),
- svn_fs_fs__serialize_txdelta_window,
- svn_fs_fs__deserialize_txdelta_window,
- APR_HASH_KEY_STRING,
- apr_pstrcat(pool, prefix, "TXDELTA_WINDOW", (char *)NULL),
- fs->pool));
+ SVN_ERR(create_cache(&(ffd->txdelta_window_cache),
+ NULL,
+ membuffer,
+ 0, 0, /* Do not use inprocess cache */
+ svn_fs_fs__serialize_txdelta_window,
+ svn_fs_fs__deserialize_txdelta_window,
+ APR_HASH_KEY_STRING,
+ apr_pstrcat(pool, prefix, "TXDELTA_WINDOW",
+ (char *)NULL),
+ fs->pool));
}
else
{
@@ -359,23 +361,15 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
SVN_ERR(init_callbacks(ffd->txdelta_window_cache, fs, no_handler, pool));
/* initialize node revision cache, if caching has been enabled */
- if (svn_cache__get_global_membuffer_cache())
- {
- SVN_ERR(svn_cache__create_membuffer_cache(&(ffd->node_revision_cache),
- svn_cache__get_global_membuffer_cache(),
- svn_fs_fs__serialize_node_revision,
- svn_fs_fs__deserialize_node_revision,
- APR_HASH_KEY_STRING,
- apr_pstrcat(pool,
- prefix,
- "NODEREVS",
- (char *)NULL),
- fs->pool));
- }
- else
- {
- ffd->node_revision_cache = NULL;
- }
+ SVN_ERR(create_cache(&(ffd->node_revision_cache),
+ NULL,
+ membuffer,
+ 0, 0, /* Do not use inprocess cache */
+ svn_fs_fs__serialize_node_revision,
+ svn_fs_fs__deserialize_node_revision,
+ APR_HASH_KEY_STRING,
+ apr_pstrcat(pool, prefix, "NODEREVS", (char *)NULL),
+ fs->pool));
SVN_ERR(init_callbacks(ffd->node_revision_cache, fs, no_handler, pool));
@@ -463,24 +457,16 @@ svn_fs_fs__initialize_txn_caches(svn_fs_
}
/* create a txn-local directory cache */
- if (svn_cache__get_global_membuffer_cache())
- SVN_ERR(svn_cache__create_membuffer_cache(&(ffd->txn_dir_cache),
- svn_cache__get_global_membuffer_cache(),
- svn_fs_fs__serialize_dir_entries,
- svn_fs_fs__deserialize_dir_entries,
- APR_HASH_KEY_STRING,
- apr_pstrcat(pool, prefix, "TXNDIR",
- (char *)NULL),
- pool));
- else
- SVN_ERR(svn_cache__create_inprocess(&(ffd->txn_dir_cache),
- svn_fs_fs__serialize_dir_entries,
- svn_fs_fs__deserialize_dir_entries,
- APR_HASH_KEY_STRING,
- 1024, 8, FALSE,
- apr_pstrcat(pool, prefix, "TXNDIR",
- (char *)NULL),
- pool));
+ SVN_ERR(create_cache(&ffd->txn_dir_cache,
+ NULL,
+ svn_cache__get_global_membuffer_cache(),
+ 1024, 8,
+ svn_fs_fs__serialize_dir_entries,
+ svn_fs_fs__deserialize_dir_entries,
+ APR_HASH_KEY_STRING,
+ apr_pstrcat(pool, prefix, "TXNDIR",
+ (char *)NULL),
+ pool));
/* reset the transaction-specific cache if the pool gets cleaned up. */
init_txn_callbacks(&(ffd->txn_dir_cache), pool);
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/fs.c?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/fs.c Tue Jul 19 23:05:44 2011
@@ -256,6 +256,21 @@ fs_upgrade(svn_fs_t *fs, const char *pat
}
static svn_error_t *
+fs_verify(svn_fs_t *fs, const char *path,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool,
+ apr_pool_t *common_pool)
+{
+ SVN_ERR(svn_fs__check_fs(fs, FALSE));
+ SVN_ERR(initialize_fs_struct(fs));
+ SVN_ERR(svn_fs_fs__open(fs, path, pool));
+ SVN_ERR(svn_fs_fs__initialize_caches(fs, pool));
+ SVN_ERR(fs_serialized_init(fs, common_pool, pool));
+ return svn_fs_fs__verify(fs, cancel_func, cancel_baton, pool);
+}
+
+static svn_error_t *
fs_pack(svn_fs_t *fs,
const char *path,
svn_fs_pack_notify_t notify_func,
@@ -342,6 +357,7 @@ static fs_library_vtable_t library_vtabl
fs_open,
fs_open_for_recovery,
fs_upgrade,
+ fs_verify,
fs_delete_fs,
fs_hotcopy,
fs_get_description,
Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/fs.h?rev=1148581&r1=1148580&r2=1148581&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_fs_fs/fs.h Tue Jul 19 23:05:44 2011
@@ -60,10 +60,6 @@ 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_MIN_UNPACKED_REVPROP "min-unpacked-revprop" /* Oldest revision
- property which has
- not been packed. */
-#define PATH_REVPROPS_DB "revprops.db"
/* If you change this, look at tests/svn_test_fs.c(maybe_install_fsfs_conf) */
#define PATH_CONFIG "fsfs.conf" /* Configuration */
@@ -90,7 +86,7 @@ extern "C" {
/* 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 5
+#define SVN_FS_FS__FORMAT_NUMBER 4
/* The minimum format number that supports svndiff version 1. */
#define SVN_FS_FS__MIN_SVNDIFF1_FORMAT 2
@@ -122,8 +118,12 @@ extern "C" {
/* The minimum format number that stores node kinds in changed-paths lists. */
#define SVN_FS_FS__MIN_KIND_IN_CHANGED_FORMAT 4
+/* The 1.7-dev format, never released, that packed revprops into SQLite
+ 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 5
+#define SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT SVN_FS_FS__PACKED_REVPROP_SQLITE_DEV_FORMAT
/* The minimum format number that supports a configuration file (fsfs.conf) */
#define SVN_FS_FS__MIN_CONFIG_FILE 4
@@ -238,8 +238,10 @@ typedef struct fs_fs_data_t
rep key to svn_string_t. */
svn_cache__t *fulltext_cache;
- /* Pack manifest cache; maps revision numbers to offsets in their respective
- pack files. */
+ /* 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
+ respective pack file. */
svn_cache__t *packed_offset_cache;
/* Cache for txdelta_window_t objects; the key is (revFilePath, offset) */
@@ -264,15 +266,9 @@ typedef struct fs_fs_data_t
/* Thread-safe boolean */
svn_atomic_t rep_cache_db_opened;
- /* The sqlite database used for revprops. */
- svn_sqlite__db_t *revprop_db;
-
/* The oldest revision not in a pack file. */
svn_revnum_t min_unpacked_rev;
- /* The oldest revision property not in a pack db. */
- svn_revnum_t min_unpacked_revprop;
-
/* Whether rep-sharing is supported by the filesystem
* and allowed by the configuration. */
svn_boolean_t rep_sharing_allowed;