You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/11/04 21:48:30 UTC
svn commit: r1031230 [13/21] - in /subversion/branches/py-tests-as-modules:
./ build/ build/ac-macros/ build/win32/ contrib/client-side/ notes/
notes/http-and-webdav/ notes/wc-ng/ subversion/bindings/ctypes-python/csvn/
subversion/bindings/javahl/nativ...
Modified: subversion/branches/py-tests-as-modules/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/libsvn_wc/wc_db.h?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/py-tests-as-modules/subversion/libsvn_wc/wc_db.h Thu Nov 4 20:48:21 2010
@@ -46,6 +46,8 @@
#include "private/svn_skel.h"
#include "private/svn_sqlite.h"
+#include "svn_private_config.h"
+
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -618,7 +620,6 @@ svn_wc__db_base_add_symlink(svn_wc__db_t
svn_wc__db_status_absent
svn_wc__db_status_excluded
- svn_wc__db_status_not_present
If CONFLICT is not NULL, then it describes a conflict for this node. The
node will be record as conflicted (in ACTUAL).
@@ -642,6 +643,36 @@ svn_wc__db_base_add_absent_node(svn_wc__
apr_pool_t *scratch_pool);
+/* Create a node in the BASE tree that is present in name only.
+
+ The new node will be located at LOCAL_ABSPATH, and correspond to the
+ repository node described by <REPOS_RELPATH, REPOS_ROOT_URL, REPOS_UUID>
+ at revision REVISION.
+
+ The node's kind is described by KIND, and the reason for its absence
+ is 'svn_wc__db_status_not_present'.
+
+ If CONFLICT is not NULL, then it describes a conflict for this node. The
+ node will be record as conflicted (in ACTUAL).
+
+ Any work items that are necessary as part of this node construction may
+ be passed in WORK_ITEMS.
+
+ All temporary allocations will be made in SCRATCH_POOL.
+*/
+svn_error_t *
+svn_wc__db_base_add_not_present_node(svn_wc__db_t *db,
+ const char *local_abspath,
+ const char *repos_relpath,
+ const char *repos_root_url,
+ const char *repos_uuid,
+ svn_revnum_t revision,
+ svn_wc__db_kind_t kind,
+ const svn_skel_t *conflict,
+ const svn_skel_t *work_items,
+ apr_pool_t *scratch_pool);
+
+
/* Remove a node from the BASE tree.
The node to remove is indicated by LOCAL_ABSPATH from the local
@@ -728,27 +759,6 @@ svn_wc__db_base_get_info(svn_wc__db_stat
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Just like svn_wc__db_base_get_info, but always reads information
- from inside the parent of LOCAL_ABSPATH, to allow reading the
- information of a node that is obstructed by a separate working
- copy.
-
- ### BH: This information is necessary for svn_wc_add3()'s
- ### checkout integration support. Even after we switch to
- ### a single db.
- */
-svn_error_t *
-svn_wc__db_base_get_info_from_parent(svn_wc__db_status_t *status,
- svn_wc__db_kind_t *kind,
- svn_revnum_t *revision,
- const char **repos_relpath,
- const char **repos_root_url,
- const char **repos_uuid,
- svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
/* Set *PROPVAL to the value of the property named PROPNAME of the node
LOCAL_ABSPATH in the BASE tree.
@@ -996,33 +1006,47 @@ svn_wc__db_pristine_repair(svn_wc__db_t
/* @} */
-/* @defgroup svn_wc__db_repos Repository information management
+/* @defgroup svn_wc__db_op Operations on WORKING tree
@{
*/
-/* Ensure an entry for the repository at REPOS_ROOT_URL with UUID exists
- in DB for LOCAL_ABSPATH, either by finding the correct row, or inserting
- a new row. In either case return the id in *REPOS_ID.
+/* Return TRUE if SRC_ABSPATH and DST_ABSPATH are versioned paths in the
+ * same DB; FALSE otherwise. */
+svn_boolean_t
+svn_wc__db_same_db(svn_wc__db_t *db,
+ const char *src_abspath,
+ const char *dst_abspath,
+ apr_pool_t *scratch_pool);
- Use SCRATCH_POOL for temporary allocations.
-*/
-svn_error_t *
-svn_wc__db_repos_ensure(apr_int64_t *repos_id,
- svn_wc__db_t *db,
- const char *local_abspath,
- const char *repos_root_url,
- const char *repos_uuid,
+/* Copy the tree at SRC_ABSPATH (in NODES and ACTUAL_NODE tables) to
+ * DST_ABSPATH.
+ *
+ * SRC_ABSPATH and DST_ABSPATH must be in the same WC. SRC_ABSPATH must
+ * exist, and must not be excluded/absent/not-present. The parent of
+ * DST_ABSPATH must be a versioned directory. DST_ABSPATH must be in a
+ * state suitable for creating a new node: nonexistent or deleted.
+ *
+ * Preserve changelist associations in the copy. Preserve all node states
+ * including excluded/absent/not-present.
+ *
+ * Copy the metadata only: do not look at or copy the nodes on disk.
+ *
+ * Add WORK_ITEMS to the work queue. */
+svn_error_t *
+svn_wc__db_op_copy_tree(svn_wc__db_t *db,
+ const char *src_abspath,
+ const char *dst_abspath,
+ const svn_skel_t *work_items,
apr_pool_t *scratch_pool);
-
-/* @} */
-
-
-/* @defgroup svn_wc__db_op Operations on WORKING tree
- @{
-*/
-
-/* ### svn cp WCPATH WCPATH ... can copy mixed base/working around */
+/* Copy the node at SRC_ABSPATH (in NODES and ACTUAL_NODE tables) to
+ * DST_ABSPATH, both in DB but not necessarily in the same WC. The parent
+ * of DST_ABSPATH must be a versioned directory.
+ *
+ * This copy is NOT recursive. It simply establishes this one node, plus
+ * incomplete nodes for the children.
+ *
+ * Add WORK_ITEMS to the work queue. */
svn_error_t *
svn_wc__db_op_copy(svn_wc__db_t *db,
const char *src_abspath,
@@ -1134,6 +1158,9 @@ svn_wc__db_op_add_symlink(svn_wc__db_t *
To specify no properties, PROPS must be an empty hash, not NULL.
If the node is not present, return an error.
+ If PROPS is NULL, set the properties to be the same as the pristine
+ properties.
+
CONFLICT is used to register a conflict on this node at the same time
the properties are changed.
@@ -1246,6 +1273,16 @@ svn_wc__db_op_mark_resolved(svn_wc__db_t
apr_pool_t *scratch_pool);
+/* Revert all local changes which are being maintained in the database,
+ * including conflict storage, properties and text modification status.
+ */
+svn_error_t *
+svn_wc__db_op_revert_actual(svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool);
+
+
+
svn_error_t *
svn_wc__db_op_revert(svn_wc__db_t *db,
const char *local_abspath,
@@ -1486,6 +1523,41 @@ svn_wc__db_read_info(svn_wc__db_status_t
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+/* Structure returned by svn_wc__db_read_children_info. Only has the
+ fields needed by status. */
+struct svn_wc__db_info_t {
+ svn_wc__db_status_t status;
+ svn_wc__db_kind_t kind;
+ svn_revnum_t revnum;
+ const char *repos_relpath;
+ const char *repos_root_url;
+ svn_revnum_t changed_rev;
+ const char *changed_author;
+ apr_time_t changed_date;
+ apr_time_t last_mod_time;
+ svn_depth_t depth;
+ svn_filesize_t translated_size;
+ const char *changelist;
+ svn_boolean_t has_props;
+#ifdef HAVE_SYMLINK
+ svn_boolean_t special;
+#endif
+ svn_boolean_t props_mod;
+ svn_boolean_t have_base;
+ svn_boolean_t conflicted;
+ svn_wc__db_lock_t *lock;
+};
+
+/* Return in *NODES a hash mapping name->struct svn_wc__db_info_t for
+ the children of DIR_ABSPATH, and in *CONFLICTS a hash of names in
+ conflict. */
+svn_error_t *
+svn_wc__db_read_children_info(apr_hash_t **nodes,
+ apr_hash_t **conflicts,
+ svn_wc__db_t *db,
+ const char *dir_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* Set *PROPVAL to the value of the property named PROPNAME of the node
LOCAL_ABSPATH in the ACTUAL tree (looking through to the WORKING or BASE
@@ -1816,12 +1888,7 @@ svn_wc__db_lock_remove(svn_wc__db_t *db,
@{
*/
-/* Scan for a BASE node's repository information.
-
- In the typical case, a BASE node has unspecified repository information,
- meaning that it is implied by its parent's information. When the info is
- needed, this function can be used to scan up the BASE tree to find
- the data.
+/* Read a BASE node's repository information.
For the BASE node implied by LOCAL_ABSPATH, its location in the repository
returned in *REPOS_ROOT_URL and *REPOS_UUID will be returned in
@@ -2198,14 +2265,6 @@ svn_wc__db_temp_forget_directory(svn_wc_
const char *local_dir_abspath,
apr_pool_t *scratch_pool);
-
-svn_error_t *
-svn_wc__db_temp_is_dir_deleted(svn_boolean_t *not_present,
- svn_revnum_t *base_revision,
- svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *scratch_pool);
-
/* Removes all references of LOCAL_ABSPATH from its working copy
using DB. */
svn_error_t *
Modified: subversion/branches/py-tests-as-modules/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/libsvn_wc/workqueue.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/libsvn_wc/workqueue.c Thu Nov 4 20:48:21 2010
@@ -181,18 +181,23 @@ run_revert(svn_wc__db_t *db,
{
const svn_skel_t *arg1 = work_item->children->next;
const char *local_abspath;
- svn_boolean_t replaced;
svn_wc__db_kind_t kind;
svn_wc__db_status_t status;
const char *parent_abspath;
svn_boolean_t conflicted;
apr_int64_t val;
+ svn_boolean_t reinstall_working;
+ svn_boolean_t remove_working;
/* We need a NUL-terminated path, so copy it out of the skel. */
local_abspath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
+
SVN_ERR(svn_skel__parse_int(&val, arg1->next, scratch_pool));
- replaced = (val != 0);
- /* magic_changed is extracted further below. */
+ remove_working = (val != 0);
+
+ SVN_ERR(svn_skel__parse_int(&val, arg1->next->next, scratch_pool));
+ reinstall_working = (val != 0);
+
/* use_commit_times is extracted further below. */
/* NOTE: we can read KIND here since uncommitted kind changes are not
@@ -206,73 +211,50 @@ run_revert(svn_wc__db_t *db,
db, local_abspath,
scratch_pool, scratch_pool));
- SVN_ERR(svn_wc__db_op_set_props(db, local_abspath, NULL, NULL, NULL,
- scratch_pool));
-
- /* Deal with the working file, as needed. */
- if (kind == svn_wc__db_kind_file)
+ if (kind == svn_wc__db_kind_dir)
{
- svn_boolean_t magic_changed;
- svn_boolean_t reinstall_working;
+ parent_abspath = local_abspath;
+ }
+ else
+ {
+ parent_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
+ }
- SVN_ERR(svn_skel__parse_int(&val, arg1->next->next, scratch_pool));
- magic_changed = (val != 0);
+ if (conflicted)
+ {
+ const apr_array_header_t *conflicts;
+ int i;
- /* If there was a magic property change, then we'll reinstall the
- working-file to pick up any/all appropriate changes. If there was
- a replacement, then we definitely want to reinstall the working-file
- using the original base. */
- reinstall_working = magic_changed || replaced;
-
- /* ### This "if (replaced)" looks very likely to be an artifact of the
- old WC-1 "revert-base and normal-base" system, and if so then it
- should go away. */
- if (replaced)
- {
- /* With the Pristine Store, there is no longer a "revert-base"
- text that needs to be moved to a "normal text-base" location.
+ SVN_ERR(svn_wc__db_read_conflicts(&conflicts, db, local_abspath,
+ scratch_pool, scratch_pool));
- ### JAF: I wonder why the "revert-base" properties weren't being
- handled the same way in this same code path. An oversight? */
- }
- else if (!reinstall_working)
+ for (i = 0; i < conflicts->nelts; i++)
{
- svn_node_kind_t check_kind;
+ const svn_wc_conflict_description2_t *cd;
- /* If the working file is missing, we need to reinstall it. */
- SVN_ERR(svn_io_check_path(local_abspath, &check_kind,
- scratch_pool));
- reinstall_working = (check_kind == svn_node_none);
+ cd = APR_ARRAY_IDX(conflicts, i,
+ const svn_wc_conflict_description2_t *);
- if (!reinstall_working)
- {
- /* ### can we optimize this call? we already fetched some
- ### info about the node. and *definitely* never want a
- ### full file-scan. */
-
- /* ### for now, just always reinstall. without some extra work,
- ### we could end up in a situation where the file is copied
- ### from the base, but then something fails immediately
- ### after that. on the second time through here, we would
- ### see the file is "the same" and fail to complete those
- ### follow-on actions. in some future work, examine the
- ### points of failure, and possibly precompue the
- ### "reinstall_working" flag, or maybe do some follow-on
- ### actions unconditionally. */
-#if 1
- reinstall_working = TRUE;
-#endif
-#if 0
- /* ### try to avoid altering the timestamp if the intended
- ### contents are the same as current-contents. */
- SVN_ERR(svn_wc__text_modified_internal_p(&reinstall_working,
- db, local_abspath,
- FALSE, FALSE,
- scratch_pool));
-#endif
- }
+ SVN_ERR(maybe_remove_conflict(parent_abspath, cd->base_file,
+ local_abspath, scratch_pool));
+ SVN_ERR(maybe_remove_conflict(parent_abspath, cd->their_file,
+ local_abspath, scratch_pool));
+ SVN_ERR(maybe_remove_conflict(parent_abspath, cd->my_file,
+ local_abspath, scratch_pool));
+ SVN_ERR(maybe_remove_conflict(parent_abspath, cd->merged_file,
+ local_abspath, scratch_pool));
}
+ }
+ /* Reverting the actual node destroys conflict markers and local props.
+ Don't use svn_wc__db_op_set_props() and svn_wc__db_op_mark_resolved()
+ because those leave a record in the ACTUALS table, which is a
+ performance issue. Besides, this does all that in one blow. */
+ SVN_ERR(svn_wc__db_op_revert_actual(db, local_abspath, scratch_pool));
+
+ /* Deal with the working file, as needed. */
+ if (kind == svn_wc__db_kind_file)
+ {
if (reinstall_working)
{
svn_boolean_t use_commit_times;
@@ -296,79 +278,25 @@ run_revert(svn_wc__db_t *db,
{
SVN__NOT_IMPLEMENTED();
}
- else if (kind == svn_wc__db_kind_dir)
+ else if (reinstall_working && kind == svn_wc__db_kind_dir)
{
- svn_node_kind_t disk_kind;
- SVN_ERR(svn_io_check_path(local_abspath, &disk_kind, scratch_pool));
+ svn_node_kind_t on_disk;
- if (disk_kind == svn_node_none)
+ /* Unfortunately we need another stat(), because I don't want
+ to resort to APR error macros to see if we're creating a
+ directory on top of an existing path */
+ SVN_ERR(svn_io_check_path(local_abspath, &on_disk, scratch_pool));
+ if (on_disk == svn_node_none)
SVN_ERR(svn_io_dir_make(local_abspath, APR_OS_DEFAULT, scratch_pool));
}
- if (kind == svn_wc__db_kind_dir)
- parent_abspath = local_abspath;
- else
- parent_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
- /* ### in wc-ng: the following block clears ACTUAL_NODE. */
- if (conflicted)
+ if (remove_working)
{
- const apr_array_header_t *conflicts;
- int i;
-
- SVN_ERR(svn_wc__db_read_conflicts(&conflicts, db, local_abspath,
- scratch_pool, scratch_pool));
-
- for (i = 0; i < conflicts->nelts; i++)
- {
- const svn_wc_conflict_description2_t *cd;
-
- cd = APR_ARRAY_IDX(conflicts, i,
- const svn_wc_conflict_description2_t *);
-
- SVN_ERR(maybe_remove_conflict(parent_abspath, cd->base_file,
- local_abspath, scratch_pool));
- SVN_ERR(maybe_remove_conflict(parent_abspath, cd->their_file,
- local_abspath, scratch_pool));
- SVN_ERR(maybe_remove_conflict(parent_abspath, cd->my_file,
- local_abspath, scratch_pool));
- SVN_ERR(maybe_remove_conflict(parent_abspath, cd->merged_file,
- local_abspath, scratch_pool));
- }
-
- SVN_ERR(svn_wc__db_op_mark_resolved(db, local_abspath,
- TRUE, TRUE, FALSE,
- scratch_pool));
+ SVN_ERR(svn_wc__db_temp_op_remove_working(db, local_abspath,
+ scratch_pool));
}
- {
- svn_boolean_t is_wc_root;
-
- SVN_ERR(svn_wc__check_wc_root(&is_wc_root, NULL, NULL,
- db, local_abspath, scratch_pool));
-
- /* Remove the WORKING_NODE from the node and (if there) its parent stub */
- /* ### A working copy root can't have a working node and trying
- ### to delete it fails because the root doesn't have a stub. */
- if (!is_wc_root)
- {
- const char *op_root_abspath = NULL;
-
- /* If the node is not the operation root, we should not delete
- the working node */
- if (status == svn_wc__db_status_added)
- SVN_ERR(svn_wc__db_scan_addition(NULL, &op_root_abspath, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL,
- db, local_abspath,
- scratch_pool, scratch_pool));
-
- if (!op_root_abspath
- || (strcmp(op_root_abspath, local_abspath) == 0))
- SVN_ERR(svn_wc__db_temp_op_remove_working(db, local_abspath,
- scratch_pool));
- }
- }
-
return SVN_NO_ERROR;
}
@@ -417,6 +345,7 @@ verify_pristine_present(svn_wc__db_t *db
svn_error_t *
svn_wc__wq_add_revert(svn_boolean_t *will_revert,
svn_wc__db_t *db,
+ const char *revert_root,
const char *local_abspath,
svn_boolean_t use_commit_times,
apr_pool_t *scratch_pool)
@@ -424,7 +353,8 @@ svn_wc__wq_add_revert(svn_boolean_t *wil
svn_wc__db_status_t status;
svn_wc__db_kind_t kind;
svn_boolean_t replaced;
- svn_boolean_t magic_changed = FALSE;
+ svn_boolean_t remove_working = FALSE;
+ svn_boolean_t reinstall_working;
SVN_ERR(svn_wc__db_read_info(
&status, &kind, NULL, NULL, NULL, NULL,
@@ -434,8 +364,11 @@ svn_wc__wq_add_revert(svn_boolean_t *wil
db, local_abspath,
scratch_pool, scratch_pool));
- /* Special handling for issue #2101. */
- if (kind == svn_wc__db_kind_file)
+ /* Special handling for issue #2101, which is specifically
+ about reverting copies of 'deleted' files and dirs, being inserted
+ in the copy as a schedule-delete files, yet can't be reverted. */
+ if (kind == svn_wc__db_kind_file
+ && status == svn_wc__db_status_deleted)
SVN_ERR(verify_pristine_present(db, local_abspath, scratch_pool));
/* Gather a few items *before* the revert work-item has a chance to run.
@@ -446,9 +379,9 @@ svn_wc__wq_add_revert(svn_boolean_t *wil
scratch_pool));
/* If a replacement has occurred, then a revert definitely happens. */
- *will_revert = replaced;
+ *will_revert = reinstall_working = replaced;
- if (!replaced)
+ if (status == svn_wc__db_status_normal)
{
apr_hash_t *base_props;
apr_hash_t *working_props;
@@ -462,50 +395,64 @@ svn_wc__wq_add_revert(svn_boolean_t *wil
scratch_pool, scratch_pool));
SVN_ERR(svn_prop_diffs(&prop_diffs, working_props, base_props,
scratch_pool));
- magic_changed = svn_wc__has_magic_property(prop_diffs);
+ if (svn_wc__has_magic_property(prop_diffs))
+ reinstall_working = TRUE;
if (prop_diffs->nelts > 0)
{
/* Property changes cause a revert to occur. */
*will_revert = TRUE;
}
- else
- {
- /* There is nothing to do for NORMAL or ADDED nodes. Typically,
- we won't even be called for added nodes (since a revert
- simply removes it from version control), but it is possible
- that a parent replacement was turned from a replaced copy
- into a normal node, and the (broken) old ENTRY->COPIED logic
- then turns the copied children into typical ADDED nodes.
- Since the recursion has already started, these children are
- visited (unlike most added nodes). */
- if (status != svn_wc__db_status_normal
- && status != svn_wc__db_status_added)
- {
- *will_revert = TRUE;
- }
+ }
+ else
+ {
+ *will_revert = TRUE;
+ if (status != svn_wc__db_status_added)
+ reinstall_working = TRUE;
+ }
- /* We may need to restore a missing working file. */
- if (! *will_revert)
- {
- svn_node_kind_t on_disk;
+ /* We may need to restore a missing working file. */
+ if (! reinstall_working
+ && status != svn_wc__db_status_added)
+ {
+ svn_node_kind_t on_disk;
- SVN_ERR(svn_io_check_path(local_abspath, &on_disk,
- scratch_pool));
- *will_revert = on_disk == svn_node_none;
- }
+ SVN_ERR(svn_io_check_path(local_abspath, &on_disk, scratch_pool));
+ reinstall_working = on_disk == svn_node_none;
+ *will_revert = *will_revert || reinstall_working;
+ }
- if (! *will_revert)
- {
- /* ### there may be ways to simplify this test, rather than
- ### doing file comparisons and junk... */
- SVN_ERR(svn_wc__internal_text_modified_p(will_revert,
- db, local_abspath,
- FALSE, FALSE,
- scratch_pool));
- }
- }
+ if (! reinstall_working
+ && status == svn_wc__db_status_normal)
+ {
+ /* ### there may be ways to simplify this test, rather than
+ ### doing file comparisons and junk... */
+ SVN_ERR(svn_wc__internal_text_modified_p(&reinstall_working,
+ db, local_abspath,
+ FALSE, FALSE,
+ scratch_pool));
+ *will_revert = *will_revert || reinstall_working;
+ }
+
+
+ if (status == svn_wc__db_status_added)
+ {
+ /* When looking at an added, non-replacing node, it's entry
+ will have to be removed after revert: if not, it'll look
+ like it's still under version control. */
+ const char *op_root_abspath;
+
+ SVN_ERR(svn_wc__db_scan_addition(NULL, &op_root_abspath, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
+ db, local_abspath,
+ scratch_pool, scratch_pool));
+
+ if (svn_dirent_is_ancestor(revert_root, op_root_abspath))
+ remove_working = TRUE;
}
+ else
+ remove_working = TRUE;
+
/* Don't even bother to queue a work item if there is nothing to do. */
if (*will_revert)
@@ -517,8 +464,8 @@ svn_wc__wq_add_revert(svn_boolean_t *wil
/* These skel atoms hold references to very transitory state, but
we only need the work_item to survive for the duration of wq_add. */
svn_skel__prepend_int(use_commit_times, work_item, scratch_pool);
- svn_skel__prepend_int(magic_changed, work_item, scratch_pool);
- svn_skel__prepend_int(replaced, work_item, scratch_pool);
+ svn_skel__prepend_int(reinstall_working, work_item, scratch_pool);
+ svn_skel__prepend_int(remove_working, work_item, scratch_pool);
svn_skel__prepend_str(local_abspath, work_item, scratch_pool);
svn_skel__prepend_str(OP_REVERT, work_item, scratch_pool);
@@ -673,12 +620,6 @@ run_base_remove(svn_wc__db_t *db,
NULL, NULL,
db, local_abspath,
scratch_pool, scratch_pool));
-
- if (!repos_relpath)
- SVN_ERR(svn_wc__db_scan_base_repos(&repos_relpath, &repos_root_url,
- &repos_uuid,
- db, local_abspath, scratch_pool,
- scratch_pool));
}
SVN_ERR(remove_base_node(db, local_abspath,
@@ -687,16 +628,15 @@ run_base_remove(svn_wc__db_t *db,
if (keep_not_present)
{
- SVN_ERR(svn_wc__db_base_add_absent_node(db, local_abspath,
- repos_relpath,
- repos_root_url,
- repos_uuid,
- revision,
- kind,
- svn_wc__db_status_not_present,
- NULL,
- NULL,
- scratch_pool));
+ SVN_ERR(svn_wc__db_base_add_not_present_node(db, local_abspath,
+ repos_relpath,
+ repos_root_url,
+ repos_uuid,
+ revision,
+ kind,
+ NULL,
+ NULL,
+ scratch_pool));
}
return SVN_NO_ERROR;
@@ -793,11 +733,10 @@ run_deletion_postcommit(svn_wc__db_t *db
lie; therefore, it must remember the file as being
'deleted' for a while. Create a new, uninteresting
ghost entry: */
- SVN_ERR(svn_wc__db_base_add_absent_node(
+ SVN_ERR(svn_wc__db_base_add_not_present_node(
db, local_abspath,
repos_relpath, repos_root_url, repos_uuid,
new_revision, kind,
- svn_wc__db_status_not_present,
NULL, NULL,
scratch_pool));
}
@@ -1919,7 +1858,7 @@ svn_error_t *
svn_wc__wq_build_prej_install(svn_skel_t **work_item,
svn_wc__db_t *db,
const char *local_abspath,
- const svn_skel_t *conflict_skel,
+ svn_skel_t *conflict_skel,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -1929,8 +1868,7 @@ svn_wc__wq_build_prej_install(svn_skel_t
SVN_ERR_ASSERT(conflict_skel != NULL);
if (conflict_skel != NULL)
- /* ### woah! this needs to dup the skel into RESULT_POOL */
- svn_skel__prepend((svn_skel_t *)conflict_skel, *work_item);
+ svn_skel__prepend(conflict_skel, *work_item);
svn_skel__prepend_str(apr_pstrdup(result_pool, local_abspath),
*work_item, result_pool);
svn_skel__prepend_str(OP_PREJ_INSTALL, *work_item, result_pool);
Modified: subversion/branches/py-tests-as-modules/subversion/libsvn_wc/workqueue.h
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/libsvn_wc/workqueue.h?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/libsvn_wc/workqueue.h (original)
+++ subversion/branches/py-tests-as-modules/subversion/libsvn_wc/workqueue.h Thu Nov 4 20:48:21 2010
@@ -162,14 +162,22 @@ 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 propety conflicts will
- be taken from CONFLICT_SKEL, or if NULL, then from wc_db for the
- given DB/LOCAL_ABSPATH. */
+ 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.
+ */
svn_error_t *
svn_wc__wq_build_prej_install(svn_skel_t **work_item,
svn_wc__db_t *db,
const char *local_abspath,
- const svn_skel_t *conflict_skel,
+ svn_skel_t *conflict_skel,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
@@ -188,10 +196,12 @@ svn_wc__wq_build_record_fileinfo(svn_ske
apr_pool_t *result_pool);
-/* Record a work item to revert LOCAL_ABSPATH. */
+/* Record a work item to revert LOCAL_ABSPATH;
+ REVERT_ROOT designates the root of the entire revert operation. */
svn_error_t *
svn_wc__wq_add_revert(svn_boolean_t *will_revert,
svn_wc__db_t *db,
+ const char *revert_root,
const char *local_abspath,
svn_boolean_t use_commit_times,
apr_pool_t *scratch_pool);
Modified: subversion/branches/py-tests-as-modules/subversion/mod_authz_svn/INSTALL
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/mod_authz_svn/INSTALL?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/mod_authz_svn/INSTALL (original)
+++ subversion/branches/py-tests-as-modules/subversion/mod_authz_svn/INSTALL Thu Nov 4 20:48:21 2010
@@ -79,6 +79,26 @@ II. Configuration
though AuthzSVNAnonymous was set to 'No'. The AuthzSVNAnonymous
directive prevents the anonymous access check from being run.
+ D. Example 4: Per-repository access file
+
+ This configuration allows to use SVNParentPath but have
+ different authz files per repository.
+
+ <Location /svn>
+ DAV svn
+ SVNParentPath /path/to/reposparent
+
+ AuthType Basic
+ AuthName "Subversion repository"
+ AuthUserFile /path/to/htpasswd/file
+
+ AuthzSVNReposRelativeAccessFile filename
+
+ Require valid-user
+ </Location>
+
+ NOTE: AuthzSVNReposRelativeAccessFile filename causes the authz file
+ to be read from <repo path>/conf/<filename>
2. Specifying permissions
Modified: subversion/branches/py-tests-as-modules/subversion/mod_authz_svn/mod_authz_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/mod_authz_svn/mod_authz_svn.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/mod_authz_svn/mod_authz_svn.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/mod_authz_svn/mod_authz_svn.c Thu Nov 4 20:48:21 2010
@@ -52,6 +52,7 @@ typedef struct {
int no_auth_when_anon_ok;
const char *base_path;
const char *access_file;
+ const char *repo_relative_access_file;
const char *force_username_case;
} authz_svn_config_rec;
@@ -76,6 +77,37 @@ create_authz_svn_dir_config(apr_pool_t *
return conf;
}
+static const char *
+AuthzSVNAccessFile_cmd(cmd_parms *cmd, void *config, const char *arg1)
+{
+ authz_svn_config_rec *conf = config;
+
+ if (conf->repo_relative_access_file != NULL)
+ return "AuthzSVNAccessFile cannot be defined at "
+ "same time as AuthzSVNReposRelativeAccessFile.";
+
+ conf->access_file = ap_server_root_relative(cmd->pool, arg1);
+
+ return NULL;
+}
+
+
+static const char *
+AuthzSVNReposRelativeAccessFile_cmd(cmd_parms *cmd,
+ void *config,
+ const char *arg1)
+{
+ authz_svn_config_rec *conf = config;
+
+ if (conf->access_file != NULL)
+ return "AuthzSVNReposRelativeAccessFile cannot be defined at "
+ "same time as AuthzSVNAccessFile.";
+
+ conf->repo_relative_access_file = arg1;
+
+ return NULL;
+}
+
/* Implements the #cmds member of Apache's #module vtable. */
static const command_rec authz_svn_cmds[] =
{
@@ -84,10 +116,17 @@ static const command_rec authz_svn_cmds[
OR_AUTHCFG,
"Set to 'Off' to allow access control to be passed along to "
"lower modules. (default is On.)"),
- AP_INIT_TAKE1("AuthzSVNAccessFile", ap_set_file_slot,
- (void *)APR_OFFSETOF(authz_svn_config_rec, access_file),
+ AP_INIT_TAKE1("AuthzSVNAccessFile", AuthzSVNAccessFile_cmd,
+ NULL,
+ OR_AUTHCFG,
+ "Path to text file containing permissions of repository "
+ "paths."),
+ AP_INIT_TAKE1("AuthzSVNReposRelativeAccessFile",
+ AuthzSVNReposRelativeAccessFile_cmd,
+ NULL,
OR_AUTHCFG,
- "Text file containing permissions of repository paths."),
+ "Path (relative to repository 'conf' directory) to text "
+ "file containing permissions of repository paths. "),
AP_INIT_FLAG("AuthzSVNAnonymous", ap_set_flag_slot,
(void *)APR_OFFSETOF(authz_svn_config_rec, anonymous),
OR_AUTHCFG,
@@ -119,18 +158,40 @@ static svn_authz_t *
get_access_conf(request_rec *r, authz_svn_config_rec *conf)
{
const char *cache_key = NULL;
+ const char *access_file;
+ const char *repos_path;
void *user_data = NULL;
svn_authz_t *access_conf = NULL;
svn_error_t *svn_err;
+ dav_error *dav_err;
char errbuf[256];
+ if (conf->repo_relative_access_file)
+ {
+ dav_err = dav_svn_get_repos_path(r, conf->base_path, &repos_path);
+ if (dav_err) {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, dav_err->desc);
+ return NULL;
+ }
+ access_file = svn_dirent_join_many(r->pool, repos_path, "conf",
+ conf->repo_relative_access_file,
+ NULL);
+ }
+ else
+ {
+ access_file = conf->access_file;
+ }
+
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ "Path to authz file is %s", access_file);
+
cache_key = apr_pstrcat(r->pool, "mod_authz_svn:",
- conf->access_file, NULL);
+ access_file, (char *)NULL);
apr_pool_userdata_get(&user_data, cache_key, r->connection->pool);
access_conf = user_data;
if (access_conf == NULL)
{
- svn_err = svn_repos_authz_read(&access_conf, conf->access_file,
+ svn_err = svn_repos_authz_read(&access_conf, access_file,
TRUE, r->connection->pool);
if (svn_err)
{
@@ -298,7 +359,8 @@ req_check_access(request_rec *r,
if (repos_path)
repos_path = svn_path_join("/", repos_path, r->pool);
- *repos_path_ref = apr_pstrcat(r->pool, repos_name, ":", repos_path, NULL);
+ *repos_path_ref = apr_pstrcat(r->pool, repos_name, ":", repos_path,
+ (char *)NULL);
if (r->method_number == M_MOVE || r->method_number == M_COPY)
{
@@ -346,7 +408,7 @@ req_check_access(request_rec *r,
dest_repos_path = svn_path_join("/", dest_repos_path, r->pool);
*dest_repos_path_ref = apr_pstrcat(r->pool, dest_repos_name, ":",
- dest_repos_path, NULL);
+ dest_repos_path, (char *)NULL);
}
/* Retrieve/cache authorization file */
@@ -515,7 +577,8 @@ subreq_bypass(request_rec *r,
username_to_authorize = get_username_to_authorize(r, conf);
/* If configured properly, this should never be true, but just in case. */
- if (!conf->anonymous || !conf->access_file)
+ if (!conf->anonymous || !conf->access_file
+ || !conf->repo_relative_access_file)
{
log_access_verdict(APLOG_MARK, r, 0, repos_path, NULL);
return HTTP_FORBIDDEN;
@@ -579,7 +642,8 @@ access_checker(request_rec *r)
int status;
/* We are not configured to run */
- if (!conf->anonymous || !conf->access_file)
+ if (!conf->anonymous
+ || (!conf->access_file && !conf->repo_relative_access_file))
return DECLINED;
if (ap_some_auth_required(r))
@@ -637,7 +701,8 @@ check_user_id(request_rec *r)
/* We are not configured to run, or, an earlier module has already
* authenticated this request. */
- if (!conf->access_file || !conf->no_auth_when_anon_ok || r->user)
+ if ((!conf->access_file && !conf->repo_relative_access_file)
+ || !conf->no_auth_when_anon_ok || r->user)
return DECLINED;
/* If anon access is allowed, return OK, preventing later modules
@@ -664,7 +729,7 @@ auth_checker(request_rec *r)
int status;
/* We are not configured to run */
- if (!conf->access_file)
+ if (!conf->access_file && !conf->repo_relative_access_file)
return DECLINED;
/* Previous hook (check_user_id) already did all the work,
Modified: subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/authz.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/authz.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/authz.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/authz.c Thu Nov 4 20:48:21 2010
@@ -60,7 +60,7 @@ dav_svn__allow_read(request_rec *r,
allow_read_bypass = dav_svn__get_pathauthz_bypass(r);
if (allow_read_bypass != NULL)
{
- if (allow_read_bypass(r,path, repos->repo_name) == OK)
+ if (allow_read_bypass(r, path, repos->repo_basename) == OK)
return TRUE;
else
return FALSE;
Modified: subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/dav_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/dav_svn.h?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/dav_svn.h (original)
+++ subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/dav_svn.h Thu Nov 4 20:48:21 2010
@@ -645,12 +645,13 @@ dav_svn__get_deleted_rev_report(const da
/*** posts/ ***/
/* The list of Subversion's custom POSTs. */
-/* ### should move these report names to a public header to share with
- ### the client (and third parties). */
+/* ### TODO: Populate this list and transmit its contents in the
+ ### OPTIONS response.
static const char * dav_svn__posts_list[] = {
"create-txn",
NULL
};
+*/
/* The various POST handlers, defined in posts/, and used by repos.c. */
dav_error *
Modified: subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/deadprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/deadprops.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/deadprops.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/deadprops.c Thu Nov 4 20:48:21 2010
@@ -161,7 +161,9 @@ get_value(dav_db *db, const dav_prop_nam
static dav_error *
-save_value(dav_db *db, const dav_prop_name *name, const svn_string_t *value)
+save_value(dav_db *db, const dav_prop_name *name,
+ const svn_string_t *const *old_value_p,
+ const svn_string_t *value)
{
const char *propname;
svn_error_t *serr;
@@ -210,10 +212,11 @@ save_value(dav_db *db, const dav_prop_na
}
else
{
- serr = svn_repos_fs_change_rev_prop3(resource->info->repos->repos,
+ serr = svn_repos_fs_change_rev_prop4(resource->info->repos->repos,
resource->info->root.rev,
resource->info->repos->username,
- propname, value, TRUE, TRUE,
+ propname, old_value_p, value,
+ TRUE, TRUE,
db->authz_read_func,
db->authz_read_baton,
resource->pool);
@@ -425,6 +428,7 @@ db_map_namespaces(dav_db *db,
static dav_error *
decode_property_value(const svn_string_t **out_propval_p,
+ svn_boolean_t *absent,
const svn_string_t *maybe_encoded_propval,
const apr_xml_elem *elem,
apr_pool_t *pool)
@@ -432,6 +436,7 @@ decode_property_value(const svn_string_t
apr_xml_attr *attr = elem->attr;
/* Default: no "encoding" attribute. */
+ *absent = FALSE;
*out_propval_p = maybe_encoded_propval;
/* Check for special encodings of the property value. */
@@ -443,12 +448,21 @@ decode_property_value(const svn_string_t
/* Handle known encodings here. */
if (enc_type && (strcmp(enc_type, "base64") == 0))
- *out_propval_p = svn_base64_decode_string(maybe_encoded_propval, pool);
+ *out_propval_p = svn_base64_decode_string(maybe_encoded_propval,
+ pool);
else
return dav_new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0,
"Unknown property encoding");
break;
}
+
+ if (strcmp(attr->name, SVN_DAV__OLD_VALUE__ABSENT) == 0)
+ {
+ /* ### parse attr->value */
+ *absent = TRUE;
+ *out_propval_p = NULL;
+ }
+
/* Next attribute, please. */
attr = attr->next;
}
@@ -462,7 +476,10 @@ db_store(dav_db *db,
const apr_xml_elem *elem,
dav_namespace_map *mapping)
{
+ const svn_string_t *const *old_propval_p;
+ const svn_string_t *old_propval;
const svn_string_t *propval;
+ svn_boolean_t absent;
apr_pool_t *pool = db->p;
dav_error *derr;
@@ -475,11 +492,41 @@ db_store(dav_db *db,
propval = svn_string_create
(dav_xml_get_cdata(elem, pool, 0 /* strip_white */), pool);
- derr = decode_property_value(&propval, propval, elem, pool);
+ derr = decode_property_value(&propval, &absent, propval, elem, pool);
if (derr)
return derr;
- return save_value(db, name, propval);
+ if (absent && ! elem->first_child)
+ /* ### better error check */
+ return dav_new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+ apr_psprintf(pool,
+ "'%s' cannot be specified on the value "
+ "without specifying an expectation",
+ SVN_DAV__OLD_VALUE__ABSENT));
+
+ /* ### namespace check? */
+ if (elem->first_child && !strcmp(elem->first_child->name, SVN_DAV__OLD_VALUE))
+ {
+ const char *propname;
+
+ get_repos_propname(db, name, &propname);
+
+ /* Parse OLD_PROPVAL. */
+ old_propval = svn_string_create(dav_xml_get_cdata(elem->first_child, pool,
+ 0 /* strip_white */),
+ pool);
+ derr = decode_property_value(&old_propval, &absent,
+ old_propval, elem->first_child, pool);
+ if (derr)
+ return derr;
+
+ old_propval_p = (const svn_string_t *const *) &old_propval;
+ }
+ else
+ old_propval_p = NULL;
+
+
+ return save_value(db, name, old_propval_p, propval);
}
@@ -506,10 +553,10 @@ db_remove(dav_db *db, const dav_prop_nam
not a working resource! But this is how we currently
(hackily) allow the svn client to change unversioned rev
props. See issue #916. */
- serr = svn_repos_fs_change_rev_prop3(db->resource->info->repos->repos,
+ serr = svn_repos_fs_change_rev_prop4(db->resource->info->repos->repos,
db->resource->info->root.rev,
db->resource->info->repos->username,
- propname, NULL, TRUE, TRUE,
+ propname, NULL, NULL, TRUE, TRUE,
db->authz_read_func,
db->authz_read_baton,
db->resource->pool);
Modified: subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/lock.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/lock.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/lock.c Thu Nov 4 20:48:21 2010
@@ -91,7 +91,7 @@ svn_lock_to_dav_lock(dav_lock **dlock,
"<D:owner xmlns:D=\"DAV:\">",
apr_xml_quote_string(pool,
slock->comment, 1),
- "</D:owner>", NULL);
+ "</D:owner>", (char *)NULL);
}
else
{
@@ -133,7 +133,7 @@ unescape_xml(const char **output,
apr_xml_doc *xml_doc;
apr_status_t apr_err;
const char *xml_input = apr_pstrcat
- (pool, "<?xml version=\"1.0\" encoding=\"utf-8\"?>", input, NULL);
+ (pool, "<?xml version=\"1.0\" encoding=\"utf-8\"?>", input, (char *)NULL);
apr_err = apr_xml_parser_feed(xml_parser, xml_input, strlen(xml_input));
if (!apr_err)
Modified: subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/mirror.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/mirror.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/mirror.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/mirror.c Thu Nov 4 20:48:21 2010
@@ -49,7 +49,8 @@ static void proxy_request_fixup(request_
r->filename = (char *) svn_path_uri_encode(apr_pstrcat(r->pool, "proxy:",
master_uri,
uri_segment,
- NULL), r->pool);
+ (char *)NULL),
+ r->pool);
r->handler = "proxy-server";
ap_add_output_filter("LocationRewrite", NULL, r, r->connection);
ap_add_output_filter("ReposRewrite", NULL, r, r->connection);
@@ -83,11 +84,11 @@ int dav_svn__proxy_request_fixup(request
r->method_number == M_GET) {
if ((seg = ap_strstr(r->uri, root_dir))) {
if (ap_strstr_c(seg, apr_pstrcat(r->pool, special_uri,
- "/wrk/", NULL))
+ "/wrk/", (char *)NULL))
|| ap_strstr_c(seg, apr_pstrcat(r->pool, special_uri,
- "/txn/", NULL))
+ "/txn/", (char *)NULL))
|| ap_strstr_c(seg, apr_pstrcat(r->pool, special_uri,
- "/txr/", NULL))) {
+ "/txr/", (char *)NULL))) {
seg += strlen(root_dir);
proxy_request_fixup(r, master_uri, seg);
}
@@ -239,7 +240,7 @@ apr_status_t dav_svn__location_header_fi
new_uri = ap_construct_url(r->pool,
apr_pstrcat(r->pool,
dav_svn__get_root_dir(r), "/",
- start_foo, NULL),
+ start_foo, (char *)NULL),
r);
new_uri = svn_path_uri_encode(new_uri, r->pool);
apr_table_set(r->headers_out, "Location", new_uri);
Modified: subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/mod_dav_svn.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/mod_dav_svn.c Thu Nov 4 20:48:21 2010
@@ -311,18 +311,24 @@ SVNPathAuthz_cmd(cmd_parms *cmd, void *c
dir_conf_t *conf = config;
if (apr_strnatcasecmp("off", arg1) == 0)
- conf->path_authz_method = CONF_PATHAUTHZ_OFF;
- else if (apr_strnatcasecmp(PATHAUTHZ_BYPASS_ARG,arg1) == 0)
+ {
+ conf->path_authz_method = CONF_PATHAUTHZ_OFF;
+ }
+ else if (apr_strnatcasecmp(PATHAUTHZ_BYPASS_ARG, arg1) == 0)
{
conf->path_authz_method = CONF_PATHAUTHZ_BYPASS;
if (pathauthz_bypass_func == NULL)
- pathauthz_bypass_func=ap_lookup_provider(
- AUTHZ_SVN__SUBREQ_BYPASS_PROV_GRP,
- AUTHZ_SVN__SUBREQ_BYPASS_PROV_NAME,
- AUTHZ_SVN__SUBREQ_BYPASS_PROV_VER);
+ {
+ pathauthz_bypass_func =
+ ap_lookup_provider(AUTHZ_SVN__SUBREQ_BYPASS_PROV_GRP,
+ AUTHZ_SVN__SUBREQ_BYPASS_PROV_NAME,
+ AUTHZ_SVN__SUBREQ_BYPASS_PROV_VER);
+ }
}
else
- conf->path_authz_method = CONF_PATHAUTHZ_ON;
+ {
+ conf->path_authz_method = CONF_PATHAUTHZ_ON;
+ }
return NULL;
}
@@ -525,35 +531,39 @@ dav_svn__get_special_uri(request_rec *r)
const char *
dav_svn__get_me_resource_uri(request_rec *r)
{
- return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/me", NULL);
+ return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/me",
+ (char *)NULL);
}
const char *
dav_svn__get_rev_stub(request_rec *r)
{
- return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/rev", NULL);
+ return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/rev",
+ (char *)NULL);
}
const char *
dav_svn__get_rev_root_stub(request_rec *r)
{
- return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/rvr", NULL);
+ return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/rvr",
+ (char *)NULL);
}
const char *
dav_svn__get_txn_stub(request_rec *r)
{
- return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/txn", NULL);
+ return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/txn",
+ (char *)NULL);
}
const char *
dav_svn__get_txn_root_stub(request_rec *r)
{
- return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/txr", NULL);
+ return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/txr", (char *)NULL);
}
@@ -608,7 +618,7 @@ dav_svn__get_pathauthz_bypass(request_re
conf = ap_get_module_config(r->per_dir_config, &dav_svn_module);
- if (conf->path_authz_method==CONF_PATHAUTHZ_BYPASS)
+ if (conf->path_authz_method == CONF_PATHAUTHZ_BYPASS)
return pathauthz_bypass_func;
return NULL;
}
Modified: subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/reports/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/reports/replay.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/reports/replay.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/reports/replay.c Thu Nov 4 20:48:21 2010
@@ -402,7 +402,7 @@ malformed_element_error(const char *tagn
"The request's '", tagname,
"' element is malformed; there "
"is a problem with the client.",
- NULL),
+ (char *)NULL),
SVN_DAV_ERROR_NAMESPACE, SVN_DAV_ERROR_TAG);
}
Modified: subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/reports/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/reports/update.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/reports/update.c Thu Nov 4 20:48:21 2010
@@ -250,7 +250,7 @@ absent_helper(svn_boolean_t is_dir,
"<S:absent-%s name=\"%s\"/>" DEBUG_CR,
DIR_OR_FILE(is_dir),
apr_xml_quote_string(pool,
- svn_relpath_basename(path, pool),
+ svn_relpath_basename(path, NULL),
1)));
}
@@ -409,8 +409,6 @@ open_helper(svn_boolean_t is_dir,
static svn_error_t *
close_helper(svn_boolean_t is_dir, item_baton_t *baton)
{
- int i;
-
if (baton->uc->resource_walk)
return SVN_NO_ERROR;
@@ -419,6 +417,7 @@ close_helper(svn_boolean_t is_dir, item_
if (baton->removed_props && (! baton->added || baton->copyfrom))
{
const char *qname;
+ int i;
for (i = 0; i < baton->removed_props->nelts; i++)
{
@@ -589,7 +588,7 @@ upd_delete_entry(const char *path,
{
item_baton_t *parent = parent_baton;
const char *qname = apr_xml_quote_string(pool,
- svn_relpath_basename(path, pool),
+ svn_relpath_basename(path, NULL),
1);
return dav_svn__brigade_printf(parent->uc->bb, parent->uc->output,
"<S:delete-entry name=\"%s\"/>" DEBUG_CR,
@@ -918,7 +917,8 @@ malformed_element_error(const char *tagn
{
const char *errstr = apr_pstrcat(pool, "The request's '", tagname,
"' element is malformed; there "
- "is a problem with the client.", NULL);
+ "is a problem with the client.",
+ (char *)NULL);
return dav_svn__new_error_tag(pool, HTTP_BAD_REQUEST, 0, errstr,
SVN_DAV_ERROR_NAMESPACE, SVN_DAV_ERROR_TAG);
}
Modified: subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/repos.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/repos.c Thu Nov 4 20:48:21 2010
@@ -1106,7 +1106,7 @@ create_private_resource(const dav_resour
/* versioned = baselined = working = FALSE */
comb->res.uri = apr_pstrcat(base->pool, base->info->repos->root_path,
- path->data, NULL);
+ path->data, (char *)NULL);
comb->res.info = &comb->priv;
comb->res.hooks = &dav_svn__hooks_repository;
comb->res.pool = base->pool;
@@ -1140,7 +1140,7 @@ dav_svn_split_uri(request_rec *r,
const char *root_path,
const char **cleaned_uri,
int *trailing_slash,
- const char **repos_name,
+ const char **repos_basename,
const char **relative_path,
const char **repos_path)
{
@@ -1216,14 +1216,14 @@ dav_svn_split_uri(request_rec *r,
### slash. something about SVN-private-path */
/* Depending on whether SVNPath or SVNParentPath was used, we need
- to compute 'relative' and 'repos_name' differently. */
+ to compute 'relative' and 'repos_basename' differently. */
/* Normal case: the SVNPath command was used to specify a
particular repository. */
if (fs_path != NULL)
{
- /* the repos_name is the last component of root_path. */
- *repos_name = svn_dirent_basename(root_path, r->pool);
+ /* the repos_basename is the last component of root_path. */
+ *repos_basename = svn_dirent_basename(root_path, r->pool);
/* 'relative' is already correct for SVNPath; the root_path
already contains the name of the repository, so relative is
@@ -1264,7 +1264,7 @@ dav_svn_split_uri(request_rec *r,
}
/* return answer */
- *repos_name = magic_component;
+ *repos_basename = magic_component;
}
/* We can return 'relative' at this point too. */
@@ -1459,7 +1459,7 @@ get_parentpath_resource(request_rec *r,
if (r->uri[len-1] != '/')
{
new_uri = apr_pstrcat(r->pool, ap_escape_uri(r->pool, r->uri),
- "/", NULL);
+ "/", (char *)NULL);
apr_table_setn(r->headers_out, "Location",
ap_construct_url(r->pool, new_uri, r));
return dav_new_error(r->pool, HTTP_MOVED_PERMANENTLY, 0,
@@ -1882,7 +1882,7 @@ get_resource(request_rec *r,
dav_resource_combined *comb;
dav_svn_repos *repos;
const char *cleaned_uri;
- const char *repos_name;
+ const char *repo_basename;
const char *relative;
const char *repos_path;
const char *repos_key;
@@ -1925,7 +1925,7 @@ get_resource(request_rec *r,
/* This does all the work of interpreting/splitting the request uri. */
err = dav_svn_split_uri(r, r->uri, root_path,
&cleaned_uri, &had_slash,
- &repos_name, &relative, &repos_path);
+ &repo_basename, &relative, &repos_path);
if (err)
return err;
@@ -1938,9 +1938,9 @@ get_resource(request_rec *r,
{
/* ...then the URL to the repository is actually one implicit
component longer... */
- root_path = svn_uri_join(root_path, repos_name, r->pool);
+ root_path = svn_uri_join(root_path, repo_basename, r->pool);
/* ...and we need to specify exactly what repository to open. */
- fs_path = svn_dirent_join(fs_parent_path, repos_name, r->pool);
+ fs_path = svn_dirent_join(fs_parent_path, repo_basename, r->pool);
}
/* Start building and filling a 'combination' object. */
@@ -2011,7 +2011,7 @@ get_resource(request_rec *r,
repos->repo_name = repo_name;
/* The repository filesystem basename */
- repos->repo_basename = repos_name;
+ repos->repo_basename = repo_basename;
/* An XSL transformation */
repos->xslt_uri = xslt_uri;
@@ -2090,7 +2090,7 @@ get_resource(request_rec *r,
}
/* Retrieve/cache open repository */
- repos_key = apr_pstrcat(r->pool, "mod_dav_svn:", fs_path, NULL);
+ repos_key = apr_pstrcat(r->pool, "mod_dav_svn:", fs_path, (char *)NULL);
apr_pool_userdata_get(&userdata, repos_key, r->connection->pool);
repos->repos = userdata;
if (repos->repos == NULL)
@@ -2253,7 +2253,7 @@ get_resource(request_rec *r,
"/",
r->args ? "?" : "",
r->args ? r->args : "",
- NULL);
+ (char *)NULL);
apr_table_setn(r->headers_out, "Location",
ap_construct_url(r->pool, new_path, r));
return dav_new_error(r->pool, HTTP_MOVED_PERMANENTLY, 0,
@@ -3338,7 +3338,7 @@ deliver(const dav_resource *resource, ap
/* ### The xml output doesn't like to see a trailing slash on
### the visible portion, so avoid that. */
if (is_dir)
- href = apr_pstrcat(entry_pool, href, "/", NULL);
+ href = apr_pstrcat(entry_pool, href, "/", (char *)NULL);
if (gen_html)
name = href;
@@ -4055,7 +4055,7 @@ do_walk(walker_ctx_t *ctx, int depth)
apr_pstrmemdup(iterpool,
ctx->repos_path->data,
ctx->repos_path->len),
- key, NULL);
+ key, (char *)NULL);
if (! dav_svn__allow_read(ctx->info.r, ctx->info.repos,
repos_relpath, ctx->info.root.rev,
iterpool))
@@ -4212,7 +4212,7 @@ dav_svn__create_working_resource(dav_res
/* collection = FALSE. ### not necessarily correct */
res->uri = apr_pstrcat(base->pool, base->info->repos->root_path,
- path, NULL);
+ path, (char *)NULL);
res->hooks = &dav_svn__hooks_repository;
res->pool = base->pool;
Modified: subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/util.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/util.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/util.c Thu Nov 4 20:48:21 2010
@@ -107,6 +107,9 @@ dav_svn__convert_err(svn_error_t *serr,
case SVN_ERR_FS_PATH_ALREADY_LOCKED:
status = HTTP_LOCKED;
break;
+ case SVN_ERR_FS_PROP_BASEVALUE_MISMATCH:
+ status = HTTP_PRECONDITION_FAILED;
+ break;
/* add other mappings here */
}
Modified: subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/version.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/mod_dav_svn/version.c Thu Nov 4 20:48:21 2010
@@ -41,7 +41,6 @@
#include "private/svn_log.h"
#include "dav_svn.h"
-#include "mod_dav_svn.h"
svn_error_t *
@@ -143,6 +142,7 @@ get_vsn_options(apr_pool_t *p, apr_text_
/* Send SVN_RA_CAPABILITY_* capabilities. */
apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_DEPTH);
apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_LOG_REVPROPS);
+ apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS);
apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY);
/* Mergeinfo is a special case: here we merely say that the server
* knows how to handle mergeinfo -- whether the repository does too
@@ -235,19 +235,19 @@ get_option(const dav_resource *resource,
apr_table_set(r->headers_out, SVN_DAV_ROOT_URI_HEADER, repos_root_uri);
apr_table_set(r->headers_out, SVN_DAV_ME_RESOURCE_HEADER,
apr_pstrcat(resource->pool, repos_root_uri, "/",
- dav_svn__get_me_resource_uri(r), NULL));
+ dav_svn__get_me_resource_uri(r), (char *)NULL));
apr_table_set(r->headers_out, SVN_DAV_REV_ROOT_STUB_HEADER,
apr_pstrcat(resource->pool, repos_root_uri, "/",
- dav_svn__get_rev_root_stub(r), NULL));
+ dav_svn__get_rev_root_stub(r), (char *)NULL));
apr_table_set(r->headers_out, SVN_DAV_REV_STUB_HEADER,
apr_pstrcat(resource->pool, repos_root_uri, "/",
- dav_svn__get_rev_stub(r), NULL));
+ dav_svn__get_rev_stub(r), (char *)NULL));
apr_table_set(r->headers_out, SVN_DAV_TXN_ROOT_STUB_HEADER,
apr_pstrcat(resource->pool, repos_root_uri, "/",
- dav_svn__get_txn_root_stub(r), NULL));
+ dav_svn__get_txn_root_stub(r), (char *)NULL));
apr_table_set(r->headers_out, SVN_DAV_TXN_STUB_HEADER,
apr_pstrcat(resource->pool, repos_root_uri, "/",
- dav_svn__get_txn_stub(r), NULL));
+ dav_svn__get_txn_stub(r), (char *)NULL));
}
return NULL;
@@ -1015,22 +1015,6 @@ deliver_report(request_rec *r,
if (doc->root->ns == ns)
{
- const char *cleaned_uri, *relative_path, *repos_path;
- int trailing_slash;
- /* During SVNPathAuthz short_circuit
- * resource->info->repos->repo_name becomes NULL.*/
- if (resource->info->repos->repo_name == NULL)
- {
- dav_error *err;
- err = dav_svn_split_uri(r, r->uri, dav_svn__get_root_dir(r),
- &cleaned_uri, &trailing_slash,
- &(resource->info->repos->repo_name),
- &relative_path, &repos_path);
- if (err)
- {
- return err;
- }
- }
/* ### note that these report names should have symbols... */
if (strcmp(doc->root->name, "update-report") == 0)