You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by iv...@apache.org on 2014/11/14 14:18:03 UTC
svn commit: r1639628 [18/23] - in /subversion/branches/svn-auth-x509: ./
build/ build/generator/ notes/ notes/api-errata/1.8/ notes/api-errata/1.9/
notes/wc-ng/ subversion/ subversion/bindings/ctypes-python/
subversion/bindings/cxxhl/ subversion/bindin...
Modified: subversion/branches/svn-auth-x509/subversion/libsvn_wc/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_wc/util.c?rev=1639628&r1=1639627&r2=1639628&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_wc/util.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_wc/util.c Fri Nov 14 13:17:55 2014
@@ -188,11 +188,11 @@ svn_wc_match_ignore_list(const char *str
return svn_cstring_match_glob_list(str, list);
}
-svn_wc_conflict_description3_t *
-svn_wc_conflict_description_create_text3(const char *local_abspath,
+svn_wc_conflict_description2_t *
+svn_wc_conflict_description_create_text2(const char *local_abspath,
apr_pool_t *result_pool)
{
- svn_wc_conflict_description3_t *conflict;
+ svn_wc_conflict_description2_t *conflict;
SVN_ERR_ASSERT_NO_RETURN(svn_dirent_is_absolute(local_abspath));
@@ -205,13 +205,13 @@ svn_wc_conflict_description_create_text3
return conflict;
}
-svn_wc_conflict_description3_t *
-svn_wc_conflict_description_create_prop3(const char *local_abspath,
+svn_wc_conflict_description2_t *
+svn_wc_conflict_description_create_prop2(const char *local_abspath,
svn_node_kind_t node_kind,
const char *property_name,
apr_pool_t *result_pool)
{
- svn_wc_conflict_description3_t *conflict;
+ svn_wc_conflict_description2_t *conflict;
SVN_ERR_ASSERT_NO_RETURN(svn_dirent_is_absolute(local_abspath));
@@ -223,8 +223,8 @@ svn_wc_conflict_description_create_prop3
return conflict;
}
-svn_wc_conflict_description3_t *
-svn_wc_conflict_description_create_tree3(
+svn_wc_conflict_description2_t *
+svn_wc_conflict_description_create_tree2(
const char *local_abspath,
svn_node_kind_t node_kind,
svn_wc_operation_t operation,
@@ -232,7 +232,7 @@ svn_wc_conflict_description_create_tree3
const svn_wc_conflict_version_t *src_right_version,
apr_pool_t *result_pool)
{
- svn_wc_conflict_description3_t *conflict;
+ svn_wc_conflict_description2_t *conflict;
SVN_ERR_ASSERT_NO_RETURN(svn_dirent_is_absolute(local_abspath));
@@ -248,12 +248,37 @@ svn_wc_conflict_description_create_tree3
return conflict;
}
+svn_wc_conflict_version_t *
+svn_wc_conflict_version_create2(const char *repos_url,
+ const char *repos_uuid,
+ const char *repos_relpath,
+ svn_revnum_t revision,
+ svn_node_kind_t kind,
+ apr_pool_t *result_pool)
+{
+ svn_wc_conflict_version_t *version;
+
+ version = apr_pcalloc(result_pool, sizeof(*version));
+
+ SVN_ERR_ASSERT_NO_RETURN(svn_uri_is_canonical(repos_url, result_pool)
+ && svn_relpath_is_canonical(repos_relpath)
+ && SVN_IS_VALID_REVNUM(revision)
+ /* ### repos_uuid can be NULL :( */);
+
+ version->repos_url = repos_url;
+ version->peg_rev = revision;
+ version->path_in_repos = repos_relpath;
+ version->node_kind = kind;
+ version->repos_uuid = repos_uuid;
-svn_wc_conflict_description3_t *
-svn_wc__conflict_description3_dup(const svn_wc_conflict_description3_t *conflict,
+ return version;
+}
+
+svn_wc_conflict_description2_t *
+svn_wc_conflict_description2_dup(const svn_wc_conflict_description2_t *conflict,
apr_pool_t *pool)
{
- svn_wc_conflict_description3_t *new_conflict;
+ svn_wc_conflict_description2_t *new_conflict;
new_conflict = apr_pcalloc(pool, sizeof(*new_conflict));
@@ -272,8 +297,8 @@ svn_wc__conflict_description3_dup(const
new_conflict->their_abspath = apr_pstrdup(pool, conflict->their_abspath);
if (conflict->my_abspath)
new_conflict->my_abspath = apr_pstrdup(pool, conflict->my_abspath);
- if (conflict->merged_abspath)
- new_conflict->merged_abspath = apr_pstrdup(pool, conflict->merged_abspath);
+ if (conflict->merged_file)
+ new_conflict->merged_file = apr_pstrdup(pool, conflict->merged_file);
if (conflict->src_left_version)
new_conflict->src_left_version =
svn_wc_conflict_version_dup(conflict->src_left_version, pool);
@@ -281,36 +306,27 @@ svn_wc__conflict_description3_dup(const
new_conflict->src_right_version =
svn_wc_conflict_version_dup(conflict->src_right_version, pool);
- return new_conflict;
-}
-
-svn_wc_conflict_version_t *
-svn_wc_conflict_version_create2(const char *repos_url,
- const char *repos_uuid,
- const char *repos_relpath,
- svn_revnum_t revision,
- svn_node_kind_t kind,
- apr_pool_t *result_pool)
-{
- svn_wc_conflict_version_t *version;
-
- version = apr_pcalloc(result_pool, sizeof(*version));
-
- SVN_ERR_ASSERT_NO_RETURN(svn_uri_is_canonical(repos_url, result_pool)
- && svn_relpath_is_canonical(repos_relpath)
- && SVN_IS_VALID_REVNUM(revision)
- /* ### repos_uuid can be NULL :( */);
-
- version->repos_url = repos_url;
- version->peg_rev = revision;
- version->path_in_repos = repos_relpath;
- version->node_kind = kind;
- version->repos_uuid = repos_uuid;
+ /* ### For property conflicts, cd2 stores prop_reject_abspath in
+ * ### their_abspath, and stores theirs_abspath in merged_file. */
+ if (conflict->prop_reject_abspath)
+ new_conflict->prop_reject_abspath = new_conflict->their_abspath;
+
+ if (conflict->prop_value_base)
+ new_conflict->prop_value_base =
+ svn_string_dup(conflict->prop_value_base, pool);
+ if (conflict->prop_value_working)
+ new_conflict->prop_value_working =
+ svn_string_dup(conflict->prop_value_working, pool);
+ if (conflict->prop_value_incoming_old)
+ new_conflict->prop_value_incoming_old =
+ svn_string_dup(conflict->prop_value_incoming_old, pool);
+ if (conflict->prop_value_incoming_new)
+ new_conflict->prop_value_incoming_new =
+ svn_string_dup(conflict->prop_value_incoming_new, pool);
- return version;
+ return new_conflict;
}
-
svn_wc_conflict_version_t *
svn_wc_conflict_version_dup(const svn_wc_conflict_version_t *version,
apr_pool_t *result_pool)
@@ -339,91 +355,6 @@ svn_wc_conflict_version_dup(const svn_wc
return new_version;
}
-apr_array_header_t *
-svn_wc__cd3_array_to_cd2_array(const apr_array_header_t *conflicts,
- apr_pool_t *result_pool)
-{
- apr_array_header_t *new_conflicts;
- int i;
-
- new_conflicts = apr_array_make(result_pool, conflicts->nelts,
- sizeof (svn_wc_conflict_description2_t *));
-
- for (i = 0; i < conflicts->nelts; i++)
- {
- svn_wc_conflict_description3_t *cd;
- svn_wc_conflict_description2_t *cd2;
-
- cd = APR_ARRAY_IDX(conflicts, i, svn_wc_conflict_description3_t *);
- cd2 = svn_wc__cd3_to_cd2(cd, result_pool);
- APR_ARRAY_PUSH(new_conflicts, svn_wc_conflict_description2_t *) = cd2;
- }
-
- return new_conflicts;
-}
-
-svn_wc_conflict_description2_t *
-svn_wc__cd3_to_cd2(const svn_wc_conflict_description3_t *conflict,
- apr_pool_t *result_pool)
-{
- svn_wc_conflict_description2_t *new_conflict;
-
- if (conflict == NULL)
- return NULL;
-
- new_conflict = apr_pcalloc(result_pool, sizeof(*new_conflict));
-
- if (conflict->local_abspath)
- new_conflict->local_abspath = apr_pstrdup(result_pool,
- conflict->local_abspath);
- new_conflict->node_kind = conflict->node_kind;
- new_conflict->kind = conflict->kind;
- if (conflict->property_name)
- new_conflict->property_name = apr_pstrdup(result_pool,
- conflict->property_name);
- new_conflict->is_binary = conflict->is_binary;
- if (conflict->mime_type)
- new_conflict->mime_type = apr_pstrdup(result_pool, conflict->mime_type);
- new_conflict->action = conflict->action;
- new_conflict->reason = conflict->reason;
- if (conflict->base_abspath)
- new_conflict->base_abspath = apr_pstrdup(result_pool,
- conflict->base_abspath);
-
- if (conflict->kind == svn_wc_conflict_kind_property)
- {
- /* For property conflicts, cd2 stored prop_reject_abspath in
- * their_abspath, and stored theirs_abspath in merged_file. */
- if (conflict->prop_reject_abspath)
- new_conflict->their_abspath = apr_pstrdup(result_pool,
- conflict->prop_reject_abspath);
- if (conflict->their_abspath)
- new_conflict->merged_file = apr_pstrdup(result_pool,
- conflict->their_abspath);
- }
- else
- {
- if (conflict->their_abspath)
- new_conflict->their_abspath = apr_pstrdup(result_pool,
- conflict->their_abspath);
-
- if (conflict->merged_abspath)
- new_conflict->merged_file = apr_pstrdup(result_pool,
- conflict->merged_abspath);
- }
- if (conflict->my_abspath)
- new_conflict->my_abspath = apr_pstrdup(result_pool, conflict->my_abspath);
- new_conflict->operation = conflict->operation;
- if (conflict->src_left_version)
- new_conflict->src_left_version =
- svn_wc_conflict_version_dup(conflict->src_left_version, result_pool);
- if (conflict->src_right_version)
- new_conflict->src_right_version =
- svn_wc_conflict_version_dup(conflict->src_right_version, result_pool);
-
- return new_conflict;
-}
-
svn_wc_conflict_description_t *
svn_wc__cd2_to_cd(const svn_wc_conflict_description2_t *conflict,
apr_pool_t *result_pool)
Modified: subversion/branches/svn-auth-x509/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_wc/wc.h?rev=1639628&r1=1639627&r2=1639628&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_wc/wc.h Fri Nov 14 13:17:55 2014
@@ -249,52 +249,6 @@ svn_wc__context_create_with_db(svn_wc_co
apr_pool_t *
svn_wc__get_committed_queue_pool(const struct svn_wc_committed_queue_t *queue);
-
-/** Internal helper for svn_wc_process_committed_queue2().
- *
- * ### If @a queue is NULL, then ...?
- * ### else:
- * Bump an item from @a queue (the one associated with @a
- * local_abspath) to @a new_revnum after a commit succeeds, recursing
- * if @a recurse is set.
- *
- * @a new_date is the (server-side) date of the new revision, or 0.
- *
- * @a rev_author is the (server-side) author of the new
- * revision; it may be @c NULL.
- *
- * @a new_dav_cache is a hash of dav property changes to be made to
- * the @a local_abspath.
- * ### [JAF] Is it? See svn_wc_queue_committed3(). It ends up being
- * ### assigned as a whole to wc.db:BASE_NODE:dav_cache.
- *
- * If @a no_unlock is set, don't release any user locks on @a
- * local_abspath; otherwise release them as part of this processing.
- *
- * If @a keep_changelist is set, don't remove any changeset assignments
- * from @a local_abspath; otherwise, clear it of such assignments.
- *
- * If @a sha1_checksum is non-NULL, use it to identify the node's pristine
- * text.
- *
- * Set TOP_OF_RECURSE to TRUE to show that this the top of a possibly
- * recursive commit operation.
- */
-svn_error_t *
-svn_wc__process_committed_internal(svn_wc__db_t *db,
- const char *local_abspath,
- svn_boolean_t recurse,
- svn_boolean_t top_of_recurse,
- svn_revnum_t new_revnum,
- apr_time_t new_date,
- const char *rev_author,
- apr_hash_t *new_dav_cache,
- svn_boolean_t no_unlock,
- svn_boolean_t keep_changelist,
- const svn_checksum_t *sha1_checksum,
- const svn_wc_committed_queue_t *queue,
- apr_pool_t *scratch_pool);
-
/*** Update traversals. ***/
@@ -676,7 +630,7 @@ svn_wc__write_check(svn_wc__db_t *db,
const char *local_abspath,
apr_pool_t *scratch_pool);
-/* Read into CONFLICTS svn_wc_conflict_description3_t* structs
+/* Read into CONFLICTS svn_wc_conflict_description2_t* structs
* for all conflicts that have LOCAL_ABSPATH as victim.
*
* Victim must be versioned or be part of a tree conflict.
Modified: subversion/branches/svn-auth-x509/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_wc/wc_db.c?rev=1639628&r1=1639627&r2=1639628&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_wc/wc_db.c Fri Nov 14 13:17:55 2014
@@ -4700,25 +4700,23 @@ struct op_copy_baton
const char *dst_op_root_relpath;
};
-/* Helper for svn_wc__db_op_copy().
- *
- * Implements svn_sqlite__transaction_callback_t. */
+/* Helper for svn_wc__db_op_copy(). */
static svn_error_t *
-op_copy_txn(void * baton,
- svn_sqlite__db_t *sdb,
+op_copy_txn(svn_wc__db_wcroot_t *wcroot,
+ struct op_copy_baton *ocb,
apr_pool_t *scratch_pool)
{
- struct op_copy_baton *ocb = baton;
int move_op_depth;
- if (sdb != ocb->dst_wcroot->sdb)
+ if (wcroot != ocb->dst_wcroot)
{
/* Source and destination databases differ; so also start a lock
- in the destination database, by calling ourself in a lock. */
+ in the destination database, by calling ourself in an extra lock. */
- return svn_error_trace(
- svn_sqlite__with_lock(ocb->dst_wcroot->sdb,
- op_copy_txn, ocb, scratch_pool));
+ SVN_WC__DB_WITH_TXN(op_copy_txn(ocb->dst_wcroot, ocb, scratch_pool),
+ ocb->dst_wcroot);
+
+ return SVN_NO_ERROR;
}
/* From this point we can assume a lock in the src and dst databases */
@@ -4769,8 +4767,8 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
/* Call with the sdb in src_wcroot. It might call itself again to
also obtain a lock in dst_wcroot */
- SVN_ERR(svn_sqlite__with_lock(ocb.src_wcroot->sdb, op_copy_txn, &ocb,
- scratch_pool));
+ SVN_WC__DB_WITH_TXN(op_copy_txn(ocb.src_wcroot, &ocb, scratch_pool),
+ ocb.src_wcroot);
return SVN_NO_ERROR;
}
@@ -5212,15 +5210,12 @@ db_op_copy_shadowed_layer(svn_wc__db_wcr
return SVN_NO_ERROR;
}
-/* Helper for svn_wc__db_op_copy_shadowed_layer().
- *
- * Implements svn_sqlite__transaction_callback_t. */
+/* Helper for svn_wc__db_op_copy_shadowed_layer(). */
static svn_error_t *
-op_copy_shadowed_layer_txn(void *baton,
- svn_sqlite__db_t *sdb,
+op_copy_shadowed_layer_txn(svn_wc__db_wcroot_t *wcroot,
+ struct op_copy_baton *ocb,
apr_pool_t *scratch_pool)
{
- struct op_copy_baton *ocb = baton;
const char *src_parent_relpath;
const char *dst_parent_relpath;
int src_op_depth;
@@ -5230,15 +5225,16 @@ op_copy_shadowed_layer_txn(void *baton,
apr_int64_t repos_id = INVALID_REPOS_ID;
svn_revnum_t revision = SVN_INVALID_REVNUM;
- if (sdb != ocb->dst_wcroot->sdb)
+ if (wcroot != ocb->dst_wcroot)
{
- /* Source and destination databases differ; so also start a lock
- in the destination database, by calling ourself in a lock. */
+ /* Source and destination databases differ; so also start a lock
+ in the destination database, by calling ourself in an extra lock. */
- return svn_error_trace(
- svn_sqlite__with_lock(ocb->dst_wcroot->sdb,
- op_copy_shadowed_layer_txn,
- ocb, scratch_pool));
+ SVN_WC__DB_WITH_TXN(op_copy_shadowed_layer_txn(ocb->dst_wcroot, ocb,
+ scratch_pool),
+ ocb->dst_wcroot);
+
+ return SVN_NO_ERROR;
}
/* From this point we can assume a lock in the src and dst databases */
@@ -5320,9 +5316,9 @@ svn_wc__db_op_copy_shadowed_layer(svn_wc
/* Call with the sdb in src_wcroot. It might call itself again to
also obtain a lock in dst_wcroot */
- SVN_ERR(svn_sqlite__with_lock(ocb.src_wcroot->sdb,
- op_copy_shadowed_layer_txn,
- &ocb, scratch_pool));
+ SVN_WC__DB_WITH_TXN(op_copy_shadowed_layer_txn(ocb.src_wcroot, &ocb,
+ scratch_pool),
+ ocb.src_wcroot);
return SVN_NO_ERROR;
}
@@ -11925,6 +11921,7 @@ svn_wc__db_lock_add(svn_wc__db_t *db,
static svn_error_t *
lock_remove_txn(svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
+ svn_skel_t *work_items,
apr_pool_t *scratch_pool)
{
const char *repos_relpath;
@@ -11944,6 +11941,8 @@ lock_remove_txn(svn_wc__db_wcroot_t *wcr
SVN_ERR(svn_sqlite__step_done(stmt));
+ SVN_ERR(add_work_items(wcroot->sdb, work_items, scratch_pool));
+
return SVN_NO_ERROR;
}
@@ -11951,6 +11950,7 @@ lock_remove_txn(svn_wc__db_wcroot_t *wcr
svn_error_t *
svn_wc__db_lock_remove(svn_wc__db_t *db,
const char *local_abspath,
+ svn_skel_t *work_items,
apr_pool_t *scratch_pool)
{
svn_wc__db_wcroot_t *wcroot;
@@ -11963,7 +11963,7 @@ svn_wc__db_lock_remove(svn_wc__db_t *db,
VERIFY_USABLE_WCROOT(wcroot);
SVN_WC__DB_WITH_TXN(
- lock_remove_txn(wcroot, local_relpath, scratch_pool),
+ lock_remove_txn(wcroot, local_relpath, work_items, scratch_pool),
wcroot);
/* There may be some entries, and the lock info is now out of date. */
@@ -15521,3 +15521,514 @@ svn_wc__db_vacuum(svn_wc__db_t *db,
return SVN_NO_ERROR;
}
+
+/* Item queued with svn_wc__db_commit_queue_add */
+typedef struct commit_queue_item_t
+{
+ const char *local_relpath;
+ svn_boolean_t recurse; /* Use legacy recursion */
+ svn_boolean_t committed; /* Process the node as committed */
+ svn_boolean_t remove_lock; /* Remove existing lock on node */
+ svn_boolean_t remove_changelist; /* Remove changelist on node */
+
+ /* The pristine text checksum. NULL if the old value should be kept
+ and for directories */
+ const svn_checksum_t *new_sha1_checksum;
+
+ apr_hash_t *new_dav_cache; /* New DAV cache for the node */
+} commit_queue_item_t;
+
+/* The queue definition for vn_wc__db_create_commit_queue,
+ svn_wc__db_commit_queue_add and finally svn_wc__db_process_commit_queue */
+struct svn_wc__db_commit_queue_t
+{
+ svn_wc__db_wcroot_t *wcroot; /* Wcroot for ITEMS */
+ apr_array_header_t *items; /* List of commit_queue_item_t* */
+ svn_boolean_t have_recurse; /* Is one or more item[x]->recurse TRUE? */
+};
+
+/* Create a new svn_wc__db_commit_queue_t instance in RESULT_POOL for the
+ working copy specified with WRI_ABSPATH */
+svn_error_t *
+svn_wc__db_create_commit_queue(svn_wc__db_commit_queue_t **queue,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_wc__db_wcroot_t *wcroot;
+ const char *local_relpath;
+ svn_wc__db_commit_queue_t *q;
+
+ SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
+
+ SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
+ wri_abspath, result_pool, scratch_pool));
+ VERIFY_USABLE_WCROOT(wcroot);
+
+ q = apr_pcalloc(result_pool, sizeof(*q));
+
+ SVN_ERR_ASSERT(wcroot->sdb);
+
+ q->wcroot = wcroot;
+ q->items = apr_array_make(result_pool, 64,
+ sizeof(commit_queue_item_t*));
+ q->have_recurse = FALSE;
+
+ *queue = q;
+ return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_wc__db_commit_queue_add(svn_wc__db_commit_queue_t *queue,
+ const char *local_abspath,
+ svn_boolean_t recurse,
+ svn_boolean_t is_commited,
+ svn_boolean_t remove_lock,
+ svn_boolean_t remove_changelist,
+ const svn_checksum_t *new_sha1_checksum,
+ apr_hash_t *new_dav_cache,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ commit_queue_item_t *cqi;
+ const char *local_relpath;
+
+ local_relpath = svn_dirent_skip_ancestor(queue->wcroot->abspath,
+ local_abspath);
+
+ if (! local_relpath)
+ return svn_error_createf(
+ SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+ _("The path '%s' is not in the working copy '%s'"),
+ svn_dirent_local_style(local_abspath, scratch_pool),
+ svn_dirent_local_style(queue->wcroot->abspath, scratch_pool));
+
+ cqi = apr_pcalloc(result_pool, sizeof(*cqi));
+ cqi->local_relpath = local_relpath;
+ cqi->recurse = recurse;
+ cqi->committed = is_commited;
+ cqi->remove_lock = remove_lock;
+ cqi->remove_changelist = remove_changelist;
+ cqi->new_sha1_checksum = new_sha1_checksum;
+ cqi->new_dav_cache = new_dav_cache;
+
+ queue->have_recurse |= recurse;
+
+ APR_ARRAY_PUSH(queue->items, commit_queue_item_t *) = cqi;
+ return SVN_NO_ERROR;
+}
+
+/*** Finishing updates and commits. ***/
+
+/* Post process an item that is committed in the repository. Collapse layers into
+ * BASE. Queue work items that will finish a commit of the file or directory
+ * LOCAL_ABSPATH in DB:
+ */
+static svn_error_t *
+process_committed_leaf(svn_wc__db_t *db,
+ svn_wc__db_wcroot_t *wcroot,
+ const char *local_relpath,
+ svn_boolean_t via_recurse,
+ svn_wc__db_status_t status,
+ svn_node_kind_t kind,
+ svn_boolean_t prop_mods,
+ const svn_checksum_t *old_checksum,
+ svn_revnum_t new_revnum,
+ apr_time_t new_changed_date,
+ const char *new_changed_author,
+ apr_hash_t *new_dav_cache,
+ svn_boolean_t remove_lock,
+ svn_boolean_t remove_changelist,
+ const svn_checksum_t *checksum,
+ apr_pool_t *scratch_pool)
+{
+ svn_revnum_t new_changed_rev = new_revnum;
+ svn_skel_t *work_item = NULL;
+
+ {
+ const char *lock_relpath;
+ svn_boolean_t locked;
+
+ if (kind == svn_node_dir)
+ lock_relpath = local_relpath;
+ else
+ lock_relpath = svn_relpath_dirname(local_relpath, scratch_pool);
+
+ SVN_ERR(svn_wc__db_wclock_owns_lock_internal(&locked, wcroot,
+ lock_relpath, FALSE,
+ scratch_pool));
+
+ if (!locked)
+ return svn_error_createf(SVN_ERR_WC_NOT_LOCKED, NULL,
+ _("No write-lock in '%s'"),
+ path_for_error_message(wcroot, local_relpath,
+ scratch_pool));
+
+ SVN_ERR(flush_entries(wcroot, lock_relpath, svn_depth_empty,
+ scratch_pool));
+ }
+
+ if (status == svn_wc__db_status_deleted)
+ {
+ return svn_error_trace(
+ db_base_remove(wcroot, local_relpath, db,
+ FALSE /* keep_as_working */,
+ FALSE /* queue_deletes */,
+ TRUE /* remove_locks */,
+ (! via_recurse)
+ ? new_revnum : SVN_INVALID_REVNUM,
+ NULL, NULL,
+ scratch_pool));
+ }
+ else if (status == svn_wc__db_status_not_present)
+ {
+ /* We are committing the leaf of a copy operation.
+ We leave the not-present marker to allow pulling in excluded
+ children of a copy.
+
+ The next update will remove the not-present marker. */
+
+ return SVN_NO_ERROR;
+ }
+
+ SVN_ERR_ASSERT(status == svn_wc__db_status_normal
+ || status == svn_wc__db_status_incomplete
+ || status == svn_wc__db_status_added);
+
+ if (kind != svn_node_dir)
+ {
+ /* If we sent a delta (meaning: post-copy modification),
+ then this file will appear in the queue and so we should have
+ its checksum already. */
+ if (checksum == NULL)
+ {
+ /* It was copied and not modified. We must have a text
+ base for it. And the node should have a checksum. */
+ SVN_ERR_ASSERT(old_checksum != NULL);
+
+ checksum = old_checksum;
+
+ /* Is the node completely unmodified and are we recursing? */
+ if (via_recurse && !prop_mods)
+ {
+ /* If a copied node itself is not modified, but the op_root of
+ the copy is committed we have to make sure that changed_rev,
+ changed_date and changed_author don't change or the working
+ copy used for committing will show different last modified
+ information then a clean checkout of exactly the same
+ revisions. (Issue #3676) */
+
+ SVN_ERR(svn_wc__db_read_info_internal(
+ NULL, NULL, NULL, NULL, NULL,
+ &new_changed_rev,
+ &new_changed_date,
+ &new_changed_author, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ wcroot, local_relpath,
+ scratch_pool, scratch_pool));
+ }
+ }
+
+ SVN_ERR(svn_wc__wq_build_file_commit(&work_item,
+ db, svn_dirent_join(wcroot->abspath,
+ local_relpath,
+ scratch_pool),
+ prop_mods,
+ scratch_pool, scratch_pool));
+ }
+
+ /* The new text base will be found in the pristine store by its checksum. */
+ SVN_ERR(commit_node(wcroot, local_relpath,
+ new_revnum, new_changed_rev,
+ new_changed_date, new_changed_author,
+ checksum,
+ NULL /* new_children */,
+ new_dav_cache,
+ !remove_changelist,
+ !remove_lock,
+ work_item,
+ scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+
+/** Internal helper for svn_wc_process_committed_queue2().
+ * Bump a commit item, collapsing local changes with the new repository
+ * information to a new BASE node.
+ *
+ * @a new_date is the (server-side) date of the new revision, or 0.
+ *
+ * @a rev_author is the (server-side) author of the new
+ * revision; it may be @c NULL.
+ *
+ * @a new_dav_cache is a hash of all the new dav properties for LOCAL_RELPATH.
+ *
+ * If @a remove_lock is set, release any user locks on @a
+ * local_abspath; otherwise keep them during processing.
+ *
+ * If @a remove_changelist is set, clear any changeset assignments
+ * from @a local_abspath; otherwise, keep such assignments.
+ *
+ * If @a new_sha1_checksum is non-NULL, use it to identify the node's pristine
+ * text.
+ *
+ * Set TOP_OF_RECURSE to TRUE to show that this the top of a possibly
+ * recursive commit operation. (Part of the legacy recurse handling)
+ */
+static svn_error_t *
+process_committed_internal(svn_wc__db_t *db,
+ svn_wc__db_wcroot_t *wcroot,
+ const char *local_relpath,
+ svn_boolean_t recurse,
+ svn_boolean_t top_of_recurse,
+ svn_revnum_t new_revnum,
+ apr_time_t new_date,
+ const char *rev_author,
+ apr_hash_t *new_dav_cache,
+ svn_boolean_t remove_lock,
+ svn_boolean_t remove_changelist,
+ const svn_checksum_t *new_sha1_checksum,
+ apr_hash_t *items_by_relpath,
+ apr_pool_t *scratch_pool)
+{
+ svn_wc__db_status_t status;
+ svn_node_kind_t kind;
+ const svn_checksum_t *old_checksum;
+ svn_boolean_t prop_mods;
+
+ SVN_ERR(svn_wc__db_read_info_internal(&status, &kind, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, &old_checksum, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, &prop_mods, NULL, NULL, NULL,
+ wcroot, local_relpath,
+ scratch_pool, scratch_pool));
+
+ /* NOTE: be wary of making crazy semantic changes in this function, since
+ svn_wc_process_committed4() calls this. */
+
+ SVN_ERR(process_committed_leaf(db, wcroot, local_relpath, !top_of_recurse,
+ status, kind, prop_mods, old_checksum,
+ new_revnum, new_date, rev_author,
+ new_dav_cache,
+ remove_lock, remove_changelist,
+ new_sha1_checksum,
+ scratch_pool));
+
+ /* Only check for recursion on nodes that have children */
+ if (kind != svn_node_dir
+ || status == svn_wc__db_status_not_present
+ || status == svn_wc__db_status_excluded
+ || status == svn_wc__db_status_server_excluded
+ /* Node deleted -> then no longer a directory */
+ || status == svn_wc__db_status_deleted)
+ {
+ return SVN_NO_ERROR;
+ }
+
+ if (recurse)
+ {
+ const apr_array_header_t *children;
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+ int i;
+
+ /* Read PATH's entries; this is the absolute path. */
+ SVN_ERR(gather_children(&children, wcroot, local_relpath,
+ scratch_pool, iterpool));
+
+ /* Recursively loop over all children. */
+ for (i = 0; i < children->nelts; i++)
+ {
+ const char *name = APR_ARRAY_IDX(children, i, const char *);
+ const char *this_relpath;
+ const commit_queue_item_t *cqi;
+
+ svn_pool_clear(iterpool);
+
+ this_relpath = svn_dirent_join(local_relpath, name, iterpool);
+
+ new_sha1_checksum = NULL;
+ cqi = svn_hash_gets(items_by_relpath, this_relpath);
+
+ if (cqi != NULL)
+ new_sha1_checksum = cqi->new_sha1_checksum;
+
+ /* Recurse. Pass NULL for NEW_DAV_CACHE, because the
+ ones present in the current call are only applicable to
+ this one committed item. */
+ SVN_ERR(process_committed_internal(
+ db, wcroot, this_relpath,
+ TRUE /* recurse */,
+ FALSE /* top_of_recurse */,
+ new_revnum, new_date,
+ rev_author,
+ NULL /* new_dav_cache */,
+ FALSE /* remove_lock */,
+ remove_changelist,
+ new_sha1_checksum,
+ items_by_relpath,
+ iterpool));
+ }
+
+ svn_pool_destroy(iterpool);
+ }
+
+ return SVN_NO_ERROR;
+}
+
+/* Return TRUE if any item of QUEUE is a parent of ITEM and will be
+ processed recursively, return FALSE otherwise.
+
+ The algorithmic complexity of this search implementation is O(queue
+ length), but it's quite quick.
+*/
+static svn_boolean_t
+have_recursive_parent(const apr_array_header_t *all_items,
+ const commit_queue_item_t *item,
+ apr_pool_t *scratch_pool)
+{
+ const char *local_relpath = item->local_relpath;
+ int i;
+
+ for (i = 0; i < all_items->nelts; i++)
+ {
+ const commit_queue_item_t *qi
+ = APR_ARRAY_IDX(all_items, i, const commit_queue_item_t *);
+
+ if (qi == item)
+ continue;
+
+ if (qi->recurse && svn_relpath_skip_ancestor(qi->local_relpath,
+ local_relpath))
+ {
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+/* Compare function for svn_sort__array */
+static int
+compare_queue_items(const void *v1,
+ const void *v2)
+{
+ const commit_queue_item_t *cqi1
+ = *(const commit_queue_item_t **)v1;
+ const commit_queue_item_t *cqi2
+ = *(const commit_queue_item_t **)v2;
+
+ return svn_path_compare_paths(cqi1->local_relpath, cqi2->local_relpath);
+}
+
+/* Internal, locked version of svn_wc__db_process_commit_queue */
+static svn_error_t *
+db_process_commit_queue(svn_wc__db_t *db,
+ svn_wc__db_commit_queue_t *queue,
+ svn_revnum_t new_revnum,
+ apr_time_t new_date,
+ const char *new_author,
+ apr_pool_t *scratch_pool)
+{
+ apr_hash_t *items_by_relpath = NULL;
+ int j;
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+
+ svn_sort__array(queue->items, compare_queue_items);
+
+ if (queue->have_recurse)
+ {
+ items_by_relpath = apr_hash_make(scratch_pool);
+
+ for (j = 0; j < queue->items->nelts; j++)
+ {
+ commit_queue_item_t *cqi
+ = APR_ARRAY_IDX(queue->items, j, commit_queue_item_t *);
+
+ svn_hash_sets(items_by_relpath, cqi->local_relpath, cqi);
+ }
+ }
+
+ for (j = 0; j < queue->items->nelts; j++)
+ {
+ commit_queue_item_t *cqi
+ = APR_ARRAY_IDX(queue->items, j, commit_queue_item_t *);
+
+ svn_pool_clear(iterpool);
+
+ /* Skip this item if it is a child of a recursive item, because it has
+ been (or will be) accounted for when that recursive item was (or
+ will be) processed. */
+ if (queue->have_recurse && have_recursive_parent(queue->items, cqi,
+ iterpool))
+ continue;
+
+ if (!cqi->committed)
+ {
+ if (cqi->remove_lock)
+ {
+ svn_skel_t *work_item;
+
+ SVN_ERR(svn_wc__wq_build_sync_file_flags(
+ &work_item,
+ db,
+ svn_dirent_join(
+ queue->wcroot->abspath,
+ cqi->local_relpath,
+ iterpool),
+ iterpool, iterpool));
+
+ lock_remove_txn(queue->wcroot, cqi->local_relpath, work_item,
+ iterpool);
+ }
+ if (cqi->remove_changelist)
+ SVN_ERR(svn_wc__db_op_set_changelist(db,
+ svn_dirent_join(
+ queue->wcroot->abspath,
+ cqi->local_relpath,
+ iterpool),
+ NULL, NULL,
+ svn_depth_empty,
+ NULL, NULL, /* notify */
+ NULL, NULL, /* cancel */
+ iterpool));
+ }
+ else
+ {
+ SVN_ERR(process_committed_internal(
+ db, queue->wcroot, cqi->local_relpath,
+ cqi->recurse,
+ TRUE /* top_of_recurse */,
+ new_revnum, new_date, new_author,
+ cqi->new_dav_cache,
+ cqi->remove_lock,
+ cqi->remove_changelist,
+ cqi->new_sha1_checksum,
+ items_by_relpath,
+ iterpool));
+ }
+ }
+
+ svn_pool_destroy(iterpool);
+
+ return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_wc__db_process_commit_queue(svn_wc__db_t *db,
+ svn_wc__db_commit_queue_t *queue,
+ svn_revnum_t new_revnum,
+ apr_time_t new_date,
+ const char *new_author,
+ apr_pool_t *scratch_pool)
+{
+ SVN_WC__DB_WITH_TXN(db_process_commit_queue(db, queue,
+ new_revnum, new_date,
+ new_author, scratch_pool),
+ queue->wcroot);
+
+ return SVN_NO_ERROR;
+}
Modified: subversion/branches/svn-auth-x509/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_wc/wc_db.h?rev=1639628&r1=1639627&r2=1639628&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_wc/wc_db.h Fri Nov 14 13:17:55 2014
@@ -1261,6 +1261,53 @@ svn_wc__db_committable_externals_below(a
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+/* Opaque struct for svn_wc__db_create_commit_queue, svn_wc__db_commit_queue_add,
+ svn_wc__db_process_commit_queue */
+typedef struct svn_wc__db_commit_queue_t svn_wc__db_commit_queue_t;
+
+/* Create a new svn_wc__db_commit_queue_t instance in RESULT_POOL for the
+ working copy specified with WRI_ABSPATH */
+svn_error_t *
+svn_wc__db_create_commit_queue(svn_wc__db_commit_queue_t **queue,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/* Adds the specified path to the commit queue with the related information.
+
+ See svn_wc_queue_committed4() for argument documentation.
+
+ Note that this function currently DOESN'T copy the passed values to
+ RESULT_POOL, but expects them to be valid until processing. Otherwise the
+ only users memory requirements would +- double.
+ */
+svn_error_t *
+svn_wc__db_commit_queue_add(svn_wc__db_commit_queue_t *queue,
+ const char *local_abspath,
+ svn_boolean_t recurse,
+ svn_boolean_t is_commited,
+ svn_boolean_t remove_lock,
+ svn_boolean_t remove_changelist,
+ const svn_checksum_t *new_sha1_checksum,
+ apr_hash_t *new_dav_cache,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/* Process the items in QUEUE in a single transaction. Commit workqueue items
+ for items that need post processing.
+
+ Implementation detail of svn_wc_process_committed_queue2().
+ */
+svn_error_t *
+svn_wc__db_process_commit_queue(svn_wc__db_t *db,
+ svn_wc__db_commit_queue_t *queue,
+ svn_revnum_t new_revnum,
+ apr_time_t new_date,
+ const char *new_author,
+ apr_pool_t *scratch_pool);
+
+
/* Gets a mapping from const char * local abspaths of externals to the const
char * local abspath of where they are defined for all externals defined
at or below LOCAL_ABSPATH.
@@ -2138,16 +2185,16 @@ svn_wc__db_read_props_streamily(svn_wc__
apr_pool_t *scratch_pool);
-/* Set *PROPS to the properties of the node LOCAL_ABSPATH in the WORKING
- tree (looking through to the BASE tree as required).
-
- ### *PROPS will set set to NULL in the following situations:
- ### ... tbd. see props.c:svn_wc__get_pristine_props()
+/* Set *PROPS to the base properties of the node at LOCAL_ABSPATH.
*PROPS maps "const char *" names to "const svn_string_t *" values.
If the node has no properties, set *PROPS to an empty hash.
- If the node is not present, return an error.
+ If the base node is in a state that cannot have properties (such as
+ not-present or locally added without copy-from), return an error.
+
Allocate *PROPS and its keys and values in RESULT_POOL.
+
+ See also svn_wc_get_pristine_props().
*/
svn_error_t *
svn_wc__db_read_pristine_props(apr_hash_t **props,
@@ -2633,10 +2680,12 @@ svn_wc__db_lock_add(svn_wc__db_t *db,
apr_pool_t *scratch_pool);
-/* Remove any lock for LOCAL_ABSPATH in DB. */
+/* Remove any lock for LOCAL_ABSPATH in DB and install WORK_ITEMS
+ (if not NULL) in DB */
svn_error_t *
svn_wc__db_lock_remove(svn_wc__db_t *db,
const char *local_abspath,
+ svn_skel_t *work_items,
apr_pool_t *scratch_pool);
Modified: subversion/branches/svn-auth-x509/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_wc/workqueue.c?rev=1639628&r1=1639627&r2=1639628&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_wc/workqueue.c Fri Nov 14 13:17:55 2014
@@ -1016,8 +1016,8 @@ svn_error_t *
svn_wc__wq_build_dir_install(svn_skel_t **work_item,
svn_wc__db_t *db,
const char *local_abspath,
- apr_pool_t *scratch_pool,
- apr_pool_t *result_pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
const char *local_relpath;
@@ -1116,14 +1116,15 @@ run_prej_install(work_item_baton_t *wqb,
scratch_pool, scratch_pool));
if (arg1->next != NULL)
- prop_conflict_skel = arg1->next;
+ prop_conflict_skel = arg1->next; /* Before Subversion 1.9 */
else
- SVN_ERR_MALFUNCTION(); /* ### wc_db can't provide it ... yet. */
+ prop_conflict_skel = NULL; /* Read from DB */
/* Construct a property reject file in the temporary area. */
SVN_ERR(svn_wc__create_prejfile(&tmp_prejfile_abspath,
db, local_abspath,
prop_conflict_skel,
+ cancel_func, cancel_baton,
scratch_pool, scratch_pool));
/* ... and atomically move it into place. */
@@ -1139,21 +1140,21 @@ svn_error_t *
svn_wc__wq_build_prej_install(svn_skel_t **work_item,
svn_wc__db_t *db,
const char *local_abspath,
- svn_skel_t *conflict_skel,
+ /*svn_skel_t *conflict_skel,*/
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
const char *local_relpath;
*work_item = svn_skel__make_empty_list(result_pool);
- /* ### gotta have this, today */
- SVN_ERR_ASSERT(conflict_skel != NULL);
-
SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, local_abspath,
local_abspath, result_pool, scratch_pool));
- if (conflict_skel != NULL)
- svn_skel__prepend(conflict_skel, *work_item);
+ /* ### In Subversion 1.7 and 1.8 we created a legacy property conflict skel
+ here:
+ if (conflict_skel != NULL)
+ svn_skel__prepend(conflict_skel, *work_item);
+ */
svn_skel__prepend_str(local_relpath, *work_item, result_pool);
svn_skel__prepend_str(OP_PREJ_INSTALL, *work_item, result_pool);
@@ -1489,8 +1490,11 @@ svn_wc__wq_run(svn_wc__db_t *db,
{
static int count = 0;
const char *count_env_var = getenv("SVN_DEBUG_WORK_QUEUE");
+ int count_env_val;
+
+ SVN_ERR(svn_cstring_atoi(&count_env_val, count_env_var));
- if (count_env_var && ++count == atoi(count_env_var))
+ if (count_env_var && ++count == count_env_val)
return svn_error_create(SVN_ERR_CANCELLED, NULL, "fake cancel");
}
#endif
Modified: subversion/branches/svn-auth-x509/subversion/libsvn_wc/workqueue.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_wc/workqueue.h?rev=1639628&r1=1639627&r2=1639628&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_wc/workqueue.h (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_wc/workqueue.h Fri Nov 14 13:17:55 2014
@@ -181,22 +181,12 @@ svn_wc__wq_build_sync_file_flags(svn_ske
/* Set *WORK_ITEM to a new work item that will install a property reject
- file for LOCAL_ABSPATH into the working copy. The property conflicts will
- be taken from CONFLICT_SKEL.
-
- ### Caution: Links CONFLICT_SKEL into the *WORK_ITEM, which involves
- modifying *CONFLICT_SKEL.
-
- ### TODO: Make CONFLICT_SKEL 'const' and dup it into RESULT_POOL.
-
- ### TODO: If CONFLICT_SKEL is NULL, take property conflicts from wc_db
- for the given DB/LOCAL_ABSPATH.
+ file for LOCAL_ABSPATH into the working copy.
*/
svn_error_t *
svn_wc__wq_build_prej_install(svn_skel_t **work_item,
svn_wc__db_t *db,
const char *local_abspath,
- svn_skel_t *conflict_skel,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
@@ -225,8 +215,8 @@ svn_error_t *
svn_wc__wq_build_dir_install(svn_skel_t **work_item,
svn_wc__db_t *db,
const char *local_abspath,
- apr_pool_t *scratch_pool,
- apr_pool_t *result_pool);
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
svn_error_t *
svn_wc__wq_build_postupgrade(svn_skel_t **work_item,
Modified: subversion/branches/svn-auth-x509/subversion/mod_dav_svn/deadprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/mod_dav_svn/deadprops.c?rev=1639628&r1=1639627&r2=1639628&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/mod_dav_svn/deadprops.c (original)
+++ subversion/branches/svn-auth-x509/subversion/mod_dav_svn/deadprops.c Fri Nov 14 13:17:55 2014
@@ -323,7 +323,7 @@ db_open(apr_pool_t *p,
db->p = svn_pool_create(p);
/* ### temp hack */
- db->work = svn_stringbuf_ncreate("", 0, db->p);
+ db->work = svn_stringbuf_create_empty(db->p);
/* make our path-based authz callback available to svn_repos_* funcs. */
arb = apr_pcalloc(p, sizeof(*arb));
Modified: subversion/branches/svn-auth-x509/subversion/mod_dav_svn/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/mod_dav_svn/lock.c?rev=1639628&r1=1639627&r2=1639628&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/mod_dav_svn/lock.c (original)
+++ subversion/branches/svn-auth-x509/subversion/mod_dav_svn/lock.c Fri Nov 14 13:17:55 2014
@@ -787,7 +787,31 @@ append_locks(dav_lockdb *lockdb,
DAV_ERR_LOCK_SAVE_LOCK,
"Anonymous lock creation is not allowed.");
}
- else if (serr && (serr->apr_err == SVN_ERR_REPOS_HOOK_FAILURE ||
+ else if (serr && serr->apr_err == SVN_ERR_REPOS_POST_LOCK_HOOK_FAILED)
+ {
+ /* The lock was created in the repository, so we should report the node
+ as locked to the client */
+
+ /* First log the hook failure, for diagnostics. This clears serr */
+ dav_svn__log_err(info->r,
+ dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
+ "Post lock hook failure.",
+ resource->pool),
+ APLOG_WARNING);
+
+ /* How can we report the error to the client?
+
+ We can't return an error code, as that would make it impossible
+ to return the lock details?
+
+ Add yet another custom header?
+ Just an header doesn't handle a full error chain...
+
+ ### Current behavior: we don't report an error.
+ */
+
+ }
+ else if (serr && (svn_error_find_cause(serr, SVN_ERR_REPOS_HOOK_FAILURE) ||
serr->apr_err == SVN_ERR_FS_NO_SUCH_LOCK ||
serr->apr_err == SVN_ERR_FS_LOCK_EXPIRED ||
SVN_ERR_IS_LOCK_ERROR(serr)))
@@ -897,6 +921,22 @@ remove_lock(dav_lockdb *lockdb,
DAV_ERR_LOCK_SAVE_LOCK,
"Anonymous lock removal is not allowed.");
}
+ else if (serr && serr->apr_err == SVN_ERR_REPOS_POST_UNLOCK_HOOK_FAILED
+ && !resource->info->repos->is_svn_client)
+ {
+ /* Generic DAV clients don't understand the specific error code we
+ would produce here as being just a warning, so lets produce a
+ success result. We removed the lock anyway. */
+
+ /* First log the hook failure, for diagnostics. This clears serr */
+ dav_svn__log_err(info->r,
+ dav_svn__convert_err(serr,
+ HTTP_INTERNAL_SERVER_ERROR,
+ "Post unlock hook failure.",
+ resource->pool),
+ APLOG_WARNING);
+
+ }
else if (serr)
return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
"Failed to remove a lock.",
@@ -1016,7 +1056,7 @@ refresh_locks(dav_lockdb *lockdb,
DAV_ERR_LOCK_SAVE_LOCK,
"Anonymous lock refreshing is not allowed.");
}
- else if (serr && (serr->apr_err == SVN_ERR_REPOS_HOOK_FAILURE ||
+ else if (serr && (svn_error_find_cause(serr, SVN_ERR_REPOS_HOOK_FAILURE) ||
serr->apr_err == SVN_ERR_FS_NO_SUCH_LOCK ||
serr->apr_err == SVN_ERR_FS_LOCK_EXPIRED ||
SVN_ERR_IS_LOCK_ERROR(serr)))
Propchange: subversion/branches/svn-auth-x509/subversion/mod_dav_svn/status.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: subversion/branches/svn-auth-x509/subversion/mod_dav_svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/mod_dav_svn/util.c?rev=1639628&r1=1639627&r2=1639628&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/mod_dav_svn/util.c (original)
+++ subversion/branches/svn-auth-x509/subversion/mod_dav_svn/util.c Fri Nov 14 13:17:55 2014
@@ -152,7 +152,7 @@ dav_svn__convert_err(svn_error_t *serr,
derr = build_error_chain(pool, purged_serr, status);
if (message != NULL
- && purged_serr->apr_err != SVN_ERR_REPOS_HOOK_FAILURE)
+ && !svn_error_find_cause(purged_serr, SVN_ERR_REPOS_HOOK_FAILURE))
/* Don't hide hook failures; we might hide the error text */
derr = dav_push_error(pool, status, purged_serr->apr_err,
message, derr);
@@ -177,10 +177,10 @@ get_last_history_rev(svn_revnum_t *revis
const char *ignored;
/* Get an initial HISTORY baton. */
- SVN_ERR(svn_fs_node_history(&history, root, path, pool));
+ SVN_ERR(svn_fs_node_history2(&history, root, path, pool, pool));
/* Now get the first *real* point of interesting history. */
- SVN_ERR(svn_fs_history_prev(&history, history, FALSE, pool));
+ SVN_ERR(svn_fs_history_prev2(&history, history, FALSE, pool, pool));
/* Fetch the location information for this history step. */
return svn_fs_history_location(&ignored, revision, history, pool);