[prev in list] [next in list] [prev in thread] [next in thread]
List: subversion-commits
Subject: svn commit: r1177691 [3/6] - in /subversion/branches/fs-py: ./ build/ build/ac-macros/ build/generat
From: hwright () apache ! org
Date: 2011-09-30 15:02:47
Message-ID: 20110930150254.836432388B71 () eris ! apache ! org
[Download RAW message or body]
Modified: subversion/branches/fs-py/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_client/mergeinfo.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_client/mergeinfo.c Fri Sep 30 \
15:02:43 2011 @@ -438,16 +438,17 @@ svn_client__get_repos_mergeinfo(svn_ra_s
svn_revnum_t rev,
svn_mergeinfo_inheritance_t inherit,
svn_boolean_t squelch_incapable,
- svn_boolean_t validate_inherited_mergeinfo,
apr_pool_t *pool)
{
svn_mergeinfo_catalog_t tgt_mergeinfo_cat;
*target_mergeinfo = NULL;
- SVN_ERR(svn_client__get_repos_mergeinfo_catalog(
- &tgt_mergeinfo_cat, ra_session, rel_path, rev, inherit,
- squelch_incapable, FALSE, validate_inherited_mergeinfo, pool, pool));
+ SVN_ERR(svn_client__get_repos_mergeinfo_catalog(&tgt_mergeinfo_cat,
+ ra_session,
+ rel_path, rev, inherit,
+ squelch_incapable, FALSE,
+ pool, pool));
if (tgt_mergeinfo_cat && apr_hash_count(tgt_mergeinfo_cat))
{
@@ -463,17 +464,15 @@ svn_client__get_repos_mergeinfo(svn_ra_s
}
svn_error_t *
-svn_client__get_repos_mergeinfo_catalog(
- svn_mergeinfo_catalog_t *mergeinfo_cat,
- svn_ra_session_t *ra_session,
- const char *rel_path,
- svn_revnum_t rev,
- svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t squelch_incapable,
- svn_boolean_t include_descendants,
- svn_boolean_t validate_inherited_mergeinfo,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
+svn_client__get_repos_mergeinfo_catalog(svn_mergeinfo_catalog_t *mergeinfo_cat,
+ svn_ra_session_t *ra_session,
+ const char *rel_path,
+ svn_revnum_t rev,
+ svn_mergeinfo_inheritance_t inherit,
+ svn_boolean_t squelch_incapable,
+ svn_boolean_t include_descendants,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_error_t *err;
svn_mergeinfo_t repos_mergeinfo_cat;
@@ -483,9 +482,8 @@ svn_client__get_repos_mergeinfo_catalog(
APR_ARRAY_PUSH(rel_paths, const char *) = rel_path;
/* Fetch the mergeinfo. */
- err = svn_ra_get_mergeinfo2(ra_session, &repos_mergeinfo_cat, rel_paths,
- rev, inherit, validate_inherited_mergeinfo,
- include_descendants, result_pool);
+ err = svn_ra_get_mergeinfo(ra_session, &repos_mergeinfo_cat, rel_paths,
+ rev, inherit, include_descendants, result_pool);
if (err)
{
if (squelch_incapable && err->apr_err == SVN_ERR_UNSUPPORTED_FEATURE)
@@ -687,7 +685,7 @@ svn_client__get_wc_or_repos_mergeinfo_ca
SVN_ERR(svn_client__get_repos_mergeinfo_catalog(
&target_mergeinfo_cat_repos, ra_session,
"", target_rev, inherit,
- TRUE, include_descendants, TRUE,
+ TRUE, include_descendants,
result_pool, scratch_pool));
if (target_mergeinfo_cat_repos
@@ -1094,7 +1092,7 @@ get_mergeinfo(svn_mergeinfo_catalog_t *m
rev = peg_rev;
SVN_ERR(svn_client__get_repos_mergeinfo_catalog(
mergeinfo_catalog, ra_session, "", rev, svn_mergeinfo_inherited,
- FALSE, include_descendants, TRUE,
+ FALSE, include_descendants,
result_pool, scratch_pool));
}
else /* ! svn_path_is_url() */
@@ -1236,7 +1234,8 @@ svn_client__elide_mergeinfo_catalog(svn_
eb = mergeinfo_catalog;
SVN_ERR(svn_editor__insert_shims((const svn_delta_editor_t **)&editor, &eb,
- editor, eb, pool, pool));
+ editor, eb, NULL, NULL, NULL, NULL,
+ pool, pool));
/* Walk over the paths, and build up a list of elidable ones. */
SVN_ERR(svn_hash_keys(&paths, mergeinfo_catalog, pool));
Modified: subversion/branches/fs-py/subversion/libsvn_client/mergeinfo.h
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_client/mergeinfo.h?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_client/mergeinfo.h (original)
+++ subversion/branches/fs-py/subversion/libsvn_client/mergeinfo.h Fri Sep 30 \
15:02:43 2011 @@ -166,13 +166,7 @@ svn_client__get_wc_mergeinfo_catalog(svn
If there is no mergeinfo available for REL_PATH, or if the server
doesn't support a mergeinfo capability and SQUELCH_INCAPABLE is
- TRUE, set *TARGET_MERGEINFO to NULL.
-
- If the mergeinfo for REL_PATH path is inherited,
- VALIDATE_INHERITED_MERGEINFO is TRUE, and the server supports
- the #SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO capability,
- then *TARGET_MERGEINFO will only contain merge source path-revisions
- that actually exist in the repository. */
+ TRUE, set *TARGET_MERGEINFO to NULL. */
svn_error_t *
svn_client__get_repos_mergeinfo(svn_ra_session_t *ra_session,
svn_mergeinfo_t *target_mergeinfo,
@@ -180,7 +174,6 @@ svn_client__get_repos_mergeinfo(svn_ra_s
svn_revnum_t rev,
svn_mergeinfo_inheritance_t inherit,
svn_boolean_t squelch_incapable,
- svn_boolean_t validate_inherited_mergeinfo,
apr_pool_t *pool);
/* If INCLUDE_DESCENDANTS is FALSE, behave exactly like
@@ -194,17 +187,15 @@ svn_client__get_repos_mergeinfo(svn_ra_s
paths of the subtrees. If no mergeinfo is found, then
*TARGET_MERGEINFO_CAT is set to NULL. */
svn_error_t *
-svn_client__get_repos_mergeinfo_catalog(
- svn_mergeinfo_catalog_t *mergeinfo_cat,
- svn_ra_session_t *ra_session,
- const char *rel_path,
- svn_revnum_t rev,
- svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t squelch_incapable,
- svn_boolean_t include_descendants,
- svn_boolean_t validate_inherited_mergeinfo,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
+svn_client__get_repos_mergeinfo_catalog(svn_mergeinfo_catalog_t *mergeinfo_cat,
+ svn_ra_session_t *ra_session,
+ const char *rel_path,
+ svn_revnum_t rev,
+ svn_mergeinfo_inheritance_t inherit,
+ svn_boolean_t squelch_incapable,
+ svn_boolean_t include_descendants,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* Retrieve the direct mergeinfo for the TARGET_WCPATH from the WC's
mergeinfo prop, or that inherited from its nearest ancestor if the
@@ -233,14 +224,7 @@ svn_client__get_repos_mergeinfo_catalog(
If TARGET_WCPATH inherited its mergeinfo from a working copy ancestor
or if it was obtained from the repository, set *INHERITED to TRUE, set it
- to FALSE otherwise.
-
- Note: If the repository is contacted to find inherited mergeinfo, then
- inherited mergeinfo validation is requested by default (see the
- VALIDATE_INHERITED_MERGEINFO parameter to svn_client__get_repos_mergeinfo).
- If the caller needs to know if validation actually occurred then it should
- check if the server supports the
- SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO capability. */
+ to FALSE otherwise. */
svn_error_t *
svn_client__get_wc_or_repos_mergeinfo(svn_mergeinfo_t *target_mergeinfo,
svn_boolean_t *inherited,
Modified: subversion/branches/fs-py/subversion/libsvn_client/ra.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_client/ra.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_client/ra.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_client/ra.c Fri Sep 30 15:02:43 2011
@@ -368,7 +368,7 @@ svn_client__open_ra_session_internal(svn
}
return SVN_NO_ERROR;
- }
+}
#undef SVN_CLIENT__MAX_REDIRECT_ATTEMPTS
@@ -435,22 +435,75 @@ path_or_url_local_style(const char *path
return svn_dirent_local_style(path_or_url, pool);
}
+/* Given PATH_OR_URL, which contains either a working copy path or an
+ absolute URL, a peg revision PEG_REVISION, and a desired revision
+ REVISION, find the path at which that object exists in REVISION,
+ following copy history if necessary. If REVISION is younger than
+ PEG_REVISION, then check that PATH_OR_URL is the same node in both
+ PEG_REVISION and REVISION, and return @c
+ SVN_ERR_CLIENT_UNRELATED_RESOURCES if it is not the same node.
+
+ If PEG_REVISION's kind is svn_opt_revision_unspecified, interpret it
+ as "head" for a URL or "working" for a working-copy path.
+
+ Store the actual revision number of the object in *REV_P, and the
+ final resulting URL in *URL_P.
+
+ Use authentication baton cached in CTX to authenticate against the
+ repository.
+
+ Use POOL for all allocations. */
+static svn_error_t *
+resolve_rev_and_url(svn_revnum_t *rev_p,
+ const char **url_p,
+ svn_ra_session_t *ra_session,
+ const char *path_or_url,
+ const svn_opt_revision_t *peg_revision,
+ const svn_opt_revision_t *revision,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool)
+{
+ svn_opt_revision_t peg_rev = *peg_revision;
+ svn_opt_revision_t start_rev = *revision;
+ svn_opt_revision_t *good_rev;
+ const char *url;
+ svn_revnum_t rev;
+
+ SVN_ERR(svn_opt_resolve_revisions(&peg_rev, &start_rev,
+ svn_path_is_url(path_or_url),
+ TRUE,
+ pool));
+
+ /* Run the history function to get the object's (possibly
+ different) url in REVISION. */
+ SVN_ERR(svn_client__repos_locations(&url, &good_rev, NULL, NULL,
+ ra_session, path_or_url, &peg_rev,
+ &start_rev, NULL, ctx, pool));
+
+ /* Resolve good_rev into a real revnum. */
+ if (good_rev->kind == svn_opt_revision_unspecified)
+ good_rev->kind = svn_opt_revision_head;
+ SVN_ERR(svn_client__get_revision_number(&rev, NULL, ctx->wc_ctx, url,
+ ra_session, good_rev, pool));
+ *rev_p = rev;
+ *url_p = url;
+
+ return SVN_NO_ERROR;
+}
+
svn_error_t *
svn_client__ra_session_from_path(svn_ra_session_t **ra_session_p,
svn_revnum_t *rev_p,
const char **url_p,
const char *path_or_url,
const char *base_dir_abspath,
- const svn_opt_revision_t *peg_revision_p,
+ const svn_opt_revision_t *peg_revision,
const svn_opt_revision_t *revision,
svn_client_ctx_t *ctx,
apr_pool_t *pool)
{
svn_ra_session_t *ra_session;
- const char *initial_url, *url;
- svn_opt_revision_t *good_rev;
- svn_opt_revision_t peg_revision, start_rev;
- svn_revnum_t rev;
+ const char *initial_url;
const char *corrected_url;
SVN_ERR(svn_client_url_from_path2(&initial_url, path_or_url, ctx, pool,
@@ -459,13 +512,6 @@ svn_client__ra_session_from_path(svn_ra_
return svn_error_createf(SVN_ERR_ENTRY_MISSING_URL, NULL,
_("'%s' has no URL"), path_or_url);
- start_rev = *revision;
- peg_revision = *peg_revision_p;
- SVN_ERR(svn_opt_resolve_revisions(&peg_revision, &start_rev,
- svn_path_is_url(path_or_url),
- TRUE,
- pool));
-
SVN_ERR(svn_client__open_ra_session_internal(&ra_session, &corrected_url,
initial_url,
base_dir_abspath, NULL,
@@ -477,27 +523,14 @@ svn_client__ra_session_from_path(svn_ra_
if (corrected_url && svn_path_is_url(path_or_url))
path_or_url = corrected_url;
- /* Run the history function to get the object's (possibly
- different) url in REVISION. */
- SVN_ERR(svn_client__repos_locations(&url, &good_rev, NULL, NULL,
- ra_session,
- path_or_url, &peg_revision,
- /* search range: */
- &start_rev, NULL,
- ctx, pool));
+ SVN_ERR(resolve_rev_and_url(rev_p, url_p, ra_session,
+ path_or_url, peg_revision, revision,
+ ctx, pool));
/* Make the session point to the real URL. */
- SVN_ERR(svn_ra_reparent(ra_session, url, pool));
-
- /* Resolve good_rev into a real revnum. */
- if (good_rev->kind == svn_opt_revision_unspecified)
- good_rev->kind = svn_opt_revision_head;
- SVN_ERR(svn_client__get_revision_number(&rev, NULL, ctx->wc_ctx, url,
- ra_session, good_rev, pool));
+ SVN_ERR(svn_ra_reparent(ra_session, *url_p, pool));
*ra_session_p = ra_session;
- *rev_p = rev;
- *url_p = url;
return SVN_NO_ERROR;
}
Modified: subversion/branches/fs-py/subversion/libsvn_client/repos_diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_client/repos_diff.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_client/repos_diff.c Fri Sep 30 \
15:02:43 2011 @@ -1388,6 +1388,7 @@ svn_client__get_diff_editor(const svn_de
eb->pool));
SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
+ NULL, NULL, NULL, NULL,
result_pool, result_pool));
return SVN_NO_ERROR;
Modified: subversion/branches/fs-py/subversion/libsvn_client/url.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_client/url.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_client/url.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_client/url.c Fri Sep 30 15:02:43 2011
@@ -73,6 +73,6 @@ svn_client_root_url_from_path(const char
SVN_ERR(svn_dirent_get_absolute(&path_or_url, path_or_url, pool));
return svn_error_trace(
- svn_client__get_repos_root(url, path_or_url,
+ svn_client__get_repos_root(url, NULL, path_or_url,
ctx, pool, pool));
}
Modified: subversion/branches/fs-py/subversion/libsvn_client/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_client/util.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_client/util.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_client/util.c Fri Sep 30 15:02:43 \
2011 @@ -145,6 +145,7 @@ svn_client__path_relative_to_root(const
svn_error_t *
svn_client__get_repos_root(const char **repos_root,
+ const char **repos_uuid,
const char *abspath_or_url,
svn_client_ctx_t *ctx,
apr_pool_t *result_pool,
@@ -155,7 +156,7 @@ svn_client__get_repos_root(const char **
/* If PATH_OR_URL is a local path we can fetch the repos root locally. */
if (!svn_path_is_url(abspath_or_url))
{
- SVN_ERR(svn_wc__node_get_repos_info(repos_root, NULL,
+ SVN_ERR(svn_wc__node_get_repos_info(repos_root, repos_uuid,
ctx->wc_ctx, abspath_or_url,
result_pool, scratch_pool));
@@ -168,7 +169,10 @@ svn_client__get_repos_root(const char **
NULL, NULL, FALSE, TRUE,
ctx, scratch_pool));
- SVN_ERR(svn_ra_get_repos_root2(ra_session, repos_root, result_pool));
+ if (repos_root)
+ SVN_ERR(svn_ra_get_repos_root2(ra_session, repos_root, result_pool));
+ if (repos_uuid)
+ SVN_ERR(svn_ra_get_uuid2(ra_session, repos_uuid, result_pool));
return SVN_NO_ERROR;
}
Modified: subversion/branches/fs-py/subversion/libsvn_delta/compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_delta/compat.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_delta/compat.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_delta/compat.c Fri Sep 30 15:02:43 \
2011 @@ -25,6 +25,9 @@
#include "svn_error.h"
#include "svn_delta.h"
#include "svn_sorts.h"
+#include "svn_dirent_uri.h"
+#include "svn_path.h"
+#include "svn_props.h"
#include "svn_pools.h"
@@ -93,7 +96,10 @@ struct ev2_edit_baton
{
svn_editor_t *editor;
apr_hash_t *paths;
+ svn_revnum_t target_revision;
apr_pool_t *edit_pool;
+ svn_delta_fetch_props_func_t fetch_props_func;
+ void *fetch_props_baton;
};
struct ev2_dir_baton
@@ -110,9 +116,9 @@ struct ev2_file_baton
enum action
{
- add,
- delete,
- set_prop
+ ACTION_ADD,
+ ACTION_DELETE,
+ ACTION_SET_PROP
};
struct path_action
@@ -155,11 +161,88 @@ add_action(struct ev2_edit_baton *eb,
}
static svn_error_t *
+process_actions(void *edit_baton,
+ const char *path,
+ apr_array_header_t *actions,
+ apr_pool_t *scratch_pool)
+{
+ struct ev2_edit_baton *eb = edit_baton;
+ apr_hash_t *props = NULL;
+ int i;
+
+ /* Go through all of our actions, populating various datastructures
+ * dependent on them. */
+ for (i = 0; i < actions->nelts; i++)
+ {
+ const struct path_action *action = APR_ARRAY_IDX(actions, i,
+ struct path_action *);
+
+ switch (action->action)
+ {
+ case ACTION_SET_PROP:
+ {
+ const struct prop_args *p_args = action->args;
+
+ if (!props)
+ {
+ /* Fetch the original props. We can then apply each of
+ the modifications to it. */
+ SVN_ERR(eb->fetch_props_func(&props,
+ eb->fetch_props_baton,
+ path,
+ scratch_pool, scratch_pool));
+ }
+
+ /* Note that p_args->value may be NULL. */
+ apr_hash_set(props, p_args->name, APR_HASH_KEY_STRING,
+ p_args->value);
+ break;
+ }
+
+ case ACTION_DELETE:
+ {
+ svn_revnum_t *revnum = action->args;
+
+ /* If we get a delete, we'd better not have gotten any
+ other actions for this path later, so we can go ahead
+ and call our handler. */
+ SVN_ERR(svn_editor_delete(eb->editor, path, *revnum));
+ break;
+ }
+
+ case ACTION_ADD:
+ {
+ /* ### do something */
+ break;
+ }
+
+ default:
+ SVN_ERR_MALFUNCTION();
+ }
+ }
+
+ /* We've now got a wholistic view of what has happened to this node,
+ * so we can call our own editor APIs on it. */
+
+ if (props)
+ {
+ /* We fetched and modified the props in some way. Apply 'em now that
+ we have the new set. */
+ SVN_ERR(svn_editor_set_props(eb->editor, path, eb->target_revision,
+ props, TRUE));
+ }
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
ev2_set_target_revision(void *edit_baton,
svn_revnum_t target_revision,
apr_pool_t *scratch_pool)
{
struct ev2_edit_baton *eb = edit_baton;
+
+ eb->target_revision = target_revision;
return SVN_NO_ERROR;
}
@@ -173,6 +256,7 @@ ev2_open_root(void *edit_baton,
struct ev2_edit_baton *eb = edit_baton;
db->eb = eb;
+ db->path = "";
*root_baton = db;
return SVN_NO_ERROR;
@@ -188,7 +272,7 @@ ev2_delete_entry(const char *path,
svn_revnum_t *revnum = apr_palloc(pb->eb->edit_pool, sizeof(*revnum));
*revnum = revision;
- SVN_ERR(add_action(pb->eb, path, delete, revnum));
+ SVN_ERR(add_action(pb->eb, path, ACTION_DELETE, revnum));
return SVN_NO_ERROR;
}
@@ -207,7 +291,7 @@ ev2_add_directory(const char *path,
kind = apr_palloc(pb->eb->edit_pool, sizeof(*kind));
*kind = svn_node_dir;
- SVN_ERR(add_action(pb->eb, path, add, kind));
+ SVN_ERR(add_action(pb->eb, path, ACTION_ADD, kind));
cb->eb = pb->eb;
cb->path = apr_pstrdup(result_pool, path);
@@ -245,7 +329,7 @@ ev2_change_dir_prop(void *dir_baton,
p_args->name = apr_pstrdup(db->eb->edit_pool, name);
p_args->value = value ? svn_string_dup(value, db->eb->edit_pool) : NULL;
- SVN_ERR(add_action(db->eb, db->path, set_prop, p_args));
+ SVN_ERR(add_action(db->eb, db->path, ACTION_SET_PROP, p_args));
return SVN_NO_ERROR;
}
@@ -286,7 +370,7 @@ ev2_add_file(const char *path,
kind = apr_palloc(pb->eb->edit_pool, sizeof(*kind));
*kind = svn_node_file;
- SVN_ERR(add_action(pb->eb, path, add, kind));
+ SVN_ERR(add_action(pb->eb, path, ACTION_ADD, kind));
return SVN_NO_ERROR;
}
@@ -335,7 +419,7 @@ ev2_change_file_prop(void *file_baton,
p_args->name = apr_pstrdup(fb->eb->edit_pool, name);
p_args->value = value ? svn_string_dup(value, fb->eb->edit_pool) : NULL;
- SVN_ERR(add_action(fb->eb, fb->path, set_prop, p_args));
+ SVN_ERR(add_action(fb->eb, fb->path, ACTION_SET_PROP, p_args));
return SVN_NO_ERROR;
}
@@ -380,60 +464,9 @@ ev2_close_edit(void *edit_baton,
svn_sort__item_t *item = &APR_ARRAY_IDX(sorted_hash, i, svn_sort__item_t);
apr_array_header_t *actions = item->value;
const char *path = item->key;
- apr_hash_t *props = NULL;
- int j;
svn_pool_clear(iterpool);
-
- /* Go through all of our actions, populating various datastructures
- * dependent on them. */
- for (j = 0; j < actions->nelts; j++)
- {
- struct path_action *action = APR_ARRAY_IDX(actions, j,
- struct path_action *);
-
- switch (action->action)
- {
- case set_prop:
- {
- struct prop_args *p_args = action->args;
-
- if (!props)
- props = apr_hash_make(iterpool);
-
- apr_hash_set(props, p_args->name, APR_HASH_KEY_STRING,
- p_args->value);
- break;
- }
-
- case delete:
- {
- svn_revnum_t *revnum = action->args;
-
- /* If we get a delete, we'd better not have gotten any
- other actions for this path later, so we can go ahead
- and call our handler. */
- SVN_ERR(svn_editor_delete(eb->editor, path, *revnum));
- break;
- }
-
- default:
- break;
- }
- }
-
- /* We've now got a wholistic view of what has happened to this node,
- * so we can call our own editor APIs on it. */
-
- /* We don't want to just unconditionally call set_props on our PROPS
- hash, since if we didn't get an set props actions, that hash would
- be invalid (or if it was valid, it would be empty and we'd delete
- all the properties). So instead, we only allocate the hash when
- we know we've seen a SET_PROP action, and ensure that hash is valid
- when calling the Ev2 function below. */
- if (props)
- SVN_ERR(svn_editor_set_props(eb->editor, path, SVN_INVALID_REVNUM,
- props, TRUE));
+ SVN_ERR(process_actions(edit_baton, path, actions, iterpool));
}
svn_pool_destroy(iterpool);
@@ -453,6 +486,8 @@ svn_error_t *
svn_delta_from_editor(const svn_delta_editor_t **deditor,
void **dedit_baton,
svn_editor_t *editor,
+ svn_delta_fetch_props_func_t fetch_props_func,
+ void *fetch_props_baton,
apr_pool_t *pool)
{
/* Static 'cause we don't want it to be on the stack. */
@@ -478,7 +513,10 @@ svn_delta_from_editor(const svn_delta_ed
eb->editor = editor;
eb->paths = apr_hash_make(pool);
+ eb->target_revision = SVN_INVALID_REVNUM;
eb->edit_pool = pool;
+ eb->fetch_props_func = fetch_props_func;
+ eb->fetch_props_baton = fetch_props_baton;
*dedit_baton = eb;
*deditor = &delta_editor;
@@ -487,12 +525,196 @@ svn_delta_from_editor(const svn_delta_ed
}
+
+
+
+typedef enum action_code_t {
+ ACTION_MV,
+ ACTION_MKDIR,
+ ACTION_CP,
+ ACTION_PROPSET,
+ ACTION_PUT,
+ ACTION_RM
+} action_code_t;
+
+struct operation {
+ enum {
+ OP_OPEN,
+ OP_DELETE,
+ OP_ADD,
+ OP_REPLACE,
+ OP_PROPSET /* only for files for which no other operation is
+ occuring; directories are OP_OPEN with non-empty
+ props */
+ } operation;
+ svn_node_kind_t kind; /* to copy, mkdir, put or set revprops */
+ svn_revnum_t rev; /* to copy, valid for add and replace */
+ const char *url; /* to copy, valid for add and replace */
+ const char *src_file; /* for put, the source file for contents */
+ apr_hash_t *children; /* const char *path -> struct operation * */
+ apr_hash_t *props; /* const char *prop_name ->
+ const svn_string_t *prop_value */
+ void *baton; /* as returned by the commit editor */
+};
+
struct editor_baton
{
const svn_delta_editor_t *deditor;
void *dedit_baton;
+
+ svn_delta_fetch_kind_func_t fetch_kind_func;
+ void *fetch_kind_baton;
+
+ struct operation root;
+
+ apr_hash_t *paths;
+ apr_pool_t *edit_pool;
};
+/* Find the operation associated with PATH, which is a single-path
+ component representing a child of the path represented by
+ OPERATION. If no such child operation exists, create a new one of
+ type OP_OPEN. */
+static struct operation *
+get_operation(const char *path,
+ struct operation *operation,
+ apr_pool_t *result_pool)
+{
+ struct operation *child = apr_hash_get(operation->children, path,
+ APR_HASH_KEY_STRING);
+ if (! child)
+ {
+ child = apr_pcalloc(result_pool, sizeof(*child));
+ child->children = apr_hash_make(result_pool);
+ child->operation = OP_OPEN;
+ child->rev = SVN_INVALID_REVNUM;
+ child->kind = svn_node_dir;
+ child->props = NULL;
+ apr_hash_set(operation->children, apr_pstrdup(result_pool, path),
+ APR_HASH_KEY_STRING, child);
+ }
+ return child;
+}
+
+/* Add PATH to the operations tree rooted at OPERATION, creating any
+ intermediate nodes that are required. Here's what's expected for
+ each action type:
+
+ ACTION URL REV SRC-FILE PROPNAME
+ ------------ ----- ------- -------- --------
+ ACTION_MKDIR NULL invalid NULL NULL
+ ACTION_CP valid valid NULL NULL
+ ACTION_PUT NULL invalid valid NULL
+ ACTION_RM NULL invalid NULL NULL
+ ACTION_PROPSET valid invalid NULL valid
+
+ Node type information is obtained for any copy source (to determine
+ whether to create a file or directory) and for any deleted path (to
+ ensure it exists since svn_delta_editor_t->delete_entry doesn't
+ return an error on non-existent nodes). */
+static svn_error_t *
+build(struct editor_baton *eb,
+ action_code_t action,
+ const char *relpath,
+ const char *url,
+ svn_revnum_t rev,
+ apr_hash_t *props,
+ const char *src_file,
+ svn_revnum_t head,
+ apr_pool_t *scratch_pool)
+{
+ apr_array_header_t *path_bits = svn_path_decompose(relpath, scratch_pool);
+ const char *path_so_far = "";
+ struct operation *operation = &eb->root;
+ int i;
+
+ /* We should only see PROPS when action is ACTION_PROPSET. */
+ SVN_ERR_ASSERT((props && action == ACTION_PROPSET)
+ || (!props && action != ACTION_PROPSET) );
+
+ /* Look for any previous operations we've recognized for PATH. If
+ any of PATH's ancestors have not yet been traversed, we'll be
+ creating OP_OPEN operations for them as we walk down PATH's path
+ components. */
+ for (i = 0; i < path_bits->nelts; ++i)
+ {
+ const char *path_bit = APR_ARRAY_IDX(path_bits, i, const char *);
+ path_so_far = svn_relpath_join(path_so_far, path_bit, scratch_pool);
+ operation = get_operation(path_so_far, operation, eb->edit_pool);
+ }
+
+ /* Handle property changes. */
+ if (props)
+ {
+ SVN_ERR(eb->fetch_kind_func(&operation->kind, eb->fetch_kind_baton,
+ relpath, scratch_pool));
+
+ /* If we're not adding this thing ourselves, check for existence. */
+ if (! ((operation->operation == OP_ADD) ||
+ (operation->operation == OP_REPLACE)))
+ {
+ if ((operation->kind == svn_node_file)
+ && (operation->operation == OP_OPEN))
+ operation->operation = OP_PROPSET;
+ }
+ operation->props = svn_prop_hash_dup(props, eb->edit_pool);
+ if (!operation->rev)
+ operation->rev = rev;
+ return SVN_NO_ERROR;
+ }
+
+ if (action == ACTION_RM)
+ operation->operation = OP_DELETE;
+
+ /* Handle copy operations (which can be adds or replacements). */
+ else if (action == ACTION_CP)
+ {
+ operation->operation =
+ operation->operation == OP_DELETE ? OP_REPLACE : OP_ADD;
+
+ SVN_ERR(eb->fetch_kind_func(&operation->kind, eb->fetch_kind_baton,
+ relpath, scratch_pool));
+ operation->url = url;
+ operation->rev = rev;
+ }
+ /* Handle mkdir operations (which can be adds or replacements). */
+ else if (action == ACTION_MKDIR)
+ {
+ operation->operation =
+ operation->operation == OP_DELETE ? OP_REPLACE : OP_ADD;
+ operation->kind = svn_node_dir;
+ }
+ /* Handle put operations (which can be adds, replacements, or opens). */
+ else if (action == ACTION_PUT)
+ {
+ if (operation->operation == OP_DELETE)
+ {
+ operation->operation = OP_REPLACE;
+ }
+ else
+ {
+ SVN_ERR(eb->fetch_kind_func(&operation->kind, eb->fetch_kind_baton,
+ relpath, scratch_pool));
+ if (operation->kind == svn_node_file)
+ operation->operation = OP_OPEN;
+ else if (operation->kind == svn_node_none)
+ operation->operation = OP_ADD;
+ else
+ return svn_error_createf(SVN_ERR_BAD_URL, NULL,
+ "'%s' is not a file", relpath);
+ }
+ operation->kind = svn_node_file;
+ operation->src_file = src_file;
+ }
+ else
+ {
+ /* We shouldn't get here. */
+ SVN_ERR_MALFUNCTION();
+ }
+
+ return SVN_NO_ERROR;
+}
+
/* This implements svn_editor_cb_add_directory_t */
static svn_error_t *
add_directory_cb(void *baton,
@@ -509,6 +731,8 @@ add_directory_cb(void *baton,
static svn_error_t *
add_file_cb(void *baton,
const char *relpath,
+ const svn_checksum_t *checksum,
+ svn_stream_t *contents,
apr_hash_t *props,
svn_revnum_t replaces_rev,
apr_pool_t *scratch_pool)
@@ -548,6 +772,11 @@ set_props_cb(void *baton,
svn_boolean_t complete,
apr_pool_t *scratch_pool)
{
+ struct editor_baton *eb = baton;
+
+ SVN_ERR(build(eb, ACTION_PROPSET, relpath, NULL, SVN_INVALID_REVNUM,
+ props, NULL, SVN_INVALID_REVNUM, scratch_pool));
+
return SVN_NO_ERROR;
}
@@ -614,6 +843,24 @@ complete_cb(void *baton,
apr_pool_t *scratch_pool)
{
struct editor_baton *eb = baton;
+ apr_array_header_t *sorted_hash;
+ int i;
+
+ /* Sort the paths touched by this edit.
+ * Ev2 doesn't really have any particular need for depth-first-ness, but
+ * we want to ensure all parent directories are handled before children in
+ * the case of adds (which does introduce an element of depth-first-ness). */
+ sorted_hash = svn_sort__hash(eb->paths, svn_sort_compare_items_as_paths,
+ scratch_pool);
+
+ for (i = 0; i < sorted_hash->nelts; i++)
+ {
+ svn_sort__item_t *item = &APR_ARRAY_IDX(sorted_hash, i, svn_sort__item_t);
+ const char *path = item->key;
+
+ /* ### We should actually do something here, but for now... */
+ }
+
return svn_error_trace(eb->deditor->close_edit(eb->dedit_baton,
scratch_pool));
}
@@ -634,6 +881,8 @@ svn_editor_from_delta(svn_editor_t **edi
void *dedit_baton,
svn_cancel_func_t cancel_func,
void *cancel_baton,
+ svn_delta_fetch_kind_func_t fetch_kind_func,
+ void *fetch_kind_baton,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -656,6 +905,17 @@ svn_editor_from_delta(svn_editor_t **edi
eb->deditor = deditor;
eb->dedit_baton = dedit_baton;
+ eb->edit_pool = result_pool;
+ eb->paths = apr_hash_make(result_pool);
+
+ eb->fetch_kind_func = fetch_kind_func;
+ eb->fetch_kind_baton = fetch_kind_baton;
+
+ eb->root.children = apr_hash_make(result_pool);
+ eb->root.kind = svn_node_dir;
+ eb->root.operation = OP_OPEN;
+ eb->root.props = NULL;
+ eb->root.rev = SVN_INVALID_REVNUM;
SVN_ERR(svn_editor_create(&editor, eb, cancel_func, cancel_baton,
result_pool, scratch_pool));
@@ -676,6 +936,10 @@ svn_editor__insert_shims(const svn_delta
void **dedit_baton_out,
const svn_delta_editor_t *deditor_in,
void *dedit_baton_in,
+ svn_delta_fetch_props_func_t fetch_props_func,
+ void *fetch_props_baton,
+ svn_delta_fetch_kind_func_t fetch_kind_func,
+ void *fetch_kind_baton,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -690,8 +954,10 @@ svn_editor__insert_shims(const svn_delta
svn_editor_t *editor;
SVN_ERR(svn_editor_from_delta(&editor, deditor_in, dedit_baton_in,
- NULL, NULL, result_pool, scratch_pool));
+ NULL, NULL, fetch_kind_func, fetch_kind_baton,
+ result_pool, scratch_pool));
SVN_ERR(svn_delta_from_editor(deditor_out, dedit_baton_out, editor,
+ fetch_props_func, fetch_props_baton,
result_pool));
#endif
Modified: subversion/branches/fs-py/subversion/libsvn_delta/editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_delta/editor.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_delta/editor.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_delta/editor.c Fri Sep 30 15:02:43 \
2011 @@ -56,7 +56,6 @@ struct svn_editor_t
#ifdef ENABLE_ORDERING_CHECK
apr_hash_t *pending_incomplete_children;
- apr_hash_t *needs_text;
apr_hash_t *completed_nodes;
apr_hash_t *needs_text_or_target;
svn_boolean_t finished;
@@ -82,7 +81,6 @@ svn_editor_create(svn_editor_t **editor,
(*editor)->scratch_pool = svn_pool_create(result_pool);
#ifdef ENABLE_ORDERING_CHECK
(*editor)->pending_incomplete_children = apr_hash_make(result_pool);
- (*editor)->needs_text = apr_hash_make(result_pool);
(*editor)->completed_nodes = apr_hash_make(result_pool);
(*editor)->needs_text_or_target = apr_hash_make(result_pool);
(*editor)->finished = FALSE;
@@ -262,6 +260,9 @@ svn_editor_add_directory(svn_editor_t *e
props, replaces_rev,
editor->scratch_pool);
#ifdef ENABLE_ORDERING_CHECK
+ apr_hash_set(editor->completed_nodes,
+ apr_pstrdup(editor->result_pool, relpath),
+ APR_HASH_KEY_STRING, (void *) 0x5ca1ab1e);
apr_hash_set(editor->pending_incomplete_children, relpath,
APR_HASH_KEY_STRING, NULL);
{
@@ -285,6 +286,8 @@ svn_editor_add_directory(svn_editor_t *e
svn_error_t *
svn_editor_add_file(svn_editor_t *editor,
const char *relpath,
+ const svn_checksum_t *checksum,
+ svn_stream_t *contents,
apr_hash_t *props,
svn_revnum_t replaces_rev)
{
@@ -300,13 +303,15 @@ svn_editor_add_file(svn_editor_t *editor
if (editor->cancel_func)
SVN_ERR(editor->cancel_func(editor->cancel_baton));
- err = editor->funcs.cb_add_file(editor->baton, relpath, props,
+ err = editor->funcs.cb_add_file(editor->baton, relpath,
+ checksum, contents, props,
replaces_rev, editor->scratch_pool);
#ifdef ENABLE_ORDERING_CHECK
+ apr_hash_set(editor->completed_nodes,
+ apr_pstrdup(editor->result_pool, relpath),
+ APR_HASH_KEY_STRING, (void *) 0x5ca1ab1e);
apr_hash_set(editor->pending_incomplete_children, relpath,
APR_HASH_KEY_STRING, NULL);
- apr_hash_set(editor->needs_text, apr_pstrdup(editor->result_pool, relpath),
- APR_HASH_KEY_STRING, (void *) 0xcafeface);
#endif
svn_pool_clear(editor->scratch_pool);
return err;
@@ -335,6 +340,9 @@ svn_editor_add_symlink(svn_editor_t *edi
err = editor->funcs.cb_add_symlink(editor->baton, relpath, target, props,
replaces_rev, editor->scratch_pool);
#ifdef ENABLE_ORDERING_CHECK
+ apr_hash_set(editor->completed_nodes,
+ apr_pstrdup(editor->result_pool, relpath),
+ APR_HASH_KEY_STRING, (void *) 0x5ca1ab1e);
apr_hash_set(editor->pending_incomplete_children, relpath,
APR_HASH_KEY_STRING, NULL);
#endif
@@ -364,6 +372,9 @@ svn_editor_add_absent(svn_editor_t *edit
err = editor->funcs.cb_add_absent(editor->baton, relpath, kind,
replaces_rev, editor->scratch_pool);
#ifdef ENABLE_ORDERING_CHECK
+ apr_hash_set(editor->completed_nodes,
+ apr_pstrdup(editor->result_pool, relpath),
+ APR_HASH_KEY_STRING, (void *) 0x5ca1ab1e);
apr_hash_set(editor->pending_incomplete_children, relpath,
APR_HASH_KEY_STRING, NULL);
#endif
@@ -436,7 +447,6 @@ svn_editor_set_text(svn_editor_t *editor
err = editor->funcs.cb_set_text(editor->baton, relpath, revision,
checksum, contents, editor->scratch_pool);
#ifdef ENABLE_ORDERING_CHECK
- apr_hash_set(editor->needs_text, relpath, APR_HASH_KEY_STRING, NULL);
apr_hash_set(editor->needs_text_or_target, relpath, APR_HASH_KEY_STRING,
NULL);
apr_hash_set(editor->completed_nodes,
@@ -548,6 +558,8 @@ svn_editor_move(svn_editor_t *editor,
SVN_ERR_ASSERT(editor->funcs.cb_move != NULL);
#ifdef ENABLE_ORDERING_CHECK
SVN_ERR_ASSERT(!editor->finished);
+ SVN_ERR_ASSERT(!apr_hash_get(editor->completed_nodes, src_relpath,
+ APR_HASH_KEY_STRING));
SVN_ERR_ASSERT(!apr_hash_get(editor->completed_nodes, dst_relpath,
APR_HASH_KEY_STRING));
#endif
@@ -558,6 +570,22 @@ svn_editor_move(svn_editor_t *editor,
err = editor->funcs.cb_move(editor->baton, src_relpath, src_revision,
dst_relpath, replaces_rev,
editor->scratch_pool);
+#ifdef ENABLE_ORDERING_CHECK
+ /* ### after moving a node away, a new one can be created. how does
+ ### affect the "replaces_rev" concept elsewhere? */
+#if 0
+ apr_hash_set(editor->completed_nodes,
+ apr_pstrdup(editor->result_pool, src_relpath),
+ APR_HASH_KEY_STRING, (void *) 0x5ca1ab1e);
+#endif
+
+ /* ### hmm. post-move, it should be possible to change props/contents. */
+#if 0
+ apr_hash_set(editor->completed_nodes,
+ apr_pstrdup(editor->result_pool, dst_relpath),
+ APR_HASH_KEY_STRING, (void *) 0x5ca1ab1e);
+#endif
+#endif
svn_pool_clear(editor->scratch_pool);
return err;
}
@@ -570,8 +598,8 @@ svn_editor_complete(svn_editor_t *editor
SVN_ERR_ASSERT(editor->funcs.cb_complete != NULL);
#ifdef ENABLE_ORDERING_CHECK
+ SVN_ERR_ASSERT(!editor->finished);
SVN_ERR_ASSERT(apr_hash_count(editor->pending_incomplete_children) == 0);
- SVN_ERR_ASSERT(apr_hash_count(editor->needs_text) == 0);
SVN_ERR_ASSERT(apr_hash_count(editor->needs_text_or_target) == 0);
#endif
@@ -590,6 +618,9 @@ svn_editor_abort(svn_editor_t *editor)
svn_error_t *err;
SVN_ERR_ASSERT(editor->funcs.cb_abort != NULL);
+#ifdef ENABLE_ORDERING_CHECK
+ SVN_ERR_ASSERT(!editor->finished);
+#endif
err = editor->funcs.cb_abort(editor->baton, editor->scratch_pool);
#ifdef ENABLE_ORDERING_CHECK
Modified: subversion/branches/fs-py/subversion/libsvn_diff/diff_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_diff/diff_file.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_diff/diff_file.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_diff/diff_file.c Fri Sep 30 15:02:43 \
2011 @@ -1636,7 +1636,7 @@ output_unified_diff_modified(void *baton
if (output_baton->show_c_function)
{
- int p;
+ apr_size_t p;
const char *invalid_character;
/* Save the extra context for later use.
@@ -1920,7 +1920,7 @@ flush_context_saver(context_saver_t *cs,
int i;
for (i = 0; i < SVN_DIFF__UNIFIED_CONTEXT_SIZE; i++)
{
- int slot = (i + cs->next_slot) % SVN_DIFF__UNIFIED_CONTEXT_SIZE;
+ apr_size_t slot = (i + cs->next_slot) % SVN_DIFF__UNIFIED_CONTEXT_SIZE;
if (cs->data[slot])
{
apr_size_t len = cs->len[slot];
Modified: subversion/branches/fs-py/subversion/libsvn_diff/diff_memory.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_diff/diff_memory.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_diff/diff_memory.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_diff/diff_memory.c Fri Sep 30 \
15:02:43 2011 @@ -710,7 +710,7 @@ flush_context_saver(context_saver_t *cs,
int i;
for (i = 0; i < SVN_DIFF__UNIFIED_CONTEXT_SIZE; i++)
{
- int slot = (i + cs->next_slot) % SVN_DIFF__UNIFIED_CONTEXT_SIZE;
+ apr_size_t slot = (i + cs->next_slot) % SVN_DIFF__UNIFIED_CONTEXT_SIZE;
if (cs->data[slot])
{
apr_size_t len = cs->len[slot];
Modified: subversion/branches/fs-py/subversion/libsvn_diff/parse-diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_diff/parse-diff.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_diff/parse-diff.c Fri Sep 30 15:02:43 \
2011 @@ -22,6 +22,7 @@
*/
#include <stdlib.h>
+#include <stddef.h>
#include <string.h>
#include "svn_types.h"
@@ -965,8 +966,8 @@ git_start(enum parse_state *new_state, c
while (TRUE)
{
- int len_old;
- int len_new;
+ ptrdiff_t len_old;
+ ptrdiff_t len_new;
new_path_marker = strstr(new_path_start, " b/");
Modified: subversion/branches/fs-py/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs/fs-loader.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs/fs-loader.c Fri Sep 30 15:02:43 \
2011 @@ -998,22 +998,6 @@ svn_fs_closest_copy(svn_fs_root_t **root
}
svn_error_t *
-svn_fs_get_mergeinfo2(svn_mergeinfo_catalog_t *catalog,
- svn_fs_root_t *root,
- const apr_array_header_t *paths,
- svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t validate_inherited_mergeinfo,
- svn_boolean_t include_descendants,
- apr_pool_t *pool)
-{
- return svn_error_trace(root->vtable->get_mergeinfo(catalog, root, paths,
- inherit,
- validate_inherited_mergeinfo,
- include_descendants,
- pool));
-}
-
-svn_error_t *
svn_fs_get_mergeinfo(svn_mergeinfo_catalog_t *catalog,
svn_fs_root_t *root,
const apr_array_header_t *paths,
@@ -1021,24 +1005,10 @@ svn_fs_get_mergeinfo(svn_mergeinfo_catal
svn_boolean_t include_descendants,
apr_pool_t *pool)
{
- return svn_error_trace(svn_fs_get_mergeinfo2(catalog, root, paths,
- inherit,
- FALSE,
- include_descendants,
- pool));
-}
-
-svn_error_t *
-svn_fs_validate_mergeinfo(svn_mergeinfo_t *validated_mergeinfo,
- svn_fs_t *fs,
- svn_mergeinfo_t mergeinfo,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- return svn_error_trace(fs->vtable->validate_mergeinfo(validated_mergeinfo,
- fs, mergeinfo,
- result_pool,
- scratch_pool));
+ return svn_error_trace(root->vtable->get_mergeinfo(catalog, root, paths,
+ inherit,
+ include_descendants,
+ pool));
}
svn_error_t *
Modified: subversion/branches/fs-py/subversion/libsvn_fs/fs-loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs/fs-loader.h?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_fs/fs-loader.h (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs/fs-loader.h Fri Sep 30 15:02:43 \
2011 @@ -203,11 +203,6 @@ typedef struct fs_vtable_t
svn_error_t *(*bdb_set_errcall)(svn_fs_t *fs,
void (*handler)(const char *errpfx,
char *msg));
- svn_error_t *(*validate_mergeinfo)(svn_mergeinfo_t *validated_mergeinfo,
- svn_fs_t *fs,
- svn_mergeinfo_t mergeinfo,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
} fs_vtable_t;
@@ -340,7 +335,6 @@ typedef struct root_vtable_t
svn_fs_root_t *root,
const apr_array_header_t *paths,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool);
} root_vtable_t;
Modified: subversion/branches/fs-py/subversion/libsvn_fs_base/bdb/locks-table.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs_base/bdb/locks-table.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_fs_base/bdb/locks-table.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs_base/bdb/locks-table.c Fri Sep 30 \
15:02:43 2011 @@ -248,11 +248,11 @@ svn_fs_bdb__locks_get(svn_fs_t *fs,
db_err = svn_bdb_dbc_get(cursor, &key, svn_fs_base__result_dbt(&value),
DB_SET_RANGE);
- /* As long as the prefix of the returned KEY matches LOOKUP_PATH we
- know it is either LOOKUP_PATH or a decendant thereof. */
if (!svn_fspath__is_root(path, strlen(path)))
lookup_path = apr_pstrcat(pool, path, "/", (char *)NULL);
+ /* As long as the prefix of the returned KEY matches LOOKUP_PATH we
+ know it is either LOOKUP_PATH or a decendant thereof. */
while ((! db_err)
&& strncmp(lookup_path, key.data, strlen(lookup_path)) == 0)
{
Modified: subversion/branches/fs-py/subversion/libsvn_fs_base/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs_base/fs.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_fs_base/fs.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs_base/fs.c Fri Sep 30 15:02:43 2011
@@ -496,7 +496,6 @@ static fs_vtable_t fs_vtable = {
svn_fs_base__get_lock,
svn_fs_base__get_locks,
base_bdb_set_errcall,
- svn_fs_base__validate_mergeinfo,
};
/* Where the format number is stored. */
Modified: subversion/branches/fs-py/subversion/libsvn_fs_base/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs_base/tree.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_fs_base/tree.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs_base/tree.c Fri Sep 30 15:02:43 \
2011 @@ -4955,128 +4955,6 @@ base_node_origin_rev(svn_revnum_t *revis
/* Mergeinfo Queries */
-/* Implements svn_fs_validate_mergeinfo. */
-svn_error_t *
-svn_fs_base__validate_mergeinfo(svn_mergeinfo_t *validated_mergeinfo,
- svn_fs_t *fs,
- svn_mergeinfo_t mergeinfo,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- svn_mergeinfo_t filtered_mergeinfo;
- apr_hash_t *rev_to_sources;
- apr_hash_index_t *hi;
- apr_pool_t *iterpool;
-
- /* A couple easy outs. */
- if (mergeinfo == NULL)
- {
- *validated_mergeinfo = NULL;
- return SVN_NO_ERROR;
- }
- else if (apr_hash_count(mergeinfo) == 0)
- {
- *validated_mergeinfo = apr_hash_make(result_pool);
- return SVN_NO_ERROR;
- }
-
- filtered_mergeinfo = apr_hash_make(scratch_pool);
- rev_to_sources = apr_hash_make(scratch_pool);
-
- /* Since svn_fs_check_path needs an svn_fs_root_t based on a revision,
- we convert MERGEINFO into a mapping of revisions to a hash of source
- paths for efficiency. */
- for (hi = apr_hash_first(scratch_pool, mergeinfo);
- hi;
- hi = apr_hash_next(hi))
- {
- const char *path = svn__apr_hash_index_key(hi);
- apr_array_header_t *rangelist = svn__apr_hash_index_val(hi);
- int i;
-
- for (i = 0; i < rangelist->nelts; i++)
- {
- svn_merge_range_t *range =
- APR_ARRAY_IDX(rangelist, i, svn_merge_range_t *);
- svn_revnum_t j;
-
- for (j = range->start + 1; j <= range->end; j++)
- {
- apr_hash_t *paths_for_rev =
- apr_hash_get(rev_to_sources, &j, sizeof(svn_revnum_t));
-
- /* No hash associated with this rev yet? */
- if (!paths_for_rev)
- {
- svn_revnum_t *rev = apr_palloc(scratch_pool, sizeof(*rev));
-
- *rev = j;
- paths_for_rev = apr_hash_make(scratch_pool);
- apr_hash_set(rev_to_sources, rev,
- sizeof(svn_revnum_t), paths_for_rev);
- }
-
- apr_hash_set(paths_for_rev, path, APR_HASH_KEY_STRING, path);
- }
- }
- }
-
- iterpool = svn_pool_create(scratch_pool);
-
- /* Validate the rev->source MERGEINFO equivalent hash, building the
- validated mergeinfo as we go. */
- for (hi = apr_hash_first(scratch_pool, rev_to_sources);
- hi;
- hi = apr_hash_next(hi))
- {
- const svn_revnum_t *rev = svn__apr_hash_index_key(hi);
- apr_hash_t *paths = svn__apr_hash_index_val(hi);
- apr_pool_t *inner_iterpool;
- apr_hash_index_t *hi2;
- svn_node_kind_t kind;
- svn_fs_root_t *mergeinfo_rev_root;
-
- svn_pool_clear(iterpool);
- inner_iterpool = svn_pool_create(iterpool);
-
- SVN_ERR(svn_fs_base__revision_root(&mergeinfo_rev_root, fs,
- *rev, iterpool));
-
- for (hi2 = apr_hash_first(iterpool, paths);
- hi2;
- hi2 = apr_hash_next(hi2))
- {
- const char *path = svn__apr_hash_index_key(hi2);
-
- svn_pool_clear(inner_iterpool);
- SVN_ERR(base_check_path(&kind, mergeinfo_rev_root,
- path, inner_iterpool));
- if (kind == svn_node_none)
- {
- apr_hash_set(paths, path, APR_HASH_KEY_STRING, NULL);
- }
- else
- {
- svn_mergeinfo_t good_mergeinfo_fragment;
- const char *mergeinfo_str =
- apr_psprintf(inner_iterpool, "%s:%ld", path, *rev);
-
- SVN_ERR(svn_mergeinfo_parse(&good_mergeinfo_fragment,
- mergeinfo_str, scratch_pool));
- SVN_ERR(svn_mergeinfo_merge(filtered_mergeinfo,
- good_mergeinfo_fragment,
- scratch_pool));
- }
- }
- svn_pool_destroy(inner_iterpool);
- }
-
- svn_pool_destroy(iterpool);
- *validated_mergeinfo = svn_mergeinfo_dup(filtered_mergeinfo, result_pool);
- return SVN_NO_ERROR;
-}
-
-
/* Examine directory NODE's immediately children for mergeinfo.
For those which have explicit mergeinfo, add their mergeinfo to
@@ -5255,14 +5133,12 @@ crawl_directory_for_mergeinfo(svn_fs_t *
/* Calculate the mergeinfo for PATH under revision ROOT using
inheritance type INHERIT. Set *MERGEINFO to the mergeinfo, or to
- NULL if there is none. If *MERGEINFO is inherited set *INHERITED
- to true, false otherwise. Results are allocated in POOL; TRAIL->POOL
+ NULL if there is none. Results are allocated in POOL; TRAIL->pool
is used for temporary allocations. */
struct get_mergeinfo_for_path_baton
{
svn_mergeinfo_t *mergeinfo;
- svn_boolean_t *inherited;
svn_fs_root_t *root;
const char *path;
svn_mergeinfo_inheritance_t inherit;
@@ -5280,7 +5156,6 @@ txn_body_get_mergeinfo_for_path(void *ba
dag_node_t *node = NULL;
*(args->mergeinfo) = NULL;
- *(args->inherited) = FALSE;
SVN_ERR(open_path(&parent_path, args->root, args->path, 0,
NULL, trail, trail->pool));
@@ -5375,7 +5250,6 @@ txn_body_get_mergeinfo_for_path(void *ba
parent_path, nearest_ancestor,
trail->pool),
args->pool));
- *(args->inherited) = TRUE;
}
return SVN_NO_ERROR;
@@ -5408,17 +5282,14 @@ txn_body_get_node_mergeinfo_stats(void *
}
-/* Get the mergeinfo for a set of paths, returned in *MERGEINFO_CATALOG.
- If the mergeinfo for any path is inherited and VALIDATE_INHERITED_MERGEINFO
- is true, then the mergeinfo for that path in *MERGEINFO_CATALOG will only
- contain path-revs that actually exist in repository. Returned values are
- allocated in POOL, while temporary values are allocated in a sub-pool. */
+/* Get the mergeinfo for a set of paths, returned in
+ *MERGEINFO_CATALOG. Returned values are allocated in POOL, while
+ temporary values are allocated in a sub-pool. */
static svn_error_t *
get_mergeinfos_for_paths(svn_fs_root_t *root,
svn_mergeinfo_catalog_t *mergeinfo_catalog,
const apr_array_header_t *paths,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool)
{
@@ -5429,7 +5300,6 @@ get_mergeinfos_for_paths(svn_fs_root_t *
for (i = 0; i < paths->nelts; i++)
{
svn_mergeinfo_t path_mergeinfo;
- svn_boolean_t inherited;
struct get_mergeinfo_for_path_baton gmfp_args;
const char *path = APR_ARRAY_IDX(paths, i, const char *);
@@ -5439,7 +5309,6 @@ get_mergeinfos_for_paths(svn_fs_root_t *
/* Get the mergeinfo for PATH itself. */
gmfp_args.mergeinfo = &path_mergeinfo;
- gmfp_args.inherited = &inherited;
gmfp_args.root = root;
gmfp_args.path = path;
gmfp_args.inherit = inherit;
@@ -5448,16 +5317,9 @@ get_mergeinfos_for_paths(svn_fs_root_t *
txn_body_get_mergeinfo_for_path,
&gmfp_args, FALSE, iterpool));
if (path_mergeinfo)
- {
- if (inherited && validate_inherited_mergeinfo)
- SVN_ERR(svn_fs_base__validate_mergeinfo(&path_mergeinfo, root->fs,
- path_mergeinfo, pool,
- iterpool));
-
- apr_hash_set(result_catalog, apr_pstrdup(pool, path),
- APR_HASH_KEY_STRING,
- path_mergeinfo);
- }
+ apr_hash_set(result_catalog, apr_pstrdup(pool, path),
+ APR_HASH_KEY_STRING,
+ path_mergeinfo);
/* If we're including descendants, do so. */
if (include_descendants)
@@ -5500,7 +5362,6 @@ base_get_mergeinfo(svn_mergeinfo_catalog
svn_fs_root_t *root,
const apr_array_header_t *paths,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool)
{
@@ -5514,8 +5375,8 @@ base_get_mergeinfo(svn_mergeinfo_catalog
/* Retrieve a path -> mergeinfo mapping. */
return get_mergeinfos_for_paths(root, catalog, paths,
- inherit, validate_inherited_mergeinfo,
- include_descendants, pool);
+ inherit, include_descendants,
+ pool);
}
Modified: subversion/branches/fs-py/subversion/libsvn_fs_base/tree.h
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs_base/tree.h?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_fs_base/tree.h (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs_base/tree.h Fri Sep 30 15:02:43 \
2011 @@ -91,14 +91,6 @@ svn_error_t *svn_fs_base__get_path_creat
trail_t *trail,
apr_pool_t *pool);
-/* Implements svn_fs_validate_mergeinfo. */
-svn_error_t *
-svn_fs_base__validate_mergeinfo(svn_mergeinfo_t *validated_mergeinfo,
- svn_fs_t *fs,
- svn_mergeinfo_t mergeinfo,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
#ifdef __cplusplus
}
Modified: subversion/branches/fs-py/subversion/libsvn_fs_fs/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs_fs/fs.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs_fs/fs.c Fri Sep 30 15:02:43 2011
@@ -159,7 +159,6 @@ static fs_vtable_t fs_vtable = {
svn_fs_fs__get_lock,
svn_fs_fs__get_locks,
fs_set_errcall,
- svn_fs_fs__validate_mergeinfo,
};
Modified: subversion/branches/fs-py/subversion/libsvn_fs_fs/key-gen.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs_fs/key-gen.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_fs_fs/key-gen.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs_fs/key-gen.c Fri Sep 30 15:02:43 \
2011 @@ -41,8 +41,8 @@
void
svn_fs_fs__add_keys(const char *key1, const char *key2, char *result)
{
- int i1 = strlen(key1) - 1;
- int i2 = strlen(key2) - 1;
+ apr_size_t i1 = strlen(key1) - 1;
+ apr_size_t i2 = strlen(key2) - 1;
int i3 = 0;
int val;
int carry = 0;
@@ -79,7 +79,7 @@ svn_fs_fs__add_keys(const char *key1, co
void
svn_fs_fs__next_key(const char *this, apr_size_t *len, char *next)
{
- int i;
+ apr_ssize_t i;
apr_size_t olen = *len; /* remember the first length */
char c; /* current char */
svn_boolean_t carry = TRUE; /* boolean: do we have a carry or not?
@@ -146,8 +146,8 @@ svn_fs_fs__next_key(const char *this, ap
int
svn_fs_fs__key_compare(const char *a, const char *b)
{
- int a_len = strlen(a);
- int b_len = strlen(b);
+ apr_size_t a_len = strlen(a);
+ apr_size_t b_len = strlen(b);
int cmp;
if (a_len > b_len)
Modified: subversion/branches/fs-py/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs_fs/tree.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs_fs/tree.c Fri Sep 30 15:02:43 2011
@@ -3353,127 +3353,6 @@ assemble_history(svn_fs_t *fs,
/* mergeinfo queries */
-/* Implements svn_fs_validate_mergeinfo. */
-svn_error_t *
-svn_fs_fs__validate_mergeinfo(svn_mergeinfo_t *validated_mergeinfo,
- svn_fs_t *fs,
- svn_mergeinfo_t mergeinfo,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- svn_mergeinfo_t filtered_mergeinfo;
- apr_hash_t *rev_to_sources;
- apr_hash_index_t *hi;
- apr_pool_t *iterpool;
-
- /* A couple easy outs. */
- if (mergeinfo == NULL)
- {
- *validated_mergeinfo = NULL;
- return SVN_NO_ERROR;
- }
- else if (apr_hash_count(mergeinfo) == 0)
- {
- *validated_mergeinfo = apr_hash_make(result_pool);
- return SVN_NO_ERROR;
- }
-
- filtered_mergeinfo = apr_hash_make(scratch_pool);
- rev_to_sources = apr_hash_make(scratch_pool);
-
- /* Since svn_fs_check_path needs an svn_fs_root_t based on a revision,
- we convert MERGEINFO into a mapping of revisions to a hash of source
- paths for efficiency. */
- for (hi = apr_hash_first(scratch_pool, mergeinfo);
- hi;
- hi = apr_hash_next(hi))
- {
- const char *path = svn__apr_hash_index_key(hi);
- apr_array_header_t *rangelist = svn__apr_hash_index_val(hi);
- int i;
-
- for (i = 0; i < rangelist->nelts; i++)
- {
- svn_merge_range_t *range =
- APR_ARRAY_IDX(rangelist, i, svn_merge_range_t *);
- svn_revnum_t j;
-
- for (j = range->start + 1; j <= range->end; j++)
- {
- apr_hash_t *paths_for_rev =
- apr_hash_get(rev_to_sources, &j, sizeof(svn_revnum_t));
-
- /* No hash associated with this rev yet? */
- if (!paths_for_rev)
- {
- svn_revnum_t *rev = apr_palloc(scratch_pool, sizeof(*rev));
-
- *rev = j;
- paths_for_rev = apr_hash_make(scratch_pool);
- apr_hash_set(rev_to_sources, rev,
- sizeof(svn_revnum_t), paths_for_rev);
- }
-
- apr_hash_set(paths_for_rev, path, APR_HASH_KEY_STRING, path);
- }
- }
- }
-
- iterpool = svn_pool_create(scratch_pool);
-
- /* Validate the rev->source MERGEINFO equivalent hash, building the
- validated mergeinfo as we go. */
- for (hi = apr_hash_first(scratch_pool, rev_to_sources);
- hi;
- hi = apr_hash_next(hi))
- {
- const svn_revnum_t *rev = svn__apr_hash_index_key(hi);
- apr_hash_t *paths = svn__apr_hash_index_val(hi);
- apr_pool_t *inner_iterpool;
- apr_hash_index_t *hi2;
- svn_node_kind_t kind;
- svn_fs_root_t *mergeinfo_rev_root;
-
- svn_pool_clear(iterpool);
- inner_iterpool = svn_pool_create(iterpool);
-
- SVN_ERR(svn_fs_fs__revision_root(&mergeinfo_rev_root, fs,
- *rev, iterpool));
-
- for (hi2 = apr_hash_first(iterpool, paths);
- hi2;
- hi2 = apr_hash_next(hi2))
- {
- const char *path = svn__apr_hash_index_key(hi2);
-
- svn_pool_clear(inner_iterpool);
- SVN_ERR(svn_fs_fs__check_path(&kind, mergeinfo_rev_root,
- path, inner_iterpool));
- if (kind == svn_node_none)
- {
- apr_hash_set(paths, path, APR_HASH_KEY_STRING, NULL);
- }
- else
- {
- svn_mergeinfo_t good_mergeinfo_fragment;
- const char *mergeinfo_str =
- apr_psprintf(inner_iterpool, "%s:%ld", path, *rev);
-
- SVN_ERR(svn_mergeinfo_parse(&good_mergeinfo_fragment,
- mergeinfo_str, scratch_pool));
- SVN_ERR(svn_mergeinfo_merge(filtered_mergeinfo,
- good_mergeinfo_fragment,
- scratch_pool));
- }
- }
- svn_pool_destroy(inner_iterpool);
- }
-
- svn_pool_destroy(iterpool);
- *validated_mergeinfo = svn_mergeinfo_dup(filtered_mergeinfo, result_pool);
- return SVN_NO_ERROR;
-}
-
/* DIR_DAG is a directory DAG node which has mergeinfo in its
descendants. This function iterates over its children. For each
child with immediate mergeinfo, it adds its mergeinfo to
@@ -3576,9 +3455,7 @@ crawl_directory_dag_for_mergeinfo(svn_fs
/* Calculates the mergeinfo for PATH under REV_ROOT using inheritance
type INHERIT. Returns it in *MERGEINFO, or NULL if there is none.
- If *MERGEINFO is inherited and VALIDATE_INHERITED_MERGEINFO is true,
- then *MERGEINFO will only contain path-revs that actually exist in
- repository. The result is allocated in RESULT_POOL; SCRATCH_POOL is
+ The result is allocated in RESULT_POOL; SCRATCH_POOL is
used for temporary allocations.
*/
static svn_error_t *
@@ -3586,7 +3463,6 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
svn_fs_root_t *rev_root,
const char *path,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t validate_inherited_mergeinfo,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -3637,6 +3513,8 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
}
}
+ svn_pool_destroy(iterpool);
+
SVN_ERR(svn_fs_fs__dag_get_proplist(&proplist, nearest_ancestor->node,
scratch_pool));
mergeinfo_string = apr_hash_get(proplist, SVN_PROP_MERGEINFO,
@@ -3663,7 +3541,6 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
err = NULL;
*mergeinfo = NULL;
}
- svn_pool_destroy(iterpool);
return svn_error_trace(err);
}
}
@@ -3685,14 +3562,8 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
parent_path, nearest_ancestor,
scratch_pool),
result_pool));
-
- if (validate_inherited_mergeinfo)
- SVN_ERR(svn_fs_fs__validate_mergeinfo(mergeinfo, rev_root->fs,
- *mergeinfo, result_pool,
- iterpool));
}
- svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}
@@ -3725,17 +3596,13 @@ add_descendant_mergeinfo(svn_mergeinfo_c
/* Get the mergeinfo for a set of paths, returned in
- *MERGEINFO_CATALOG. If the mergeinfo for any path is inherited
- and VALIDATE_INHERITED_MERGEINFO is true, then the mergeinfo for
- that path in *MERGEINFO_CATALOG will only contain path-revs that
- actually exist in repository. Returned values are allocated in
+ *MERGEINFO_CATALOG. Returned values are allocated in
POOL, while temporary values are allocated in a sub-pool. */
static svn_error_t *
get_mergeinfos_for_paths(svn_fs_root_t *root,
svn_mergeinfo_catalog_t *mergeinfo_catalog,
const apr_array_header_t *paths,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool)
{
@@ -3752,8 +3619,7 @@ get_mergeinfos_for_paths(svn_fs_root_t *
svn_pool_clear(iterpool);
err = get_mergeinfo_for_path(&path_mergeinfo, root, path,
- inherit, validate_inherited_mergeinfo,
- pool, iterpool);
+ inherit, pool, iterpool);
if (err)
{
if (err->apr_err == SVN_ERR_MERGEINFO_PARSE_ERROR)
@@ -3788,7 +3654,6 @@ fs_get_mergeinfo(svn_mergeinfo_catalog_t
svn_fs_root_t *root,
const apr_array_header_t *paths,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool)
{
@@ -3808,7 +3673,7 @@ fs_get_mergeinfo(svn_mergeinfo_catalog_t
/* Retrieve a path -> mergeinfo hash mapping. */
return get_mergeinfos_for_paths(root, catalog, paths,
- inherit, validate_inherited_mergeinfo,
+ inherit,
include_descendants, pool);
}
Modified: subversion/branches/fs-py/subversion/libsvn_fs_fs/tree.h
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_fs_fs/tree.h?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_fs_fs/tree.h (original)
+++ subversion/branches/fs-py/subversion/libsvn_fs_fs/tree.h Fri Sep 30 15:02:43 2011
@@ -71,14 +71,6 @@ svn_fs_fs__node_created_rev(svn_revnum_t
const char *path,
apr_pool_t *pool);
-/* Implements svn_fs_validate_mergeinfo. */
-svn_error_t *
-svn_fs_fs__validate_mergeinfo(svn_mergeinfo_t *validated_mergeinfo,
- svn_fs_t *fs,
- svn_mergeinfo_t mergeinfo,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/fs-py/subversion/libsvn_ra/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_ra/deprecated.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_ra/deprecated.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_ra/deprecated.c Fri Sep 30 15:02:43 \
2011 @@ -417,17 +417,3 @@ svn_error_t *svn_ra_do_status(svn_ra_ses
SVN_DEPTH_INFINITY_OR_IMMEDIATES(recurse),
status_editor, status_baton, pool);
}
-
-svn_error_t *svn_ra_get_mergeinfo(svn_ra_session_t *session,
- svn_mergeinfo_catalog_t *catalog,
- const apr_array_header_t *paths,
- svn_revnum_t revision,
- svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t include_descendants,
- apr_pool_t *pool)
-{
- return svn_error_trace(svn_ra_get_mergeinfo2(session, catalog, paths,
- revision, inherit, FALSE,
- include_descendants, pool));
-}
-
Modified: subversion/branches/fs-py/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_ra/ra_loader.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_ra/ra_loader.c Fri Sep 30 15:02:43 \
2011 @@ -757,14 +757,13 @@ svn_error_t *svn_ra_get_dir2(svn_ra_sess
path, revision, dirent_fields, pool);
}
-svn_error_t *svn_ra_get_mergeinfo2(svn_ra_session_t *session,
- svn_mergeinfo_catalog_t *catalog,
- const apr_array_header_t *paths,
- svn_revnum_t revision,
- svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t validate_inherited_mergeinfo,
- svn_boolean_t include_descendants,
- apr_pool_t *pool)
+svn_error_t *svn_ra_get_mergeinfo(svn_ra_session_t *session,
+ svn_mergeinfo_catalog_t *catalog,
+ const apr_array_header_t *paths,
+ svn_revnum_t revision,
+ svn_mergeinfo_inheritance_t inherit,
+ svn_boolean_t include_descendants,
+ apr_pool_t *pool)
{
svn_error_t *err;
int i;
@@ -786,7 +785,6 @@ svn_error_t *svn_ra_get_mergeinfo2(svn_r
return session->vtable->get_mergeinfo(session, catalog, paths,
revision, inherit,
- validate_inherited_mergeinfo,
include_descendants, pool);
}
Modified: subversion/branches/fs-py/subversion/libsvn_ra/ra_loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_ra/ra_loader.h?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_ra/ra_loader.h (original)
+++ subversion/branches/fs-py/subversion/libsvn_ra/ra_loader.h Fri Sep 30 15:02:43 \
2011 @@ -125,13 +125,12 @@ typedef struct svn_ra__vtable_t {
svn_revnum_t revision,
apr_uint32_t dirent_fields,
apr_pool_t *pool);
- /* See svn_ra_get_mergeinfo2(). */
+ /* See svn_ra_get_mergeinfo(). */
svn_error_t *(*get_mergeinfo)(svn_ra_session_t *session,
svn_mergeinfo_catalog_t *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 include_merged_revisions,
apr_pool_t *pool);
/* See svn_ra_do_update2(). */
Modified: subversion/branches/fs-py/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_ra_local/ra_plugin.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_ra_local/ra_plugin.c Fri Sep 30 \
15:02:43 2011 @@ -32,12 +32,14 @@
#include "svn_mergeinfo.h"
#include "svn_path.h"
#include "svn_version.h"
+#include "svn_cache_config.h"
#include "svn_private_config.h"
#include "../libsvn_ra/ra_loader.h"
#include "private/svn_mergeinfo_private.h"
#include "private/svn_repos_private.h"
#include "private/svn_fspath.h"
+#include "private/svn_atomic.h"
#define APR_WANT_STRFUNC
#include <apr_want.h>
@@ -129,6 +131,35 @@ get_username(svn_ra_session_t *session,
return SVN_NO_ERROR;
}
+/* Implements an svn_atomic__init_once callback. Sets the FSFS memory
+ cache size. */
+static svn_error_t *
+cache_init(void *baton, apr_pool_t *pool)
+{
+ apr_hash_t *config_hash = baton;
+ svn_config_t *config = NULL;
+ const char *memory_cache_size_str;
+
+ if (config_hash)
+ config = apr_hash_get(config_hash, SVN_CONFIG_CATEGORY_CONFIG,
+ APR_HASH_KEY_STRING);
+ svn_config_get(config, &memory_cache_size_str, SVN_CONFIG_SECTION_MISCELLANY,
+ SVN_CONFIG_OPTION_MEMORY_CACHE_SIZE, NULL);
+ if (memory_cache_size_str)
+ {
+ apr_uint64_t memory_cache_size;
+ svn_cache_config_t settings = *svn_cache_config_get();
+
+ SVN_ERR(svn_error_quick_wrap(svn_cstring_atoui64(&memory_cache_size,
+ memory_cache_size_str),
+ _("memory-cache-size invalid")));
+ settings.cache_size = 1024 * 1024 * memory_cache_size;
+ svn_cache_config_set(&settings);
+ }
+
+ return SVN_NO_ERROR;
+}
+
/*----------------------------------------------------------------*/
/*** The reporter vtable needed by do_update() and friends ***/
@@ -460,6 +491,12 @@ svn_ra_local__open(svn_ra_session_t *ses
{
svn_ra_local__session_baton_t *sess;
const char *fs_path;
+ static volatile svn_atomic_t cache_init_state = 0;
+
+ /* Initialise the FSFS memory cache size. We can only do this once
+ so one CONFIG will win the race and all others will be ignored
+ silently. */
+ SVN_ERR(svn_atomic__init_once(&cache_init_state, cache_init, config, pool));
/* We don't support redirections in ra-local. */
if (corrected_url)
@@ -705,7 +742,6 @@ 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 include_descendants,
apr_pool_t *pool)
{
@@ -722,11 +758,9 @@ svn_ra_local__get_mergeinfo(svn_ra_sessi
svn_fspath__join(sess->fs_path->data, relative_path, pool);
}
- SVN_ERR(svn_repos_fs_get_mergeinfo2(&tmp_catalog, sess->repos, abs_paths,
- revision, inherit,
- validate_inherited_mergeinfo,
- include_descendants,
- NULL, NULL, pool));
+ SVN_ERR(svn_repos_fs_get_mergeinfo(&tmp_catalog, sess->repos, abs_paths,
+ revision, inherit, include_descendants,
+ NULL, NULL, pool));
if (apr_hash_count(tmp_catalog) > 0)
SVN_ERR(svn_mergeinfo__remove_prefix_from_catalog(catalog,
tmp_catalog,
@@ -1434,9 +1468,7 @@ svn_ra_local__has_capability(svn_ra_sess
{
*has = TRUE;
}
- else if ((strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
- || (strcmp(capability,
- SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO) == 0))
+ else if (strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
{
/* With mergeinfo, the code's capabilities may not reflect the
repository's, so inquire further. */
Modified: subversion/branches/fs-py/subversion/libsvn_ra_neon/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_ra_neon/commit.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_ra_neon/commit.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_ra_neon/commit.c Fri Sep 30 15:02:43 \
2011 @@ -1622,7 +1622,7 @@ svn_error_t * svn_ra_neon__get_commit_ed
*edit_baton = cc;
SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
- pool, pool));
+ NULL, NULL, NULL, NULL, pool, pool));
return SVN_NO_ERROR;
}
Modified: subversion/branches/fs-py/subversion/libsvn_ra_neon/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_ra_neon/mergeinfo.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_ra_neon/mergeinfo.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_ra_neon/mergeinfo.c Fri Sep 30 \
15:02:43 2011 @@ -163,7 +163,6 @@ 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 include_descendants,
apr_pool_t *pool)
{
@@ -195,14 +194,6 @@ svn_ra_neon__get_mergeinfo(svn_ra_sessio
"</S:inherit>",
svn_inheritance_to_word(inherit)));
- if (validate_inherited_mergeinfo)
- {
- /* Send it only if true; server will default to "no". */
- svn_stringbuf_appendcstr(request_body,
- "<S:" SVN_DAV__VALIDATE_INHERITED ">yes"
- "</S:" SVN_DAV__VALIDATE_INHERITED ">");
- }
-
if (include_descendants)
{
/* Send it only if true; server will default to "no". */
Modified: subversion/branches/fs-py/subversion/libsvn_ra_neon/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_ra_neon/options.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_ra_neon/options.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_ra_neon/options.c Fri Sep 30 15:02:43 \
2011 @@ -198,16 +198,11 @@ 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,
@@ -403,9 +398,7 @@ svn_ra_neon__has_capability(svn_ra_sessi
you change something here, check there as well. */
if (cap_result == capability_server_yes)
{
- if ((strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
- || (strcmp(capability,
- SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO) == 0))
+ if (strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
{
/* Handle mergeinfo specially. Mergeinfo depends on the
repository as well as the server, but the server routine
@@ -418,15 +411,12 @@ svn_ra_neon__has_capability(svn_ra_sessi
support mergeinfo. */
svn_mergeinfo_catalog_t ignored;
svn_error_t *err;
- svn_boolean_t validate_inherited_mergeinfo = FALSE;
apr_array_header_t *paths = apr_array_make(pool, 1,
sizeof(char *));
APR_ARRAY_PUSH(paths, const char *) = "";
err = svn_ra_neon__get_mergeinfo(session, &ignored, paths, 0,
- FALSE,
- validate_inherited_mergeinfo,
- FALSE, pool);
+ FALSE, FALSE, pool);
if (err)
{
@@ -450,14 +440,9 @@ svn_ra_neon__has_capability(svn_ra_sessi
else
cap_result = capability_yes;
- 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);
+ apr_hash_set(ras->capabilities,
+ SVN_RA_CAPABILITY_MERGEINFO, APR_HASH_KEY_STRING,
+ cap_result);
}
else
{
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic