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/10/11 21:52:46 UTC
svn commit: r1182053 [12/30] - in /subversion/branches/svn_mutex: ./ build/
build/ac-macros/ build/generator/ build/generator/swig/
build/generator/templates/ contrib/client-side/
contrib/hook-scripts/enforcer/ contrib/server-side/ notes/ notes/merge-t...
Propchange: subversion/branches/svn_mutex/subversion/libsvn_fs_fs/temp_serializer.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 11 19:52:34 2011
@@ -1 +1,2 @@
-/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c:1067687-1072301,1141684-1142212
+/subversion/branches/revprop-packing/subversion/libsvn_fs_fs/temp_serializer.c:1143907,1143971,1144017,1144568,1146145
+/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c:1067687-1072301,1141684-1142212,1142216-1181870
Propchange: subversion/branches/svn_mutex/subversion/libsvn_fs_fs/temp_serializer.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 11 19:52:34 2011
@@ -1 +1,2 @@
-/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.h:1067687-1072301,1141684-1142212
+/subversion/branches/revprop-packing/subversion/libsvn_fs_fs/temp_serializer.h:1143907,1143971,1144017,1144568,1146145
+/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.h:1067687-1072301,1141684-1142212,1142216-1181870
Modified: subversion/branches/svn_mutex/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_fs_fs/tree.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_fs_fs/tree.c Tue Oct 11 19:52:34 2011
@@ -1892,7 +1892,7 @@ fs_delete_node(svn_fs_root_t *root,
{
parent_path_t *parent_path;
const char *txn_id = root->txn;
- apr_int64_t mergeinfo_count;
+ apr_int64_t mergeinfo_count = 0;
svn_node_kind_t kind;
if (! root->is_txn_root)
@@ -1927,7 +1927,7 @@ fs_delete_node(svn_fs_root_t *root,
pool));
/* Update mergeinfo counts for parents */
- if (svn_fs_fs__fs_supports_mergeinfo(root->fs) && mergeinfo_count > 0)
+ if (mergeinfo_count > 0)
SVN_ERR(increment_mergeinfo_up_tree(parent_path->parent,
-mergeinfo_count,
pool));
@@ -2925,7 +2925,7 @@ prev_location(const char **prev_path,
const char *path,
apr_pool_t *pool)
{
- const char *copy_path, *copy_src_path, *remainder = "";
+ const char *copy_path, *copy_src_path, *remainder_path = "";
svn_fs_root_t *copy_root;
svn_revnum_t copy_src_rev;
@@ -2955,8 +2955,8 @@ prev_location(const char **prev_path,
SVN_ERR(fs_copied_from(©_src_rev, ©_src_path,
copy_root, copy_path, pool));
if (strcmp(copy_path, path) != 0)
- remainder = svn_relpath__is_child(copy_path, path, pool);
- *prev_path = svn_fspath__join(copy_src_path, remainder, pool);
+ remainder_path = svn_relpath__is_child(copy_path, path, pool);
+ *prev_path = svn_fspath__join(copy_src_path, remainder_path, pool);
*prev_rev = copy_src_rev;
return SVN_NO_ERROR;
}
@@ -3048,7 +3048,7 @@ fs_node_origin_rev(svn_revnum_t *revisio
/* Walk the predecessor links back to origin. */
SVN_ERR(fs_node_id(&pred_id, curroot, lastpath->data, predidpool));
- while (pred_id)
+ do
{
svn_pool_clear(subpool);
SVN_ERR(svn_fs_fs__dag_get_node(&node, fs, pred_id, subpool));
@@ -3062,6 +3062,7 @@ fs_node_origin_rev(svn_revnum_t *revisio
SVN_ERR(svn_fs_fs__dag_get_predecessor_id(&pred_id, node, subpool));
pred_id = pred_id ? svn_fs_fs__id_copy(pred_id, predidpool) : NULL;
}
+ while (pred_id);
/* When we get here, NODE should be the first node-revision in our
chain. */
@@ -3184,7 +3185,7 @@ history_prev(void *baton, apr_pool_t *po
if (copyroot_rev > commit_rev)
{
- const char *remainder;
+ const char *remainder_path;
const char *copy_dst, *copy_src;
svn_fs_root_t *copyroot_root;
@@ -3202,11 +3203,11 @@ history_prev(void *baton, apr_pool_t *po
one of these other criteria ... ### for now just fallback to
the old copy hunt algorithm. */
if (strcmp(path, copy_dst) == 0)
- remainder = "";
+ remainder_path = "";
else
- remainder = svn_relpath__is_child(copy_dst, path, pool);
+ remainder_path = svn_relpath__is_child(copy_dst, path, pool);
- if (remainder)
+ if (remainder_path)
{
/* If we get here, then our current path is the destination
of, or the child of the destination of, a copy. Fill
@@ -3215,7 +3216,7 @@ history_prev(void *baton, apr_pool_t *po
SVN_ERR(svn_fs_fs__dag_get_copyfrom_path(©_src, node, pool));
dst_rev = copyroot_rev;
- src_path = svn_fspath__join(copy_src, remainder, pool);
+ src_path = svn_fspath__join(copy_src, remainder_path, pool);
}
}
@@ -3352,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
@@ -3575,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 *
@@ -3585,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)
{
@@ -3636,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,
@@ -3662,7 +3541,6 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
err = NULL;
*mergeinfo = NULL;
}
- svn_pool_destroy(iterpool);
return svn_error_trace(err);
}
}
@@ -3684,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;
}
@@ -3724,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)
{
@@ -3751,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)
@@ -3787,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)
{
@@ -3807,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/svn_mutex/subversion/libsvn_fs_fs/tree.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_fs_fs/tree.h?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_fs_fs/tree.h (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_fs_fs/tree.h Tue Oct 11 19:52:34 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/svn_mutex/subversion/libsvn_ra/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra/deprecated.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra/deprecated.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra/deprecated.c Tue Oct 11 19:52:34 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/svn_mutex/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra/ra_loader.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra/ra_loader.c Tue Oct 11 19:52:34 2011
@@ -201,14 +201,13 @@ load_ra_module(svn_ra__init_func_t *func
return SVN_NO_ERROR;
}
-/* If DEFN may support URL, return the scheme. Else, return NULL. */
+/* If SCHEMES contains URL, return the scheme. Else, return NULL. */
static const char *
-has_scheme_of(const struct ra_lib_defn *defn, const char *url)
+has_scheme_of(const char * const *schemes, const char *url)
{
- const char * const *schemes;
apr_size_t len;
- for (schemes = defn->schemes; *schemes != NULL; ++schemes)
+ for ( ; *schemes != NULL; ++schemes)
{
const char *scheme = *schemes;
len = strlen(scheme);
@@ -454,7 +453,7 @@ svn_error_t *svn_ra_open4(svn_ra_session
{
const char *scheme;
- if ((scheme = has_scheme_of(defn, repos_URL)))
+ if ((scheme = has_scheme_of(defn->schemes, repos_URL)))
{
svn_ra__init_func_t initfunc = defn->initfunc;
@@ -475,6 +474,11 @@ svn_error_t *svn_ra_open4(svn_ra_session
SVN_ERR(check_ra_version(vtable->get_version(), scheme));
+ if (! has_scheme_of(vtable->get_schemes(sesspool), repos_URL))
+ /* Library doesn't support the scheme at runtime. */
+ continue;
+
+
break;
}
}
@@ -570,19 +574,13 @@ svn_error_t *svn_ra_get_path_relative_to
apr_pool_t *pool)
{
const char *sess_url;
+
SVN_ERR(session->vtable->get_session_url(session, &sess_url, pool));
- if (strcmp(sess_url, url) == 0)
- {
- *rel_path = "";
- }
- else
- {
- *rel_path = svn_uri__is_child(sess_url, url, pool);
- if (! *rel_path)
- return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,
- _("'%s' isn't a child of session URL '%s'"),
- url, sess_url);
- }
+ *rel_path = svn_uri_skip_ancestor(sess_url, url, pool);
+ if (! *rel_path)
+ return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,
+ _("'%s' isn't a child of session URL '%s'"),
+ url, sess_url);
return SVN_NO_ERROR;
}
@@ -592,21 +590,14 @@ svn_error_t *svn_ra_get_path_relative_to
apr_pool_t *pool)
{
const char *root_url;
- SVN_ERR(session->vtable->get_repos_root(session, &root_url, pool));
- if (strcmp(root_url, url) == 0)
- {
- *rel_path = "";
- }
- else
- {
- *rel_path = svn_uri__is_child(root_url, url, pool);
- if (! *rel_path)
- return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,
- _("'%s' isn't a child of repository root "
- "URL '%s'"),
- url, root_url);
- }
+ SVN_ERR(session->vtable->get_repos_root(session, &root_url, pool));
+ *rel_path = svn_uri_skip_ancestor(root_url, url, pool);
+ if (! *rel_path)
+ return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,
+ _("'%s' isn't a child of repository root "
+ "URL '%s'"),
+ url, root_url);
return SVN_NO_ERROR;
}
@@ -766,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;
@@ -795,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);
}
@@ -1332,7 +1321,7 @@ svn_ra_get_ra_library(svn_ra_plugin_t **
for (defn = ra_libraries; defn->ra_name != NULL; ++defn)
{
const char *scheme;
- if ((scheme = has_scheme_of(defn, url)))
+ if ((scheme = has_scheme_of(defn->schemes, url)))
{
svn_ra_init_func_t compat_initfunc = defn->compat_initfunc;
Modified: subversion/branches/svn_mutex/subversion/libsvn_ra/ra_loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra/ra_loader.h?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra/ra_loader.h (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra/ra_loader.h Tue Oct 11 19:52:34 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/svn_mutex/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_local/ra_plugin.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_local/ra_plugin.c Tue Oct 11 19:52:34 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 ***/
@@ -238,6 +269,15 @@ static const svn_ra_reporter3_t ra_local
};
+/* ...
+ *
+ * Wrap a cancellation editor using SESSION's cancellation function around
+ * the supplied EDITOR. ### Some callers (via svn_ra_do_update2() etc.)
+ * don't appear to know that we do this, and are supplying an editor that
+ * they have already wrapped with the same cancellation editor, so it ends
+ * up double-wrapped.
+ *
+ * ... */
static svn_error_t *
make_reporter(svn_ra_session_t *session,
const svn_ra_reporter3_t **reporter,
@@ -256,7 +296,6 @@ make_reporter(svn_ra_session_t *session,
svn_ra_local__session_baton_t *sess = session->priv;
void *rbaton;
const char *other_fs_path = NULL;
- const char *repos_url_decoded;
/* Get the HEAD revision if one is not supplied. */
if (! SVN_IS_VALID_REVNUM(revision))
@@ -266,22 +305,19 @@ make_reporter(svn_ra_session_t *session,
regular filesystem path. */
if (other_url)
{
- size_t repos_url_len;
-
- other_url = svn_path_uri_decode(other_url, pool);
- repos_url_decoded = svn_path_uri_decode(sess->repos_url, pool);
- repos_url_len = strlen(repos_url_decoded);
+ const char *other_relpath
+ = svn_uri_skip_ancestor(sess->repos_url, other_url, pool);
/* Sanity check: the other_url better be in the same repository as
the original session url! */
- if (strncmp(other_url, repos_url_decoded, repos_url_len) != 0)
+ if (! other_relpath)
return svn_error_createf
(SVN_ERR_RA_ILLEGAL_URL, NULL,
_("'%s'\n"
"is not the same repository as\n"
"'%s'"), other_url, sess->repos_url);
- other_fs_path = other_url + repos_url_len;
+ other_fs_path = apr_pstrcat(pool, "/", other_relpath, (char *)NULL);
}
/* Pass back our reporter */
@@ -455,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)
@@ -700,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)
{
@@ -717,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,
@@ -855,14 +894,26 @@ struct log_baton
};
static svn_error_t *
-cancellation_log_receiver(void *baton,
- svn_log_entry_t *log_entry,
- apr_pool_t *pool)
+log_receiver_wrapper(void *baton,
+ svn_log_entry_t *log_entry,
+ apr_pool_t *pool)
{
struct log_baton *b = baton;
svn_ra_local__session_baton_t *sess = b->sess;
- SVN_ERR((sess->callbacks->cancel_func)(sess->callback_baton));
+ if (sess->callbacks->cancel_func)
+ SVN_ERR((sess->callbacks->cancel_func)(sess->callback_baton));
+
+ /* For consistency with the other RA layers, replace an empty
+ changed-paths hash with a NULL one.
+
+ ### Should this be done by svn_ra_get_log2() instead, then? */
+ if ((log_entry->changed_paths2)
+ && (apr_hash_count(log_entry->changed_paths2) == 0))
+ {
+ log_entry->changed_paths = NULL;
+ log_entry->changed_paths2 = NULL;
+ }
return b->real_cb(b->real_baton, log_entry, pool);
}
@@ -899,16 +950,11 @@ svn_ra_local__get_log(svn_ra_session_t *
}
}
- if (sess->callbacks &&
- sess->callbacks->cancel_func)
- {
- lb.real_cb = receiver;
- lb.real_baton = receiver_baton;
- lb.sess = sess;
-
- receiver = cancellation_log_receiver;
- receiver_baton = &lb;
- }
+ lb.real_cb = receiver;
+ lb.real_baton = receiver_baton;
+ lb.sess = sess;
+ receiver = log_receiver_wrapper;
+ receiver_baton = &lb;
return svn_repos_get_logs4(sess->repos,
abs_paths,
@@ -1422,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/svn_mutex/subversion/libsvn_ra_neon/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_neon/commit.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_neon/commit.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_neon/commit.c Tue Oct 11 19:52:34 2011
@@ -1620,5 +1620,9 @@ svn_error_t * svn_ra_neon__get_commit_ed
*editor = commit_editor;
*edit_baton = cc;
+
+ SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
+ NULL, NULL, NULL, NULL, pool, pool));
+
return SVN_NO_ERROR;
}
Modified: subversion/branches/svn_mutex/subversion/libsvn_ra_neon/fetch.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_neon/fetch.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_neon/fetch.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_neon/fetch.c Tue Oct 11 19:52:34 2011
@@ -249,27 +249,6 @@ static svn_error_t *simple_store_vsn_url
return NULL;
}
-static svn_error_t *get_delta_base(const char **delta_base,
- const char *relpath,
- svn_ra_get_wc_prop_func_t get_wc_prop,
- void *cb_baton,
- apr_pool_t *pool)
-{
- const svn_string_t *value;
-
- if (relpath == NULL || get_wc_prop == NULL)
- {
- *delta_base = NULL;
- return SVN_NO_ERROR;
- }
-
- SVN_ERR((*get_wc_prop)(cb_baton, relpath, SVN_RA_NEON__LP_VSN_URL,
- &value, pool));
-
- *delta_base = value ? value->data : NULL;
- return SVN_NO_ERROR;
-}
-
/* helper func which maps certain DAV: properties to svn:wc:
properties. Used during checkouts and updates. */
static svn_error_t *set_special_wc_prop(const char *key,
@@ -355,7 +334,7 @@ static svn_error_t *add_props(apr_hash_t
static svn_error_t *custom_get_request(svn_ra_neon__session_t *ras,
const char *url,
- const char *relpath,
+ const char *editor_relpath,
svn_ra_neon__block_reader reader,
void *subctx,
svn_ra_get_wc_prop_func_t get_wc_prop,
@@ -364,21 +343,26 @@ static svn_error_t *custom_get_request(s
apr_pool_t *pool)
{
custom_get_ctx_t cgc = { 0 };
- const char *delta_base;
+ const char *delta_base = NULL;
svn_ra_neon__request_t *request;
svn_error_t *err;
- if (use_base)
+ if (use_base && editor_relpath != NULL)
{
/* See if we can get a version URL for this resource. This will
refer to what we already have in the working copy, thus we
can get a diff against this particular resource. */
- SVN_ERR(get_delta_base(&delta_base, relpath,
- get_wc_prop, cb_baton, pool));
- }
- else
- {
- delta_base = NULL;
+
+ if (get_wc_prop != NULL)
+ {
+ const svn_string_t *value;
+
+ SVN_ERR(get_wc_prop(cb_baton, editor_relpath,
+ SVN_RA_NEON__LP_VSN_URL,
+ &value, pool));
+
+ delta_base = value ? value->data : NULL;
+ }
}
SVN_ERR(svn_ra_neon__request_create(&request, ras, "GET", url, pool));
@@ -544,7 +528,10 @@ static svn_error_t *simple_fetch_file(sv
TRUE, pool));
/* close the handler, since the file reading completed successfully. */
- return (*frc.handler)(NULL, frc.handler_baton);
+ if (frc.stream)
+ return svn_stream_close(frc.stream);
+ else
+ return (*frc.handler)(NULL, frc.handler_baton);
}
/* Helper for svn_ra_neon__get_file. This implements
@@ -2056,8 +2043,7 @@ end_element(void *userdata, int state,
rb->file_baton,
NULL, /* no base checksum in an add */
rb->editor,
- rb->ras->callbacks->get_wc_prop,
- rb->ras->callback_baton,
+ NULL, NULL, /* dav_prop callback */
rb->file_pool));
/* fetch node props as necessary. */
Modified: subversion/branches/svn_mutex/subversion/libsvn_ra_neon/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_neon/log.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_neon/log.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_neon/log.c Tue Oct 11 19:52:34 2011
@@ -529,5 +529,5 @@ svn_error_t * svn_ra_neon__get_log(svn_r
err = SVN_NO_ERROR;
}
- return err;
+ return svn_error_trace(err);
}
Modified: subversion/branches/svn_mutex/subversion/libsvn_ra_neon/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_neon/mergeinfo.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_neon/mergeinfo.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_neon/mergeinfo.c Tue Oct 11 19:52:34 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/svn_mutex/subversion/libsvn_ra_neon/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_neon/options.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_neon/options.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_neon/options.c Tue Oct 11 19:52:34 2011
@@ -34,6 +34,8 @@
#include "ra_neon.h"
+/* In a debug build, setting this environment variable to "yes" will force
+ the client to speak v1, even if the server is capable of speaking v2. */
#define SVN_IGNORE_V2_ENV_VAR "SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2"
static const svn_ra_neon__xml_elm_t options_elements[] =
@@ -134,9 +136,9 @@ static const char *capability_server_yes
information discovered from REQ's headers. Use POOL for temporary
allocation only.
- Also, set *YOUNGEST_REV to the current youngest revision if we can
- detect that from the OPTIONS exchange; set it to SVN_INVALID_REVNUM
- otherwise. */
+ Also, if YOUNGEST_REV is not NULL, set *YOUNGEST_REV to the current
+ youngest revision if we can detect that from the OPTIONS exchange, or
+ to SVN_INVALID_REVNUM otherwise. */
static void
parse_capabilities(ne_request *req,
svn_ra_neon__session_t *ras,
@@ -145,7 +147,8 @@ parse_capabilities(ne_request *req,
{
const char *val;
- *youngest_rev = SVN_INVALID_REVNUM;
+ if (youngest_rev)
+ *youngest_rev = SVN_INVALID_REVNUM;
/* Start out assuming all capabilities are unsupported. */
apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_PARTIAL_REPLAY,
@@ -195,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,
@@ -222,7 +220,8 @@ parse_capabilities(ne_request *req,
/* Not strictly capabilities, but while we're here, we might as well... */
if ((val = ne_get_response_header(req, SVN_DAV_YOUNGEST_REV_HEADER)))
{
- *youngest_rev = SVN_STR_TO_REV(val);
+ if (youngest_rev)
+ *youngest_rev = SVN_STR_TO_REV(val);
}
if ((val = ne_get_response_header(req, SVN_DAV_REPOS_UUID_HEADER)))
{
@@ -240,17 +239,13 @@ parse_capabilities(ne_request *req,
if ((val = ne_get_response_header(req, SVN_DAV_ME_RESOURCE_HEADER)))
{
#ifdef SVN_DEBUG
- /* ### This section is throw in here for development use. It
- ### allows devs the chance to force the client to speak v1,
- ### even if the server is capable of speaking v2. We should
- ### probably remove it before 1.7 goes final. */
char *ignore_v2_env_var = getenv(SVN_IGNORE_V2_ENV_VAR);
if (! (ignore_v2_env_var
&& apr_strnatcasecmp(ignore_v2_env_var, "yes") == 0))
ras->me_resource = apr_pstrdup(ras->pool, val);
#else
- ras->me_resource = apr_pstrdup(ras->pool, val);
+ ras->me_resource = apr_pstrdup(ras->pool, val);
#endif
}
if ((val = ne_get_response_header(req, SVN_DAV_REV_ROOT_STUB_HEADER)))
@@ -295,7 +290,8 @@ svn_ra_neon__exchange_capabilities(svn_r
oc.pool = pool;
oc.cdata = svn_stringbuf_create("", pool);
- *youngest_rev = SVN_INVALID_REVNUM;
+ if (youngest_rev)
+ *youngest_rev = SVN_INVALID_REVNUM;
if (relocation_location)
*relocation_location = NULL;
@@ -359,10 +355,8 @@ svn_ra_neon__get_activity_collection(con
svn_ra_neon__session_t *ras,
apr_pool_t *pool)
{
- svn_revnum_t ignored_revnum;
if (! ras->act_coll)
- SVN_ERR(svn_ra_neon__exchange_capabilities(ras, NULL,
- &ignored_revnum, pool));
+ SVN_ERR(svn_ra_neon__exchange_capabilities(ras, NULL, NULL, pool));
*activity_coll = svn_string_create(ras->act_coll, pool);
return SVN_NO_ERROR;
}
@@ -391,9 +385,7 @@ svn_ra_neon__has_capability(svn_ra_sessi
/* If any capability is unknown, they're all unknown, so ask. */
if (cap_result == NULL)
{
- svn_revnum_t ignored_revnum;
- SVN_ERR(svn_ra_neon__exchange_capabilities(ras, NULL,
- &ignored_revnum, pool));
+ SVN_ERR(svn_ra_neon__exchange_capabilities(ras, NULL, NULL, pool));
}
@@ -402,14 +394,11 @@ svn_ra_neon__has_capability(svn_ra_sessi
capability, APR_HASH_KEY_STRING);
/* Some capabilities depend on the repository as well as the server.
- NOTE: ../libsvn_ra_serf/serf.c:svn_ra_serf__has_capability()
- has a very similar code block. If you change something here,
- check there as well. */
+ NOTE: svn_ra_serf__has_capability() has a very similar code block. If
+ you change something here, check there as well. */
if (cap_result == capability_server_yes)
{
- if ((strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
- || (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
@@ -417,20 +406,17 @@ svn_ra_neon__has_capability(svn_ra_sessi
above didn't even know which repository we were interested in
-- it just told us whether the server supports mergeinfo.
If the answer was 'no', there's no point checking the
- particular repository; but if it was 'yes, we still must
+ particular repository; but if it was 'yes', we still must
change it to 'no' iff the repository itself doesn't
support mergeinfo. */
svn_mergeinfo_catalog_t ignored;
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)
{
@@ -454,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
{
Modified: subversion/branches/svn_mutex/subversion/libsvn_ra_neon/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_neon/props.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_neon/props.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_neon/props.c Tue Oct 11 19:52:34 2011
@@ -571,7 +571,7 @@ svn_error_t * svn_ra_neon__get_props_res
{
apr_hash_t *props;
char * url_path = apr_pstrdup(pool, url);
- int len = strlen(url);
+ size_t len = strlen(url);
/* Clean up any trailing slashes. */
if (len > 1 && url[len - 1] == '/')
url_path[len - 1] = '\0';
@@ -1011,9 +1011,13 @@ svn_error_t *svn_ra_neon__get_baseline_i
}
if (bc_relative_p)
{
- const char *relpath = svn_uri__is_child(sess->repos_root, url, pool);
+ const char *relpath = svn_uri_skip_ancestor(sess->repos_root, url,
+ pool);
if (! relpath)
- relpath = "";
+ return svn_error_createf(SVN_ERR_RA_REPOS_ROOT_URL_MISMATCH, NULL,
+ _("Url '%s' is not in repository '%s'"),
+ url, sess->repos_root);
+
*bc_relative_p = relpath;
}
if (latest_rev)
Modified: subversion/branches/svn_mutex/subversion/libsvn_ra_neon/ra_neon.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_neon/ra_neon.h?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_neon/ra_neon.h (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_neon/ra_neon.h Tue Oct 11 19:52:34 2011
@@ -302,15 +302,13 @@ svn_error_t *svn_ra_neon__get_dir(svn_ra
apr_uint32_t dirent_fields,
apr_pool_t *pool);
-svn_error_t * svn_ra_neon__get_mergeinfo(
- svn_ra_session_t *session,
- apr_hash_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_descendants,
- apr_pool_t *pool);
+svn_error_t * svn_ra_neon__get_mergeinfo(svn_ra_session_t *session,
+ apr_hash_t **mergeinfo,
+ 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 * svn_ra_neon__do_update(svn_ra_session_t *session,
const svn_ra_reporter3_t **reporter,
@@ -860,8 +858,7 @@ enum {
ELEM_has_children,
ELEM_merged_revision,
ELEM_deleted_rev_report,
- ELEM_validate_inherited_mergeinfo,
- ELEM_subtractive_merge,
+ ELEM_subtractive_merge
};
/* ### docco */
@@ -1125,7 +1122,8 @@ svn_ra_neon__has_capability(svn_ra_sessi
If the server is kind enough to tell us the current youngest
revision of the target repository, set *YOUNGEST_REV to that value;
- set it to SVN_INVALID_REVNUM otherwise.
+ set it to SVN_INVALID_REVNUM otherwise. YOUNGEST_REV may be NULL if
+ the caller is not interested in receiving this information.
NOTE: This function also expects the server to announce the
activity collection. */
Modified: subversion/branches/svn_mutex/subversion/libsvn_ra_neon/session.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_neon/session.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_neon/session.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_neon/session.c Tue Oct 11 19:52:34 2011
@@ -794,7 +794,6 @@ svn_ra_neon__open(svn_ra_session_t *sess
const char *pkcs11_provider;
const char *useragent = NULL;
const char *client_string = NULL;
- svn_revnum_t ignored_revnum;
SVN_ERR_ASSERT(svn_uri_is_canonical(repos_URL, pool));
@@ -1079,8 +1078,7 @@ svn_ra_neon__open(svn_ra_session_t *sess
session->priv = ras;
- return svn_ra_neon__exchange_capabilities(ras, corrected_url,
- &ignored_revnum, pool);
+ return svn_ra_neon__exchange_capabilities(ras, corrected_url, NULL, pool);
}
@@ -1147,19 +1145,13 @@ svn_ra_neon__get_path_relative_to_root(s
const char *root_url;
SVN_ERR(svn_ra_neon__get_repos_root(session, &root_url, pool));
- if (strcmp(root_url, url) == 0)
- {
- *rel_path = "";
- }
- else
- {
- *rel_path = svn_uri__is_child(root_url, url, pool);
- if (! *rel_path)
- return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,
- _("'%s' isn't a child of repository root "
- "URL '%s'"),
- url, root_url);
- }
+ *rel_path = svn_uri_skip_ancestor(root_url, url, pool);
+ if (! *rel_path)
+ return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,
+ _("'%s' isn't a child of repository root "
+ "URL '%s'"),
+ url, root_url);
+
return SVN_NO_ERROR;
}
Modified: subversion/branches/svn_mutex/subversion/libsvn_ra_neon/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_neon/util.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_neon/util.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_neon/util.c Tue Oct 11 19:52:34 2011
@@ -1589,8 +1589,9 @@ svn_ra_neon__uri_unparse(const ne_uri *u
/* Unparse uri. */
unparsed_uri = ne_uri_unparse(uri);
- /* Copy string to result pool. */
- result = apr_pstrdup(pool, unparsed_uri);
+ /* Copy string to result pool, and make sure it conforms to
+ Subversion rules */
+ result = svn_uri_canonicalize(unparsed_uri, pool);
/* Free neon's allocated copy. */
ne_free(unparsed_uri);
Modified: subversion/branches/svn_mutex/subversion/libsvn_ra_serf/blame.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_serf/blame.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_serf/blame.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_serf/blame.c Tue Oct 11 19:52:34 2011
@@ -159,8 +159,7 @@ create_propval(blame_info_t *info)
info->prop_attr_len + 1);
}
- /* Include the null term. */
- s = svn_string_ncreate(info->prop_attr, info->prop_attr_len + 1, info->pool);
+ s = svn_string_ncreate(info->prop_attr, info->prop_attr_len, info->pool);
if (info->prop_base64)
{
s = svn_base64_decode_string(s, info->pool);
Modified: subversion/branches/svn_mutex/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_serf/commit.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_serf/commit.c Tue Oct 11 19:52:34 2011
@@ -94,7 +94,7 @@ typedef struct commit_context_t {
typedef struct proppatch_context_t {
apr_pool_t *pool;
- const char *name;
+ const char *relpath;
const char *path;
commit_context_t *commit;
@@ -146,7 +146,10 @@ typedef struct dir_context_t {
/* Our parent */
struct dir_context_t *parent_dir;
- /* The directory name; if NULL, we're the 'root' */
+ /* The directory name; if "", we're the 'root' */
+ const char *relpath;
+
+ /* The basename of the directory. "" for the 'root' */
const char *name;
/* The base revision of the dir. */
@@ -178,6 +181,7 @@ typedef struct file_context_t {
dir_context_t *parent_dir;
+ const char *relpath;
const char *name;
/* The checked out context for this file. */
@@ -311,63 +315,24 @@ handle_checkout(serf_request_t *request,
return err;
}
-/* Return the relative path from DIR's topmost parent to DIR, in
- Subversion's internal path style, allocated in POOL. Use POOL for
- temporary work as well. */
-static const char *
-relative_dir_path(dir_context_t *dir, apr_pool_t *pool)
-{
- const char *rel_path = "";
- apr_array_header_t *components;
- dir_context_t *dir_ptr = dir;
- int i;
-
- components = apr_array_make(pool, 1, sizeof(const char *));
-
- for (dir_ptr = dir; dir_ptr; dir_ptr = dir_ptr->parent_dir)
- APR_ARRAY_PUSH(components, const char *) = dir_ptr->name;
-
- for (i = 0; i < components->nelts; i++)
- {
- rel_path = svn_relpath_join(rel_path,
- APR_ARRAY_IDX(components, i, const char *),
- pool);
- }
-
- return rel_path;
-}
-
-
-/* Return the relative path from FILE's topmost parent to FILE, in
- Subversion's internal path style, allocated in POOL. Use POOL for
- temporary work as well. */
-static const char *
-relative_file_path(file_context_t *f, apr_pool_t *pool)
-{
- const char *dir_path = relative_dir_path(f->parent_dir, pool);
- return svn_relpath_join(dir_path, f->name, pool);
-}
-
-
static svn_error_t *
checkout_dir(dir_context_t *dir)
{
checkout_context_t *checkout_ctx;
svn_ra_serf__handler_t *handler;
svn_error_t *err;
- dir_context_t *parent_dir = dir->parent_dir;
+ dir_context_t *p_dir = dir;
if (dir->checkout)
{
return SVN_NO_ERROR;
}
- /* Is one of our parent dirs newly added? If so, we're already
- * implicitly checked out.
- */
- while (parent_dir)
+ /* Is this directory or one of our parent dirs newly added?
+ * If so, we're already implicitly checked out. */
+ while (p_dir)
{
- if (parent_dir->added)
+ if (p_dir->added)
{
/* Implicitly checkout this dir now. */
dir->checkout = apr_pcalloc(dir->pool, sizeof(*dir->checkout));
@@ -376,12 +341,11 @@ checkout_dir(dir_context_t *dir)
dir->checkout->activity_url = dir->commit->activity_url;
dir->checkout->resource_url =
svn_path_url_add_component2(dir->parent_dir->checkout->resource_url,
- svn_relpath_basename(dir->name, NULL),
- dir->pool);
+ dir->name, dir->pool);
return SVN_NO_ERROR;
}
- parent_dir = parent_dir->parent_dir;
+ p_dir = p_dir->parent_dir;
}
/* Checkout our directory into the activity URL now. */
@@ -429,8 +393,7 @@ checkout_dir(dir_context_t *dir)
if (err->apr_err == SVN_ERR_FS_CONFLICT)
SVN_ERR_W(err, apr_psprintf(dir->pool,
_("Directory '%s' is out of date; try updating"),
- svn_dirent_local_style(relative_dir_path(dir, dir->pool),
- dir->pool)));
+ svn_dirent_local_style(dir->relpath, dir->pool)));
return err;
}
@@ -564,8 +527,8 @@ checkout_file(file_context_t *file)
file->checkout->activity_url = file->commit->activity_url;
file->checkout->resource_url =
svn_path_url_add_component2(parent_dir->checkout->resource_url,
- svn_relpath__is_child(parent_dir->name,
- file->name,
+ svn_relpath__is_child(parent_dir->relpath,
+ file->relpath,
file->pool),
file->pool);
return SVN_NO_ERROR;
@@ -586,7 +549,7 @@ checkout_file(file_context_t *file)
SVN_ERR(get_version_url(&(file->checkout->checkout_url),
file->commit->session, file->commit->conn,
- file->name, file->base_revision,
+ file->relpath, file->base_revision,
NULL, file->pool));
handler->body_delegate = create_checkout_body;
@@ -612,8 +575,7 @@ checkout_file(file_context_t *file)
if (err->apr_err == SVN_ERR_FS_CONFLICT)
SVN_ERR_W(err, apr_psprintf(file->pool,
_("File '%s' is out of date; try updating"),
- svn_dirent_local_style(relative_file_path(file, file->pool),
- file->pool)));
+ svn_dirent_local_style(file->relpath, file->pool)));
return err;
}
@@ -840,11 +802,11 @@ setup_proppatch_headers(serf_bucket_t *h
proppatch->base_revision));
}
- if (proppatch->name && proppatch->commit->lock_tokens)
+ if (proppatch->relpath && proppatch->commit->lock_tokens)
{
const char *token;
- token = apr_hash_get(proppatch->commit->lock_tokens, proppatch->name,
+ token = apr_hash_get(proppatch->commit->lock_tokens, proppatch->relpath,
APR_HASH_KEY_STRING);
if (token)
@@ -1062,7 +1024,7 @@ setup_put_headers(serf_bucket_t *headers
{
const char *token;
- token = apr_hash_get(ctx->commit->lock_tokens, ctx->name,
+ token = apr_hash_get(ctx->commit->lock_tokens, ctx->relpath,
APR_HASH_KEY_STRING);
if (token)
@@ -1119,9 +1081,8 @@ setup_copy_dir_headers(serf_bucket_t *he
else
{
uri.path = (char *)svn_path_url_add_component2(
- dir->parent_dir->checkout->resource_url,
- svn_relpath_basename(dir->name, pool),
- pool);
+ dir->parent_dir->checkout->resource_url,
+ dir->name, pool);
}
absolute_uri = apr_uri_unparse(pool, &uri, 0);
@@ -1399,6 +1360,7 @@ open_root(void *edit_baton,
dir->pool = dir_pool;
dir->commit = ctx;
dir->base_revision = base_revision;
+ dir->relpath = "";
dir->name = "";
dir->changed_props = apr_hash_make(dir->pool);
dir->removed_props = apr_hash_make(dir->pool);
@@ -1480,12 +1442,13 @@ open_root(void *edit_baton,
dir->pool = dir_pool;
dir->commit = ctx;
dir->base_revision = base_revision;
+ dir->relpath = "";
dir->name = "";
dir->changed_props = apr_hash_make(dir->pool);
dir->removed_props = apr_hash_make(dir->pool);
SVN_ERR(get_version_url(&dir->url, dir->commit->session,
- dir->commit->conn, dir->name,
+ dir->commit->conn, dir->relpath,
dir->base_revision, ctx->checked_in_url,
dir->pool));
ctx->checked_in_url = dir->url;
@@ -1564,7 +1527,7 @@ delete_entry(const char *path,
SVN_ERR(checkout_dir(dir));
delete_target = svn_path_url_add_component2(dir->checkout->resource_url,
svn_relpath_basename(path,
- pool),
+ NULL),
pool);
}
@@ -1659,7 +1622,8 @@ add_directory(const char *path,
dir->base_revision = SVN_INVALID_REVNUM;
dir->copy_revision = copyfrom_revision;
dir->copy_path = copyfrom_path;
- dir->name = apr_pstrdup(dir->pool, path);
+ dir->relpath = apr_pstrdup(dir->pool, path);
+ dir->name = svn_relpath_basename(dir->relpath, NULL);
dir->changed_props = apr_hash_make(dir->pool);
dir->removed_props = apr_hash_make(dir->pool);
@@ -1675,11 +1639,10 @@ add_directory(const char *path,
SVN_ERR(checkout_dir(parent));
dir->url = svn_path_url_add_component2(parent->commit->checked_in_url,
- path, dir->pool);
+ dir->name, dir->pool);
mkcol_target = svn_path_url_add_component2(
parent->checkout->resource_url,
- svn_relpath_basename(path, dir->pool),
- dir->pool);
+ dir->name, dir->pool);
}
handler = apr_pcalloc(dir->pool, sizeof(*handler));
@@ -1773,7 +1736,8 @@ open_directory(const char *path,
dir->added = FALSE;
dir->base_revision = base_revision;
- dir->name = apr_pstrdup(dir->pool, path);
+ dir->relpath = apr_pstrdup(dir->pool, path);
+ dir->name = svn_relpath_basename(dir->relpath, NULL);
dir->changed_props = apr_hash_make(dir->pool);
dir->removed_props = apr_hash_make(dir->pool);
@@ -1786,7 +1750,7 @@ open_directory(const char *path,
{
SVN_ERR(get_version_url(&dir->url,
dir->commit->session, dir->commit->conn,
- dir->name, dir->base_revision,
+ dir->relpath, dir->base_revision,
dir->commit->checked_in_url, dir->pool));
}
*child_baton = dir;
@@ -1864,7 +1828,7 @@ close_directory(void *dir_baton,
proppatch_ctx->pool = pool;
proppatch_ctx->progress.pool = pool;
proppatch_ctx->commit = dir->commit;
- proppatch_ctx->name = dir->name;
+ proppatch_ctx->relpath = dir->relpath;
proppatch_ctx->changed_props = dir->changed_props;
proppatch_ctx->removed_props = dir->removed_props;
proppatch_ctx->base_revision = dir->base_revision;
@@ -1903,7 +1867,8 @@ add_file(const char *path,
new_file->parent_dir = dir;
new_file->commit = dir->commit;
- new_file->name = apr_pstrdup(new_file->pool, path);
+ new_file->relpath = apr_pstrdup(new_file->pool, path);
+ new_file->name = svn_relpath_basename(new_file->relpath, NULL);
new_file->added = TRUE;
new_file->base_revision = SVN_INVALID_REVNUM;
new_file->copy_path = copy_path;
@@ -1926,8 +1891,7 @@ add_file(const char *path,
new_file->url =
svn_path_url_add_component2(dir->checkout->resource_url,
- svn_relpath_basename(path, new_file->pool),
- new_file->pool);
+ new_file->name, new_file->pool);
}
while (deleted_parent && deleted_parent[0] != '\0')
@@ -1993,7 +1957,8 @@ open_file(const char *path,
new_file->parent_dir = parent;
new_file->commit = parent->commit;
- new_file->name = apr_pstrdup(new_file->pool, path); /* TODO: basename? */
+ new_file->relpath = apr_pstrdup(new_file->pool, path);
+ new_file->name = svn_relpath_basename(new_file->relpath, NULL);
new_file->added = FALSE;
new_file->base_revision = base_revision;
new_file->changed_props = apr_hash_make(new_file->pool);
@@ -2214,7 +2179,7 @@ close_file(void *file_baton,
proppatch = apr_pcalloc(ctx->pool, sizeof(*proppatch));
proppatch->pool = ctx->pool;
proppatch->progress.pool = pool;
- proppatch->name = ctx->name;
+ proppatch->relpath = ctx->relpath;
proppatch->path = ctx->url;
proppatch->commit = ctx->commit;
proppatch->changed_props = ctx->changed_props;
@@ -2401,6 +2366,10 @@ svn_ra_serf__get_commit_editor(svn_ra_se
*ret_editor = editor;
*edit_baton = ctx;
+ SVN_ERR(svn_editor__insert_shims(ret_editor, edit_baton, *ret_editor,
+ *edit_baton, NULL, NULL, NULL, NULL,
+ pool, pool));
+
return SVN_NO_ERROR;
}
Modified: subversion/branches/svn_mutex/subversion/libsvn_ra_serf/getlocationsegments.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_serf/getlocationsegments.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_serf/getlocationsegments.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_serf/getlocationsegments.c Tue Oct 11 19:52:34 2011
@@ -184,7 +184,7 @@ svn_ra_serf__get_location_segments(svn_r
svn_ra_serf__handler_t *handler;
svn_ra_serf__xml_parser_t *parser_ctx;
const char *relative_url, *basecoll_url, *req_url;
- svn_error_t *err, *err2;
+ svn_error_t *err;
gls_ctx = apr_pcalloc(pool, sizeof(*gls_ctx));
gls_ctx->path = path;
@@ -233,20 +233,16 @@ svn_ra_serf__get_location_segments(svn_r
_("Location segment report failed on '%s'@'%ld'"),
path, peg_revision);
- err2 = svn_ra_serf__error_on_status(gls_ctx->status_code,
+ err = svn_error_compose_create(
+ svn_ra_serf__error_on_status(gls_ctx->status_code,
handler->path,
- parser_ctx->location);
- if (err2)
- {
- /* Prefer err2 to err. */
- svn_error_clear(err);
- return err2;
- }
+ parser_ctx->location),
+ err);;
svn_pool_destroy(gls_ctx->subpool);
if (err && (err->apr_err == SVN_ERR_UNSUPPORTED_FEATURE))
return svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, err, NULL);
- return err;
+ return svn_error_trace(err);
}
Modified: subversion/branches/svn_mutex/subversion/libsvn_ra_serf/locks.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_serf/locks.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_serf/locks.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_serf/locks.c Tue Oct 11 19:52:34 2011
@@ -385,14 +385,6 @@ handle_lock(serf_request_t *request,
return err;
}
- /* 405 == Method Not Allowed (Occurs when trying to lock a working
- copy path which no longer exists at HEAD in the repository. */
- if (sl.code == 405)
- return svn_error_createf(SVN_ERR_FS_OUT_OF_DATE,
- NULL,
- _("Lock request failed: %d %s"),
- ctx->status_code, ctx->reason);
-
headers = serf_bucket_response_get_headers(response);
val = serf_bucket_headers_get(headers, SVN_DAV_LOCK_OWNER_HEADER);
@@ -588,6 +580,8 @@ svn_ra_serf__lock(svn_ra_session_t *ra_s
subpool = svn_pool_create(pool);
+ /* ### TODO for issue 2263: Send all the locks over the wire at once. This
+ loop is just a temporary shim. */
for (hi = apr_hash_first(pool, path_revs); hi; hi = apr_hash_next(hi))
{
svn_ra_serf__handler_t *handler;
@@ -691,6 +685,8 @@ svn_ra_serf__unlock(svn_ra_session_t *ra
subpool = svn_pool_create(pool);
+ /* ### TODO for issue 2263: Send all the locks over the wire at once. This
+ loop is just a temporary shim. */
for (hi = apr_hash_first(pool, path_tokens); hi; hi = apr_hash_next(hi))
{
svn_ra_serf__handler_t *handler;
Modified: subversion/branches/svn_mutex/subversion/libsvn_ra_serf/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_serf/log.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_serf/log.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_serf/log.c Tue Oct 11 19:52:34 2011
@@ -121,11 +121,12 @@ push_state(svn_ra_serf__xml_parser_t *pa
if (state == ITEM)
{
log_info_t *info;
+ apr_pool_t *info_pool = svn_pool_create(parser->state->pool);
- info = apr_pcalloc(parser->state->pool, sizeof(*info));
- info->log_entry = svn_log_entry_create(parser->state->pool);
+ info = apr_pcalloc(info_pool, sizeof(*info));
+ info->pool = info_pool;
+ info->log_entry = svn_log_entry_create(info_pool);
- info->pool = parser->state->pool;
info->log_entry->revision = SVN_INVALID_REVNUM;
parser->state->private = info;
@@ -220,11 +221,14 @@ start_log(svn_ra_serf__xml_parser_t *par
}
else if (strcmp(name.name, "revprop") == 0)
{
+ const char *revprop_name;
info = push_state(parser, log_ctx, REVPROP);
- info->revprop_name = svn_xml_get_attr_value("name", attrs);
- if (info->revprop_name == NULL)
+ revprop_name = svn_xml_get_attr_value("name", attrs);
+ if (revprop_name == NULL)
return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
_("Missing name attr in revprop element"));
+
+ info->revprop_name = apr_pstrdup(info->pool, revprop_name);
}
else if (strcmp(name.name, "has-children") == 0)
{
@@ -342,6 +346,7 @@ end_log(svn_ra_serf__xml_parser_t *parse
log_ctx->nest_level--;
}
+ svn_pool_destroy(info->pool);
svn_ra_serf__xml_pop_state(parser);
}
else if (state == VERSION &&
@@ -459,7 +464,7 @@ cdata_log(svn_ra_serf__xml_parser_t *par
case DELETED_PATH:
case MODIFIED_PATH:
svn_ra_serf__expand_string(&info->tmp, &info->tmp_len,
- data, len, parser->state->pool);
+ data, len, info->pool);
break;
default:
break;
@@ -584,6 +589,7 @@ svn_ra_serf__get_log(svn_ra_session_t *r
svn_ra_serf__xml_parser_t *parser_ctx;
svn_boolean_t want_custom_revprops;
svn_revnum_t peg_rev;
+ svn_error_t *err;
const char *relative_url, *basecoll_url, *req_url;
log_ctx = apr_pcalloc(pool, sizeof(*log_ctx));
@@ -669,7 +675,13 @@ svn_ra_serf__get_log(svn_ra_session_t *r
svn_ra_serf__request_create(handler);
- SVN_ERR(svn_ra_serf__context_run_wait(&log_ctx->done, session, pool));
+ err = svn_ra_serf__context_run_wait(&log_ctx->done, session, pool);
+
+ SVN_ERR(svn_error_compose_create(
+ svn_ra_serf__error_on_status(log_ctx->status_code,
+ req_url,
+ parser_ctx->location),
+ err));
return SVN_NO_ERROR;
}
Modified: subversion/branches/svn_mutex/subversion/libsvn_ra_serf/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_serf/merge.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_serf/merge.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_serf/merge.c Tue Oct 11 19:52:34 2011
@@ -294,8 +294,7 @@ end_merge(svn_ra_serf__xml_parser_t *par
href = apr_hash_get(info->props, "href", APR_HASH_KEY_STRING);
if (! svn_urlpath__is_ancestor(ctx->merge_url, href))
{
- /* ### need something better than APR_EGENERAL */
- return svn_error_createf(APR_EGENERAL, NULL,
+ return svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
_("A MERGE response for '%s' is not "
"a child of the destination ('%s')"),
href, ctx->merge_url);
Modified: subversion/branches/svn_mutex/subversion/libsvn_ra_serf/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_serf/mergeinfo.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_serf/mergeinfo.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_serf/mergeinfo.c Tue Oct 11 19:52:34 2011
@@ -61,7 +61,6 @@ typedef struct mergeinfo_context_t {
const apr_array_header_t *paths;
svn_revnum_t revision;
svn_mergeinfo_inheritance_t inherit;
- svn_boolean_t validate_inherited_mergeinfo;
svn_boolean_t include_descendants;
} mergeinfo_context_t;
@@ -206,13 +205,6 @@ create_mergeinfo_body(serf_bucket_t **bk
"yes", alloc);
}
- if (mergeinfo_ctx->validate_inherited_mergeinfo)
- {
- svn_ra_serf__add_tag_buckets(body_bkt, "S:"
- SVN_DAV__VALIDATE_INHERITED,
- "yes", alloc);
- }
-
if (mergeinfo_ctx->paths)
{
int i;
@@ -242,7 +234,6 @@ svn_ra_serf__get_mergeinfo(svn_ra_sessio
const apr_array_header_t *paths,
svn_revnum_t revision,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool)
{
@@ -272,7 +263,6 @@ svn_ra_serf__get_mergeinfo(svn_ra_sessio
mergeinfo_ctx->paths = paths;
mergeinfo_ctx->revision = revision;
mergeinfo_ctx->inherit = inherit;
- mergeinfo_ctx->validate_inherited_mergeinfo = validate_inherited_mergeinfo;
mergeinfo_ctx->include_descendants = include_descendants;
handler = apr_pcalloc(pool, sizeof(*handler));
Modified: subversion/branches/svn_mutex/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_serf/options.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_serf/options.c Tue Oct 11 19:52:34 2011
@@ -39,6 +39,9 @@
#include "ra_serf.h"
+
+/* In a debug build, setting this environment variable to "yes" will force
+ the client to speak v1, even if the server is capable of speaking v2. */
#define SVN_IGNORE_V2_ENV_VAR "SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2"
@@ -296,22 +299,13 @@ capabilities_headers_iterator_callback(v
apr_hash_set(orc->session->capabilities, SVN_RA_CAPABILITY_DEPTH,
APR_HASH_KEY_STRING, capability_yes);
}
-
- /* For mergeinfo capabilities, the server doesn't know what repository
- we're referring to, so it can't just say capability_yes. */
if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_MERGEINFO, vals))
{
+ /* The server doesn't know what repository we're referring
+ to, so it can't just say capability_yes. */
apr_hash_set(orc->session->capabilities, SVN_RA_CAPABILITY_MERGEINFO,
APR_HASH_KEY_STRING, capability_server_yes);
}
- if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_MERGEINFO_VALIDATION,
- vals))
- {
- apr_hash_set(orc->session->capabilities,
- SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO,
- APR_HASH_KEY_STRING, capability_server_yes);
- }
-
if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_LOG_REVPROPS, vals))
{
apr_hash_set(orc->session->capabilities,
@@ -349,10 +343,6 @@ capabilities_headers_iterator_callback(v
else if (svn_cstring_casecmp(key, SVN_DAV_ME_RESOURCE_HEADER) == 0)
{
#ifdef SVN_DEBUG
- /* ### This section is throw in here for development use. It
- ### allows devs the chance to force the client to speak v1,
- ### even if the server is capable of speaking v2. We should
- ### probably remove it before 1.7 goes final. */
char *ignore_v2_env_var = getenv(SVN_IGNORE_V2_ENV_VAR);
if (!(ignore_v2_env_var
@@ -562,14 +552,11 @@ svn_ra_serf__has_capability(svn_ra_sessi
capability, APR_HASH_KEY_STRING);
/* Some capabilities depend on the repository as well as the server.
- NOTE: ../libsvn_ra_neon/session.c:svn_ra_neon__has_capability()
- has a very similar code block. If you change something here,
- check there as well. */
+ NOTE: svn_ra_neon__has_capability() has a very similar code block. If
+ you change something here, check there as well. */
if (cap_result == capability_server_yes)
{
- if ((strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
- || (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
@@ -577,20 +564,17 @@ svn_ra_serf__has_capability(svn_ra_sessi
didn't even know which repository we were interested in
-- it just told us whether the server supports mergeinfo.
If the answer was 'no', there's no point checking the
- particular repository; but if it was 'yes, we still must
+ particular repository; but if it was 'yes', we still must
change it to 'no' iff the repository itself doesn't
support mergeinfo. */
svn_mergeinfo_catalog_t ignored;
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_serf__get_mergeinfo(ra_session, &ignored, paths, 0,
- FALSE,
- validate_inherited_mergeinfo,
- FALSE, pool);
+ FALSE, FALSE, pool);
if (err)
{
@@ -613,14 +597,9 @@ svn_ra_serf__has_capability(svn_ra_sessi
else
cap_result = capability_yes;
- if (strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
- apr_hash_set(serf_sess->capabilities,
- SVN_RA_CAPABILITY_MERGEINFO, APR_HASH_KEY_STRING,
- cap_result);
- else
- apr_hash_set(serf_sess->capabilities,
- SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO,
- APR_HASH_KEY_STRING, cap_result);
+ apr_hash_set(serf_sess->capabilities,
+ SVN_RA_CAPABILITY_MERGEINFO, APR_HASH_KEY_STRING,
+ cap_result);
}
else
{
Modified: subversion/branches/svn_mutex/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_serf/ra_serf.h?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_serf/ra_serf.h Tue Oct 11 19:52:34 2011
@@ -74,7 +74,7 @@ typedef struct svn_ra_serf__connection_t
serf_bucket_alloc_t *bkt_alloc;
/* Host name */
- const char *hostinfo;
+ const char *hostname;
/* Are we using ssl */
svn_boolean_t using_ssl;
@@ -139,9 +139,13 @@ struct svn_ra_serf__session_t {
const svn_ra_callbacks2_t *wc_callbacks;
void *wc_callback_baton;
- /* Callback function to send info to WC */
- svn_ra_progress_notify_func_t wc_progress_func;
- void *wc_progress_baton;
+ /* Callback function to send progress info to the client */
+ svn_ra_progress_notify_func_t progress_func;
+ void *progress_baton;
+
+ /* Callback function to handle cancellation */
+ svn_cancel_func_t cancel_func;
+ void *cancel_baton;
/* Error that we've received but not yet returned upstream. */
svn_error_t *pending_error;
@@ -175,6 +179,9 @@ struct svn_ra_serf__session_t {
/* Connection timeout value */
long timeout;
+ /* HTTPv1 flags */
+ svn_tristate_t supports_deadprop_count;
+
/*** HTTP v2 protocol stuff. ***
*
* We assume that if mod_dav_svn sends one of the special v2 OPTIONs
@@ -535,6 +542,10 @@ struct svn_ra_serf__xml_parser_t {
/* Temporary allocations should be made in this pool. */
apr_pool_t *pool;
+ /* What kind of response are we parsing? If set, this should typically
+ define the report name. */
+ const char *response_type;
+
/* Caller-specific data passed to the start, end, cdata callbacks. */
void *user_data;
@@ -618,6 +629,11 @@ struct svn_ra_serf__xml_parser_t {
See libsvn_ra_serf/util.c */
struct svn_ra_serf__pending_t *pending;
+
+ /* Response restart support */
+ const void *headers_baton; /* Last pointer to headers */
+ apr_off_t skip_size; /* Number of bytes to skip */
+ apr_off_t read_size; /* Number of bytes read from response */
};
/*
@@ -1370,15 +1386,13 @@ svn_ra_serf__get_locks(svn_ra_session_t
svn_depth_t depth,
apr_pool_t *pool);
-svn_error_t * svn_ra_serf__get_mergeinfo(
- svn_ra_session_t *ra_session,
- apr_hash_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_descendants,
- apr_pool_t *pool);
+svn_error_t * svn_ra_serf__get_mergeinfo(svn_ra_session_t *ra_session,
+ apr_hash_t **mergeinfo,
+ const apr_array_header_t *paths,
+ svn_revnum_t revision,
+ svn_mergeinfo_inheritance_t inherit,
+ svn_boolean_t include_descendants,
+ apr_pool_t *pool);
/* Exchange capabilities with the server, by sending an OPTIONS
* request announcing the client's capabilities, and by filling
Modified: subversion/branches/svn_mutex/subversion/libsvn_ra_serf/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn_mutex/subversion/libsvn_ra_serf/replay.c?rev=1182053&r1=1182052&r2=1182053&view=diff
==============================================================================
--- subversion/branches/svn_mutex/subversion/libsvn_ra_serf/replay.c (original)
+++ subversion/branches/svn_mutex/subversion/libsvn_ra_serf/replay.c Tue Oct 11 19:52:34 2011
@@ -194,6 +194,7 @@ start_replay(svn_ra_serf__xml_parser_t *
/* Create a pool for the commit editor. */
ctx->dst_rev_pool = svn_pool_create(ctx->src_rev_pool);
+ ctx->file_pool = svn_pool_create(ctx->dst_rev_pool);
/* ### it would be nice to have a proper scratch_pool. */
SVN_ERR(svn_ra_serf__select_revprops(&ctx->props,
@@ -650,7 +651,6 @@ svn_ra_serf__replay(svn_ra_session_t *ra
replay_ctx = apr_pcalloc(pool, sizeof(*replay_ctx));
replay_ctx->src_rev_pool = pool;
- replay_ctx->file_pool = svn_pool_create(pool);
replay_ctx->editor = editor;
replay_ctx->editor_baton = edit_baton;
replay_ctx->done = FALSE;
@@ -756,6 +756,9 @@ svn_ra_serf__replay_range(svn_ra_session
to store the response status code. */
int status_code;
+ if (session->cancel_func)
+ SVN_ERR(session->cancel_func(session->cancel_baton));
+
/* Send pending requests, if any. Limit the number of outstanding
requests to MAX_OUTSTANDING_REQUESTS. */
if (rev <= end_revision && active_reports < MAX_OUTSTANDING_REQUESTS)
@@ -766,7 +769,6 @@ svn_ra_serf__replay_range(svn_ra_session
replay_ctx = apr_pcalloc(ctx_pool, sizeof(*replay_ctx));
replay_ctx->src_rev_pool = ctx_pool;
- replay_ctx->file_pool = svn_pool_create(pool);
replay_ctx->revstart_func = revstart_func;
replay_ctx->revfinish_func = revfinish_func;
replay_ctx->replay_baton = replay_baton;