[prev in list] [next in list] [prev in thread] [next in thread]
List: subversion-commits
Subject: svn commit: r1177691 [4/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.8AC0E2388B9B () eris ! apache ! org
[Download RAW message or body]
Modified: subversion/branches/fs-py/subversion/libsvn_ra_neon/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_ra_neon/props.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_ra_neon/props.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_ra_neon/props.c Fri Sep 30 15:02:43 \
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';
Modified: subversion/branches/fs-py/subversion/libsvn_ra_neon/ra_neon.h
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_ra_neon/ra_neon.h?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_ra_neon/ra_neon.h (original)
+++ subversion/branches/fs-py/subversion/libsvn_ra_neon/ra_neon.h Fri Sep 30 15:02:43 \
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 */
Modified: subversion/branches/fs-py/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_ra_serf/commit.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_ra_serf/commit.c Fri Sep 30 15:02:43 \
2011 @@ -2367,7 +2367,8 @@ svn_ra_serf__get_commit_editor(svn_ra_se
*edit_baton = ctx;
SVN_ERR(svn_editor__insert_shims(ret_editor, edit_baton, *ret_editor,
- *edit_baton, pool, pool));
+ *edit_baton, NULL, NULL, NULL, NULL,
+ pool, pool));
return SVN_NO_ERROR;
}
Modified: subversion/branches/fs-py/subversion/libsvn_ra_serf/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_ra_serf/mergeinfo.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_ra_serf/mergeinfo.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_ra_serf/mergeinfo.c Fri Sep 30 \
15:02:43 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/fs-py/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_ra_serf/options.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_ra_serf/options.c Fri Sep 30 15:02:43 \
2011 @@ -299,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,
@@ -565,9 +556,7 @@ svn_ra_serf__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
@@ -580,15 +569,12 @@ svn_ra_serf__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_serf__get_mergeinfo(ra_session, &ignored, paths, 0,
- FALSE,
- validate_inherited_mergeinfo,
- FALSE, pool);
+ FALSE, FALSE, pool);
if (err)
{
@@ -611,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/fs-py/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_ra_serf/ra_serf.h?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/fs-py/subversion/libsvn_ra_serf/ra_serf.h Fri Sep 30 15:02:43 \
2011 @@ -1386,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/fs-py/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_ra_svn/client.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_ra_svn/client.c Fri Sep 30 15:02:43 \
2011 @@ -1179,15 +1179,13 @@ optbool_to_tristate(apr_uint64_t v)
/* If REVISION is SVN_INVALID_REVNUM, no value is sent to the
server, which defaults to youngest. */
-static svn_error_t *ra_svn_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 validate_inherited_mergeinfo,
- svn_boolean_t include_descendants,
- apr_pool_t *pool)
+static svn_error_t *ra_svn_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_ra_svn__session_baton_t *sess_baton = session->priv;
svn_ra_svn_conn_t *conn = sess_baton->conn;
@@ -1202,10 +1200,9 @@ static svn_error_t *ra_svn_get_mergeinfo
path = APR_ARRAY_IDX(paths, i, const char *);
SVN_ERR(svn_ra_svn_write_cstring(conn, pool, path));
}
- SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!)(?r)wbb)", revision,
+ SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!)(?r)wb)", revision,
svn_inheritance_to_word(inherit),
- include_descendants,
- validate_inherited_mergeinfo));
+ include_descendants));
SVN_ERR(handle_auth_request(sess_baton, pool));
SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, "l", &mergeinfo_tuple));
@@ -2459,10 +2456,6 @@ static svn_error_t *ra_svn_has_capabilit
*has = svn_ra_svn_has_capability(sess->conn, SVN_RA_SVN_CAP_DEPTH);
else if (strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
*has = svn_ra_svn_has_capability(sess->conn, SVN_RA_SVN_CAP_MERGEINFO);
- else if (strcmp(capability,
- SVN_RA_SVN_CAP_VALIDATE_INHERITED_MERGEINFO) == 0)
- *has = svn_ra_svn_has_capability(
- sess->conn, SVN_RA_SVN_CAP_VALIDATE_INHERITED_MERGEINFO);
else if (strcmp(capability, SVN_RA_CAPABILITY_LOG_REVPROPS) == 0)
*has = svn_ra_svn_has_capability(sess->conn, SVN_RA_SVN_CAP_LOG_REVPROPS);
else if (strcmp(capability, SVN_RA_CAPABILITY_PARTIAL_REPLAY) == 0)
Modified: subversion/branches/fs-py/subversion/libsvn_ra_svn/editorp.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_ra_svn/editorp.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_ra_svn/editorp.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_ra_svn/editorp.c Fri Sep 30 15:02:43 \
2011 @@ -437,7 +437,8 @@ void svn_ra_svn_get_editor(const svn_del
*edit_baton = eb;
svn_error_clear(svn_editor__insert_shims(editor, edit_baton, *editor,
- *edit_baton, pool, pool));
+ *edit_baton, NULL, NULL,
+ NULL, NULL, pool, pool));
}
/* --- DRIVING AN EDITOR --- */
Modified: subversion/branches/fs-py/subversion/libsvn_ra_svn/protocol
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_ra_svn/protocol?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_ra_svn/protocol (original)
+++ subversion/branches/fs-py/subversion/libsvn_ra_svn/protocol Fri Sep 30 15:02:43 \
2011 @@ -202,11 +202,6 @@ capability and C indicates a client capa
[S] atomic-revprops If the server presents this capability, it
supports the change-rev-prop2 command.
See section 3.1.1.
-[S] validate-inherited-mergeinfo If the server presents this capability, it
- understands the optional
- validate-inherited-mergeinfo parameter in
- the get-mergeinfo command. See section
- 3.1.1.
3. Commands
-----------
@@ -330,8 +325,7 @@ second place for auth-request point as n
get-mergeinfo
params: ( ( path:string ... ) [ rev:number ] inherit:word
- descendents:bool
- ? validate-inherited-mergeinfo:bool)
+ descendents:bool)
response: ( ( ( path:string merge-info:string ) ... ) )
New in svn 1.5. If no paths are specified, an empty response is
returned. If rev is not specified, the youngest revision is used.
Modified: subversion/branches/fs-py/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_repos/commit.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_repos/commit.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_repos/commit.c Fri Sep 30 15:02:43 \
2011 @@ -854,7 +854,7 @@ svn_repos_get_commit_editor5(const svn_d
*editor = e;
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_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_repos/dump.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_repos/dump.c Fri Sep 30 15:02:43 2011
@@ -897,7 +897,7 @@ get_dump_editor(const svn_delta_editor_t
*editor = dump_editor;
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_repos/fs-wrap.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_repos/fs-wrap.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_repos/fs-wrap.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_repos/fs-wrap.c Fri Sep 30 15:02:43 \
2011 @@ -633,16 +633,15 @@ svn_repos_fs_get_locks2(apr_hash_t **loc
svn_error_t *
-svn_repos_fs_get_mergeinfo2(svn_mergeinfo_catalog_t *mergeinfo,
- svn_repos_t *repos,
- const apr_array_header_t *paths,
- svn_revnum_t rev,
- svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t validate_inherited_mergeinfo,
- svn_boolean_t include_descendants,
- svn_repos_authz_func_t authz_read_func,
- void *authz_read_baton,
- apr_pool_t *pool)
+svn_repos_fs_get_mergeinfo(svn_mergeinfo_catalog_t *mergeinfo,
+ svn_repos_t *repos,
+ const apr_array_header_t *paths,
+ svn_revnum_t rev,
+ svn_mergeinfo_inheritance_t inherit,
+ svn_boolean_t include_descendants,
+ svn_repos_authz_func_t authz_read_func,
+ void *authz_read_baton,
+ apr_pool_t *pool)
{
/* Here we cast away 'const', but won't try to write through this pointer
* without first allocating a new array. */
@@ -690,9 +689,8 @@ svn_repos_fs_get_mergeinfo2(svn_mergeinf
the change itself. */
/* ### TODO(reint): ... but how about descendant merged-to paths? */
if (readable_paths->nelts > 0)
- SVN_ERR(svn_fs_get_mergeinfo2(mergeinfo, root, readable_paths, inherit,
- validate_inherited_mergeinfo,
- include_descendants, pool));
+ SVN_ERR(svn_fs_get_mergeinfo(mergeinfo, root, readable_paths, inherit,
+ include_descendants, pool));
else
*mergeinfo = apr_hash_make(pool);
@@ -700,26 +698,6 @@ svn_repos_fs_get_mergeinfo2(svn_mergeinf
return SVN_NO_ERROR;
}
-svn_error_t *
-svn_repos_fs_get_mergeinfo(svn_mergeinfo_catalog_t *mergeinfo,
- svn_repos_t *repos,
- const apr_array_header_t *paths,
- svn_revnum_t rev,
- svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t include_descendants,
- svn_repos_authz_func_t authz_read_func,
- void *authz_read_baton,
- apr_pool_t *pool)
-{
- return svn_error_trace(svn_repos_fs_get_mergeinfo2(mergeinfo, repos,
- paths, rev, inherit,
- FALSE,
- include_descendants,
- authz_read_func,
- authz_read_baton,
- pool));
-}
-
struct pack_notify_baton
{
svn_repos_notify_func_t notify_func;
Modified: subversion/branches/fs-py/subversion/libsvn_repos/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_repos/log.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_repos/log.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_repos/log.c Fri Sep 30 15:02:43 2011
@@ -663,9 +663,9 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
svn_mergeinfo_catalog_t tmp_catalog;
APR_ARRAY_PUSH(query_paths, const char *) = changed_path;
- SVN_ERR(svn_fs_get_mergeinfo2(&tmp_catalog, root,
- query_paths, svn_mergeinfo_inherited,
- FALSE, FALSE, iterpool));
+ SVN_ERR(svn_fs_get_mergeinfo(&tmp_catalog, root,
+ query_paths, svn_mergeinfo_inherited,
+ FALSE, iterpool));
tmp_mergeinfo = apr_hash_get(tmp_catalog, changed_path,
APR_HASH_KEY_STRING);
if (tmp_mergeinfo)
@@ -682,9 +682,9 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
svn_mergeinfo_catalog_t tmp_catalog;
APR_ARRAY_PUSH(query_paths, const char *) = base_path;
- SVN_ERR(svn_fs_get_mergeinfo2(&tmp_catalog, base_root,
- query_paths, svn_mergeinfo_inherited,
- FALSE, FALSE, iterpool));
+ SVN_ERR(svn_fs_get_mergeinfo(&tmp_catalog, base_root,
+ query_paths, svn_mergeinfo_inherited,
+ FALSE, iterpool));
tmp_mergeinfo = apr_hash_get(tmp_catalog, base_path,
APR_HASH_KEY_STRING);
if (tmp_mergeinfo)
@@ -835,9 +835,8 @@ get_combined_mergeinfo_changes(svn_merge
SVN_ERR(svn_fs_revision_root(&prev_root, fs, prev_rev, iterpool));
query_paths = apr_array_make(iterpool, 1, sizeof(const char *));
APR_ARRAY_PUSH(query_paths, const char *) = prev_path;
- err = svn_fs_get_mergeinfo2(&catalog, prev_root, query_paths,
- svn_mergeinfo_inherited, FALSE, FALSE,
- iterpool);
+ err = svn_fs_get_mergeinfo(&catalog, prev_root, query_paths,
+ svn_mergeinfo_inherited, FALSE, iterpool);
if (err && (err->apr_err == SVN_ERR_FS_NOT_FOUND ||
err->apr_err == SVN_ERR_FS_NOT_DIRECTORY ||
err->apr_err == SVN_ERR_MERGEINFO_PARSE_ERROR))
@@ -852,9 +851,8 @@ get_combined_mergeinfo_changes(svn_merge
/* Fetch the current mergeinfo (as of REV, and including
inherited stuff) for this path. */
APR_ARRAY_IDX(query_paths, 0, const char *) = path;
- SVN_ERR(svn_fs_get_mergeinfo2(&catalog, root, query_paths,
- svn_mergeinfo_inherited, FALSE, FALSE,
- iterpool));
+ SVN_ERR(svn_fs_get_mergeinfo(&catalog, root, query_paths,
+ svn_mergeinfo_inherited, FALSE, iterpool));
mergeinfo = apr_hash_get(catalog, path, APR_HASH_KEY_STRING);
if (!prev_mergeinfo && !mergeinfo)
@@ -863,14 +861,13 @@ get_combined_mergeinfo_changes(svn_merge
/* Compare, constrast, and combine the results. */
SVN_ERR(svn_mergeinfo_diff(&deleted, &added, prev_mergeinfo,
mergeinfo, FALSE, iterpool));
- SVN_ERR(svn_mergeinfo_merge(*deleted_mergeinfo,
- svn_mergeinfo_dup(deleted, result_pool),
- result_pool));
- SVN_ERR(svn_mergeinfo_merge(*added_mergeinfo,
- svn_mergeinfo_dup(added, result_pool),
- result_pool));
+ SVN_ERR(svn_mergeinfo_merge2(*deleted_mergeinfo,
+ svn_mergeinfo_dup(deleted, result_pool),
+ result_pool, iterpool));
+ SVN_ERR(svn_mergeinfo_merge2(*added_mergeinfo,
+ svn_mergeinfo_dup(added, result_pool),
+ result_pool, iterpool));
}
- svn_pool_destroy(iterpool);
/* Merge all the mergeinfos which are, or are children of, one of
our paths of interest into one giant delta mergeinfo. */
@@ -893,18 +890,20 @@ get_combined_mergeinfo_changes(svn_merge
const char *path = APR_ARRAY_IDX(paths, i, const char *);
if (! svn_dirent_is_ancestor(path, changed_path))
continue;
+ svn_pool_clear(iterpool);
deleted = apr_hash_get(deleted_mergeinfo_catalog, key, klen);
- SVN_ERR(svn_mergeinfo_merge(*deleted_mergeinfo,
- svn_mergeinfo_dup(deleted, result_pool),
- result_pool));
- SVN_ERR(svn_mergeinfo_merge(*added_mergeinfo,
- svn_mergeinfo_dup(added, result_pool),
- result_pool));
+ SVN_ERR(svn_mergeinfo_merge2(*deleted_mergeinfo,
+ svn_mergeinfo_dup(deleted, result_pool),
+ result_pool, iterpool));
+ SVN_ERR(svn_mergeinfo_merge2(*added_mergeinfo,
+ svn_mergeinfo_dup(added, result_pool),
+ result_pool, iterpool));
break;
}
}
+ svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}
@@ -1741,8 +1740,8 @@ store_search(svn_mergeinfo_t processed,
apr_hash_set(mergeinfo, apr_pstrdup(processed_pool, path),
APR_HASH_KEY_STRING, ranges);
}
- SVN_ERR(svn_mergeinfo_merge(processed, mergeinfo,
- apr_hash_pool_get(processed)));
+ SVN_ERR(svn_mergeinfo_merge2(processed, mergeinfo,
+ apr_hash_pool_get(processed), scratch_pool));
return SVN_NO_ERROR;
}
@@ -2113,10 +2112,10 @@ get_paths_history_as_mergeinfo(svn_merge
SVN_ERR(svn_mergeinfo__mergeinfo_from_segments(
&path_history_mergeinfo, loc_seg_baton.history_segments, iterpool));
- SVN_ERR(svn_mergeinfo_merge(*paths_history_mergeinfo,
- svn_mergeinfo_dup(path_history_mergeinfo,
- result_pool),
- result_pool));
+ SVN_ERR(svn_mergeinfo_merge2(*paths_history_mergeinfo,
+ svn_mergeinfo_dup(path_history_mergeinfo,
+ result_pool),
+ result_pool, iterpool));
}
svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
Modified: subversion/branches/fs-py/subversion/libsvn_repos/reporter.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_repos/reporter.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_repos/reporter.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_repos/reporter.c Fri Sep 30 15:02:43 \
2011 @@ -32,17 +32,19 @@
#include "svn_props.h"
#include "repos.h"
#include "svn_private_config.h"
+
#include "private/svn_dep_compat.h"
#include "private/svn_fspath.h"
+#include "private/svn_subr_private.h"
#define NUM_CACHED_SOURCE_ROOTS 4
-/* Theory of operation: we write report operations out to a temporary
- file as we receive them. When the report is finished, we read the
+/* Theory of operation: we write report operations out to a spill-buffer
+ as we receive them. When the report is finished, we read the
operations back out again, using them to guide the progression of
the delta between the source and target revs.
- Temporary file format: we use a simple ad-hoc format to store the
+ Spill-buffer content format: we use a simple ad-hoc format to store the
report operations. Each report operation is the concatention of
the following ("+/-" indicates the single character '+' or '-';
<length> and <revnum> are written out as decimal strings):
@@ -122,8 +124,8 @@ typedef struct report_baton_t
svn_repos_authz_func_t authz_read_func;
void *authz_read_baton;
- /* The temporary file in which we are stashing the report. */
- apr_file_t *tempfile;
+ /* The spill-buffer holding the report. */
+ svn_spillbuf_reader_t *reader;
/* For the actual editor drive, we'll need a lookahead path info
entry, a cache of FS roots, and a pool to store them. */
@@ -158,14 +160,14 @@ static svn_error_t *delta_dirs(report_ba
/* --- READING PREVIOUSLY STORED REPORT INFORMATION --- */
static svn_error_t *
-read_number(apr_uint64_t *num, apr_file_t *temp, apr_pool_t *pool)
+read_number(apr_uint64_t *num, svn_spillbuf_reader_t *reader, apr_pool_t *pool)
{
char c;
*num = 0;
while (1)
{
- SVN_ERR(svn_io_file_getc(&c, temp, pool));
+ SVN_ERR(svn_spillbuf__reader_getc(&c, reader, pool));
if (c == ':')
break;
*num = *num * 10 + (c - '0');
@@ -174,13 +176,14 @@ read_number(apr_uint64_t *num, apr_file_
}
static svn_error_t *
-read_string(const char **str, apr_file_t *temp, apr_pool_t *pool)
+read_string(const char **str, svn_spillbuf_reader_t *reader, apr_pool_t *pool)
{
apr_uint64_t len;
apr_size_t size;
+ apr_size_t amt;
char *buf;
- SVN_ERR(read_number(&len, temp, pool));
+ SVN_ERR(read_number(&len, reader, pool));
/* Len can never be less than zero. But could len be so large that
len + 1 wraps around and we end up passing 0 to apr_palloc(),
@@ -201,22 +204,26 @@ read_string(const char **str, apr_file_t
size = (apr_size_t)len;
buf = apr_palloc(pool, size+1);
- SVN_ERR(svn_io_file_read_full2(temp, buf, size, NULL, NULL, pool));
+ if (size > 0)
+ {
+ SVN_ERR(svn_spillbuf__reader_read(&amt, reader, buf, size, pool));
+ SVN_ERR_ASSERT(amt == size);
+ }
buf[len] = 0;
*str = buf;
return SVN_NO_ERROR;
}
static svn_error_t *
-read_rev(svn_revnum_t *rev, apr_file_t *temp, apr_pool_t *pool)
+read_rev(svn_revnum_t *rev, svn_spillbuf_reader_t *reader, apr_pool_t *pool)
{
char c;
apr_uint64_t num;
- SVN_ERR(svn_io_file_getc(&c, temp, pool));
+ SVN_ERR(svn_spillbuf__reader_getc(&c, reader, pool));
if (c == '+')
{
- SVN_ERR(read_number(&num, temp, pool));
+ SVN_ERR(read_number(&num, reader, pool));
*rev = (svn_revnum_t) num;
}
else
@@ -225,15 +232,15 @@ read_rev(svn_revnum_t *rev, apr_file_t *
}
/* Read a single character to set *DEPTH (having already read '+')
- from TEMP. PATH is the path to which the depth applies, and is
+ from READER. PATH is the path to which the depth applies, and is
used for error reporting only. */
static svn_error_t *
-read_depth(svn_depth_t *depth, apr_file_t *temp, const char *path,
+read_depth(svn_depth_t *depth, svn_spillbuf_reader_t *reader, const char *path,
apr_pool_t *pool)
{
char c;
- SVN_ERR(svn_io_file_getc(&c, temp, pool));
+ SVN_ERR(svn_spillbuf__reader_getc(&c, reader, pool));
switch (c)
{
case 'X':
@@ -260,14 +267,16 @@ read_depth(svn_depth_t *depth, apr_file_
return SVN_NO_ERROR;
}
-/* Read a report operation *PI out of TEMP. Set *PI to NULL if we
+/* Read a report operation *PI out of READER. Set *PI to NULL if we
have reached the end of the report. */
static svn_error_t *
-read_path_info(path_info_t **pi, apr_file_t *temp, apr_pool_t *pool)
+read_path_info(path_info_t **pi,
+ svn_spillbuf_reader_t *reader,
+ apr_pool_t *pool)
{
char c;
- SVN_ERR(svn_io_file_getc(&c, temp, pool));
+ SVN_ERR(svn_spillbuf__reader_getc(&c, reader, pool));
if (c == '-')
{
*pi = NULL;
@@ -275,23 +284,23 @@ read_path_info(path_info_t **pi, apr_fil
}
*pi = apr_palloc(pool, sizeof(**pi));
- SVN_ERR(read_string(&(*pi)->path, temp, pool));
- SVN_ERR(svn_io_file_getc(&c, temp, pool));
+ SVN_ERR(read_string(&(*pi)->path, reader, pool));
+ SVN_ERR(svn_spillbuf__reader_getc(&c, reader, pool));
if (c == '+')
- SVN_ERR(read_string(&(*pi)->link_path, temp, pool));
+ SVN_ERR(read_string(&(*pi)->link_path, reader, pool));
else
(*pi)->link_path = NULL;
- SVN_ERR(read_rev(&(*pi)->rev, temp, pool));
- SVN_ERR(svn_io_file_getc(&c, temp, pool));
+ SVN_ERR(read_rev(&(*pi)->rev, reader, pool));
+ SVN_ERR(svn_spillbuf__reader_getc(&c, reader, pool));
if (c == '+')
- SVN_ERR(read_depth(&((*pi)->depth), temp, (*pi)->path, pool));
+ SVN_ERR(read_depth(&((*pi)->depth), reader, (*pi)->path, pool));
else
(*pi)->depth = svn_depth_infinity;
- SVN_ERR(svn_io_file_getc(&c, temp, pool));
+ SVN_ERR(svn_spillbuf__reader_getc(&c, reader, pool));
(*pi)->start_empty = (c == '+');
- SVN_ERR(svn_io_file_getc(&c, temp, pool));
+ SVN_ERR(svn_spillbuf__reader_getc(&c, reader, pool));
if (c == '+')
- SVN_ERR(read_string(&(*pi)->lock_token, temp, pool));
+ SVN_ERR(read_string(&(*pi)->lock_token, reader, pool));
else
(*pi)->lock_token = NULL;
(*pi)->pool = pool;
@@ -306,7 +315,7 @@ relevant(path_info_t *pi, const char *pr
(!*prefix || pi->path[plen] == '/'));
}
-/* Fetch the next pathinfo from B->tempfile for a descendant of
+/* Fetch the next pathinfo from B->reader for a descendant of
PREFIX. If the next pathinfo is for an immediate child of PREFIX,
set *ENTRY to the path component of the report information and
*INFO to the path information for that entry. If the next pathinfo
@@ -353,7 +362,7 @@ fetch_path_info(report_baton_t *b, const
*entry = relpath;
*info = b->lookahead;
subpool = svn_pool_create(b->pool);
- SVN_ERR(read_path_info(&b->lookahead, b->tempfile, subpool));
+ SVN_ERR(read_path_info(&b->lookahead, b->reader, subpool));
}
}
return SVN_NO_ERROR;
@@ -371,7 +380,7 @@ skip_path_info(report_baton_t *b, const
{
svn_pool_destroy(b->lookahead->pool);
subpool = svn_pool_create(b->pool);
- SVN_ERR(read_path_info(&b->lookahead, b->tempfile, subpool));
+ SVN_ERR(read_path_info(&b->lookahead, b->reader, subpool));
}
return SVN_NO_ERROR;
}
@@ -1279,7 +1288,6 @@ drive(report_baton_t *b, svn_revnum_t s_
static svn_error_t *
finish_report(report_baton_t *b, apr_pool_t *pool)
{
- apr_off_t offset;
path_info_t *info;
apr_pool_t *subpool;
svn_revnum_t s_rev;
@@ -1288,14 +1296,12 @@ finish_report(report_baton_t *b, apr_poo
/* Save our pool to manage the lookahead and fs_root cache with. */
b->pool = pool;
- /* Add an end marker and rewind the temporary file. */
- SVN_ERR(svn_io_file_write_full(b->tempfile, "-", 1, NULL, pool));
- offset = 0;
- SVN_ERR(svn_io_file_seek(b->tempfile, APR_SET, &offset, pool));
+ /* Add the end marker. */
+ SVN_ERR(svn_spillbuf__reader_write(b->reader, "-", 1, pool));
/* Read the first pathinfo from the report and verify that it is a top-level
set_path entry. */
- SVN_ERR(read_path_info(&info, b->tempfile, pool));
+ SVN_ERR(read_path_info(&info, b->reader, pool));
if (!info || strcmp(info->path, b->s_operand) != 0
|| info->link_path || !SVN_IS_VALID_REVNUM(info->rev))
return svn_error_create(SVN_ERR_REPOS_BAD_REVISION_REPORT, NULL,
@@ -1304,7 +1310,7 @@ finish_report(report_baton_t *b, apr_poo
/* Initialize the lookahead pathinfo. */
subpool = svn_pool_create(pool);
- SVN_ERR(read_path_info(&b->lookahead, b->tempfile, subpool));
+ SVN_ERR(read_path_info(&b->lookahead, b->reader, subpool));
if (b->lookahead && strcmp(b->lookahead->path, b->s_operand) == 0)
{
@@ -1322,7 +1328,7 @@ finish_report(report_baton_t *b, apr_poo
b->lookahead->depth = info->depth;
}
info = b->lookahead;
- SVN_ERR(read_path_info(&b->lookahead, b->tempfile, subpool));
+ SVN_ERR(read_path_info(&b->lookahead, b->reader, subpool));
}
/* Open the target root and initialize the source root cache. */
@@ -1344,7 +1350,7 @@ finish_report(report_baton_t *b, apr_poo
/* --- COLLECTING THE REPORT INFORMATION --- */
-/* Record a report operation into the temporary file. Return an error
+/* Record a report operation into the spill buffer. Return an error
if DEPTH is svn_depth_unknown. */
static svn_error_t *
write_path_info(report_baton_t *b, const char *path, const char *lpath,
@@ -1383,7 +1389,7 @@ write_path_info(report_baton_t *b, const
rep = apr_psprintf(pool, "+%" APR_SIZE_T_FMT ":%s%s%s%s%c%s",
strlen(path), path, lrep, rrep, drep,
start_empty ? '+' : '-', ltrep);
- return svn_io_file_write_full(b->tempfile, rep, strlen(rep), NULL, pool);
+ return svn_spillbuf__reader_write(b->reader, rep, strlen(rep), pool);
}
svn_error_t *
@@ -1422,20 +1428,14 @@ svn_error_t *
svn_repos_finish_report(void *baton, apr_pool_t *pool)
{
report_baton_t *b = baton;
- svn_error_t *finish_err, *close_err;
-
- finish_err = finish_report(b, pool);
- close_err = svn_io_file_close(b->tempfile, pool);
- return svn_error_trace(svn_error_compose_create(finish_err, close_err));
+ return svn_error_trace(finish_report(b, pool));
}
svn_error_t *
svn_repos_abort_report(void *baton, apr_pool_t *pool)
{
- report_baton_t *b = baton;
-
- return svn_error_trace(svn_io_file_close(b->tempfile, pool));
+ return SVN_NO_ERROR;
}
/* --- BEGINNING THE REPORT --- */
@@ -1484,10 +1484,9 @@ svn_repos_begin_report2(void **report_ba
b->authz_read_baton = authz_read_baton;
b->revision_infos = apr_hash_make(pool);
b->pool = pool;
-
- SVN_ERR(svn_io_open_unique_file3(&b->tempfile, NULL, NULL,
- svn_io_file_del_on_pool_cleanup,
- pool, pool));
+ b->reader = svn_spillbuf__reader_create(1000 /* blocksize */,
+ 1000000 /* maxsize */,
+ pool);
/* Hand reporter back to client. */
*report_baton = b;
Modified: subversion/branches/fs-py/subversion/libsvn_repos/rev_hunt.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_repos/rev_hunt.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_repos/rev_hunt.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_repos/rev_hunt.c Fri Sep 30 15:02:43 \
2011 @@ -997,9 +997,8 @@ get_path_mergeinfo(apr_hash_t **mergeinf
/* We do not need to call svn_repos_fs_get_mergeinfo() (which performs authz)
because we will filter out unreadable revisions in
find_interesting_revision(), above */
- SVN_ERR(svn_fs_get_mergeinfo2(&tmp_catalog, root, paths,
- svn_mergeinfo_inherited, FALSE, FALSE,
- subpool));
+ SVN_ERR(svn_fs_get_mergeinfo(&tmp_catalog, root, paths,
+ svn_mergeinfo_inherited, FALSE, subpool));
*mergeinfo = apr_hash_get(tmp_catalog, path, APR_HASH_KEY_STRING);
if (*mergeinfo)
Modified: subversion/branches/fs-py/subversion/libsvn_subr/config_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_subr/config_file.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_subr/config_file.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_subr/config_file.c Fri Sep 30 \
15:02:43 2011 @@ -1071,6 +1071,11 @@ svn_config_ensure(const char *config_dir
"### Set interactive-conflicts to 'no' to disable interactive" NL
"### conflict resolution prompting. It defaults to 'yes'." NL
"# interactive-conflicts = no" NL
+ "### Set memory-cache-size to define the size of the memory cache" NL
+ "### used by the client when accessing a FSFS repository via" NL
+ "### ra_local (the file:// scheme). The value represents the number" NL
+ "### of MB used by the cache." NL
+ "# memory-cache-size = 16" NL
"" NL
"### Section for configuring automatic properties." NL
"[auto-props]" NL
Modified: subversion/branches/fs-py/subversion/libsvn_subr/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_subr/deprecated.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_subr/deprecated.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_subr/deprecated.c Fri Sep 30 15:02:43 \
2011 @@ -1073,6 +1073,42 @@ svn_rangelist_inheritable(apr_array_head
pool, pool));
}
+svn_error_t *
+svn_rangelist_merge(apr_array_header_t **rangelist,
+ const apr_array_header_t *changes,
+ apr_pool_t *pool)
+{
+ return svn_error_trace(svn_rangelist_merge2(*rangelist, changes,
+ pool, pool));
+}
+
+svn_error_t *
+svn_mergeinfo_merge(svn_mergeinfo_t mergeinfo,
+ svn_mergeinfo_t changes,
+ apr_pool_t *pool)
+{
+ return svn_error_trace(svn_mergeinfo_merge2(mergeinfo, changes, pool,
+ pool));
+}
+
+svn_error_t *
+svn_mergeinfo_remove(svn_mergeinfo_t *mergeinfo, svn_mergeinfo_t eraser,
+ svn_mergeinfo_t whiteboard, apr_pool_t *pool)
+{
+ return svn_mergeinfo_remove2(mergeinfo, eraser, whiteboard, TRUE, pool,
+ pool);
+}
+
+svn_error_t *
+svn_mergeinfo_intersect(svn_mergeinfo_t *mergeinfo,
+ svn_mergeinfo_t mergeinfo1,
+ svn_mergeinfo_t mergeinfo2,
+ apr_pool_t *pool)
+{
+ return svn_mergeinfo_intersect2(mergeinfo, mergeinfo1, mergeinfo2,
+ TRUE, pool, pool);
+}
+
/*** From config.c ***/
svn_error_t *
@@ -1126,12 +1162,3 @@ svn_xml_make_header(svn_stringbuf_t **st
{
svn_xml_make_header2(str, NULL, pool);
}
-
-svn_error_t *
-svn_rangelist_merge(apr_array_header_t **rangelist,
- const apr_array_header_t *changes,
- apr_pool_t *pool)
-{
- return svn_error_trace(svn_rangelist_merge2(*rangelist, changes,
- pool, pool));
-}
Modified: subversion/branches/fs-py/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_subr/dirent_uri.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_subr/dirent_uri.c Fri Sep 30 15:02:43 \
2011 @@ -1420,6 +1420,7 @@ svn_uri__is_child(const char *parent_uri
{
const char *relpath;
+ assert(pool); /* hysterical raisins. */
assert(svn_uri_is_canonical(parent_uri, NULL));
assert(svn_uri_is_canonical(child_uri, NULL));
Modified: subversion/branches/fs-py/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_subr/io.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_subr/io.c Fri Sep 30 15:02:43 2011
@@ -2158,8 +2158,11 @@ svn_io_remove_file2(const char *path,
}
#endif
- return svn_error_wrap_apr(apr_err, _("Can't remove file '%s'"),
- svn_dirent_local_style(path, scratch_pool));
+ if (apr_err)
+ return svn_error_wrap_apr(apr_err, _("Can't remove file '%s'"),
+ svn_dirent_local_style(path, scratch_pool));
+
+ return SVN_NO_ERROR;
}
@@ -2934,9 +2937,11 @@ svn_io_detect_mimetype2(const char **mim
heuristic. */
if (mimetype_map)
{
- const char *type_from_map, *path_ext;
- svn_path_splitext(NULL, &path_ext, file, pool);
- fileext_tolower((char *)path_ext);
+ const char *type_from_map;
+ char *path_ext; /* Can point to physical const memory but only when
+ svn_path_splitext sets it to "". */
+ svn_path_splitext(NULL, (const char **)&path_ext, file, pool);
+ fileext_tolower(path_ext);
if ((type_from_map = apr_hash_get(mimetype_map, path_ext,
APR_HASH_KEY_STRING)))
{
Modified: subversion/branches/fs-py/subversion/libsvn_subr/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_subr/mergeinfo.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_subr/mergeinfo.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_subr/mergeinfo.c Fri Sep 30 15:02:43 \
2011 @@ -245,15 +245,13 @@ get_type_of_intersection(const svn_merge
When replacing the last range in RANGELIST, either allocate a new range in
RESULT_POOL or modify the existing range in place. Any new ranges added
- to RANGELIST are allocated in RESULT_POOL. SCRATCH_POOL is used for any
- temporary allocations.
+ to RANGELIST are allocated in RESULT_POOL.
*/
static svn_error_t *
combine_with_lastrange(const svn_merge_range_t *new_range,
apr_array_header_t *rangelist,
svn_boolean_t consider_inheritance,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
+ apr_pool_t *result_pool)
{
svn_merge_range_t *lastrange;
svn_merge_range_t combined_range;
@@ -614,14 +612,14 @@ parse_rangelist(const char **input, cons
/* revisionline -> PATHNAME COLON revisionlist */
static svn_error_t *
parse_revision_line(const char **input, const char *end, svn_mergeinfo_t hash,
- apr_pool_t *pool)
+ apr_pool_t *scratch_pool)
{
svn_stringbuf_t *pathname;
apr_array_header_t *existing_rangelist;
- apr_array_header_t *rangelist = apr_array_make(pool, 1,
+ apr_array_header_t *rangelist = apr_array_make(scratch_pool, 1,
sizeof(svn_merge_range_t *));
- SVN_ERR(parse_pathname(input, end, &pathname, pool));
+ SVN_ERR(parse_pathname(input, end, &pathname, scratch_pool));
if (*(*input) != ':')
return svn_error_create(SVN_ERR_MERGEINFO_PARSE_ERROR, NULL,
@@ -629,7 +627,7 @@ parse_revision_line(const char **input,
*input = *input + 1;
- SVN_ERR(parse_rangelist(input, end, rangelist, pathname->data, pool));
+ SVN_ERR(parse_rangelist(input, end, rangelist, pathname->data, scratch_pool));
if (*input != end && *(*input) != '\n')
return svn_error_createf(SVN_ERR_MERGEINFO_PARSE_ERROR, NULL,
@@ -668,8 +666,10 @@ parse_revision_line(const char **input,
"revision ranges '%s' and '%s' "
"with different inheritance "
"types"),
- range_to_string(lastrange, pool),
- range_to_string(range, pool));
+ range_to_string(lastrange,
+ scratch_pool),
+ range_to_string(range,
+ scratch_pool));
}
/* Combine overlapping or adjacent ranges with the
@@ -697,9 +697,12 @@ parse_revision_line(const char **input,
absolute path key. */
existing_rangelist = apr_hash_get(hash, pathname->data, APR_HASH_KEY_STRING);
if (existing_rangelist)
- SVN_ERR(svn_rangelist_merge2(rangelist, existing_rangelist, pool, pool));
+ SVN_ERR(svn_rangelist_merge2(rangelist, existing_rangelist,
+ scratch_pool, scratch_pool));
- apr_hash_set(hash, pathname->data, APR_HASH_KEY_STRING, rangelist);
+ apr_hash_set(hash, apr_pstrdup(apr_hash_pool_get(hash), pathname->data),
+ APR_HASH_KEY_STRING,
+ svn_rangelist_dup(rangelist, apr_hash_pool_get(hash)));
return SVN_NO_ERROR;
}
@@ -709,8 +712,14 @@ static svn_error_t *
parse_top(const char **input, const char *end, svn_mergeinfo_t hash,
apr_pool_t *pool)
{
+ apr_pool_t *iterpool = svn_pool_create(pool);
+
while (*input < end)
- SVN_ERR(parse_revision_line(input, end, hash, pool));
+ {
+ svn_pool_clear(iterpool);
+ SVN_ERR(parse_revision_line(input, end, hash, iterpool));
+ }
+ svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}
@@ -763,21 +772,18 @@ svn_rangelist_merge2(apr_array_header_t
result. */
if (elt1->inheritable || elt2->inheritable)
elt1->inheritable = TRUE;
- SVN_ERR(combine_with_lastrange(elt1, rangelist, TRUE, result_pool,
- scratch_pool));
+ SVN_ERR(combine_with_lastrange(elt1, rangelist, TRUE, result_pool));
i++;
j++;
}
else if (res < 0)
{
- SVN_ERR(combine_with_lastrange(elt1, rangelist, TRUE, result_pool,
- scratch_pool));
+ SVN_ERR(combine_with_lastrange(elt1, rangelist, TRUE, result_pool));
i++;
}
else
{
- SVN_ERR(combine_with_lastrange(elt2, rangelist, TRUE, result_pool,
- scratch_pool));
+ SVN_ERR(combine_with_lastrange(elt2, rangelist, TRUE, result_pool));
j++;
}
}
@@ -790,16 +796,14 @@ svn_rangelist_merge2(apr_array_header_t
{
svn_merge_range_t *elt = APR_ARRAY_IDX(original_rangelist, i,
svn_merge_range_t *);
- SVN_ERR(combine_with_lastrange(elt, rangelist, TRUE, result_pool,
- scratch_pool));
+ SVN_ERR(combine_with_lastrange(elt, rangelist, TRUE, result_pool));
}
for (; j < changes->nelts; j++)
{
svn_merge_range_t *elt = APR_ARRAY_IDX(changes, j, svn_merge_range_t *);
- SVN_ERR(combine_with_lastrange(elt, rangelist,
- TRUE, result_pool, scratch_pool));
+ SVN_ERR(combine_with_lastrange(elt, rangelist, TRUE, result_pool));
}
return SVN_NO_ERROR;
@@ -997,7 +1001,7 @@ rangelist_intersect_or_remove(apr_array_
tmp_range.inheritable =
(elt2->inheritable || elt1->inheritable);
SVN_ERR(combine_with_lastrange(&tmp_range, *output,
- consider_inheritance, pool,
+ consider_inheritance,
pool));
}
@@ -1034,7 +1038,7 @@ rangelist_intersect_or_remove(apr_array_
SVN_ERR(combine_with_lastrange(&tmp_range,
*output, consider_inheritance,
- pool, pool));
+ pool));
}
/* Set up the rest of the rangelist2 range for further
@@ -1055,7 +1059,7 @@ rangelist_intersect_or_remove(apr_array_
SVN_ERR(combine_with_lastrange(&tmp_range,
*output,
consider_inheritance,
- pool, pool));
+ pool));
}
working_elt2.start = elt1->end;
@@ -1107,7 +1111,7 @@ rangelist_intersect_or_remove(apr_array_
if (i2 == lasti2 && i2 < rangelist2->nelts)
{
SVN_ERR(combine_with_lastrange(&working_elt2, *output,
- consider_inheritance, pool, pool));
+ consider_inheritance, pool));
i2++;
}
@@ -1118,7 +1122,7 @@ rangelist_intersect_or_remove(apr_array_
svn_merge_range_t *);
SVN_ERR(combine_with_lastrange(elt, *output,
- consider_inheritance, pool, pool));
+ consider_inheritance, pool));
}
}
@@ -1320,8 +1324,10 @@ svn_mergeinfo__equals(svn_boolean_t *is_
}
svn_error_t *
-svn_mergeinfo_merge(svn_mergeinfo_t mergeinfo, svn_mergeinfo_t changes,
- apr_pool_t *pool)
+svn_mergeinfo_merge2(svn_mergeinfo_t mergeinfo,
+ svn_mergeinfo_t changes,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
apr_array_header_t *sorted1, *sorted2;
int i, j;
@@ -1330,12 +1336,14 @@ svn_mergeinfo_merge(svn_mergeinfo_t merg
if (!apr_hash_count(changes))
return SVN_NO_ERROR;
- sorted1 = svn_sort__hash(mergeinfo, svn_sort_compare_items_as_paths, pool);
- sorted2 = svn_sort__hash(changes, svn_sort_compare_items_as_paths, pool);
+ sorted1 = svn_sort__hash(mergeinfo, svn_sort_compare_items_as_paths,
+ scratch_pool);
+ sorted2 = svn_sort__hash(changes, svn_sort_compare_items_as_paths,
+ scratch_pool);
i = 0;
j = 0;
- iterpool = svn_pool_create(pool);
+ iterpool = svn_pool_create(scratch_pool);
while (i < sorted1->nelts && j < sorted2->nelts)
{
svn_sort__item_t elt1, elt2;
@@ -1354,7 +1362,7 @@ svn_mergeinfo_merge(svn_mergeinfo_t merg
rl1 = elt1.value;
rl2 = elt2.value;
- SVN_ERR(svn_rangelist_merge2(rl1, rl2, pool, iterpool));
+ SVN_ERR(svn_rangelist_merge2(rl1, rl2, result_pool, iterpool));
apr_hash_set(mergeinfo, elt1.key, elt1.klen, rl1);
i++;
j++;
@@ -1410,8 +1418,8 @@ svn_mergeinfo_catalog_merge(svn_mergeinf
svn_mergeinfo_t mergeinfo = cat_elt.value;
svn_mergeinfo_t changes_mergeinfo = change_elt.value;
- SVN_ERR(svn_mergeinfo_merge(mergeinfo, changes_mergeinfo,
- result_pool));
+ SVN_ERR(svn_mergeinfo_merge2(mergeinfo, changes_mergeinfo,
+ result_pool, scratch_pool));
apr_hash_set(mergeinfo_cat, cat_elt.key, cat_elt.klen, mergeinfo);
i++;
j++;
@@ -1445,16 +1453,6 @@ svn_mergeinfo_catalog_merge(svn_mergeinf
}
svn_error_t *
-svn_mergeinfo_intersect(svn_mergeinfo_t *mergeinfo,
- svn_mergeinfo_t mergeinfo1,
- svn_mergeinfo_t mergeinfo2,
- apr_pool_t *pool)
-{
- return svn_mergeinfo_intersect2(mergeinfo, mergeinfo1, mergeinfo2,
- TRUE, pool, pool);
-}
-
-svn_error_t *
svn_mergeinfo_intersect2(svn_mergeinfo_t *mergeinfo,
svn_mergeinfo_t mergeinfo1,
svn_mergeinfo_t mergeinfo2,
@@ -1463,26 +1461,29 @@ svn_mergeinfo_intersect2(svn_mergeinfo_t
apr_pool_t *scratch_pool)
{
apr_hash_index_t *hi;
+ apr_pool_t *iterpool;
*mergeinfo = apr_hash_make(result_pool);
+ iterpool = svn_pool_create(scratch_pool);
/* ### TODO(reint): Do we care about the case when a path in one
### mergeinfo hash has inheritable mergeinfo, and in the other
### has non-inhertiable mergeinfo? It seems like that path
### itself should really be an intersection, while child paths
### should not be... */
- for (hi = apr_hash_first(apr_hash_pool_get(mergeinfo1), mergeinfo1);
+ for (hi = apr_hash_first(scratch_pool, mergeinfo1);
hi; hi = apr_hash_next(hi))
{
const char *path = svn__apr_hash_index_key(hi);
apr_array_header_t *rangelist1 = svn__apr_hash_index_val(hi);
apr_array_header_t *rangelist2;
+ svn_pool_clear(iterpool);
rangelist2 = apr_hash_get(mergeinfo2, path, APR_HASH_KEY_STRING);
if (rangelist2)
{
SVN_ERR(svn_rangelist_intersect(&rangelist2, rangelist1, rangelist2,
- consider_inheritance, scratch_pool));
+ consider_inheritance, iterpool));
if (rangelist2->nelts > 0)
apr_hash_set(*mergeinfo,
apr_pstrdup(result_pool, path),
@@ -1490,18 +1491,11 @@ svn_mergeinfo_intersect2(svn_mergeinfo_t
svn_rangelist_dup(rangelist2, result_pool));
}
}
+ svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}
svn_error_t *
-svn_mergeinfo_remove(svn_mergeinfo_t *mergeinfo, svn_mergeinfo_t eraser,
- svn_mergeinfo_t whiteboard, apr_pool_t *pool)
-{
- return svn_mergeinfo_remove2(mergeinfo, eraser, whiteboard, TRUE, pool,
- pool);
-}
-
-svn_error_t *
svn_mergeinfo_remove2(svn_mergeinfo_t *mergeinfo,
svn_mergeinfo_t eraser,
svn_mergeinfo_t whiteboard,
Modified: subversion/branches/fs-py/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_subr/sqlite.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_subr/sqlite.c Fri Sep 30 15:02:43 \
2011 @@ -133,6 +133,10 @@ struct svn_sqlite__value_t
} while (0)
+/* Time (in milliseconds) to wait for sqlite locks before giving up. */
+#define BUSY_TIMEOUT 10000
+
+
/* Convenience wrapper around exec_sql2(). */
#define exec_sql(db, sql) exec_sql2((db), (sql), SQLITE_OK)
@@ -579,108 +583,6 @@ svn_sqlite__reset(svn_sqlite__stmt_t *st
svn_error_t *
-svn_sqlite__set_schema_version(svn_sqlite__db_t *db,
- int version,
- apr_pool_t *scratch_pool)
-{
- const char *pragma_cmd = apr_psprintf(scratch_pool,
- "PRAGMA user_version = %d;",
- version);
-
- return svn_error_trace(exec_sql(db, pragma_cmd));
-}
-
-
-/* Time (in milliseconds) to wait for sqlite locks before giving up. */
-#define BUSY_TIMEOUT 10000
-
-
-#if 0
-/*
- * EXAMPLE
- *
- * The following provide an example for a series of SQL statements to
- * create/upgrade a SQLite schema across multiple "formats". This array
- * and integer would be passed into svn_sqlite__open().
- */
-static const char *schema_create_sql[] = {
- NULL, /* An empty database is format 0 */
-
- /* USER_VERSION 1 */
- "PRAGMA auto_vacuum = 1;"
- APR_EOL_STR
- "CREATE TABLE mergeinfo (revision INTEGER NOT NULL, mergedfrom TEXT NOT "
- "NULL, mergedto TEXT NOT NULL, mergedrevstart INTEGER NOT NULL, "
- "mergedrevend INTEGER NOT NULL, inheritable INTEGER NOT NULL);"
- APR_EOL_STR
- "CREATE INDEX mi_mergedfrom_idx ON mergeinfo (mergedfrom);"
- APR_EOL_STR
- "CREATE INDEX mi_mergedto_idx ON mergeinfo (mergedto);"
- APR_EOL_STR
- "CREATE INDEX mi_revision_idx ON mergeinfo (revision);"
- APR_EOL_STR
- "CREATE TABLE mergeinfo_changed (revision INTEGER NOT NULL, path TEXT "
- "NOT NULL);"
- APR_EOL_STR
- "CREATE UNIQUE INDEX mi_c_revpath_idx ON mergeinfo_changed (revision, path);"
- APR_EOL_STR
- "CREATE INDEX mi_c_path_idx ON mergeinfo_changed (path);"
- APR_EOL_STR
- "CREATE INDEX mi_c_revision_idx ON mergeinfo_changed (revision);"
- APR_EOL_STR,
-
- /* USER_VERSION 2 */
- "CREATE TABLE node_origins (node_id TEXT NOT NULL, node_rev_id TEXT NOT "
- "NULL);"
- APR_EOL_STR
- "CREATE UNIQUE INDEX no_ni_idx ON node_origins (node_id);"
- APR_EOL_STR
-};
-
-static const int latest_schema_format =
- sizeof(schema_create_sql)/sizeof(schema_create_sql[0]) - 1;
-
-#endif
-
-struct upgrade_baton
-{
- int current_schema;
- int latest_schema;
- const char * const *upgrade_sql;
-};
-
-
-/* This implements svn_sqlite__transaction_callback_t */
-static svn_error_t *
-upgrade_format(void *baton,
- svn_sqlite__db_t *db,
- apr_pool_t *scratch_pool)
-{
- struct upgrade_baton *ub = baton;
- int current_schema = ub->current_schema;
- apr_pool_t *iterpool = svn_pool_create(scratch_pool);
-
- while (current_schema < ub->latest_schema)
- {
- svn_pool_clear(iterpool);
-
- /* Go to the next schema */
- current_schema++;
-
- /* Run the upgrade SQL */
- if (ub->upgrade_sql[current_schema])
- SVN_ERR(exec_sql(db, ub->upgrade_sql[current_schema]));
-
- /* Update the user version pragma */
- SVN_ERR(svn_sqlite__set_schema_version(db, current_schema, iterpool));
- }
-
- svn_pool_destroy(iterpool);
-
- return SVN_NO_ERROR;
-}
-
-svn_error_t *
svn_sqlite__read_schema_version(int *version,
svn_sqlite__db_t *db,
apr_pool_t *scratch_pool)
@@ -696,41 +598,6 @@ svn_sqlite__read_schema_version(int *ver
}
-/* Check the schema format of the database, upgrading it if necessary.
- Return SVN_ERR_SQLITE_UNSUPPORTED_SCHEMA if the schema format is too new,
- or SVN_ERR_SQLITE_ERROR if an sqlite error occurs during validation.
- Return SVN_NO_ERROR if everything is okay. */
-static svn_error_t *
-check_format(svn_sqlite__db_t *db,
- int latest_schema,
- const char * const *upgrade_sql,
- apr_pool_t *scratch_pool)
-{
- int current_schema;
-
- /* Validate that the schema exists as expected. */
- SVN_ERR(svn_sqlite__read_schema_version(¤t_schema, db, scratch_pool));
-
- if (current_schema == latest_schema)
- return SVN_NO_ERROR;
-
- if (current_schema < latest_schema)
- {
- struct upgrade_baton ub;
-
- ub.current_schema = current_schema;
- ub.latest_schema = latest_schema;
- ub.upgrade_sql = upgrade_sql;
-
- return svn_error_trace(svn_sqlite__with_transaction(
- db, upgrade_format, &ub, scratch_pool));
- }
-
- return svn_error_createf(SVN_ERR_SQLITE_UNSUPPORTED_SCHEMA, NULL,
- _("Schema format %d not recognized"),
- current_schema);
-}
-
static volatile svn_atomic_t sqlite_init_state = 0;
/* If possible, verify that SQLite was compiled in a thread-safe
@@ -836,22 +703,6 @@ internal_open(sqlite3 **db3, const char
return SVN_NO_ERROR;
}
-svn_error_t *
-svn_sqlite__get_schema_version(int *version,
- const char *path,
- apr_pool_t *scratch_pool)
-{
- svn_sqlite__db_t db;
-
- SVN_ERR(svn_atomic__init_once(&sqlite_init_state,
- init_sqlite, NULL, scratch_pool));
- SVN_ERR(internal_open(&db.db3, path, svn_sqlite__mode_readonly,
- scratch_pool));
- SVN_ERR(svn_sqlite__read_schema_version(version, &db, scratch_pool));
- SQLITE_ERR(sqlite3_close(db.db3), &db);
-
- return SVN_NO_ERROR;
-}
/* APR cleanup function used to close the database when its pool is destroyed.
DATA should be the svn_sqlite__db_t handle for the database. */
@@ -897,7 +748,7 @@ close_apr(void *data)
svn_error_t *
svn_sqlite__open(svn_sqlite__db_t **db, const char *path,
svn_sqlite__mode_t mode, const char * const statements[],
- int latest_schema, const char * const *upgrade_sql,
+ int unused1, const char * const *unused2,
apr_pool_t *result_pool, apr_pool_t *scratch_pool)
{
SVN_ERR(svn_atomic__init_once(&sqlite_init_state,
@@ -966,10 +817,6 @@ svn_sqlite__open(svn_sqlite__db_t **db,
setting SQLITE_TEMP_STORE to 0 (always to disk) */
svn_error_clear(exec_sql(*db, "PRAGMA temp_store = MEMORY;"));
- /* Validate the schema, upgrading if necessary. */
- if (upgrade_sql != NULL)
- SVN_ERR(check_format(*db, latest_schema, upgrade_sql, scratch_pool));
-
/* Store the provided statements. */
if (statements)
{
Modified: subversion/branches/fs-py/subversion/libsvn_wc/diff_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_wc/diff_editor.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_wc/diff_editor.c Fri Sep 30 15:02:43 \
2011 @@ -1932,6 +1932,7 @@ svn_wc_get_diff_editor6(const svn_delta_
result_pool));
SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
+ NULL, NULL, NULL, NULL,
result_pool, scratch_pool));
return SVN_NO_ERROR;
Modified: subversion/branches/fs-py/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/libsvn_wc/externals.c?rev=1177691&r1=1177690&r2=1177691&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/libsvn_wc/externals.c (original)
+++ subversion/branches/fs-py/subversion/libsvn_wc/externals.c Fri Sep 30 15:02:43 \
2011 @@ -30,6 +30,7 @@
#include <apr_hash.h>
#include <apr_tables.h>
#include <apr_general.h>
+#include <apr_uri.h>
#include "svn_dirent_uri.h"
#include "svn_path.h"
@@ -1248,3 +1249,195 @@ svn_wc__externals_gather_definitions(apr
return SVN_NO_ERROR;
}
}
+
+/* Return the scheme of @a uri in @a scheme allocated from @a pool.
+ If @a uri does not appear to be a valid URI, then @a scheme will
+ not be updated. */
+static svn_error_t *
+uri_scheme(const char **scheme, const char *uri, apr_pool_t *pool)
+{
+ apr_size_t i;
+
+ for (i = 0; uri[i] && uri[i] != ':'; ++i)
+ if (uri[i] == '/')
+ goto error;
+
+ if (i > 0 && uri[i] == ':' && uri[i+1] == '/' && uri[i+2] == '/')
+ {
+ *scheme = apr_pstrmemdup(pool, uri, i);
+ return SVN_NO_ERROR;
+ }
+
+error:
+ return svn_error_createf(SVN_ERR_BAD_URL, 0,
+ _("URL '%s' does not begin with a scheme"),
+ uri);
+}
+
+svn_error_t *
+svn_wc__resolve_relative_external_url(const char **resolved_url,
+ const svn_wc_external_item2_t *item,
+ const char *repos_root_url,
+ const char *parent_dir_url,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ const char *url = item->url;
+ apr_uri_t parent_dir_uri;
+ apr_status_t status;
+
+ *resolved_url = item->url;
+
+ /* If the URL is already absolute, there is nothing to do. */
+ if (svn_path_is_url(url))
+ {
+ /* "http://server/path" */
+ *resolved_url = svn_uri_canonicalize(url, result_pool);
+ return SVN_NO_ERROR;
+ }
+
+ if (url[0] == '/')
+ {
+ /* "/path", "//path", and "///path" */
+ int num_leading_slashes = 1;
+ if (url[1] == '/')
+ {
+ num_leading_slashes++;
+ if (url[2] == '/')
+ num_leading_slashes++;
+ }
+
+ /* "//schema-relative" and in some cases "///schema-relative".
+ This last format is supported on file:// schema relative. */
+ url = apr_pstrcat(scratch_pool,
+ apr_pstrndup(scratch_pool, url, num_leading_slashes),
+ svn_relpath_canonicalize(url + num_leading_slashes,
+ scratch_pool),
+ (char*)NULL);
+ }
+ else
+ {
+ /* "^/path" and "../path" */
+ url = svn_relpath_canonicalize(url, scratch_pool);
+ }
+
+ /* Parse the parent directory URL into its parts. */
+ status = apr_uri_parse(scratch_pool, parent_dir_url, &parent_dir_uri);
+ if (status)
+ return svn_error_createf(SVN_ERR_BAD_URL, 0,
+ _("Illegal parent directory URL '%s'"),
+ parent_dir_url);
+
+ /* If the parent directory URL is at the server root, then the URL
+ may have no / after the hostname so apr_uri_parse() will leave
+ the URL's path as NULL. */
+ if (! parent_dir_uri.path)
+ parent_dir_uri.path = apr_pstrmemdup(scratch_pool, "/", 1);
+ parent_dir_uri.query = NULL;
+ parent_dir_uri.fragment = NULL;
+
+ /* Handle URLs relative to the current directory or to the
+ repository root. The backpaths may only remove path elements,
+ not the hostname. This allows an external to refer to another
+ repository in the same server relative to the location of this
+ repository, say using SVNParentPath. */
+ if ((0 == strncmp("../", url, 3)) ||
+ (0 == strncmp("^/", url, 2)))
+ {
+ apr_array_header_t *base_components;
+ apr_array_header_t *relative_components;
+ int i;
+
+ /* Decompose either the parent directory's URL path or the
+ repository root's URL path into components. */
+ if (0 == strncmp("../", url, 3))
+ {
+ base_components = svn_path_decompose(parent_dir_uri.path,
+ scratch_pool);
+ relative_components = svn_path_decompose(url, scratch_pool);
+ }
+ else
+ {
+ apr_uri_t repos_root_uri;
+
+ status = apr_uri_parse(scratch_pool, repos_root_url,
+ &repos_root_uri);
+ if (status)
+ return svn_error_createf(SVN_ERR_BAD_URL, 0,
+ _("Illegal repository root URL '%s'"),
+ repos_root_url);
+
+ /* If the repository root URL is at the server root, then
+ the URL may have no / after the hostname so
+ apr_uri_parse() will leave the URL's path as NULL. */
+ if (! repos_root_uri.path)
+ repos_root_uri.path = apr_pstrmemdup(scratch_pool, "/", 1);
+
+ base_components = svn_path_decompose(repos_root_uri.path,
+ scratch_pool);
+ relative_components = svn_path_decompose(url + 2, scratch_pool);
+ }
+
+ for (i = 0; i < relative_components->nelts; ++i)
+ {
+ const char *component = APR_ARRAY_IDX(relative_components,
+ i,
+ const char *);
+ if (0 == strcmp("..", component))
+ {
+ /* Constructing the final absolute URL together with
+ apr_uri_unparse() requires that the path be absolute,
+ so only pop a component if the component being popped
+ is not the component for the root directory. */
+ if (base_components->nelts > 1)
+ apr_array_pop(base_components);
+ }
+ else
+ APR_ARRAY_PUSH(base_components, const char *) = component;
+ }
+
+ parent_dir_uri.path = (char *)svn_path_compose(base_components,
+ scratch_pool);
+ *resolved_url = svn_uri_canonicalize(apr_uri_unparse(scratch_pool,
+ &parent_dir_uri, 0),
+ result_pool);
+ return SVN_NO_ERROR;
+ }
+
+ /* The remaining URLs are relative to either the scheme or server root
+ and can only refer to locations inside that scope, so backpaths are
+ not allowed. */
+ if (svn_path_is_backpath_present(url + 2))
+ return svn_error_createf(SVN_ERR_BAD_URL, 0,
+ _("The external relative URL '%s' cannot have "
+ "backpaths, i.e. '..'"),
+ item->url);
+
+ /* Relative to the scheme: Build a new URL from the parts we know. */
+ if (0 == strncmp("//", url, 2))
+ {
+ const char *scheme;
+
+ SVN_ERR(uri_scheme(&scheme, repos_root_url, scratch_pool));
+ *resolved_url = svn_uri_canonicalize(apr_pstrcat(scratch_pool, scheme,
+ ":", url, (char *)NULL),
+ result_pool);
+ return SVN_NO_ERROR;
+ }
+
+ /* Relative to the server root: Just replace the path portion of the
+ parent's URL. */
+ if (url[0] == '/')
+ {
+ parent_dir_uri.path = (char *)url;
+ *resolved_url = svn_uri_canonicalize(apr_uri_unparse(scratch_pool,
+ &parent_dir_uri, 0),
+ result_pool);
+ return SVN_NO_ERROR;
+ }
+
+ return svn_error_createf(SVN_ERR_BAD_URL, 0,
+ _("Unrecognized format for the relative external "
+ "URL '%s'"),
+ item->url);
+}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic