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 2015/01/24 20:42:22 UTC
svn commit: r1654574 [1/2] - in /subversion/branches/pin-externals: ./
build/generator/ subversion/bindings/javahl/native/ subversion/include/
subversion/libsvn_client/ subversion/libsvn_fs_fs/
subversion/libsvn_ra_serf/ subversion/libsvn_repos/ subver...
Author: stsp
Date: Sat Jan 24 19:42:21 2015
New Revision: 1654574
URL: http://svn.apache.org/r1654574
Log:
On the pin-externals branch, sync with trunk.
Modified:
subversion/branches/pin-externals/ (props changed)
subversion/branches/pin-externals/build/generator/gen_win_dependencies.py
subversion/branches/pin-externals/subversion/bindings/javahl/native/CreateJ.cpp
subversion/branches/pin-externals/subversion/bindings/javahl/native/RemoteSession.cpp
subversion/branches/pin-externals/subversion/include/svn_ra.h
subversion/branches/pin-externals/subversion/include/svn_ra_svn.h
subversion/branches/pin-externals/subversion/include/svn_repos.h
subversion/branches/pin-externals/subversion/libsvn_client/externals.c
subversion/branches/pin-externals/subversion/libsvn_fs_fs/tree.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/blame.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/commit.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/get_deleted_rev.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/get_file.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/get_lock.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/getdate.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/getlocations.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/getlocationsegments.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/getlocks.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/inherited_props.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/lock.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/log.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/merge.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/mergeinfo.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/options.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/property.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/ra_serf.h
subversion/branches/pin-externals/subversion/libsvn_ra_serf/replay.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/serf.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/update.c
subversion/branches/pin-externals/subversion/libsvn_ra_serf/util.c
subversion/branches/pin-externals/subversion/libsvn_repos/commit.c
subversion/branches/pin-externals/subversion/libsvn_subr/io.c
subversion/branches/pin-externals/subversion/svnrdump/dump_editor.c
subversion/branches/pin-externals/subversion/svnrdump/load_editor.c
subversion/branches/pin-externals/subversion/tests/cmdline/svnrdump_tests.py
subversion/branches/pin-externals/subversion/tests/libsvn_subr/io-test.c
Propchange: subversion/branches/pin-externals/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Jan 24 19:42:21 2015
@@ -85,4 +85,4 @@
/subversion/branches/verify-at-commit:1462039-1462408
/subversion/branches/verify-keep-going:1439280-1546110
/subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1643755-1653577
+/subversion/trunk:1643755-1654573
Modified: subversion/branches/pin-externals/build/generator/gen_win_dependencies.py
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/build/generator/gen_win_dependencies.py?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/build/generator/gen_win_dependencies.py (original)
+++ subversion/branches/pin-externals/build/generator/gen_win_dependencies.py Sat Jan 24 19:42:21 2015
@@ -838,7 +838,7 @@ class GenDependenciesBase(gen_base.Gener
txt = open(version_path).read()
vermatch = re.search(
- r'#define OPENSSL_VERSION_TEXT\s+"OpenSSL\s+((\d+)\.(\d+).(\d+)([^ -]*))',
+ r'#\s*define\s+OPENSSL_VERSION_TEXT\s+"OpenSSL\s+((\d+)\.(\d+).(\d+)([^ -]*))',
txt)
version = (int(vermatch.group(2)),
Modified: subversion/branches/pin-externals/subversion/bindings/javahl/native/CreateJ.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/bindings/javahl/native/CreateJ.cpp?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/bindings/javahl/native/CreateJ.cpp (original)
+++ subversion/branches/pin-externals/subversion/bindings/javahl/native/CreateJ.cpp Sat Jan 24 19:42:21 2015
@@ -1096,8 +1096,7 @@ void fill_property_map(jobject map,
apr_hash_t* prop_hash, apr_array_header_t* prop_diffs,
apr_pool_t* scratch_pool, jmethodID put_mid)
{
- SVN_ERR_ASSERT_NO_RETURN(!prop_hash != !prop_diffs
- || !prop_hash && !prop_diffs);
+ SVN_ERR_ASSERT_NO_RETURN(!(prop_hash && prop_diffs));
if (!map || (prop_hash == NULL && prop_diffs == NULL))
return;
@@ -1189,8 +1188,7 @@ void fill_property_map(jobject map,
jobject property_map(apr_hash_t *prop_hash, apr_array_header_t* prop_diffs,
apr_pool_t* scratch_pool)
{
- SVN_ERR_ASSERT_NO_RETURN(!prop_hash != !prop_diffs
- || !prop_hash && !prop_diffs);
+ SVN_ERR_ASSERT_NO_RETURN(!(prop_hash && prop_diffs));
if (prop_hash == NULL && prop_diffs == NULL)
return NULL;
Modified: subversion/branches/pin-externals/subversion/bindings/javahl/native/RemoteSession.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/bindings/javahl/native/RemoteSession.cpp?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/bindings/javahl/native/RemoteSession.cpp (original)
+++ subversion/branches/pin-externals/subversion/bindings/javahl/native/RemoteSession.cpp Sat Jan 24 19:42:21 2015
@@ -71,8 +71,7 @@ RemoteSession::open(jint jretryAttempts,
jobject jprompter, jobject jdeprecatedPrompter,
jobject jprogress, jobject jcfgcb, jobject jtunnelcb)
{
- SVN_ERR_ASSERT_NO_RETURN(!jprompter != !jdeprecatedPrompter
- || !jprompter && !jdeprecatedPrompter);
+ SVN_ERR_ASSERT_NO_RETURN(!(jprompter && jdeprecatedPrompter));
SVN::Pool requestPool;
URL url(jurl, requestPool);
Modified: subversion/branches/pin-externals/subversion/include/svn_ra.h
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/include/svn_ra.h?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/include/svn_ra.h (original)
+++ subversion/branches/pin-externals/subversion/include/svn_ra.h Sat Jan 24 19:42:21 2015
@@ -1011,6 +1011,10 @@ svn_ra_rev_prop(svn_ra_session_t *sessio
* Use @a pool for memory allocation.
*
* @since New in 1.5.
+ *
+ * @note Like most commit editors, the returned editor requires that the
+ * @c copyfrom_path parameter passed to its @c add_file and @c add_directory
+ * methods is a URL, not a relative path.
*/
svn_error_t *
svn_ra_get_commit_editor3(svn_ra_session_t *session,
Modified: subversion/branches/pin-externals/subversion/include/svn_ra_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/include/svn_ra_svn.h?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/include/svn_ra_svn.h (original)
+++ subversion/branches/pin-externals/subversion/include/svn_ra_svn.h Sat Jan 24 19:42:21 2015
@@ -287,6 +287,12 @@ svn_ra_svn_conn_remote_host(svn_ra_svn_c
*
* Upon successful completion of the edit, the editor will invoke @a callback
* with @a callback_baton as an argument.
+ *
+ * @note The @c copyfrom_path parameter passed to the @c add_file and
+ * @c add_directory methods of the returned editor may be either a URL or a
+ * relative path, and is transferred verbatim to the receiving end of the
+ * connection. See svn_ra_svn_drive_editor2() for information on the
+ * receiving end of the connection.
*/
void
svn_ra_svn_get_editor(const svn_delta_editor_t **editor,
@@ -302,6 +308,13 @@ svn_ra_svn_get_editor(const svn_delta_ed
* if @a for_replay is TRUE.
*
* @since New in 1.4.
+ *
+ * @note The @c copyfrom_path parameter passed to the @c add_file and
+ * @c add_directory methods of the receiving editor will be canonicalized
+ * either as a URL or as a relative path (starting with a slash) according
+ * to which kind was sent by the driving end of the connection. See
+ * svn_ra_svn_get_editor() for information on the driving end of the
+ * connection.
*/
svn_error_t *
svn_ra_svn_drive_editor2(svn_ra_svn_conn_t *conn,
Modified: subversion/branches/pin-externals/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/include/svn_repos.h?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/include/svn_repos.h (original)
+++ subversion/branches/pin-externals/subversion/include/svn_repos.h Sat Jan 24 19:42:21 2015
@@ -1498,10 +1498,9 @@ svn_repos_replay(svn_fs_root_t *root,
* filesystem of @a repos, beginning at location 'rev:@a base_path',
* where "rev" is the argument given to open_root().
*
- * @a repos is a previously opened repository. @a repos_url is the
+ * @a repos is a previously opened repository. @a repos_url_decoded is the
* decoded URL to the base of the repository, and is used to check
- * copyfrom paths. copyfrom paths passed to the editor must be full,
- * URI-encoded, URLs. @a txn is a filesystem transaction object to use
+ * copyfrom paths. @a txn is a filesystem transaction object to use
* during the commit, or @c NULL to indicate that this function should
* create (and fully manage) a new transaction.
*
@@ -1537,15 +1536,19 @@ svn_repos_replay(svn_fs_root_t *root,
*
* @since New in 1.5.
*
- * @note Yes, @a repos_url is a <em>decoded</em> URL. We realize
+ * @note Yes, @a repos_url_decoded is a <em>decoded</em> URL. We realize
* that's sorta wonky. Sorry about that.
+ *
+ * @note Like most commit editors, the returned editor requires that the
+ * @c copyfrom_path parameter passed to its @c add_file and @c add_directory
+ * methods is a full, URI-encoded URL, not a relative path.
*/
svn_error_t *
svn_repos_get_commit_editor5(const svn_delta_editor_t **editor,
void **edit_baton,
svn_repos_t *repos,
svn_fs_txn_t *txn,
- const char *repos_url,
+ const char *repos_url_decoded,
const char *base_path,
apr_hash_t *revprop_table,
svn_commit_callback2_t commit_callback,
Modified: subversion/branches/pin-externals/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_client/externals.c?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_client/externals.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_client/externals.c Sat Jan 24 19:42:21 2015
@@ -1186,6 +1186,17 @@ svn_client__export_externals(apr_hash_t
sub_iterpool),
sub_iterpool));
+ /* First notify that we're about to handle an external. */
+ if (ctx->notify_func2)
+ {
+ ctx->notify_func2(
+ ctx->notify_baton2,
+ svn_wc_create_notify(item_abspath,
+ svn_wc_notify_update_external,
+ sub_iterpool),
+ sub_iterpool);
+ }
+
SVN_ERR(wrap_external_error(
ctx, item_abspath,
svn_client_export5(NULL, new_url, item_abspath,
Modified: subversion/branches/pin-externals/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_fs_fs/tree.c?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_fs_fs/tree.c Sat Jan 24 19:42:21 2015
@@ -1012,6 +1012,10 @@ open_path(parent_path_t **parent_path_p,
svn_pool_clear(iterpool);
+ /* The NODE in PARENT_PATH always lives in POOL, i.e. it will
+ * survive the cleanup of ITERPOOL and the DAG cache.*/
+ here = parent_path->node;
+
/* Parse out the next entry from the path. */
entry = svn_fs__next_entry_name(&next, rest, pool);
@@ -1105,10 +1109,6 @@ open_path(parent_path_t **parent_path_p,
apr_psprintf(iterpool, _("Failure opening '%s'"), path));
rest = next;
-
- /* The NODE in PARENT_PATH equals CHILD but lives in POOL, i.e.
- * it will survive the cleanup of ITERPOOL.*/
- here = parent_path->node;
}
svn_pool_destroy(iterpool);
Modified: subversion/branches/pin-externals/subversion/libsvn_ra_serf/blame.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/blame.c?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/blame.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/blame.c Sat Jan 24 19:42:21 2015
@@ -280,7 +280,8 @@ static svn_error_t *
create_file_revs_body(serf_bucket_t **body_bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
serf_bucket_t *buckets;
blame_context_t *blame_ctx = baton;
Modified: subversion/branches/pin-externals/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/commit.c?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/commit.c Sat Jan 24 19:42:21 2015
@@ -85,13 +85,11 @@ typedef struct proppatch_context_t {
commit_context_t *commit_ctx;
- /* Changed and removed properties. */
- apr_hash_t *changed_props;
- apr_hash_t *removed_props;
-
- /* Same, for the old value (*old_value_p). */
- apr_hash_t *previous_changed_props;
- apr_hash_t *previous_removed_props;
+ /* Changed properties. const char * -> svn_prop_t * */
+ apr_hash_t *prop_changes;
+
+ /* Same, for the old value, or NULL. */
+ apr_hash_t *old_props;
/* In HTTP v2, this is the file/directory version we think we're changing. */
svn_revnum_t base_revision;
@@ -139,9 +137,8 @@ typedef struct dir_context_t {
const char *copy_path;
svn_revnum_t copy_revision;
- /* Changed and removed properties */
- apr_hash_t *changed_props;
- apr_hash_t *removed_props;
+ /* Changed properties (const char * -> svn_prop_t *) */
+ apr_hash_t *prop_changes;
/* The checked-out working resource for this directory. May be NULL; if so
call checkout_dir() first. */
@@ -186,9 +183,8 @@ typedef struct file_context_t {
/* Our resulting checksum as reported by the WC. */
const char *result_checksum;
- /* Changed and removed properties. */
- apr_hash_t *changed_props;
- apr_hash_t *removed_props;
+ /* Changed properties (const char * -> svn_prop_t *) */
+ apr_hash_t *prop_changes;
/* URL to PUT the file at. */
const char *url;
@@ -203,7 +199,8 @@ static svn_error_t *
create_checkout_body(serf_bucket_t **bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
const char *activity_url = baton;
serf_bucket_t *body_bkt;
@@ -569,101 +566,23 @@ get_encoding_and_cdata(const char **enco
return SVN_NO_ERROR;
}
-typedef struct walker_baton_t {
- serf_bucket_t *body_bkt;
- apr_pool_t *body_pool;
-
- apr_hash_t *previous_changed_props;
- apr_hash_t *previous_removed_props;
-
- const char *path;
-
- /* Hack, since change_rev_prop(old_value_p != NULL, value = NULL) uses D:set
- rather than D:remove... (see notes/http-and-webdav/webdav-protocol) */
- enum {
- filter_all_props,
- filter_props_with_old_value,
- filter_props_without_old_value
- } filter;
-
- /* Is the property being deleted? */
- svn_boolean_t deleting;
-} walker_baton_t;
-
-/* If we have (recorded in WB) the old value of the property named NS:NAME,
- * then set *HAVE_OLD_VAL to TRUE and set *OLD_VAL_P to that old value
- * (which may be NULL); else set *HAVE_OLD_VAL to FALSE. */
+/* Helper for create_proppatch_body. Writes per property xml to body */
static svn_error_t *
-derive_old_val(svn_boolean_t *have_old_val,
- const svn_string_t **old_val_p,
- walker_baton_t *wb,
- const char *ns,
- const char *name)
+write_prop_xml(const proppatch_context_t *proppatch,
+ serf_bucket_t *body_bkt,
+ serf_bucket_alloc_t *alloc,
+ const svn_prop_t *prop,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
- *have_old_val = FALSE;
-
- if (wb->previous_changed_props)
- {
- const svn_string_t *val;
- val = svn_ra_serf__get_prop_string(wb->previous_changed_props,
- wb->path, ns, name);
- if (val)
- {
- *have_old_val = TRUE;
- *old_val_p = val;
- }
- }
-
- if (wb->previous_removed_props)
- {
- const svn_string_t *val;
- val = svn_ra_serf__get_prop_string(wb->previous_removed_props,
- wb->path, ns, name);
- if (val)
- {
- *have_old_val = TRUE;
- *old_val_p = NULL;
- }
- }
-
- return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-proppatch_walker(void *baton,
- const char *ns,
- const char *name,
- const svn_string_t *val,
- apr_pool_t *scratch_pool)
-{
- walker_baton_t *wb = baton;
- serf_bucket_t *body_bkt = wb->body_bkt;
serf_bucket_t *cdata_bkt;
- serf_bucket_alloc_t *alloc;
const char *encoding;
- svn_boolean_t have_old_val;
- const svn_string_t *old_val;
const svn_string_t *encoded_value;
const char *prop_name;
+ const svn_prop_t *old_prop;
- SVN_ERR(derive_old_val(&have_old_val, &old_val, wb, ns, name));
-
- /* Jump through hoops to work with D:remove and its val = (""-for-NULL)
- * representation. */
- if (wb->filter != filter_all_props)
- {
- if (wb->filter == filter_props_with_old_value && ! have_old_val)
- return SVN_NO_ERROR;
- if (wb->filter == filter_props_without_old_value && have_old_val)
- return SVN_NO_ERROR;
- }
- if (wb->deleting)
- val = NULL;
-
- alloc = body_bkt->allocator;
-
- SVN_ERR(get_encoding_and_cdata(&encoding, &encoded_value, alloc, val,
- wb->body_pool, scratch_pool));
+ SVN_ERR(get_encoding_and_cdata(&encoding, &encoded_value, alloc, prop->value,
+ result_pool, scratch_pool));
if (encoded_value)
{
cdata_bkt = SERF_BUCKET_SIMPLE_STRING_LEN(encoded_value->data,
@@ -677,12 +596,18 @@ proppatch_walker(void *baton,
/* Use the namespace prefix instead of adding the xmlns attribute to support
property names containing ':' */
- if (strcmp(ns, SVN_DAV_PROP_NS_SVN) == 0)
- prop_name = apr_pstrcat(wb->body_pool, "S:", name, SVN_VA_NULL);
- else if (strcmp(ns, SVN_DAV_PROP_NS_CUSTOM) == 0)
- prop_name = apr_pstrcat(wb->body_pool, "C:", name, SVN_VA_NULL);
+ if (strncmp(prop->name, SVN_PROP_PREFIX, sizeof(SVN_PROP_PREFIX) - 1) == 0)
+ {
+ prop_name = apr_pstrcat(result_pool,
+ "S:", prop->name + sizeof(SVN_PROP_PREFIX) - 1,
+ SVN_VA_NULL);
+ }
else
- SVN_ERR_MALFUNCTION();
+ {
+ prop_name = apr_pstrcat(result_pool,
+ "C:", prop->name,
+ SVN_VA_NULL);
+ }
if (cdata_bkt)
svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, prop_name,
@@ -693,15 +618,18 @@ proppatch_walker(void *baton,
"V:" SVN_DAV__OLD_VALUE__ABSENT, "1",
SVN_VA_NULL);
- if (have_old_val)
+ old_prop = proppatch->old_props
+ ? svn_hash_gets(proppatch->old_props, prop->name)
+ : NULL;
+ if (old_prop)
{
const char *encoding2;
const svn_string_t *encoded_value2;
serf_bucket_t *cdata_bkt2;
SVN_ERR(get_encoding_and_cdata(&encoding2, &encoded_value2,
- alloc, old_val,
- wb->body_pool, scratch_pool));
+ alloc, old_prop->value,
+ result_pool, scratch_pool));
if (encoded_value2)
{
@@ -789,7 +717,8 @@ maybe_set_lock_token_header(serf_bucket_
static svn_error_t *
setup_proppatch_headers(serf_bucket_t *headers,
void *baton,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
proppatch_context_t *proppatch = baton;
@@ -813,11 +742,15 @@ static svn_error_t *
create_proppatch_body(serf_bucket_t **bkt,
void *baton,
serf_bucket_alloc_t *alloc,
+ apr_pool_t *pool /* request pool */,
apr_pool_t *scratch_pool)
{
proppatch_context_t *ctx = baton;
serf_bucket_t *body_bkt;
- walker_baton_t wb = { 0 };
+ svn_boolean_t opened = FALSE;
+ apr_hash_index_t *hi;
+
+ scratch_pool = pool; /*### Should be disabled, but needs review! */
body_bkt = serf_bucket_aggregate_create(alloc);
@@ -829,59 +762,64 @@ create_proppatch_body(serf_bucket_t **bk
"xmlns:S", SVN_DAV_PROP_NS_SVN,
SVN_VA_NULL);
- wb.body_bkt = body_bkt;
- wb.body_pool = scratch_pool;
- wb.previous_changed_props = ctx->previous_changed_props;
- wb.previous_removed_props = ctx->previous_removed_props;
- wb.path = ctx->path;
-
- if (apr_hash_count(ctx->changed_props) > 0)
- {
- svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:set", SVN_VA_NULL);
- svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop", SVN_VA_NULL);
-
- wb.filter = filter_all_props;
- wb.deleting = FALSE;
- SVN_ERR(svn_ra_serf__walk_all_props(ctx->changed_props, ctx->path,
- SVN_INVALID_REVNUM,
- proppatch_walker, &wb,
- scratch_pool));
+ /* First we write property SETs */
+ for (hi = apr_hash_first(scratch_pool, ctx->prop_changes);
+ hi;
+ hi = apr_hash_next(hi))
+ {
+ svn_prop_t *prop = apr_hash_this_val(hi);
- svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:prop");
- svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:set");
+ if (prop->value
+ || (ctx->old_props && svn_hash_gets(ctx->old_props, prop->name)))
+ {
+ if (!opened)
+ {
+ opened = TRUE;
+ svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:set",
+ SVN_VA_NULL);
+ svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop",
+ SVN_VA_NULL);
+ }
+
+ SVN_ERR(write_prop_xml(ctx, body_bkt, alloc, prop,
+ scratch_pool, scratch_pool));
+ }
}
- if ((apr_hash_count(ctx->removed_props) > 0)
- && (wb.previous_changed_props || wb.previous_removed_props))
+ if (opened)
{
- /* For revision properties we handle a remove as a special propset if
- we want to provide the old version of the property */
- svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:set", SVN_VA_NULL);
- svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop", SVN_VA_NULL);
-
- wb.filter = filter_props_with_old_value;
- wb.deleting = TRUE;
- SVN_ERR(svn_ra_serf__walk_all_props(ctx->removed_props, ctx->path,
- SVN_INVALID_REVNUM,
- proppatch_walker, &wb,
- scratch_pool));
-
svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:prop");
svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:set");
}
- if (apr_hash_count(ctx->removed_props) > 0)
+ /* And then property REMOVEs */
+ opened = FALSE;
+
+ for (hi = apr_hash_first(scratch_pool, ctx->prop_changes);
+ hi;
+ hi = apr_hash_next(hi))
{
- svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:remove", SVN_VA_NULL);
- svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop", SVN_VA_NULL);
+ svn_prop_t *prop = apr_hash_this_val(hi);
+
+ if (!prop->value
+ && !(ctx->old_props && svn_hash_gets(ctx->old_props, prop->name)))
+ {
+ if (!opened)
+ {
+ opened = TRUE;
+ svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:remove",
+ SVN_VA_NULL);
+ svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop",
+ SVN_VA_NULL);
+ }
- wb.filter = filter_props_without_old_value;
- wb.deleting = TRUE;
- SVN_ERR(svn_ra_serf__walk_all_props(ctx->removed_props, ctx->path,
- SVN_INVALID_REVNUM,
- proppatch_walker, &wb,
- scratch_pool));
+ SVN_ERR(write_prop_xml(ctx, body_bkt, alloc, prop,
+ scratch_pool, scratch_pool));
+ }
+ }
+ if (opened)
+ {
svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:prop");
svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:remove");
}
@@ -943,7 +881,8 @@ static svn_error_t *
create_put_body(serf_bucket_t **body_bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
file_context_t *ctx = baton;
apr_off_t offset;
@@ -971,7 +910,8 @@ static svn_error_t *
create_empty_put_body(serf_bucket_t **body_bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
*body_bkt = SERF_BUCKET_SIMPLE_STRING("", alloc);
return SVN_NO_ERROR;
@@ -980,7 +920,8 @@ create_empty_put_body(serf_bucket_t **bo
static svn_error_t *
setup_put_headers(serf_bucket_t *headers,
void *baton,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
file_context_t *ctx = baton;
@@ -1011,7 +952,8 @@ setup_put_headers(serf_bucket_t *headers
static svn_error_t *
setup_copy_file_headers(serf_bucket_t *headers,
void *baton,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
file_context_t *file = baton;
apr_uri_t uri;
@@ -1109,7 +1051,8 @@ setup_if_header_recursive(svn_boolean_t
static svn_error_t *
setup_add_dir_common_headers(serf_bucket_t *headers,
void *baton,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
dir_context_t *dir = baton;
svn_boolean_t added;
@@ -1122,7 +1065,8 @@ setup_add_dir_common_headers(serf_bucket
static svn_error_t *
setup_copy_dir_headers(serf_bucket_t *headers,
void *baton,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
dir_context_t *dir = baton;
apr_uri_t uri;
@@ -1151,13 +1095,15 @@ setup_copy_dir_headers(serf_bucket_t *he
/* Implicitly checkout this dir now. */
dir->working_url = apr_pstrdup(dir->pool, uri.path);
- return svn_error_trace(setup_add_dir_common_headers(headers, baton, pool));
+ return svn_error_trace(setup_add_dir_common_headers(headers, baton, pool,
+ scratch_pool));
}
static svn_error_t *
setup_delete_headers(serf_bucket_t *headers,
void *baton,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
delete_context_t *del = baton;
svn_boolean_t added;
@@ -1182,7 +1128,8 @@ static svn_error_t *
create_txn_post_body(serf_bucket_t **body_bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
apr_hash_t *revprops = baton;
svn_skel_t *request_skel;
@@ -1211,7 +1158,8 @@ create_txn_post_body(serf_bucket_t **bod
static svn_error_t *
setup_post_headers(serf_bucket_t *headers,
void *baton,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
#ifdef SVN_DAV_SEND_VTXN_NAME
/* Enable this to exercise the VTXN-NAME code based on a client
@@ -1369,8 +1317,7 @@ open_root(void *edit_baton,
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);
+ dir->prop_changes = apr_hash_make(dir->pool);
dir->url = apr_pstrdup(dir->pool, commit_ctx->txn_root_url);
/* If we included our revprops in the POST, we need not
@@ -1434,8 +1381,7 @@ open_root(void *edit_baton,
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);
+ dir->prop_changes = apr_hash_make(dir->pool);
SVN_ERR(get_version_url(&dir->url, dir->commit_ctx->session,
dir->relpath,
@@ -1458,31 +1404,19 @@ open_root(void *edit_baton,
proppatch_ctx->pool = scratch_pool;
proppatch_ctx->commit_ctx = NULL; /* No lock info */
proppatch_ctx->path = proppatch_target;
- proppatch_ctx->changed_props = apr_hash_make(proppatch_ctx->pool);
- proppatch_ctx->removed_props = apr_hash_make(proppatch_ctx->pool);
+ proppatch_ctx->prop_changes = apr_hash_make(proppatch_ctx->pool);
proppatch_ctx->base_revision = SVN_INVALID_REVNUM;
for (hi = apr_hash_first(scratch_pool, commit_ctx->revprop_table);
hi;
hi = apr_hash_next(hi))
{
- const char *name = apr_hash_this_key(hi);
- svn_string_t *value = apr_hash_this_val(hi);
- const char *ns;
+ svn_prop_t *prop = apr_palloc(scratch_pool, sizeof(*prop));
- if (strncmp(name, SVN_PROP_PREFIX, sizeof(SVN_PROP_PREFIX) - 1) == 0)
- {
- ns = SVN_DAV_PROP_NS_SVN;
- name += sizeof(SVN_PROP_PREFIX) - 1;
- }
- else
- {
- ns = SVN_DAV_PROP_NS_CUSTOM;
- }
+ prop->name = apr_hash_this_key(hi);
+ prop->value = apr_hash_this_val(hi);
- svn_ra_serf__set_prop(proppatch_ctx->changed_props,
- proppatch_ctx->path,
- ns, name, value, scratch_pool);
+ svn_hash_sets(proppatch_ctx->prop_changes, prop->name, prop);
}
SVN_ERR(proppatch_resource(commit_ctx->session,
@@ -1580,8 +1514,7 @@ add_directory(const char *path,
dir->copy_path = apr_pstrdup(dir->pool, copyfrom_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);
+ dir->prop_changes = apr_hash_make(dir->pool);
if (USING_HTTPV2_COMMIT_SUPPORT(dir->commit_ctx))
{
@@ -1673,8 +1606,7 @@ open_directory(const char *path,
dir->base_revision = base_revision;
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);
+ dir->prop_changes = apr_hash_make(dir->pool);
if (USING_HTTPV2_COMMIT_SUPPORT(dir->commit_ctx))
{
@@ -1698,46 +1630,23 @@ static svn_error_t *
change_dir_prop(void *dir_baton,
const char *name,
const svn_string_t *value,
- apr_pool_t *pool)
+ apr_pool_t *scratch_pool)
{
dir_context_t *dir = dir_baton;
- const char *ns;
- const char *proppatch_target;
-
+ svn_prop_t *prop;
- if (USING_HTTPV2_COMMIT_SUPPORT(dir->commit_ctx))
- {
- proppatch_target = dir->url;
- }
- else
+ if (! USING_HTTPV2_COMMIT_SUPPORT(dir->commit_ctx))
{
/* Ensure we have a checked out dir. */
- SVN_ERR(checkout_dir(dir, pool /* scratch_pool */));
-
- proppatch_target = dir->working_url;
+ SVN_ERR(checkout_dir(dir, scratch_pool));
}
- if (strncmp(name, SVN_PROP_PREFIX, sizeof(SVN_PROP_PREFIX) - 1) == 0)
- {
- ns = SVN_DAV_PROP_NS_SVN;
- name += sizeof(SVN_PROP_PREFIX) - 1;
- }
- else
- {
- ns = SVN_DAV_PROP_NS_CUSTOM;
- }
+ prop = apr_palloc(dir->pool, sizeof(*prop));
- if (value)
- {
- svn_ra_serf__set_prop(dir->changed_props, proppatch_target,
- ns, name, value, dir->pool);
- }
- else
- {
- value = svn_string_create_empty(pool);
- svn_ra_serf__set_prop(dir->removed_props, proppatch_target,
- ns, name, value, dir->pool);
- }
+ prop->name = apr_pstrdup(dir->pool, name);
+ prop->value = value ? svn_string_dup(value, dir->pool) : NULL;
+
+ svn_hash_sets(dir->prop_changes, prop->name, prop);
return SVN_NO_ERROR;
}
@@ -1753,17 +1662,15 @@ close_directory(void *dir_baton,
*/
/* PROPPATCH our prop change and pass it along. */
- if (apr_hash_count(dir->changed_props) ||
- apr_hash_count(dir->removed_props))
+ if (apr_hash_count(dir->prop_changes))
{
proppatch_context_t *proppatch_ctx;
proppatch_ctx = apr_pcalloc(pool, sizeof(*proppatch_ctx));
proppatch_ctx->pool = pool;
- proppatch_ctx->commit_ctx = dir->commit_ctx;
+ proppatch_ctx->commit_ctx = NULL /* No lock tokens necessary */;
proppatch_ctx->relpath = dir->relpath;
- proppatch_ctx->changed_props = dir->changed_props;
- proppatch_ctx->removed_props = dir->removed_props;
+ proppatch_ctx->prop_changes = dir->prop_changes;
proppatch_ctx->base_revision = dir->base_revision;
if (USING_HTTPV2_COMMIT_SUPPORT(dir->commit_ctx))
@@ -1809,8 +1716,7 @@ add_file(const char *path,
new_file->base_revision = SVN_INVALID_REVNUM;
new_file->copy_path = apr_pstrdup(new_file->pool, copy_path);
new_file->copy_revision = copy_revision;
- new_file->changed_props = apr_hash_make(new_file->pool);
- new_file->removed_props = apr_hash_make(new_file->pool);
+ new_file->prop_changes = apr_hash_make(new_file->pool);
/* Ensure that the file doesn't exist by doing a HEAD on the
resource. If we're using HTTP v2, we'll just look into the
@@ -1933,8 +1839,7 @@ open_file(const char *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);
- new_file->removed_props = apr_hash_make(new_file->pool);
+ new_file->prop_changes = apr_hash_make(new_file->pool);
if (USING_HTTPV2_COMMIT_SUPPORT(parent->commit_ctx))
{
@@ -2008,30 +1913,14 @@ change_file_prop(void *file_baton,
apr_pool_t *pool)
{
file_context_t *file = file_baton;
- const char *ns;
+ svn_prop_t *prop;
- if (strncmp(name, SVN_PROP_PREFIX, sizeof(SVN_PROP_PREFIX) - 1) == 0)
- {
- ns = SVN_DAV_PROP_NS_SVN;
- name += sizeof(SVN_PROP_PREFIX) - 1;
- }
- else
- {
- ns = SVN_DAV_PROP_NS_CUSTOM;
- }
+ prop = apr_palloc(file->pool, sizeof(*prop));
- if (value)
- {
- svn_ra_serf__set_prop(file->changed_props, file->url,
- ns, name, value, file->pool);
- }
- else
- {
- value = svn_string_create_empty(pool);
+ prop->name = apr_pstrdup(file->pool, name);
+ prop->value = value ? svn_string_dup(value, file->pool) : NULL;
- svn_ra_serf__set_prop(file->removed_props, file->url,
- ns, name, value, file->pool);
- }
+ svn_hash_sets(file->prop_changes, prop->name, prop);
return SVN_NO_ERROR;
}
@@ -2099,8 +1988,7 @@ close_file(void *file_baton,
SVN_ERR(svn_io_file_close(ctx->svndiff, scratch_pool));
/* If we had any prop changes, push them via PROPPATCH. */
- if (apr_hash_count(ctx->changed_props) ||
- apr_hash_count(ctx->removed_props))
+ if (apr_hash_count(ctx->prop_changes))
{
proppatch_context_t *proppatch;
@@ -2109,8 +1997,7 @@ close_file(void *file_baton,
proppatch->relpath = ctx->relpath;
proppatch->path = ctx->url;
proppatch->commit_ctx = ctx->commit_ctx;
- proppatch->changed_props = ctx->changed_props;
- proppatch->removed_props = ctx->removed_props;
+ proppatch->prop_changes = ctx->prop_changes;
proppatch->base_revision = ctx->base_revision;
SVN_ERR(proppatch_resource(ctx->commit_ctx->session,
@@ -2311,9 +2198,9 @@ svn_ra_serf__change_rev_prop(svn_ra_sess
svn_ra_serf__session_t *session = ra_session->priv;
proppatch_context_t *proppatch_ctx;
const char *proppatch_target;
- const char *ns;
const svn_string_t *tmp_old_value;
svn_boolean_t atomic_capable = FALSE;
+ svn_prop_t *prop;
svn_error_t *err;
if (old_value_p || !value)
@@ -2365,57 +2252,30 @@ svn_ra_serf__change_rev_prop(svn_ra_sess
pool, pool));
}
- if (strncmp(name, SVN_PROP_PREFIX, sizeof(SVN_PROP_PREFIX) - 1) == 0)
- {
- ns = SVN_DAV_PROP_NS_SVN;
- name += sizeof(SVN_PROP_PREFIX) - 1;
- }
- else
- {
- ns = SVN_DAV_PROP_NS_CUSTOM;
- }
-
/* PROPPATCH our log message and pass it along. */
proppatch_ctx = apr_pcalloc(pool, sizeof(*proppatch_ctx));
proppatch_ctx->pool = pool;
proppatch_ctx->commit_ctx = NULL; /* No lock headers */
proppatch_ctx->path = proppatch_target;
- proppatch_ctx->changed_props = apr_hash_make(pool);
- proppatch_ctx->removed_props = apr_hash_make(pool);
- if (old_value_p)
- {
- proppatch_ctx->previous_changed_props = apr_hash_make(pool);
- proppatch_ctx->previous_removed_props = apr_hash_make(pool);
- }
+ proppatch_ctx->prop_changes = apr_hash_make(pool);
proppatch_ctx->base_revision = SVN_INVALID_REVNUM;
- if (old_value_p && *old_value_p)
- {
- svn_ra_serf__set_prop(proppatch_ctx->previous_changed_props,
- proppatch_ctx->path,
- ns, name, *old_value_p, pool);
- }
- else if (old_value_p)
+ if (old_value_p)
{
- svn_string_t *dummy_value = svn_string_create_empty(pool);
+ prop = apr_palloc(pool, sizeof (*prop));
- svn_ra_serf__set_prop(proppatch_ctx->previous_removed_props,
- proppatch_ctx->path,
- ns, name, dummy_value, pool);
- }
+ prop->name = name;
+ prop->value = *old_value_p;
- if (value)
- {
- svn_ra_serf__set_prop(proppatch_ctx->changed_props, proppatch_ctx->path,
- ns, name, value, pool);
+ proppatch_ctx->old_props = apr_hash_make(pool);
+ svn_hash_sets(proppatch_ctx->old_props, prop->name, prop);
}
- else
- {
- value = svn_string_create_empty(pool);
- svn_ra_serf__set_prop(proppatch_ctx->removed_props, proppatch_ctx->path,
- ns, name, value, pool);
- }
+ prop = apr_palloc(pool, sizeof (*prop));
+
+ prop->name = name;
+ prop->value = value;
+ svn_hash_sets(proppatch_ctx->prop_changes, prop->name, prop);
err = proppatch_resource(session,
session->conns[0],
Modified: subversion/branches/pin-externals/subversion/libsvn_ra_serf/get_deleted_rev.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/get_deleted_rev.c?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/get_deleted_rev.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/get_deleted_rev.c Sat Jan 24 19:42:21 2015
@@ -92,7 +92,8 @@ static svn_error_t *
create_getdrev_body(serf_bucket_t **body_bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
serf_bucket_t *buckets;
drev_context_t *drev_ctx = baton;
Modified: subversion/branches/pin-externals/subversion/libsvn_ra_serf/get_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/get_file.c?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/get_file.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/get_file.c Sat Jan 24 19:42:21 2015
@@ -83,7 +83,8 @@ typedef struct stream_ctx_t {
static svn_error_t *
headers_fetch(serf_bucket_t *headers,
void *baton,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
stream_ctx_t *fetch_ctx = baton;
Modified: subversion/branches/pin-externals/subversion/libsvn_ra_serf/get_lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/get_lock.c?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/get_lock.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/get_lock.c Sat Jan 24 19:42:21 2015
@@ -232,7 +232,8 @@ static svn_error_t *
create_getlock_body(serf_bucket_t **body_bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
serf_bucket_t *buckets;
@@ -255,7 +256,8 @@ create_getlock_body(serf_bucket_t **body
static svn_error_t*
setup_getlock_headers(serf_bucket_t *headers,
void *baton,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
serf_bucket_headers_setn(headers, "Depth", "0");
Modified: subversion/branches/pin-externals/subversion/libsvn_ra_serf/getdate.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/getdate.c?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/getdate.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/getdate.c Sat Jan 24 19:42:21 2015
@@ -100,7 +100,8 @@ static svn_error_t *
create_getdate_body(serf_bucket_t **body_bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
serf_bucket_t *buckets;
date_context_t *date_ctx = baton;
Modified: subversion/branches/pin-externals/subversion/libsvn_ra_serf/getlocations.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/getlocations.c?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/getlocations.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/getlocations.c Sat Jan 24 19:42:21 2015
@@ -114,7 +114,8 @@ static svn_error_t *
create_get_locations_body(serf_bucket_t **body_bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
serf_bucket_t *buckets;
loc_context_t *loc_ctx = baton;
Modified: subversion/branches/pin-externals/subversion/libsvn_ra_serf/getlocationsegments.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/getlocationsegments.c?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/getlocationsegments.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/getlocationsegments.c Sat Jan 24 19:42:21 2015
@@ -114,7 +114,8 @@ static svn_error_t *
create_gls_body(serf_bucket_t **body_bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
serf_bucket_t *buckets;
gls_context_t *gls_ctx = baton;
Modified: subversion/branches/pin-externals/subversion/libsvn_ra_serf/getlocks.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/getlocks.c?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/getlocks.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/getlocks.c Sat Jan 24 19:42:21 2015
@@ -213,7 +213,8 @@ static svn_error_t *
create_getlocks_body(serf_bucket_t **body_bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
lock_context_t *lock_ctx = baton;
serf_bucket_t *buckets;
Modified: subversion/branches/pin-externals/subversion/libsvn_ra_serf/inherited_props.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/inherited_props.c?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/inherited_props.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/inherited_props.c Sat Jan 24 19:42:21 2015
@@ -199,7 +199,8 @@ static svn_error_t *
create_iprops_body(serf_bucket_t **bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
iprops_context_t *iprops_ctx = baton;
serf_bucket_t *body_bkt;
@@ -231,21 +232,6 @@ typedef struct iprop_rq_info_t
svn_ra_serf__handler_t *handler;
} iprop_rq_info_t;
-/* Removes all non regular properties from PROPS */
-static void
-keep_only_regular_props(apr_hash_t *props,
- apr_pool_t *scratch_pool)
-{
- apr_hash_index_t *hi;
-
- for (hi = apr_hash_first(scratch_pool, props); hi; hi = apr_hash_next(hi))
- {
- const char *propname = apr_hash_this_key(hi);
-
- if (svn_property_kind2(propname) != svn_prop_regular_kind)
- svn_hash_sets(props, propname, NULL);
- }
-}
/* Assumes session reparented to the repository root. The old session
root is passed as session_url */
@@ -294,10 +280,12 @@ get_iprops_via_more_requests(svn_ra_sess
revision,
scratch_pool, scratch_pool));
- SVN_ERR(svn_ra_serf__deliver_props(&rq->handler, rq->props, session,
- session->conns[0], rq->urlpath,
- rev_marker, "0", all_props,
- scratch_pool));
+ SVN_ERR(svn_ra_serf__deliver_props2(&rq->handler, session,
+ session->conns[0], rq->urlpath,
+ rev_marker, "0", all_props,
+ svn_ra_serf__deliver_svn_props,
+ rq->props,
+ scratch_pool));
/* Allow ignoring authz problems */
rq->handler->no_fail_on_http_failure_status = TRUE;
@@ -335,29 +323,18 @@ get_iprops_via_more_requests(svn_ra_sess
apr_hash_t *node_props;
svn_prop_inherited_item_t *new_iprop;
- if (rq->handler->sline.code >= 400 && rq->handler->sline.code != 403)
+ if (rq->handler->sline.code != 207 && rq->handler->sline.code != 403)
{
- return svn_error_trace(
- svn_ra_serf__error_on_status(rq->handler->sline,
- rq->handler->path,
- rq->handler->location));
- }
-
- /* Obtain the real properties from the double hash */
- node_props = apr_hash_get(rq->props, &rev_marker, sizeof(rev_marker));
-
- if (!node_props)
- continue;
+ if (rq->handler->server_error)
+ SVN_ERR(svn_ra_serf__server_error_create(rq->handler,
+ scratch_pool));
- node_props = svn_hash_gets(node_props, rq->urlpath);
-
- if (!node_props)
- continue;
+ return svn_error_trace(svn_ra_serf__unexpected_status(rq->handler));
+ }
- SVN_ERR(svn_ra_serf__flatten_props(&node_props, node_props,
- scratch_pool, scratch_pool));
+ node_props = rq->props;
- keep_only_regular_props(node_props, scratch_pool);
+ svn_ra_serf__keep_only_regular_props(node_props, scratch_pool);
if (!apr_hash_count(node_props))
continue;
@@ -410,7 +387,6 @@ svn_ra_serf__get_inherited_props(svn_ra_
scratch_pool));
}
- /* For now, use implementation in libsvn_ra */
err = get_iprops_via_more_requests(ra_session, iprops, session_uri, path,
revision, result_pool, scratch_pool);
Modified: subversion/branches/pin-externals/subversion/libsvn_ra_serf/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/lock.c?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/lock.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/lock.c Sat Jan 24 19:42:21 2015
@@ -191,7 +191,8 @@ locks_closed(svn_ra_serf__xml_estate_t *
static svn_error_t *
set_lock_headers(serf_bucket_t *headers,
void *baton,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
lock_ctx_t *lock_ctx = baton;
@@ -399,7 +400,8 @@ static svn_error_t *
create_lock_body(serf_bucket_t **body_bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
lock_ctx_t *ctx = baton;
serf_bucket_t *buckets;
@@ -528,7 +530,8 @@ svn_ra_serf__lock(svn_ra_session_t *ra_s
static svn_error_t *
set_unlock_headers(serf_bucket_t *headers,
void *baton,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
lock_ctx_t *ctx = baton;
Modified: subversion/branches/pin-externals/subversion/libsvn_ra_serf/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/log.c?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/log.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/log.c Sat Jan 24 19:42:21 2015
@@ -412,7 +412,8 @@ static svn_error_t *
create_log_body(serf_bucket_t **body_bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
serf_bucket_t *buckets;
log_context_t *log_ctx = baton;
Modified: subversion/branches/pin-externals/subversion/libsvn_ra_serf/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/merge.c?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/merge.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/merge.c Sat Jan 24 19:42:21 2015
@@ -271,7 +271,8 @@ merge_closed(svn_ra_serf__xml_estate_t *
static svn_error_t *
setup_merge_headers(serf_bucket_t *headers,
void *baton,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
merge_context_t *ctx = baton;
@@ -337,7 +338,8 @@ static svn_error_t*
create_merge_body(serf_bucket_t **bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
merge_context_t *ctx = baton;
serf_bucket_t *body_bkt;
Modified: subversion/branches/pin-externals/subversion/libsvn_ra_serf/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/mergeinfo.c?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/mergeinfo.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/mergeinfo.c Sat Jan 24 19:42:21 2015
@@ -135,7 +135,8 @@ static svn_error_t *
create_mergeinfo_body(serf_bucket_t **bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
mergeinfo_context_t *mergeinfo_ctx = baton;
serf_bucket_t *body_bkt;
Modified: subversion/branches/pin-externals/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/options.c?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/options.c Sat Jan 24 19:42:21 2015
@@ -116,7 +116,8 @@ static svn_error_t *
create_options_body(serf_bucket_t **body_bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
serf_bucket_t *body;
body = serf_bucket_aggregate_create(alloc);
@@ -525,7 +526,8 @@ static svn_error_t *
create_simple_options_body(serf_bucket_t **body_bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
serf_bucket_t *body;
serf_bucket_t *s;
Modified: subversion/branches/pin-externals/subversion/libsvn_ra_serf/property.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/property.c?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/property.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/property.c Sat Jan 24 19:42:21 2015
@@ -64,8 +64,7 @@ typedef struct propfind_context_t {
/* the requested path */
const char *path;
- /* the requested version (number and string form) */
- svn_revnum_t rev;
+ /* the requested version (in string form) */
const char *label;
/* the request depth */
@@ -169,6 +168,29 @@ propfind_opened(svn_ra_serf__xml_estate_
return SVN_NO_ERROR;
}
+/* Set PROPS for NS:NAME VAL. Helper for propfind_closed */
+static void
+set_ns_prop(apr_hash_t *ns_props,
+ const char *ns, const char *name,
+ const svn_string_t *val, apr_pool_t *result_pool)
+{
+ apr_hash_t *props = svn_hash_gets(ns_props, ns);
+
+ if (!props)
+ {
+ props = apr_hash_make(result_pool);
+ ns = apr_pstrdup(result_pool, ns);
+ svn_hash_sets(ns_props, ns, props);
+ }
+
+ if (val)
+ {
+ name = apr_pstrdup(result_pool, name);
+ val = svn_string_dup(val, result_pool);
+ }
+
+ svn_hash_sets(props, name, val);
+}
/* Conforms to svn_ra_serf__xml_closed_t */
static svn_error_t *
@@ -226,8 +248,6 @@ propfind_closed(svn_ra_serf__xml_estate_
{
const char *encoding;
const svn_string_t *val_str;
- apr_hash_t *gathered;
- const char *path;
const char *ns;
const char *name;
const char *altvalue;
@@ -253,9 +273,7 @@ propfind_closed(svn_ra_serf__xml_estate_
val_str = cdata;
}
- /* The current path sits on the RESPONSE state. Gather up all the
- state from this PROPVAL to the (grandparent) RESPONSE state,
- and grab the path from there.
+ /* The current path sits on the RESPONSE state.
Now, it would be nice if we could, at this point, know that
the status code for this property indicated a problem -- then
@@ -265,19 +283,12 @@ propfind_closed(svn_ra_serf__xml_estate_
here, setting the property and value as expected. Once we
know for sure the status code associate with the property,
we'll decide its fate. */
- gathered = svn_ra_serf__xml_gather_since(xes, RESPONSE);
-
- /* These will be dup'd into CTX->POOL, as necessary. */
- path = svn_hash_gets(gathered, "path");
- if (path == NULL)
- path = ctx->path;
ns = svn_hash_gets(attrs, "ns");
name = svn_hash_gets(attrs, "name");
- svn_ra_serf__set_ver_prop(ctx->ps_props,
- path, ctx->rev, ns, name, val_str,
- apr_hash_pool_get(ctx->ps_props));
+ set_ns_prop(ctx->ps_props, ns, name, val_str,
+ apr_hash_pool_get(ctx->ps_props));
}
else
{
@@ -285,153 +296,60 @@ propfind_closed(svn_ra_serf__xml_estate_
SVN_ERR_ASSERT(leaving_state == PROPSTAT);
- gathered = svn_ra_serf__xml_gather_since(xes, PROPSTAT);
+ gathered = svn_ra_serf__xml_gather_since(xes, RESPONSE);
/* If we've squirreled away a note that says we want to ignore
these properties, we'll do so. Otherwise, we need to copy
them from the temporary hash into the ctx->ret_props hash. */
if (! svn_hash_gets(gathered, "ignore-prop"))
{
- SVN_ERR(svn_ra_serf__walk_all_paths(ctx->ps_props, ctx->rev,
- ctx->prop_func,
- ctx->prop_func_baton,
- scratch_pool));
- }
-
- ctx->ps_props = NULL; /* Allocated in PROPSTAT state pool */
- }
+ apr_hash_index_t *hi_ns;
+ const char *path;
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
- return SVN_NO_ERROR;
-}
-
-
-const svn_string_t *
-svn_ra_serf__get_ver_prop_string(apr_hash_t *props,
- const char *path,
- svn_revnum_t rev,
- const char *ns,
- const char *name)
-{
- apr_hash_t *ver_props, *path_props, *ns_props;
- void *val = NULL;
-
- ver_props = apr_hash_get(props, &rev, sizeof(rev));
- if (ver_props)
- {
- path_props = svn_hash_gets(ver_props, path);
- if (path_props)
- {
- ns_props = svn_hash_gets(path_props, ns);
- if (ns_props)
+ path = svn_hash_gets(gathered, "path");
+ if (!path)
+ path = ctx->path;
+
+ for (hi_ns = apr_hash_first(scratch_pool, ctx->ps_props);
+ hi_ns;
+ hi_ns = apr_hash_next(hi_ns))
{
- val = svn_hash_gets(ns_props, name);
+ const char *ns = apr_hash_this_key(hi_ns);
+ apr_hash_t *props = apr_hash_this_val(hi_ns);
+ apr_hash_index_t *hi_prop;
+
+ svn_pool_clear(iterpool);
+
+ for (hi_prop = apr_hash_first(iterpool, props);
+ hi_prop;
+ hi_prop = apr_hash_next(hi_prop))
+ {
+ const char *name = apr_hash_this_key(hi_prop);
+ const svn_string_t *value = apr_hash_this_val(hi_prop);
+
+ SVN_ERR(ctx->prop_func(ctx->prop_func_baton, path,
+ ns, name, value, iterpool));
+ }
}
- }
- }
-
- return val;
-}
-
-const char *
-svn_ra_serf__get_ver_prop(apr_hash_t *props,
- const char *path,
- svn_revnum_t rev,
- const char *ns,
- const char *name)
-{
- const svn_string_t *val;
-
- val = svn_ra_serf__get_ver_prop_string(props, path, rev, ns, name);
-
- if (val)
- {
- return val->data;
- }
-
- return NULL;
-}
-
-const svn_string_t *
-svn_ra_serf__get_prop_string(apr_hash_t *props,
- const char *path,
- const char *ns,
- const char *name)
-{
- return svn_ra_serf__get_ver_prop_string(props, path, SVN_INVALID_REVNUM,
- ns, name);
-}
-
-const char *
-svn_ra_serf__get_prop(apr_hash_t *props,
- const char *path,
- const char *ns,
- const char *name)
-{
- return svn_ra_serf__get_ver_prop(props, path, SVN_INVALID_REVNUM, ns, name);
-}
-void
-svn_ra_serf__set_ver_prop(apr_hash_t *props,
- const char *path, svn_revnum_t rev,
- const char *ns, const char *name,
- const svn_string_t *val, apr_pool_t *pool)
-{
- apr_hash_t *ver_props, *path_props, *ns_props;
-
- ver_props = apr_hash_get(props, &rev, sizeof(rev));
- if (!ver_props)
- {
- ver_props = apr_hash_make(pool);
- apr_hash_set(props, apr_pmemdup(pool, &rev, sizeof(rev)), sizeof(rev),
- ver_props);
- }
-
- path_props = svn_hash_gets(ver_props, path);
-
- if (!path_props)
- {
- path_props = apr_hash_make(pool);
- path = apr_pstrdup(pool, path);
- svn_hash_sets(ver_props, path, path_props);
-
- /* todo: we know that we'll fail the next check, but fall through
- * for now for simplicity's sake.
- */
- }
-
- ns_props = svn_hash_gets(path_props, ns);
- if (!ns_props)
- {
- ns_props = apr_hash_make(pool);
- ns = apr_pstrdup(pool, ns);
- svn_hash_sets(path_props, ns, ns_props);
- }
+ svn_pool_destroy(iterpool);
+ }
- if (val)
- {
- name = apr_pstrdup(pool, name);
- val = svn_string_dup(val, pool);
+ ctx->ps_props = NULL; /* Allocated in PROPSTAT state pool */
}
- svn_hash_sets(ns_props, name, val);
+ return SVN_NO_ERROR;
}
-void
-svn_ra_serf__set_prop(apr_hash_t *props,
- const char *path,
- const char *ns, const char *name,
- const svn_string_t *val, apr_pool_t *pool)
-{
- svn_ra_serf__set_ver_prop(props, path, SVN_INVALID_REVNUM, ns, name,
- val, pool);
-}
static svn_error_t *
setup_propfind_headers(serf_bucket_t *headers,
- void *setup_baton,
- apr_pool_t *pool)
+ void *setup_baton,
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
propfind_context_t *ctx = setup_baton;
@@ -452,7 +370,8 @@ static svn_error_t *
create_propfind_body(serf_bucket_t **bkt,
void *setup_baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *pool)
+ apr_pool_t *pool /* request pool */,
+ apr_pool_t *scratch_pool)
{
propfind_context_t *ctx = setup_baton;
@@ -549,7 +468,6 @@ svn_ra_serf__deliver_props2(svn_ra_serf_
new_prop_ctx->prop_func = prop_func;
new_prop_ctx->prop_func_baton = prop_func_baton;
new_prop_ctx->depth = depth;
- new_prop_ctx->rev = rev;
if (SVN_IS_VALID_REVNUM(rev))
{
@@ -588,58 +506,54 @@ svn_ra_serf__deliver_props2(svn_ra_serf_
return SVN_NO_ERROR;
}
-/* Baton for deliver_prop */
-struct deliver_prop_baton_t
+svn_error_t *
+svn_ra_serf__deliver_svn_props(void *baton,
+ const char *path,
+ const char *ns,
+ const char *name,
+ const svn_string_t *value,
+ apr_pool_t *scratch_pool)
{
- apr_pool_t *result_pool;
- apr_hash_t *prop_vals;
- svn_revnum_t rev;
-};
+ apr_hash_t *props = baton;
+ apr_pool_t *result_pool = apr_hash_pool_get(props);
+ const char *prop_name;
+
+ prop_name = svn_ra_serf__svnname_from_wirename(ns, name, result_pool);
+ if (prop_name == NULL)
+ return SVN_NO_ERROR;
+
+ svn_hash_sets(props, prop_name, svn_string_dup(value, result_pool));
-/* Implements svn_ra_serf__prop_func for svn_ra_serf__deliver_props */
-static svn_error_t *
-deliver_prop(void *baton,
- const char *path,
- const char *ns,
- const char *name,
- const svn_string_t *value,
- apr_pool_t *scratch_pool)
-{
- struct deliver_prop_baton_t *dpb = baton;
-
- svn_ra_serf__set_ver_prop(dpb->prop_vals,
- path, dpb->rev,
- ns, name, value,
- dpb->result_pool);
return SVN_NO_ERROR;
}
svn_error_t *
-svn_ra_serf__deliver_props(svn_ra_serf__handler_t **propfind_handler,
- apr_hash_t *prop_vals,
- svn_ra_serf__session_t *sess,
- svn_ra_serf__connection_t *conn,
- const char *url,
- svn_revnum_t rev,
- const char *depth,
- const svn_ra_serf__dav_props_t *lookup_props,
- apr_pool_t *pool)
-{
- struct deliver_prop_baton_t *dpb = apr_pcalloc(pool, sizeof(*dpb));
-
- dpb->result_pool = apr_hash_pool_get(prop_vals);
- dpb->prop_vals = prop_vals;
- dpb->rev = rev;
-
- return svn_error_trace(svn_ra_serf__deliver_props2(propfind_handler,
- sess, conn,
- url, rev,
- depth,
- lookup_props,
- deliver_prop, dpb,
- pool));
-}
+svn_ra_serf__deliver_node_props(void *baton,
+ const char *path,
+ const char *ns,
+ const char *name,
+ const svn_string_t *value,
+ apr_pool_t *scratch_pool)
+{
+ apr_hash_t *nss = baton;
+ apr_hash_t *props;
+ apr_pool_t *result_pool = apr_hash_pool_get(nss);
+
+ props = svn_hash_gets(nss, ns);
+
+ if (!props)
+ {
+ props = apr_hash_make(result_pool);
+ ns = apr_pstrdup(result_pool, ns);
+ svn_hash_sets(nss, ns, props);
+ }
+
+ name = apr_pstrdup(result_pool, name);
+ svn_hash_sets(props, name, svn_string_dup(value, result_pool));
+
+ return SVN_NO_ERROR;
+}
/*
@@ -658,32 +572,6 @@ svn_ra_serf__wait_for_props(svn_ra_serf_
return SVN_NO_ERROR;
}
-/*
- * This is a blocking version of deliver_props.
- */
-svn_error_t *
-svn_ra_serf__retrieve_props(apr_hash_t **results,
- svn_ra_serf__session_t *sess,
- svn_ra_serf__connection_t *conn,
- const char *url,
- svn_revnum_t rev,
- const char *depth,
- const svn_ra_serf__dav_props_t *props,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- svn_ra_serf__handler_t *handler;
-
- *results = apr_hash_make(result_pool);
-
- SVN_ERR(svn_ra_serf__deliver_props(&handler, *results, sess, conn, url,
- rev, depth, props, result_pool));
- SVN_ERR(svn_ra_serf__wait_for_props(handler, scratch_pool));
-
- return SVN_NO_ERROR;
-}
-
-
svn_error_t *
svn_ra_serf__fetch_node_props(apr_hash_t **results,
svn_ra_serf__connection_t *conn,
@@ -693,28 +581,19 @@ svn_ra_serf__fetch_node_props(apr_hash_t
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
- apr_hash_t *multiprops;
- apr_hash_t *ver_props;
+ apr_hash_t *props;
+ svn_ra_serf__handler_t *handler;
- /* Note: a couple extra hash tables and whatnot get into RESULT_POOL.
- Not a big deal at this point. Theoretically, we could fetch all
- props into SCRATCH_POOL, then copy just the REVISION/URL props
- into RESULT_POOL. Too much work for too little gain... */
- SVN_ERR(svn_ra_serf__retrieve_props(&multiprops, conn->session, conn,
- url, revision, "0", which_props,
- result_pool, scratch_pool));
+ props = apr_hash_make(result_pool);
- ver_props = apr_hash_get(multiprops, &revision, sizeof(revision));
- if (ver_props != NULL)
- {
- *results = svn_hash_gets(ver_props, url);
- if (*results != NULL)
- return SVN_NO_ERROR;
- }
+ SVN_ERR(svn_ra_serf__deliver_props2(&handler, conn->session, conn,
+ url, revision, "0", which_props,
+ svn_ra_serf__deliver_node_props, props,
+ scratch_pool));
+ SVN_ERR(svn_ra_serf__wait_for_props(handler, scratch_pool));
- return svn_error_create(SVN_ERR_RA_DAV_PROPS_NOT_FOUND, NULL,
- _("The PROPFIND response did not include "
- "the requested properties"));
+ *results = props;
+ return SVN_NO_ERROR;
}
@@ -761,79 +640,6 @@ svn_ra_serf__walk_node_props(apr_hash_t
}
-svn_error_t *
-svn_ra_serf__walk_all_props(apr_hash_t *props,
- const char *name,
- svn_revnum_t rev,
- svn_ra_serf__walker_visitor_t walker,
- void *baton,
- apr_pool_t *scratch_pool)
-{
- apr_hash_t *ver_props;
- apr_hash_t *path_props;
-
- ver_props = apr_hash_get(props, &rev, sizeof(rev));
- if (!ver_props)
- return SVN_NO_ERROR;
-
- path_props = svn_hash_gets(ver_props, name);
- if (!path_props)
- return SVN_NO_ERROR;
-
- return svn_error_trace(svn_ra_serf__walk_node_props(path_props,
- walker, baton,
- scratch_pool));
-}
-
-
-svn_error_t *
-svn_ra_serf__walk_all_paths(apr_hash_t *props,
- svn_revnum_t rev,
- svn_ra_serf__path_rev_walker_t walker,
- void *baton,
- apr_pool_t *pool)
-{
- apr_hash_index_t *path_hi;
- apr_hash_t *ver_props;
-
- ver_props = apr_hash_get(props, &rev, sizeof(rev));
-
- if (!ver_props)
- {
- return SVN_NO_ERROR;
- }
-
- for (path_hi = apr_hash_first(pool, ver_props); path_hi;
- path_hi = apr_hash_next(path_hi))
- {
- void *path_props;
- const void *path_name;
- apr_hash_index_t *ns_hi;
-
- apr_hash_this(path_hi, &path_name, NULL, &path_props);
- for (ns_hi = apr_hash_first(pool, path_props); ns_hi;
- ns_hi = apr_hash_next(ns_hi))
- {
- void *ns_val;
- const void *ns_name;
- apr_hash_index_t *name_hi;
- apr_hash_this(ns_hi, &ns_name, NULL, &ns_val);
- for (name_hi = apr_hash_first(pool, ns_val); name_hi;
- name_hi = apr_hash_next(name_hi))
- {
- void *prop_val;
- const void *prop_name;
-
- apr_hash_this(name_hi, &prop_name, NULL, &prop_val);
- /* use a subpool? */
- SVN_ERR(walker(baton, path_name, ns_name, prop_name, prop_val,
- pool));
- }
- }
- }
-
- return SVN_NO_ERROR;
-}
const char *
@@ -917,58 +723,6 @@ svn_ra_serf__flatten_props(apr_hash_t **
scratch_pool));
}
-
-static svn_error_t *
-select_revprops(void *baton,
- const char *ns,
- const char *name,
- const svn_string_t *val,
- apr_pool_t *scratch_pool)
-{
- apr_hash_t *revprops = baton;
- apr_pool_t *result_pool = apr_hash_pool_get(revprops);
- const char *prop_name;
-
- /* ### copy NAME into the RESULT_POOL? */
- /* ### copy VAL into the RESULT_POOL? */
-
- if (strcmp(ns, SVN_DAV_PROP_NS_CUSTOM) == 0)
- prop_name = name;
- else if (strcmp(ns, SVN_DAV_PROP_NS_SVN) == 0)
- prop_name = apr_pstrcat(result_pool, SVN_PROP_PREFIX, name, SVN_VA_NULL);
- else if (strcmp(ns, SVN_PROP_PREFIX) == 0)
- prop_name = apr_pstrcat(result_pool, SVN_PROP_PREFIX, name, SVN_VA_NULL);
- else if (strcmp(ns, "") == 0)
- prop_name = name;
- else
- {
- /* do nothing for now? */
- return SVN_NO_ERROR;
- }
-
- svn_hash_sets(revprops, prop_name, val);
-
- return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
-svn_ra_serf__select_revprops(apr_hash_t **revprops,
- const char *name,
- svn_revnum_t rev,
- apr_hash_t *all_revprops,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- *revprops = apr_hash_make(result_pool);
-
- return svn_error_trace(svn_ra_serf__walk_all_props(
- all_revprops, name, rev,
- select_revprops, *revprops,
- scratch_pool));
-}
-
-
/*
* Contact the server (using CONN) to calculate baseline
* information for BASELINE_URL at REVISION (which may be
@@ -1276,3 +1030,19 @@ svn_ra_serf__fetch_dav_prop(const char *
return SVN_NO_ERROR;
}
+
+/* Removes all non regular properties from PROPS */
+void
+svn_ra_serf__keep_only_regular_props(apr_hash_t *props,
+ apr_pool_t *scratch_pool)
+{
+ apr_hash_index_t *hi;
+
+ for (hi = apr_hash_first(scratch_pool, props); hi; hi = apr_hash_next(hi))
+ {
+ const char *propname = apr_hash_this_key(hi);
+
+ if (svn_property_kind2(propname) != svn_prop_regular_kind)
+ svn_hash_sets(props, propname, NULL);
+ }
+}
Modified: subversion/branches/pin-externals/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/ra_serf.h?rev=1654574&r1=1654573&r2=1654574&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/ra_serf.h Sat Jan 24 19:42:21 2015
@@ -382,19 +382,19 @@ typedef svn_error_t *
apr_pool_t *scratch_pool);
/* Callback for when a request body is needed. */
-/* ### should pass a scratch_pool */
typedef svn_error_t *
(*svn_ra_serf__request_body_delegate_t)(serf_bucket_t **body_bkt,
void *baton,
serf_bucket_alloc_t *alloc,
- apr_pool_t *request_pool);
+ apr_pool_t *request_pool,
+ apr_pool_t *scratch_pool);
/* Callback for when request headers are needed. */
-/* ### should pass a scratch_pool */
typedef svn_error_t *
(*svn_ra_serf__request_header_delegate_t)(serf_bucket_t *headers,
void *baton,
- apr_pool_t *request_pool);
+ apr_pool_t *request_pool,
+ apr_pool_t *scratch_pool);
/* Callback for when a response has an error. */
typedef svn_error_t *
@@ -916,6 +916,12 @@ svn_ra_serf__add_cdata_len_buckets(serf_
/** PROPFIND-related functions **/
+/* Removes all non regular properties from PROPS */
+void
+svn_ra_serf__keep_only_regular_props(apr_hash_t *props,
+ apr_pool_t *scratch_pool);
+
+
/* Callback used via svn_ra_serf__deliver_props2 */
typedef svn_error_t *
(*svn_ra_serf__prop_func)(void *baton,
@@ -926,23 +932,29 @@ typedef svn_error_t *
apr_pool_t *scratch_pool);
/*
- * This function will deliver a PROP_CTX PROPFIND request in the SESS
- * serf context for the properties listed in LOOKUP_PROPS at URL for
- * DEPTH ("0","1","infinity").
- *
- * This function will not block waiting for the response. Callers are
- * expected to call svn_ra_serf__wait_for_props().
+ * Implementation of svn_ra_serf__prop_func that just delivers svn compatible
+ * properties in the apr_hash_t * that is used as baton.
*/
svn_error_t *
-svn_ra_serf__deliver_props(svn_ra_serf__handler_t **propfind_handler,
- apr_hash_t *prop_vals,
- svn_ra_serf__session_t *sess,
- svn_ra_serf__connection_t *conn,
- const char *url,
- svn_revnum_t rev,
- const char *depth,
- const svn_ra_serf__dav_props_t *lookup_props,
- apr_pool_t *pool);
+svn_ra_serf__deliver_svn_props(void *baton,
+ const char *path,
+ const char *ns,
+ const char *name,
+ const svn_string_t *value,
+ apr_pool_t *scratch_pool);
+
+/*
+ * Implementation of svn_ra_serf__prop_func that delivers all DAV properties
+ * in (const char * -> apr_hash_t *) on Namespace pointing to a second hash
+ * (const char * -> svn_string_t *) to the values.
+ */
+svn_error_t *
+svn_ra_serf__deliver_node_props(void *baton,
+ const char *path,
+ const char *ns,
+ const char *name,
+ const svn_string_t *value,
+ apr_pool_t *scratch_pool);
/*
@@ -972,26 +984,6 @@ svn_error_t *
svn_ra_serf__wait_for_props(svn_ra_serf__handler_t *handler,
apr_pool_t *scratch_pool);
-/* This is a blocking version of deliver_props.
-
- The properties are fetched and placed into RESULTS, allocated in
- RESULT_POOL.
-
- ### more docco about the other params.
-
- Temporary allocations are made in SCRATCH_POOL.
-*/
-svn_error_t *
-svn_ra_serf__retrieve_props(apr_hash_t **results,
- svn_ra_serf__session_t *sess,
- svn_ra_serf__connection_t *conn,
- const char *url,
- svn_revnum_t rev,
- const char *depth,
- const svn_ra_serf__dav_props_t *props,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
/* Using CONN, fetch the properties specified by WHICH_PROPS using CONN
for URL at REVISION. The resulting properties are placed into a 2-level
@@ -1036,17 +1028,6 @@ svn_ra_serf__fetch_dav_prop(const char *
apr_pool_t *scratch_pool);
-/* Set PROPS for PATH at REV revision with a NS:NAME VAL.
- *
- * The POOL governs allocation.
- */
-void
-svn_ra_serf__set_ver_prop(apr_hash_t *props,
- const char *path, svn_revnum_t rev,
- const char *ns, const char *name,
- const svn_string_t *val, apr_pool_t *pool);
-#define svn_ra_serf__set_rev_prop svn_ra_serf__set_ver_prop
-
/** Property walker functions **/
typedef svn_error_t *
@@ -1056,15 +1037,6 @@ typedef svn_error_t *
const svn_string_t *val,
apr_pool_t *pool);
-svn_error_t *
-svn_ra_serf__walk_all_props(apr_hash_t *props,
- const char *name,
- svn_revnum_t rev,
- svn_ra_serf__walker_visitor_t walker,
- void *baton,
- apr_pool_t *pool);
-
-
/* Like walk_all_props(), but a 2-level hash. */
svn_error_t *
svn_ra_serf__walk_node_props(apr_hash_t *props,
@@ -1073,21 +1045,6 @@ svn_ra_serf__walk_node_props(apr_hash_t
apr_pool_t *scratch_pool);
-typedef svn_error_t *
-(*svn_ra_serf__path_rev_walker_t)(void *baton,
- const char *path,
- const char *ns,
- const char *name,
- const svn_string_t *val,
- apr_pool_t *pool);
-svn_error_t *
-svn_ra_serf__walk_all_paths(apr_hash_t *props,
- svn_revnum_t rev,
- svn_ra_serf__path_rev_walker_t walker,
- void *baton,
- apr_pool_t *pool);
-
-
/* Map a property name, as passed over the wire, into its corresponding
Subversion-internal name. The returned name will be a static value,
or allocated within RESULT_POOL.
@@ -1100,17 +1057,6 @@ svn_ra_serf__svnname_from_wirename(const
apr_pool_t *result_pool);
-/* Select the basic revision properties from the set of "all" properties.
- Return these in *REVPROPS, allocated from RESULT_POOL. */
-svn_error_t *
-svn_ra_serf__select_revprops(apr_hash_t **revprops,
- const char *name,
- svn_revnum_t rev,
- apr_hash_t *all_revprops,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
-
/* PROPS is nested hash tables mapping NS -> NAME -> VALUE.
This function takes the NS:NAME:VALUE hashes and flattens them into a set of
names to VALUE. The names are composed of NS:NAME, with specific
@@ -1129,40 +1075,6 @@ svn_ra_serf__flatten_props(apr_hash_t **
apr_pool_t *scratch_pool);
-/* Return the property value for PATH at REV revision with a NS:NAME.
- * PROPS is a four-level nested hash: (svn_revnum_t => char *path =>
- * char *ns => char *name => svn_string_t *). */
-const svn_string_t *
-svn_ra_serf__get_ver_prop_string(apr_hash_t *props,
- const char *path, svn_revnum_t rev,
- const char *ns, const char *name);
-
-/* Same as svn_ra_serf__get_ver_prop_string(), but returns a C string. */
-const char *
-svn_ra_serf__get_ver_prop(apr_hash_t *props,
- const char *path, svn_revnum_t rev,
- const char *ns, const char *name);
-
-/* Same as svn_ra_serf__get_ver_prop_string(), but for the unknown revision. */
-const svn_string_t *
-svn_ra_serf__get_prop_string(apr_hash_t *props,
- const char *path,
- const char *ns,
- const char *name);
-
-/* Same as svn_ra_serf__get_ver_prop(), but for the unknown revision. */
-const char *
-svn_ra_serf__get_prop(apr_hash_t *props,
- const char *path,
- const char *ns,
- const char *name);
-
-/* Same as svn_ra_serf__set_rev_prop(), but for the unknown revision. */
-void
-svn_ra_serf__set_prop(apr_hash_t *props, const char *path,
- const char *ns, const char *name,
- const svn_string_t *val, apr_pool_t *pool);
-
svn_error_t *
svn_ra_serf__get_resource_type(svn_node_kind_t *kind,
apr_hash_t *props);
@@ -1461,7 +1373,12 @@ svn_ra_serf__get_dated_revision(svn_ra_s
apr_time_t tm,
apr_pool_t *pool);
-/* Implements svn_ra__vtable_t.get_commit_editor(). */
+/* Implements svn_ra__vtable_t.get_commit_editor().
+ *
+ * Note: Like other commit editors, the returned editor requires that the
+ * @c copyfrom_path parameter passed to its @c add_file and @c add_directory
+ * methods is a URL, not a relative path.
+ */
svn_error_t *
svn_ra_serf__get_commit_editor(svn_ra_session_t *session,
const svn_delta_editor_t **editor,