You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/08/16 12:18:03 UTC
svn commit: r1373783 [34/50] - in /subversion/branches/compressed-pristines:
./ build/ build/ac-macros/ build/generator/ build/generator/templates/
build/win32/ contrib/client-side/emacs/ contrib/client-side/svn-push/
contrib/client-side/svnmerge/ cont...
Modified: subversion/branches/compressed-pristines/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_wc/wc_db.h?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_wc/wc_db.h Thu Aug 16 10:17:48 2012
@@ -435,6 +435,25 @@ svn_wc__db_base_add_directory(svn_wc__db
const svn_skel_t *work_items,
apr_pool_t *scratch_pool);
+/* Add a new directory in BASE, whether WORKING nodes exist or not. Mark it
+ as incomplete and with revision REVISION. If REPOS_RELPATH is not NULL,
+ apply REPOS_RELPATH, REPOS_ROOT_URL and REPOS_UUID.
+ Perform all temporary allocations in SCRATCH_POOL.
+ */
+svn_error_t *
+svn_wc__db_base_add_incomplete_directory(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_depth_t depth,
+ svn_boolean_t insert_base_deleted,
+ svn_boolean_t delete_working,
+ svn_skel_t *conflict,
+ svn_skel_t *work_items,
+ apr_pool_t *scratch_pool);
+
/* Add or replace a file in the BASE tree.
@@ -484,11 +503,12 @@ svn_wc__db_base_add_file(svn_wc__db_t *d
const char *changed_author,
const svn_checksum_t *checksum,
apr_hash_t *dav_cache,
- const svn_skel_t *conflict,
+ svn_boolean_t delete_working,
svn_boolean_t update_actual_props,
apr_hash_t *new_actual_props,
svn_boolean_t keep_recorded_info,
svn_boolean_t insert_base_deleted,
+ const svn_skel_t *conflict,
const svn_skel_t *work_items,
apr_pool_t *scratch_pool);
@@ -565,9 +585,12 @@ svn_wc__db_base_add_symlink(svn_wc__db_t
const char *changed_author,
const char *target,
apr_hash_t *dav_cache,
- const svn_skel_t *conflict,
+ svn_boolean_t delete_working,
svn_boolean_t update_actual_props,
apr_hash_t *new_actual_props,
+ svn_boolean_t keep_recorded_info,
+ svn_boolean_t insert_base_deleted,
+ const svn_skel_t *conflict,
const svn_skel_t *work_items,
apr_pool_t *scratch_pool);
@@ -636,13 +659,15 @@ svn_wc__db_base_add_not_present_node(svn
apr_pool_t *scratch_pool);
-/* Remove a node from the BASE tree.
+/* Remove a node and all its descendants from the BASE tree. This handles
+ the deletion of a tree from the update editor and some file external
+ scenarios.
The node to remove is indicated by LOCAL_ABSPATH from the local
filesystem.
- Note that no changes are made to the local filesystem; LOCAL_ABSPATH
- is merely the key to figure out which BASE node to remove.
+ This operation *installs* workqueue operations to update the local
+ filesystem after the database operation.
To maintain a consistent database this function will also remove
any working node that marks LOCAL_ABSPATH as base-deleted. If this
@@ -650,12 +675,24 @@ svn_wc__db_base_add_not_present_node(svn
actual node will be removed if the actual node does not mark a
conflict.
- Note the caller is responsible for removing base node
- children before calling this function (this may change).
+ If KEEP_AS_WORKING is TRUE, then the base tree is copied to higher
+ layers as a copy of itself before deleting the BASE nodes.
+
+ If NOT_PRESENT_REVISION specifies a valid revision a not-present
+ node is installed in BASE node with kind NOT_PRESENT_KIND after
+ deleting.
+
+ If CONFLICT and/or WORK_ITEMS are passed they are installed as part
+ of the operation, after the work items inserted by the operation
+ itself.
*/
svn_error_t *
svn_wc__db_base_remove(svn_wc__db_t *db,
const char *local_abspath,
+ svn_boolean_t keep_as_working,
+ svn_revnum_t not_present_revision,
+ svn_skel_t *conflict,
+ svn_skel_t *work_items,
apr_pool_t *scratch_pool);
@@ -941,6 +978,18 @@ svn_wc__db_pristine_get_sha1(const svn_c
apr_pool_t *scratch_pool);
+/* If necessary transfers the PRISTINE file of SRC_LOCAL_ABSPATH to the
+ working copy identified by DST_WRI_ABSPATH. If CHECKSUM is not NULL, use
+ CHECKSUM to identify which pristine file to transfer. */
+svn_error_t *
+svn_wc__db_pristine_transfer(svn_wc__db_t *db,
+ const char *src_local_abspath,
+ const svn_checksum_t *checksum,
+ const char *dst_wri_abspath,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *scratch_pool);
+
/* Remove the pristine text with SHA-1 checksum SHA1_CHECKSUM from the
* pristine store, iff it is not referenced by any of the (other) WC DB
* tables. */
@@ -1005,6 +1054,7 @@ svn_wc__db_external_add_file(svn_wc__db_
apr_hash_t *new_actual_props,
svn_boolean_t keep_recorded_info,
+ const svn_skel_t *conflict,
const svn_skel_t *work_items,
apr_pool_t *scratch_pool);
@@ -1281,6 +1331,8 @@ svn_wc__db_op_copy_file(svn_wc__db_t *db
const char *original_uuid,
svn_revnum_t original_revision,
const svn_checksum_t *checksum,
+ svn_boolean_t update_actual_props,
+ const apr_hash_t *new_actual_props,
svn_boolean_t is_move,
const svn_skel_t *conflict,
const svn_skel_t *work_items,
@@ -1414,6 +1466,10 @@ svn_wc__db_temp_working_set_props(svn_wc
/* Mark LOCAL_ABSPATH, and all children, for deletion.
*
+ * This function removes the file externals (and if DELETE_DIR_EXTERNALS is
+ * TRUE also the directory externals) registered below LOCAL_ABSPATH.
+ * (DELETE_DIR_EXTERNALS should be true if also removing unversioned nodes)
+ *
* If MOVED_TO_ABSPATH is not NULL, mark the deletion of LOCAL_ABSPATH
* as the delete-half of a move from LOCAL_ABSPATH to MOVED_TO_ABSPATH.
*
@@ -1429,11 +1485,13 @@ svn_error_t *
svn_wc__db_op_delete(svn_wc__db_t *db,
const char *local_abspath,
const char *moved_to_abspath,
- /* ### flip to CANCEL, then NOTIFY. precedent. */
- svn_wc_notify_func2_t notify_func,
- void *notify_baton,
+ svn_boolean_t delete_dir_externals,
+ svn_skel_t *conflict,
+ svn_skel_t *work_items,
svn_cancel_func_t cancel_func,
void *cancel_baton,
+ svn_wc_notify_func2_t notify_func,
+ void *notify_baton,
apr_pool_t *scratch_pool);
@@ -1445,6 +1503,10 @@ svn_wc__db_op_delete(svn_wc__db_t *db,
* It currently lacks support for moves (though this could be changed,
* at which point svn_wc__db_op_delete() becomes redundant).
*
+ * This function removes the file externals (and if DELETE_DIR_EXTERNALS is
+ * TRUE also the directory externals) registered below the targets.
+ * (DELETE_DIR_EXTERNALS should be true if also removing unversioned nodes)
+ *
* If NOTIFY_FUNC is not NULL, then it will be called (with NOTIFY_BATON)
* for each node deleted. While this processing occurs, if CANCEL_FUNC is
* not NULL, then it will be called (with CANCEL_BATON) to detect cancellation
@@ -1456,6 +1518,8 @@ svn_wc__db_op_delete(svn_wc__db_t *db,
svn_error_t *
svn_wc__db_op_delete_many(svn_wc__db_t *db,
apr_array_header_t *targets,
+ svn_boolean_t delete_dir_externals,
+ const svn_skel_t *conflict,
svn_cancel_func_t cancel_func,
void *cancel_baton,
svn_wc_notify_func2_t notify_func,
@@ -1487,12 +1551,21 @@ svn_wc__db_op_set_changelist(svn_wc__db_
void *cancel_baton,
apr_pool_t *scratch_pool);
+/* Record CONFLICT on LOCAL_ABSPATH, potentially replacing other conflicts
+ recorded on LOCAL_ABSPATH.
+
+ Users should in most cases pass CONFLICT to another WC_DB call instead of
+ calling svn_wc__db_op_mark_conflict() directly outside a transaction, to
+ allow recording atomically with the operation involved.
-/* ### caller maintains ACTUAL. we're just recording state. */
-/* ### we probably need to record details of the conflict. how? */
+ Any work items that are necessary as part of marking this node conflicted
+ can be passed in WORK_ITEMS.
+ */
svn_error_t *
svn_wc__db_op_mark_conflict(svn_wc__db_t *db,
const char *local_abspath,
+ const svn_skel_t *conflict,
+ const svn_skel_t *work_items,
apr_pool_t *scratch_pool);
@@ -1507,6 +1580,7 @@ svn_wc__db_op_mark_resolved(svn_wc__db_t
svn_boolean_t resolved_text,
svn_boolean_t resolved_props,
svn_boolean_t resolved_tree,
+ const svn_skel_t *work_items,
apr_pool_t *scratch_pool);
@@ -1530,9 +1604,8 @@ svn_wc__db_op_revert(svn_wc__db_t *db,
apr_pool_t *scratch_pool);
/* Query the revert list for LOCAL_ABSPATH and set *REVERTED if the
- * path was reverted. Set *CONFLICT_OLD, *CONFLICT_NEW,
- * *CONFLICT_WORKING and *PROP_REJECT to the names of the conflict
- * files, or NULL if the names are not stored.
+ * path was reverted. Set *MARKER_FILES to a const char *list of
+ * marker files if any were recorded on LOCAL_ABSPATH.
*
* Set *COPIED_HERE if the reverted node was copied here and is the
* operation root of the copy.
@@ -1542,10 +1615,7 @@ svn_wc__db_op_revert(svn_wc__db_t *db,
*/
svn_error_t *
svn_wc__db_revert_list_read(svn_boolean_t *reverted,
- const char **conflict_old,
- const char **conflict_new,
- const char **conflict_working,
- const char **prop_reject,
+ const apr_array_header_t **marker_files,
svn_boolean_t *copied_here,
svn_kind_t *kind,
svn_wc__db_t *db,
@@ -1593,50 +1663,6 @@ svn_wc__db_revert_list_done(svn_wc__db_t
const char *local_abspath,
apr_pool_t *scratch_pool);
-
-/* Return a hash @a *tree_conflicts of all the children of @a
- * local_abspath that are in tree conflicts. The hash maps local
- * basenames to pointers to svn_wc_conflict_description2_t, all
- * allocated in result pool.
- */
-/* ### this is not an OPERATION. remove the _op_. */
-svn_error_t *
-svn_wc__db_op_read_all_tree_conflicts(apr_hash_t **tree_conflicts,
- svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
-/* Get any tree conflict associated with LOCAL_ABSPATH in DB, and put it
- in *TREE_CONFLICT, allocated in RESULT_POOL.
-
- Use SCRATCH_POOL for any temporary allocations.
-*/
-/* ### this is not an OPERATION. remove the _op_. */
-svn_error_t *
-svn_wc__db_op_read_tree_conflict(
- const svn_wc_conflict_description2_t **tree_conflict,
- svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
-
-/* Set the tree conflict on LOCAL_ABSPATH in DB to TREE_CONFLICT. Use
- NULL to remove a tree conflict.
-
- Use SCRATCH_POOL for any temporary allocations.
-*/
-/* ### can this also record text/prop conflicts? drop "tree"? */
-/* ### dunno if it can, but it definitely should be able to. */
-/* ### gjs: also ref: db_op_mark_conflict() */
-svn_error_t *
-svn_wc__db_op_set_tree_conflict(svn_wc__db_t *db,
- const char *local_abspath,
- const svn_wc_conflict_description2_t *tree_conflict,
- apr_pool_t *scratch_pool);
-
-
/* ### status */
@@ -2021,9 +2047,6 @@ svn_wc__db_read_props(apr_hash_t **props
* a hash table mapping <tt>char *</tt> names onto svn_string_t *
* values for any properties of child nodes of LOCAL_ABSPATH (up to DEPTH).
*
- * If BASE_PROPS is TRUE, read the properties from the BASE layer (op_depth=0),
- * without local modifications.
- *
* If BASE_PROPS is FALSE, read the properties from the WORKING layer (highest
* op_depth).
*
@@ -2034,7 +2057,6 @@ svn_error_t *
svn_wc__db_read_props_streamily(svn_wc__db_t *db,
const char *local_abspath,
svn_depth_t depth,
- svn_boolean_t base_props,
svn_boolean_t pristine,
const apr_array_header_t *changelists,
svn_wc__proplist_receiver_t receiver_func,
@@ -2062,6 +2084,22 @@ svn_wc__db_read_pristine_props(apr_hash_
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+
+/** Obtain a mapping of const char * local_abspaths to const svn_string_t*
+ * property values in *VALUES, of all PROPNAME properties on LOCAL_ABSPATH
+ * and its descendants.
+ *
+ * Allocate the result in RESULT_POOL, and perform temporary allocations in
+ * SCRATCH_POOL.
+ */
+svn_error_t *
+svn_wc__db_prop_retrieve_recursive(apr_hash_t **values,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ const char *propname,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
/* Set *CHILDREN to a new array of the (const char *) basenames of the
immediate children of the working node at LOCAL_ABSPATH in DB.
@@ -2115,13 +2153,12 @@ svn_wc__db_read_conflict_victims(const a
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Read into *MARKER_FILES the basenames of the immediate children of
- LOCAL_ABSPATH in DB that are unversioned marker files for text or
- property conflicts. The files may have been deleted by the user.
+/* Read into *MARKER_FILES the absolute paths of the marker files
+ of conflicts stored on LOCAL_ABSPATH and its immediate children in DB.
+ The on-disk files may have been deleted by the user.
Allocate *MARKER_FILES in RESULT_POOL and do temporary allocations
in SCRATCH_POOL */
-/* ### This function will probably be removed. */
svn_error_t *
svn_wc__db_get_conflict_marker_files(apr_hash_t **markers,
svn_wc__db_t *db,
@@ -2129,22 +2166,20 @@ svn_wc__db_get_conflict_marker_files(apr
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Read into CONFLICTS svn_wc_conflict_description2_t* structs
- for all conflicts that have LOCAL_ABSPATH as victim.
+/* Read the conflict information recorded on LOCAL_ABSPATH in *CONFLICT,
+ an editable conflict skel.
- Victim must be versioned or be part of a tree conflict.
+ If the node exists, but does not have a conflict set *CONFLICT to NULL,
+ otherwise return a SVN_ERR_WC_PATH_NOT_FOUND error.
Allocate *CONFLICTS in RESULT_POOL and do temporary allocations in
SCRATCH_POOL */
-/* ### Currently there can be just one property conflict recorded
- per victim */
-/* ### This function will probably be removed. */
svn_error_t *
-svn_wc__db_read_conflicts(const apr_array_header_t **conflicts,
- svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
+svn_wc__db_read_conflict(svn_skel_t **conflict,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* Return the kind of the node in DB at LOCAL_ABSPATH. The WORKING tree will
@@ -2153,12 +2188,16 @@ svn_wc__db_read_conflicts(const apr_arra
If the node is missing and ALLOW_MISSING is FALSE, then it will return
SVN_ERR_WC_PATH_NOT_FOUND.
+ If SHOW_HIDDEN is FALSE and the status of LOCAL_ABSPATH is NOT_PRESENT or
+ EXCLUDED, set KIND to svn_kind_none.
+
Uses SCRATCH_POOL for temporary allocations. */
svn_error_t *
svn_wc__db_read_kind(svn_kind_t *kind,
svn_wc__db_t *db,
const char *local_abspath,
svn_boolean_t allow_missing,
+ svn_boolean_t show_hidden,
apr_pool_t *scratch_pool);
@@ -2252,7 +2291,7 @@ svn_wc__db_global_relocate(svn_wc__db_t
the commit. It will become the BASE node's 'revnum' and 'changed_rev'
values in the BASE_NODE table.
- CHANGED_REVISION is the the new 'last changed' revision. If the node is
+ CHANGED_REVISION is the new 'last changed' revision. If the node is
modified its value is equivalent to NEW_REVISION, but in case of a
decendant of a copy/move it can be an older revision.
@@ -2437,6 +2476,10 @@ svn_wc__db_lock_remove(svn_wc__db_t *db,
All returned data will be allocated in RESULT_POOL. All temporary
allocations will be made in SCRATCH_POOL.
+
+ ### Either delete this function and use _base_get_info instead, or
+ ### add a 'revision' output to make a complete repository node location
+ ### and rename to not say 'scan', because it doesn't.
*/
svn_error_t *
svn_wc__db_scan_base_repos(const char **repos_relpath,
@@ -2795,27 +2838,41 @@ svn_wc__db_wclock_owns_lock(svn_boolean_
*/
/* Removes all references to LOCAL_ABSPATH from DB, while optionally leaving
- tree conflicts and/or a not present node.
+ a not present node.
This operation always recursively removes all nodes at and below
LOCAL_ABSPATH from NODES and ACTUAL.
If NOT_PRESENT_REVISION specifies a valid revision, leave a not_present
- BASE node at local_abspath. (Requires an existing BASE node before removing)
+ BASE node at local_abspath of the specified status and kind.
+ (Requires an existing BASE node before removing)
+
+ If DESTROY_WC is TRUE, this operation *installs* workqueue operations to
+ update the local filesystem after the database operation. If DESTROY_CHANGES
+ is FALSE, modified and unversioned files are left after running this
+ operation (and the WQ). If DESTROY_CHANGES and DESTROY_WC are TRUE,
+ LOCAL_ABSPATH and everything below it will be removed by the WQ.
+
+
+ Note: Unlike many similar functions it is a valid scenario for this
+ function to be called on a wcroot! In this case it will just leave the root
+ record in BASE
*/
svn_error_t *
-svn_wc__db_op_remove_node(svn_wc__db_t *db,
+svn_wc__db_op_remove_node(svn_boolean_t *left_changes,
+ svn_wc__db_t *db,
const char *local_abspath,
+ svn_boolean_t destroy_wc,
+ svn_boolean_t destroy_changes,
svn_revnum_t not_present_revision,
+ svn_wc__db_status_t not_present_status,
svn_kind_t not_present_kind,
+ const svn_skel_t *conflict,
+ const svn_skel_t *work_items,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
apr_pool_t *scratch_pool);
-/* Remove the WORKING_NODE row of LOCAL_ABSPATH in DB. */
-svn_error_t *
-svn_wc__db_temp_op_remove_working(svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *scratch_pool);
-
/* Sets the depth of LOCAL_ABSPATH in its working copy to DEPTH using DB.
Returns SVN_ERR_WC_PATH_NOT_FOUND if LOCAL_ABSPATH is not a BASE directory
@@ -2911,40 +2968,6 @@ svn_wc__db_temp_op_make_copy(svn_wc__db_
const char *local_abspath,
apr_pool_t *scratch_pool);
-
-/* Set the conflict marker information on LOCAL_ABSPATH to the specified
- values */
-svn_error_t *
-svn_wc__db_temp_op_set_text_conflict_marker_files(svn_wc__db_t *db,
- const char *local_abspath,
- const char *old_abspath,
- const char *new_abspath,
- const char *wrk_abspath,
- apr_pool_t *scratch_pool);
-
-/* Set the conflict marker information on LOCAL_ABSPATH to the specified
- values */
-svn_error_t *
-svn_wc__db_temp_op_set_property_conflict_marker_file(svn_wc__db_t *db,
- const char *local_abspath,
- const char *prej_abspath,
- apr_pool_t *scratch_pool);
-
-/* Add a new directory in BASE, whether WORKING nodes exist or not. Mark it
- as incomplete and with revision REVISION. If REPOS_RELPATH is not NULL,
- apply REPOS_RELPATH, REPOS_ROOT_URL and REPOS_UUID.
- Perform all temporary allocations in SCRATCH_POOL.
- */
-svn_error_t *
-svn_wc__db_temp_op_set_new_dir_to_incomplete(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_depth_t depth,
- apr_pool_t *scratch_pool);
-
/* Close the wc root LOCAL_ABSPATH and remove any per-directory
handles associated with it. */
svn_error_t *
@@ -2953,7 +2976,8 @@ svn_wc__db_drop_root(svn_wc__db_t *db,
apr_pool_t *scratch_pool);
/* Return the OP_DEPTH for LOCAL_RELPATH. */
-apr_int64_t svn_wc__db_op_depth_for_upgrade(const char *local_relpath);
+int
+svn_wc__db_op_depth_for_upgrade(const char *local_relpath);
/* Set *HAVE_WORK TRUE if there is a working layer below the top layer and
*HAVE_BASE if there is a base layer. Set *STATUS to the status of the
@@ -3057,19 +3081,19 @@ svn_wc__db_has_switched_subtrees(svn_boo
const char *trail_url,
apr_pool_t *scratch_pool);
-/* Set @a *server_excluded_subtrees to a hash mapping <tt>const char *</tt>
+/* Set @a *excluded_subtrees to a hash mapping <tt>const char *</tt>
* local absolute paths to <tt>const char *</tt> local absolute paths for
- * every path at or under @a local_abspath in @a db which are excluded by
- * the server (e.g. due to authz). If no such paths are found then
+ * every path under @a local_abspath in @a db which are excluded by
+ * the server (e.g. due to authz), or user. If no such paths are found then
* @a *server_excluded_subtrees is set to @c NULL.
* Allocate the hash and all items therein from @a result_pool.
*/
svn_error_t *
-svn_wc__db_get_server_excluded_subtrees(apr_hash_t **server_excluded_subtrees,
- svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
+svn_wc__db_get_excluded_subtrees(apr_hash_t **server_excluded_subtrees,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* Indicate in *IS_MODIFIED whether the working copy has local modifications,
* using DB. Use SCRATCH_POOL for temporary allocations.
@@ -3094,6 +3118,23 @@ svn_wc__db_verify(svn_wc__db_t *db,
apr_pool_t *scratch_pool);
+/* Possibly need two structures, one with relpaths and with abspaths?
+ * Only exposed for testing at present. */
+struct svn_wc__db_moved_to_t {
+ const char *local_relpath; /* moved-to destination */
+ int op_depth; /* op-root of source */
+};
+
+/* Set *FINAL_ABSPATH to an array of svn_wc__db_moved_to_t for
+ * LOCAL_ABSPATH after following any and all nested moves.
+ * Only exposed for testing at present. */
+svn_error_t *
+svn_wc__db_follow_moved_to(apr_array_header_t **moved_tos,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
/* @} */
Modified: subversion/branches/compressed-pristines/subversion/libsvn_wc/wc_db_pristine.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_wc/wc_db_pristine.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_wc/wc_db_pristine.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_wc/wc_db_pristine.c Thu Aug 16 10:17:48 2012
@@ -523,6 +523,176 @@ svn_wc__db_pristine_get_sha1(const svn_c
return svn_error_trace(svn_sqlite__reset(stmt));
}
+/* Baton for pristine_transfer() */
+struct pristine_transfer_baton
+{
+ svn_wc__db_wcroot_t *src_wcroot;
+ svn_wc__db_wcroot_t *dst_wcroot;
+ svn_cancel_func_t cancel_func;
+ void * cancel_baton;
+
+ /* pristine install baton, filled from pristine_transfer() */
+ struct pristine_install_baton_t ib;
+};
+
+/* Transaction implementation of svn_wc__db_pristine_transfer().
+ Calls itself again to obtain locks in both working copies */
+static svn_error_t *
+pristine_transfer(void *baton, svn_wc__db_wcroot_t *wcroot,
+ const char *local_relpath, apr_pool_t *scratch_pool)
+{
+ struct pristine_transfer_baton *tb = baton;
+ svn_sqlite__stmt_t *stmt;
+ svn_boolean_t have_row;
+
+ /* Is this the initial call or the recursive call? */
+ if (wcroot == tb->dst_wcroot)
+ {
+ /* The initial call: */
+
+ /* Get all the info within a src wcroot lock */
+ SVN_ERR(svn_wc__db_with_txn(tb->src_wcroot, local_relpath,
+ pristine_transfer, tb, scratch_pool));
+
+ /* And do the final install, while we still have the dst lock */
+ if (tb->ib.tempfile_abspath)
+ SVN_ERR(pristine_install_txn(&(tb->ib), tb->dst_wcroot->sdb,
+ scratch_pool));
+ return SVN_NO_ERROR;
+ }
+
+ /* We have a lock on tb->dst_wcroot and tb->src_wcroot */
+
+ /* Get the right checksum if it wasn't passed */
+ if (!tb->ib.sha1_checksum)
+ {
+ SVN_ERR(svn_sqlite__get_statement(&stmt, tb->src_wcroot->sdb,
+ STMT_SELECT_NODE_INFO));
+
+ SVN_ERR(svn_sqlite__bindf(stmt, "is",
+ tb->src_wcroot->wc_id, local_relpath));
+
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+
+ if (have_row)
+ SVN_ERR(svn_sqlite__column_checksum(&(tb->ib.sha1_checksum), stmt, 6,
+ scratch_pool));
+
+ SVN_ERR(svn_sqlite__reset(stmt));
+
+ if (!tb->ib.sha1_checksum)
+ return SVN_NO_ERROR; /* Nothing to transfer */
+ }
+
+ /* Check if we have the pristine in the destination wcroot */
+ SVN_ERR(svn_sqlite__get_statement(&stmt, tb->dst_wcroot->sdb,
+ STMT_SELECT_PRISTINE));
+ SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, tb->ib.sha1_checksum,
+ scratch_pool));
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+ SVN_ERR(svn_sqlite__reset(stmt));
+
+ /* Destination repository already has this pristine. We're done */
+ if (have_row)
+ return SVN_NO_ERROR;
+
+ /* Verify if the pristine actually exists and get the MD5 in one query */
+ SVN_ERR(svn_sqlite__get_statement(&stmt, tb->src_wcroot->sdb,
+ STMT_SELECT_PRISTINE));
+ SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, tb->ib.sha1_checksum,
+ scratch_pool));
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+
+ if (!have_row)
+ {
+ return svn_error_createf(SVN_ERR_WC_DB_ERROR, svn_sqlite__reset(stmt),
+ _("The pristine text with checksum '%s' was "
+ "not found"),
+ svn_checksum_to_cstring_display(
+ tb->ib.sha1_checksum, scratch_pool));
+ }
+ SVN_ERR(svn_sqlite__column_checksum(&(tb->ib.md5_checksum), stmt, 0,
+ scratch_pool));
+ SVN_ERR(svn_sqlite__reset(stmt));
+
+ /* We now have read locks in both working copies, so we can safely copy the
+ file to the temp location of the destination working copy */
+ {
+ svn_stream_t *src_stream;
+ svn_stream_t *dst_stream;
+ const char *tmp_abspath;
+ const char *src_abspath;
+
+ SVN_ERR(svn_stream_open_unique(&dst_stream, &tmp_abspath,
+ pristine_get_tempdir(tb->dst_wcroot,
+ scratch_pool,
+ scratch_pool),
+ svn_io_file_del_on_pool_cleanup,
+ scratch_pool, scratch_pool));
+
+ SVN_ERR(get_pristine_fname(&src_abspath, tb->src_wcroot->abspath,
+ tb->ib.sha1_checksum,
+ scratch_pool, scratch_pool));
+
+ SVN_ERR(svn_stream_open_readonly(&src_stream, src_abspath,
+ scratch_pool, scratch_pool));
+
+ /* ### Should we verify the SHA1 or MD5 here, or is that too expensive? */
+ SVN_ERR(svn_stream_copy3(src_stream, dst_stream,
+ tb->cancel_func, tb->cancel_baton,
+ scratch_pool));
+
+ /* And now set the right information to install once we leave the
+ src transaction */
+
+ SVN_ERR(get_pristine_fname(&(tb->ib.pristine_abspath),
+ tb->dst_wcroot->abspath,
+ tb->ib.sha1_checksum,
+ scratch_pool, scratch_pool));
+ tb->ib.tempfile_abspath = tmp_abspath;
+ }
+ return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_wc__db_pristine_transfer(svn_wc__db_t *db,
+ const char *src_local_abspath,
+ const svn_checksum_t *checksum,
+ const char *dst_wri_abspath,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *scratch_pool)
+{
+ const char *src_relpath;
+ const char *dst_relpath;
+ struct pristine_transfer_baton tb;
+ memset(&tb, 0, sizeof(tb));
+
+ SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&tb.src_wcroot, &src_relpath,
+ db, src_local_abspath,
+ scratch_pool, scratch_pool));
+ VERIFY_USABLE_WCROOT(tb.src_wcroot);
+ SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&tb.dst_wcroot, &dst_relpath,
+ db, dst_wri_abspath,
+ scratch_pool, scratch_pool));
+ VERIFY_USABLE_WCROOT(tb.dst_wcroot);
+
+ if (tb.src_wcroot == tb.dst_wcroot
+ || tb.src_wcroot->sdb == tb.dst_wcroot->sdb)
+ {
+ return SVN_NO_ERROR; /* Nothing to transfer */
+ }
+
+ tb.cancel_func = cancel_func;
+ tb.cancel_baton = cancel_baton;
+
+ return svn_error_trace(svn_wc__db_with_txn(tb.dst_wcroot, src_relpath,
+ pristine_transfer, &tb,
+ scratch_pool));
+}
+
+
+
/* Remove the file at FILE_ABSPATH in such a way that we could re-create a
* new file of the same name at any time thereafter.
@@ -685,11 +855,12 @@ pristine_cleanup_wcroot(svn_wc__db_wcroo
apr_pool_t *scratch_pool)
{
svn_sqlite__stmt_t *stmt;
+ svn_error_t *err = NULL;
/* Find each unreferenced pristine in the DB and remove it. */
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
STMT_SELECT_UNREFERENCED_PRISTINES));
- while (1)
+ while (! err)
{
svn_boolean_t have_row;
const svn_checksum_t *sha1_checksum;
@@ -700,15 +871,14 @@ pristine_cleanup_wcroot(svn_wc__db_wcroo
SVN_ERR(svn_sqlite__column_checksum(&sha1_checksum, stmt, 0,
scratch_pool));
- SVN_ERR(pristine_remove_if_unreferenced(wcroot, sha1_checksum,
- scratch_pool));
+ err = pristine_remove_if_unreferenced(wcroot, sha1_checksum,
+ scratch_pool);
}
- SVN_ERR(svn_sqlite__reset(stmt));
- return SVN_NO_ERROR;
+ return svn_error_trace(
+ svn_error_compose_create(err, svn_sqlite__reset(stmt)));
}
-
svn_error_t *
svn_wc__db_pristine_cleanup(svn_wc__db_t *db,
const char *wri_abspath,
Modified: subversion/branches/compressed-pristines/subversion/libsvn_wc/wc_db_util.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_wc/wc_db_util.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_wc/wc_db_util.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_wc/wc_db_util.c Thu Aug 16 10:17:48 2012
@@ -196,7 +196,12 @@ svn_wc__db_with_txn(svn_wc__db_wcroot_t
void *cb_baton,
apr_pool_t *scratch_pool)
{
- struct txn_baton_t tb = { wcroot, local_relpath, cb_func, cb_baton };
+ struct txn_baton_t tb;
+
+ tb.wcroot = wcroot;
+ tb.local_relpath = local_relpath;
+ tb.cb_func = cb_func;
+ tb.cb_baton = cb_baton;
return svn_error_trace(
svn_sqlite__with_lock(wcroot->sdb, run_txn, &tb, scratch_pool));
Modified: subversion/branches/compressed-pristines/subversion/libsvn_wc/wc_db_wcroot.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_wc/wc_db_wcroot.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_wc/wc_db_wcroot.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_wc/wc_db_wcroot.c Thu Aug 16 10:17:48 2012
@@ -372,6 +372,7 @@ svn_wc__db_wcroot_parse_local_abspath(sv
svn_boolean_t moved_upwards = FALSE;
svn_boolean_t always_check = FALSE;
int wc_format = 0;
+ const char *adm_relpath;
/* ### we need more logic for finding the database (if it is located
### outside of the wcroot) and then managing all of that within DB.
@@ -459,48 +460,60 @@ svn_wc__db_wcroot_parse_local_abspath(sv
database in the right place. If we find it... great! If not, then
peel off some components, and try again. */
+ adm_relpath = svn_wc_get_adm_dir(scratch_pool);
while (TRUE)
{
svn_error_t *err;
+ svn_node_kind_t adm_subdir_kind;
- /* We always open the database in read/write mode. If the database
- isn't writable in the filesystem, SQLite will internally open
- it as read-only, and we'll get an error if we try to do a write
- operation.
-
- We could decide what to do on a per-operation basis, but since
- we're caching database handles, it make sense to be as permissive
- as the filesystem allows. */
- err = svn_wc__db_util_open_db(&sdb, local_abspath, SDB_FILE,
- svn_sqlite__mode_readwrite, NULL,
- db->state_pool, scratch_pool);
- if (err == NULL)
+ const char *adm_subdir = svn_dirent_join(local_abspath, adm_relpath,
+ scratch_pool);
+
+ SVN_ERR(svn_io_check_path(adm_subdir, &adm_subdir_kind, scratch_pool));
+
+ if (adm_subdir_kind == svn_node_dir)
{
+ /* We always open the database in read/write mode. If the database
+ isn't writable in the filesystem, SQLite will internally open
+ it as read-only, and we'll get an error if we try to do a write
+ operation.
+
+ We could decide what to do on a per-operation basis, but since
+ we're caching database handles, it make sense to be as permissive
+ as the filesystem allows. */
+ err = svn_wc__db_util_open_db(&sdb, local_abspath, SDB_FILE,
+ svn_sqlite__mode_readwrite, NULL,
+ db->state_pool, scratch_pool);
+ if (err == NULL)
+ {
#ifdef SVN_DEBUG
- /* Install self-verification trigger statements. */
- SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_VERIFICATION_TRIGGERS));
+ /* Install self-verification trigger statements. */
+ SVN_ERR(svn_sqlite__exec_statements(sdb,
+ STMT_VERIFICATION_TRIGGERS));
#endif
- break;
- }
- if (err->apr_err != SVN_ERR_SQLITE_ERROR
- && !APR_STATUS_IS_ENOENT(err->apr_err))
- return svn_error_trace(err);
- svn_error_clear(err);
-
- /* If we have not moved upwards, then check for a wc-1 working copy.
- Since wc-1 has a .svn in every directory, and we didn't find one
- in the original directory, then we aren't looking at a wc-1.
-
- If the original path is not present, then we have to check on every
- iteration. The content may be the immediate parent, or possibly
- five ancetors higher. We don't test for directory presence (just
- for the presence of subdirs/files), so we don't know when we can
- stop checking ... so just check always. */
- if (!moved_upwards || always_check)
- {
- SVN_ERR(get_old_version(&wc_format, local_abspath, scratch_pool));
- if (wc_format != 0)
- break;
+ break;
+ }
+ if (err->apr_err != SVN_ERR_SQLITE_ERROR
+ && !APR_STATUS_IS_ENOENT(err->apr_err))
+ return svn_error_trace(err);
+ svn_error_clear(err);
+
+ /* If we have not moved upwards, then check for a wc-1 working copy.
+ Since wc-1 has a .svn in every directory, and we didn't find one
+ in the original directory, then we aren't looking at a wc-1.
+
+ If the original path is not present, then we have to check on every
+ iteration. The content may be the immediate parent, or possibly
+ five ancetors higher. We don't test for directory presence (just
+ for the presence of subdirs/files), so we don't know when we can
+ stop checking ... so just check always. */
+ if (!moved_upwards || always_check)
+ {
+ SVN_ERR(get_old_version(&wc_format, local_abspath,
+ scratch_pool));
+ if (wc_format != 0)
+ break;
+ }
}
/* We couldn't open the SDB within the specified directory, so
Modified: subversion/branches/compressed-pristines/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_wc/workqueue.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_wc/workqueue.c Thu Aug 16 10:17:48 2012
@@ -34,6 +34,7 @@
#include "wc_db.h"
#include "workqueue.h"
#include "adm_files.h"
+#include "conflicts.h"
#include "translate.h"
#include "svn_private_config.h"
@@ -41,7 +42,6 @@
/* Workqueue operation names. */
-#define OP_BASE_REMOVE "base-remove"
#define OP_FILE_COMMIT "file-commit"
#define OP_FILE_INSTALL "file-install"
#define OP_FILE_REMOVE "file-remove"
@@ -49,10 +49,15 @@
#define OP_FILE_COPY_TRANSLATED "file-translate"
#define OP_SYNC_FILE_FLAGS "sync-file-flags"
#define OP_PREJ_INSTALL "prej-install"
+#define OP_DIRECTORY_REMOVE "dir-remove"
+
+#define OP_POSTUPGRADE "postupgrade"
+
+/* Legacy items */
+#define OP_BASE_REMOVE "base-remove"
#define OP_RECORD_FILEINFO "record-fileinfo"
#define OP_TMP_SET_TEXT_CONFLICT_MARKERS "tmp-set-text-conflict-markers"
#define OP_TMP_SET_PROPERTY_CONFLICT_MARKER "tmp-set-property-conflict-marker"
-#define OP_POSTUPGRADE "postupgrade"
/* For work queue debugging. Generates output about its operation. */
/* #define SVN_DEBUG_WORK_QUEUE */
@@ -99,110 +104,7 @@ get_and_record_fileinfo(svn_wc__db_t *db
/* Removes a BASE_NODE and all it's data, leaving any adds and copies as is.
Do this as a depth first traversal to make sure than any parent still exists
on error conditions.
-
- ### This function needs review for 4th tree behavior.*/
-static svn_error_t *
-remove_base_node(svn_wc__db_t *db,
- const char *local_abspath,
- svn_cancel_func_t cancel_func,
- void *cancel_baton,
- apr_pool_t *scratch_pool)
-{
- svn_wc__db_status_t base_status, wrk_status;
- svn_kind_t base_kind, wrk_kind;
- svn_boolean_t have_base, have_work;
- svn_error_t *err;
-
- if (cancel_func)
- SVN_ERR(cancel_func(cancel_baton));
-
- err = svn_wc__db_read_info(&wrk_status, &wrk_kind, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL,
- &have_base, NULL, &have_work,
- db, local_abspath, scratch_pool, scratch_pool);
- if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
- {
- /* No node to delete, this can happen when the wq item is rerun. */
- svn_error_clear(err);
- return SVN_NO_ERROR;
- }
-
- if(! have_base)
- /* No base node to delete, this can happen when the wq item is rerun. */
- return SVN_NO_ERROR;
-
- if (wrk_status == svn_wc__db_status_normal
- || wrk_status == svn_wc__db_status_not_present
- || wrk_status == svn_wc__db_status_server_excluded)
- {
- base_status = wrk_status;
- base_kind = wrk_kind;
- }
- else
- SVN_ERR(svn_wc__db_base_get_info(&base_status, &base_kind, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- db, local_abspath,
- scratch_pool, scratch_pool));
-
- /* Children first */
- if (base_kind == svn_kind_dir
- && (base_status == svn_wc__db_status_normal
- || base_status == svn_wc__db_status_incomplete))
- {
- const apr_array_header_t *children;
- apr_pool_t *iterpool = svn_pool_create(scratch_pool);
- int i;
-
- SVN_ERR(svn_wc__db_base_get_children(&children, db, local_abspath,
- scratch_pool, iterpool));
-
- for (i = 0; i < children->nelts; i++)
- {
- const char *child_name = APR_ARRAY_IDX(children, i, const char *);
- const char *child_abspath;
-
- svn_pool_clear(iterpool);
-
- child_abspath = svn_dirent_join(local_abspath, child_name, iterpool);
-
- SVN_ERR(remove_base_node(db, child_abspath, cancel_func, cancel_baton,
- iterpool));
- }
-
- svn_pool_destroy(iterpool);
- }
-
- if (base_status == svn_wc__db_status_normal
- && wrk_status != svn_wc__db_status_added
- && wrk_status != svn_wc__db_status_excluded)
- {
- if (wrk_status != svn_wc__db_status_deleted
- && (base_kind == svn_kind_file
- || base_kind == svn_kind_symlink))
- {
- SVN_ERR(svn_io_remove_file2(local_abspath, TRUE, scratch_pool));
- }
- else if (base_kind == svn_kind_dir
- && wrk_status != svn_wc__db_status_deleted)
- {
- err = svn_io_dir_remove_nonrecursive(local_abspath, scratch_pool);
- if (err && (APR_STATUS_IS_ENOENT(err->apr_err)
- || SVN__APR_STATUS_IS_ENOTDIR(err->apr_err)
- || APR_STATUS_IS_ENOTEMPTY(err->apr_err)))
- svn_error_clear(err);
- else
- SVN_ERR(err);
- }
- }
-
- SVN_ERR(svn_wc__db_base_remove(db, local_abspath, scratch_pool));
-
- return SVN_NO_ERROR;
-}
-
+ */
/* Process the OP_REMOVE_BASE work item WORK_ITEM.
* See svn_wc__wq_build_remove_base() which generates this work item.
@@ -219,8 +121,6 @@ run_base_remove(svn_wc__db_t *db,
const char *local_relpath;
const char *local_abspath;
svn_revnum_t not_present_rev = SVN_INVALID_REVNUM;
- svn_kind_t not_present_kind;
- const char *repos_relpath, *repos_root_url, *repos_uuid;
apr_int64_t val;
local_relpath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
@@ -233,23 +133,6 @@ run_base_remove(svn_wc__db_t *db,
not_present_rev = (svn_revnum_t)val;
SVN_ERR(svn_skel__parse_int(&val, arg1->next->next, scratch_pool));
- not_present_kind = (svn_kind_t)val;
-
- if (SVN_IS_VALID_REVNUM(not_present_rev))
- {
- const char *dir_abspath, *name;
-
- /* This wq operation is restartable, so we can't assume the node
- to be here. But we can assume that the parent is still there */
- svn_dirent_split(&dir_abspath, &name, local_abspath, scratch_pool);
-
- SVN_ERR(svn_wc__db_scan_base_repos(&repos_relpath, &repos_root_url,
- &repos_uuid,
- db, dir_abspath,
- scratch_pool, scratch_pool));
-
- repos_relpath = svn_relpath_join(repos_relpath, name, scratch_pool);
- }
}
else
{
@@ -261,9 +144,9 @@ run_base_remove(svn_wc__db_t *db,
if (keep_not_present)
{
- SVN_ERR(svn_wc__db_base_get_info(NULL, ¬_present_kind,
- ¬_present_rev, &repos_relpath,
- &repos_root_url, &repos_uuid, NULL,
+ SVN_ERR(svn_wc__db_base_get_info(NULL, NULL,
+ ¬_present_rev, NULL,
+ NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL,
db, local_abspath,
@@ -271,45 +154,8 @@ run_base_remove(svn_wc__db_t *db,
}
}
- SVN_ERR(remove_base_node(db, local_abspath,
- cancel_func, cancel_baton,
- scratch_pool));
-
- if (SVN_IS_VALID_REVNUM(not_present_rev))
- {
- SVN_ERR(svn_wc__db_base_add_not_present_node(db, local_abspath,
- repos_relpath,
- repos_root_url,
- repos_uuid,
- not_present_rev,
- not_present_kind,
- NULL,
- NULL,
- scratch_pool));
- }
-
- return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_wc__wq_build_base_remove(svn_skel_t **work_item,
- svn_wc__db_t *db,
- const char *local_abspath,
- svn_revnum_t not_present_revision,
- svn_kind_t not_present_kind,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- const char *local_relpath;
- *work_item = svn_skel__make_empty_list(result_pool);
-
- SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, local_abspath,
- local_abspath, result_pool, scratch_pool));
-
- svn_skel__prepend_int(not_present_kind, *work_item, result_pool);
- svn_skel__prepend_int(not_present_revision, *work_item, result_pool);
- svn_skel__prepend_str(local_relpath, *work_item, result_pool);
- svn_skel__prepend_str(OP_BASE_REMOVE, *work_item, result_pool);
+ SVN_ERR(svn_wc__db_base_remove(db, local_abspath, FALSE, not_present_rev,
+ NULL, NULL, scratch_pool));
return SVN_NO_ERROR;
}
@@ -715,6 +561,8 @@ run_file_install(svn_wc__db_t *db,
scratch_pool));
/* No need to set exec or read-only flags on special files. */
+
+ /* ### Shouldn't this record a timestamp and size, etc.? */
return SVN_NO_ERROR;
}
@@ -781,12 +629,27 @@ run_file_install(svn_wc__db_t *db,
}
/* Tweak the on-disk file according to its properties. */
- if (props
- && (apr_hash_get(props, SVN_PROP_NEEDS_LOCK, APR_HASH_KEY_STRING)
- || apr_hash_get(props, SVN_PROP_EXECUTABLE, APR_HASH_KEY_STRING)))
- {
- SVN_ERR(svn_wc__sync_flags_with_props(NULL, db, local_abspath,
- scratch_pool));
+#ifndef WIN32
+ if (props && apr_hash_get(props, SVN_PROP_EXECUTABLE, APR_HASH_KEY_STRING))
+ SVN_ERR(svn_io_set_file_executable(local_abspath, TRUE, FALSE,
+ scratch_pool));
+#endif
+
+ /* Note that this explicitly checks the pristine properties, to make sure
+ that when the lock is locally set (=modification) it is not read only */
+ if (props && apr_hash_get(props, SVN_PROP_NEEDS_LOCK, APR_HASH_KEY_STRING))
+ {
+ svn_wc__db_status_t status;
+ svn_wc__db_lock_t *lock;
+ SVN_ERR(svn_wc__db_read_info(&status, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, &lock, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ db, local_abspath,
+ scratch_pool, scratch_pool));
+
+ if (!lock && status != svn_wc__db_status_added)
+ SVN_ERR(svn_io_set_file_read_only(local_abspath, FALSE, scratch_pool));
}
if (use_commit_times)
@@ -876,6 +739,7 @@ run_file_remove(svn_wc__db_t *db,
svn_error_t *
svn_wc__wq_build_file_remove(svn_skel_t **work_item,
svn_wc__db_t *db,
+ const char *wri_abspath,
const char *local_abspath,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
@@ -883,7 +747,7 @@ svn_wc__wq_build_file_remove(svn_skel_t
const char *local_relpath;
*work_item = svn_skel__make_empty_list(result_pool);
- SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, local_abspath,
+ SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, wri_abspath,
local_abspath, result_pool, scratch_pool));
svn_skel__prepend_str(local_relpath, *work_item, result_pool);
@@ -894,6 +758,87 @@ svn_wc__wq_build_file_remove(svn_skel_t
/* ------------------------------------------------------------------------ */
+/* OP_DIRECTORY_REMOVE */
+
+/* Process the OP_FILE_REMOVE work item WORK_ITEM.
+ * See svn_wc__wq_build_file_remove() which generates this work item.
+ * Implements (struct work_item_dispatch).func. */
+static svn_error_t *
+run_dir_remove(svn_wc__db_t *db,
+ const svn_skel_t *work_item,
+ const char *wri_abspath,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *scratch_pool)
+{
+ const svn_skel_t *arg1 = work_item->children->next;
+ const char *local_relpath;
+ const char *local_abspath;
+ svn_boolean_t recursive;
+
+ local_relpath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
+ SVN_ERR(svn_wc__db_from_relpath(&local_abspath, db, wri_abspath,
+ local_relpath, scratch_pool, scratch_pool));
+
+ recursive = FALSE;
+ if (arg1->next)
+ {
+ apr_int64_t val;
+ SVN_ERR(svn_skel__parse_int(&val, arg1->next, scratch_pool));
+
+ recursive = (val != 0);
+ }
+
+ /* Remove the path, no worrying if it isn't there. */
+ if (recursive)
+ return svn_error_trace(
+ svn_io_remove_dir2(local_abspath, TRUE,
+ cancel_func, cancel_baton,
+ scratch_pool));
+ else
+ {
+ svn_error_t *err;
+
+ err = svn_io_dir_remove_nonrecursive(local_abspath, scratch_pool);
+
+ if (err && (APR_STATUS_IS_ENOENT(err->apr_err)
+ || SVN__APR_STATUS_IS_ENOTDIR(err->apr_err)
+ || APR_STATUS_IS_ENOTEMPTY(err->apr_err)))
+ {
+ svn_error_clear(err);
+ err = NULL;
+ }
+
+ return svn_error_trace(err);
+ }
+}
+
+svn_error_t *
+svn_wc__wq_build_dir_remove(svn_skel_t **work_item,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
+ const char *local_abspath,
+ svn_boolean_t recursive,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ const char *local_relpath;
+ *work_item = svn_skel__make_empty_list(result_pool);
+
+ SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, wri_abspath,
+ local_abspath, result_pool, scratch_pool));
+
+ if (recursive)
+ svn_skel__prepend_int(TRUE, *work_item, result_pool);
+
+ svn_skel__prepend_str(local_relpath, *work_item, result_pool);
+ svn_skel__prepend_str(OP_DIRECTORY_REMOVE, *work_item, result_pool);
+
+ return SVN_NO_ERROR;
+}
+
+/* ------------------------------------------------------------------------ */
+
/* OP_FILE_MOVE */
/* Process the OP_FILE_MOVE work item WORK_ITEM.
@@ -1135,29 +1080,34 @@ run_prej_install(svn_wc__db_t *db,
const svn_skel_t *arg1 = work_item->children->next;
const char *local_relpath;
const char *local_abspath;
- const svn_skel_t *conflict_skel;
+ svn_skel_t *conflicts;
+ const svn_skel_t *prop_conflict_skel;
const char *tmp_prejfile_abspath;
const char *prejfile_abspath;
local_relpath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
SVN_ERR(svn_wc__db_from_relpath(&local_abspath, db, wri_abspath,
local_relpath, scratch_pool, scratch_pool));
+
+ SVN_ERR(svn_wc__db_read_conflict(&conflicts, db, local_abspath,
+ scratch_pool, scratch_pool));
+
+ SVN_ERR(svn_wc__conflict_read_prop_conflict(&prejfile_abspath,
+ NULL, NULL, NULL, NULL,
+ db, local_abspath, conflicts,
+ scratch_pool, scratch_pool));
+
if (arg1->next != NULL)
- conflict_skel = arg1->next;
+ prop_conflict_skel = arg1->next;
else
SVN_ERR_MALFUNCTION(); /* ### wc_db can't provide it ... yet. */
/* Construct a property reject file in the temporary area. */
SVN_ERR(svn_wc__create_prejfile(&tmp_prejfile_abspath,
db, local_abspath,
- conflict_skel,
+ prop_conflict_skel,
scratch_pool, scratch_pool));
- /* Get the (stored) name of where it should go. */
- SVN_ERR(svn_wc__get_prejfile_abspath(&prejfile_abspath, db, local_abspath,
- scratch_pool, scratch_pool));
- SVN_ERR_ASSERT(prejfile_abspath != NULL);
-
/* ... and atomically move it into place. */
SVN_ERR(svn_io_file_rename(tmp_prejfile_abspath,
prejfile_abspath,
@@ -1249,32 +1199,6 @@ run_record_fileinfo(svn_wc__db_t *db,
scratch_pool));
}
-
-svn_error_t *
-svn_wc__wq_build_record_fileinfo(svn_skel_t **work_item,
- svn_wc__db_t *db,
- const char *local_abspath,
- apr_time_t set_time,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- const char *local_relpath;
- *work_item = svn_skel__make_empty_list(result_pool);
-
- SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
-
- SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, local_abspath,
- local_abspath, result_pool, scratch_pool));
-
- if (set_time)
- svn_skel__prepend_int(set_time, *work_item, result_pool);
-
- svn_skel__prepend_str(local_relpath, *work_item, result_pool);
- svn_skel__prepend_str(OP_RECORD_FILEINFO, *work_item, result_pool);
-
- return SVN_NO_ERROR;
-}
-
/* ------------------------------------------------------------------------ */
/* OP_TMP_SET_TEXT_CONFLICT_MARKERS */
@@ -1331,58 +1255,42 @@ run_set_text_conflict_markers(svn_wc__db
scratch_pool, scratch_pool));
}
- return svn_error_trace(
- svn_wc__db_temp_op_set_text_conflict_marker_files(db,
- local_abspath,
- old_abspath,
- new_abspath,
- wrk_abspath,
- scratch_pool));
-}
+ /* Upgrade scenario: We have a workqueue item that describes how to install a
+ non skel conflict. Fetch all the information we can to create a new style
+ conflict. */
+ /* ### Before format 30 this is/was a common code path as we didn't install
+ ### the conflict directly in the db. It just calls the wc_db code
+ ### to set the right fields. */
+ {
+ /* Check if we should combine with a property conflict... */
+ svn_skel_t *conflicts;
-svn_error_t *
-svn_wc__wq_tmp_build_set_text_conflict_markers(svn_skel_t **work_item,
- svn_wc__db_t *db,
- const char *local_abspath,
- const char *old_abspath,
- const char *new_abspath,
- const char *wrk_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- const char *local_relpath;
- *work_item = svn_skel__make_empty_list(result_pool);
-
- SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
+ SVN_ERR(svn_wc__db_read_conflict(&conflicts, db, local_abspath,
+ scratch_pool, scratch_pool));
- /* Abspaths in the workqueue won't work if the WC is moved. */
- if (wrk_abspath)
- SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, local_abspath,
- wrk_abspath, result_pool, scratch_pool));
-
- svn_skel__prepend_str(wrk_abspath ? local_relpath : "",
- *work_item, result_pool);
-
- if (new_abspath)
- SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, local_abspath,
- new_abspath, result_pool, scratch_pool));
- svn_skel__prepend_str(new_abspath ? local_relpath : "",
- *work_item, result_pool);
-
- if (old_abspath)
- SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, local_abspath,
- old_abspath, result_pool, scratch_pool));
- svn_skel__prepend_str(old_abspath ? local_relpath : "",
- *work_item, result_pool);
+ if (! conflicts)
+ {
+ /* No conflict exists, create a basic skel */
+ conflicts = svn_wc__conflict_skel_create(scratch_pool);
- SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, local_abspath,
- local_abspath, result_pool, scratch_pool));
+ SVN_ERR(svn_wc__conflict_skel_set_op_update(conflicts, NULL,
+ scratch_pool,
+ scratch_pool));
+ }
- svn_skel__prepend_str(local_relpath, *work_item, result_pool);
- svn_skel__prepend_str(OP_TMP_SET_TEXT_CONFLICT_MARKERS, *work_item,
- result_pool);
+ /* Add the text conflict to the existing onflict */
+ SVN_ERR(svn_wc__conflict_skel_add_text_conflict(conflicts, db,
+ local_abspath,
+ wrk_abspath,
+ old_abspath,
+ new_abspath,
+ scratch_pool,
+ scratch_pool));
+ SVN_ERR(svn_wc__db_op_mark_conflict(db, local_abspath, conflicts,
+ NULL, scratch_pool));
+ }
return SVN_NO_ERROR;
}
@@ -1411,47 +1319,43 @@ run_set_property_conflict_marker(svn_wc_
arg = arg->next;
local_relpath = arg->len ? apr_pstrmemdup(scratch_pool, arg->data, arg->len)
- : NULL;
+ : NULL;
if (local_relpath)
SVN_ERR(svn_wc__db_from_relpath(&prej_abspath, db, wri_abspath,
local_relpath,
scratch_pool, scratch_pool));
- return svn_error_trace(
- svn_wc__db_temp_op_set_property_conflict_marker_file(db,
- local_abspath,
- prej_abspath,
- scratch_pool));
-}
-
-svn_error_t *
-svn_wc__wq_tmp_build_set_property_conflict_marker(svn_skel_t **work_item,
- svn_wc__db_t *db,
- const char *local_abspath,
- const char *prej_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- const char *local_relpath;
- *work_item = svn_skel__make_empty_list(result_pool);
-
- SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
+ {
+ /* Check if we should combine with a text conflict... */
+ svn_skel_t *conflicts;
+ apr_hash_t *prop_names;
- if (prej_abspath)
- SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, local_abspath,
- prej_abspath, result_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_read_conflict(&conflicts, db, local_abspath,
+ scratch_pool, scratch_pool));
- svn_skel__prepend_str(prej_abspath ? local_relpath : "",
- *work_item, result_pool);
+ if (! conflicts)
+ {
+ /* No conflict exists, create a basic skel */
+ conflicts = svn_wc__conflict_skel_create(scratch_pool);
- SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, local_abspath,
- local_abspath, result_pool, scratch_pool));
+ SVN_ERR(svn_wc__conflict_skel_set_op_update(conflicts, NULL,
+ scratch_pool,
+ scratch_pool));
+ }
- svn_skel__prepend_str(local_relpath, *work_item, result_pool);
- svn_skel__prepend_str(OP_TMP_SET_PROPERTY_CONFLICT_MARKER, *work_item,
- result_pool);
+ prop_names = apr_hash_make(scratch_pool);
+ SVN_ERR(svn_wc__conflict_skel_add_prop_conflict(conflicts, db,
+ local_abspath,
+ prej_abspath,
+ NULL, NULL, NULL,
+ prop_names,
+ scratch_pool,
+ scratch_pool));
+ SVN_ERR(svn_wc__db_op_mark_conflict(db, local_abspath, conflicts,
+ NULL, scratch_pool));
+ }
return SVN_NO_ERROR;
}
@@ -1465,14 +1369,17 @@ static const struct work_item_dispatch d
{ OP_FILE_COPY_TRANSLATED, run_file_copy_translated },
{ OP_SYNC_FILE_FLAGS, run_sync_file_flags },
{ OP_PREJ_INSTALL, run_prej_install },
- { OP_RECORD_FILEINFO, run_record_fileinfo },
- { OP_BASE_REMOVE, run_base_remove },
- { OP_TMP_SET_TEXT_CONFLICT_MARKERS, run_set_text_conflict_markers },
- { OP_TMP_SET_PROPERTY_CONFLICT_MARKER, run_set_property_conflict_marker },
+ { OP_DIRECTORY_REMOVE, run_dir_remove },
/* Upgrade steps */
{ OP_POSTUPGRADE, run_postupgrade },
+ /* Legacy workqueue items. No longer created */
+ { OP_BASE_REMOVE, run_base_remove },
+ { OP_RECORD_FILEINFO, run_record_fileinfo },
+ { OP_TMP_SET_TEXT_CONFLICT_MARKERS, run_set_text_conflict_markers },
+ { OP_TMP_SET_PROPERTY_CONFLICT_MARKER, run_set_property_conflict_marker },
+
/* Sentinel. */
{ NULL }
};
Modified: subversion/branches/compressed-pristines/subversion/libsvn_wc/workqueue.h
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/libsvn_wc/workqueue.h?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/libsvn_wc/workqueue.h (original)
+++ subversion/branches/compressed-pristines/subversion/libsvn_wc/workqueue.h Thu Aug 16 10:17:48 2012
@@ -114,15 +114,29 @@ svn_wc__wq_build_file_install(svn_skel_t
/* Set *WORK_ITEM to a new work item that will remove a single
- file. */
+ file LOCAL_ABSPATH from the working copy identified by the pair DB,
+ WRI_ABSPATH. */
svn_error_t *
svn_wc__wq_build_file_remove(svn_skel_t **work_item,
svn_wc__db_t *db,
+ const char *wri_abspath,
const char *local_abspath,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Set *WORK_ITEM to a new work item that describes a moves of
+/* Set *WORK_ITEM to a new work item that will remove a single
+ directory or if RECURSIVE is TRUE a directory with all its
+ descendants. */
+svn_error_t *
+svn_wc__wq_build_dir_remove(svn_skel_t **work_item,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
+ const char *local_abspath,
+ svn_boolean_t recursive,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/* Set *WORK_ITEM to a new work item that describes a move of
a file or directory from SRC_ABSPATH to DST_ABSPATH, ready for
storing in the working copy managing DST_ABSPATH.
@@ -182,81 +196,6 @@ svn_wc__wq_build_prej_install(svn_skel_t
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Set *WORK_ITEM to a new work item that will record file information of
- LOCAL_ABSPATH into the TRANSLATED_SIZE and LAST_MOD_TIME of the node via
- the svn_wc__db_global_record_fileinfo() function.
-
- If SET_TIME is not 0, set LOCAL_ABSPATH's last modified time to this
- time and after that record the actual file time.
-
- ### it is unclear whether this should survive. */
-svn_error_t *
-svn_wc__wq_build_record_fileinfo(svn_skel_t **work_item,
- svn_wc__db_t *db,
- const char *local_abspath,
- apr_time_t set_time,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
-/* Set *WORK_ITEM to a new work item that will remove all the data of
- the BASE_NODE of LOCAL_ABSPATH and all it's descendants, but keeping
- any WORKING_NODE data.
-
- This function doesn't check for local modifications of the text files
- as these would have triggered a tree conflict before.
-
- ### This is only used from update_editor.c's do_entry_deletion().
- */
-svn_error_t *
-svn_wc__wq_build_base_remove(svn_skel_t **work_item,
- svn_wc__db_t *db,
- const char *local_abspath,
- svn_revnum_t not_present_revision,
- svn_kind_t not_present_kind,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
-
-/* ### Temporary helper to store text conflict marker locations as a wq
- ### operation. Eventually the data must be stored in the pristine store+db
- ### before the wq runs (within the operation transaction) and then a wq
- ### operation will create the markers.
-
- Set *WORK_ITEM to a new work item that sets the conflict marker values
- on ACTUAL_NODE to the passed values or to NULL if NULL is passed.
-
- Allocate the result in RESULT_POOL and perform temporary allocations
- in SCRATCH_POOL
-*/
-svn_error_t *
-svn_wc__wq_tmp_build_set_text_conflict_markers(svn_skel_t **work_item,
- svn_wc__db_t *db,
- const char *local_abspath,
- const char *old_abspath,
- const char *new_abspath,
- const char *wrk_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
-/* ### Temporary helper to store the property conflict marker location as a wq
- ### operation. Eventually the data must be stored in the pristine store+db
- ### before the wq runs (within the operation transaction) and then a wq
- ### operation will create the marker.
-
- Set *WORK_ITEM to a new work item that sets the conflict marker values
- on ACTUAL_NODE to the passed values or to NULL if NULL is passed.
-
- Allocate the result in RESULT_POOL and perform temporary allocations
- in SCRATCH_POOL
-*/
-svn_error_t *
-svn_wc__wq_tmp_build_set_property_conflict_marker(svn_skel_t **work_item,
- svn_wc__db_t *db,
- const char *local_abspath,
- const char *prej_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
/* Handle the final post-commit step of retranslating and recording the
working copy state of a committed file.
Modified: subversion/branches/compressed-pristines/subversion/mod_authz_svn/mod_authz_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/mod_authz_svn/mod_authz_svn.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/mod_authz_svn/mod_authz_svn.c (original)
+++ subversion/branches/compressed-pristines/subversion/mod_authz_svn/mod_authz_svn.c Thu Aug 16 10:17:48 2012
@@ -235,7 +235,7 @@ convert_case(char *text, svn_boolean_t t
char *c = text;
while (*c)
{
- *c = (to_uppercase ? apr_toupper(*c) : apr_tolower(*c));
+ *c = (char)(to_uppercase ? apr_toupper(*c) : apr_tolower(*c));
++c;
}
}
Modified: subversion/branches/compressed-pristines/subversion/mod_dav_svn/dav_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/mod_dav_svn/dav_svn.h?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/mod_dav_svn/dav_svn.h (original)
+++ subversion/branches/compressed-pristines/subversion/mod_dav_svn/dav_svn.h Thu Aug 16 10:17:48 2012
@@ -316,6 +316,9 @@ svn_boolean_t dav_svn__get_txdelta_cache
/* for the repository referred to by this request, is fulltext caching active? */
svn_boolean_t dav_svn__get_fulltext_cache_flag(request_rec *r);
+/* for the repository referred to by this request, is revprop caching active? */
+svn_boolean_t dav_svn__get_revprop_cache_flag(request_rec *r);
+
/* for the repository referred to by this request, are subrequests bypassed?
* A function pointer if yes, NULL if not.
*/
Modified: subversion/branches/compressed-pristines/subversion/mod_dav_svn/liveprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/mod_dav_svn/liveprops.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/mod_dav_svn/liveprops.c (original)
+++ subversion/branches/compressed-pristines/subversion/mod_dav_svn/liveprops.c Thu Aug 16 10:17:48 2012
@@ -75,7 +75,8 @@ enum {
SVN_PROPID_baseline_relative_path = 1,
SVN_PROPID_md5_checksum,
SVN_PROPID_repository_uuid,
- SVN_PROPID_deadprop_count
+ SVN_PROPID_deadprop_count,
+ SVN_PROPID_sha1_checksum
};
@@ -106,6 +107,7 @@ static const dav_liveprop_spec props[] =
SVN_RO_SVN_PROP(md5_checksum, md5-checksum),
SVN_RO_SVN_PROP(repository_uuid, repository-uuid),
SVN_RO_SVN_PROP(deadprop_count, deadprop-count),
+ SVN_RO_SVN_PROP(sha1_checksum, sha1-checksum),
{ 0 } /* sentinel */
};
@@ -279,7 +281,7 @@ insert_prop_internal(const dav_resource
const char *value = NULL;
const char *s;
const dav_liveprop_spec *info;
- int global_ns;
+ long global_ns;
svn_error_t *serr;
/* ### TODO proper errors */
@@ -668,6 +670,7 @@ insert_prop_internal(const dav_resource
break;
case SVN_PROPID_md5_checksum:
+ case SVN_PROPID_sha1_checksum:
if ((! resource->collection)
&& (! resource->baselined)
&& (resource->type == DAV_RESOURCE_TYPE_REGULAR
@@ -676,11 +679,21 @@ insert_prop_internal(const dav_resource
{
svn_node_kind_t kind;
svn_checksum_t *checksum;
+ svn_checksum_kind_t checksum_kind;
+
+ if (propid == SVN_PROPID_md5_checksum)
+ {
+ checksum_kind = svn_checksum_md5;
+ }
+ else
+ {
+ checksum_kind = svn_checksum_sha1;
+ }
serr = svn_fs_check_path(&kind, resource->info->root.root,
resource->info->repos_path, scratch_pool);
if (!serr && kind == svn_node_file)
- serr = svn_fs_file_checksum(&checksum, svn_checksum_md5,
+ serr = svn_fs_file_checksum(&checksum, checksum_kind,
resource->info->root.root,
resource->info->repos_path, TRUE,
scratch_pool);
@@ -688,8 +701,11 @@ insert_prop_internal(const dav_resource
{
ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err,
resource->info->r,
- "Can't fetch or compute MD5 checksum of '%s': "
+ "Can't fetch or compute %s checksum of '%s': "
"%s",
+ checksum_kind == svn_checksum_md5
+ ? "MD5"
+ : "SHA1",
resource->info->repos_path,
serr->message);
svn_error_clear(serr);
@@ -769,11 +785,11 @@ insert_prop_internal(const dav_resource
if (what == DAV_PROP_INSERT_NAME
|| (what == DAV_PROP_INSERT_VALUE && *value == '\0')) {
- s = apr_psprintf(result_pool, "<lp%d:%s/>" DEBUG_CR, global_ns,
+ s = apr_psprintf(result_pool, "<lp%ld:%s/>" DEBUG_CR, global_ns,
info->name);
}
else if (what == DAV_PROP_INSERT_VALUE) {
- s = apr_psprintf(result_pool, "<lp%d:%s>%s</lp%d:%s>" DEBUG_CR,
+ s = apr_psprintf(result_pool, "<lp%ld:%s>%s</lp%ld:%s>" DEBUG_CR,
global_ns, info->name, value, global_ns, info->name);
}
else {
Modified: subversion/branches/compressed-pristines/subversion/mod_dav_svn/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/mod_dav_svn/lock.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/mod_dav_svn/lock.c (original)
+++ subversion/branches/compressed-pristines/subversion/mod_dav_svn/lock.c Thu Aug 16 10:17:48 2012
@@ -765,10 +765,17 @@ 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 ||
+ serr->apr_err == SVN_ERR_FS_NO_SUCH_LOCK ||
+ serr->apr_err == SVN_ERR_FS_LOCK_EXPIRED ||
+ SVN_ERR_IS_LOCK_ERROR(serr)))
+ return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
+ "Failed to create new lock.",
+ resource->pool);
else if (serr)
- return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
- "Failed to create new lock.",
- resource->pool);
+ return dav_svn__sanitize_error(serr, "Failed to create new lock.",
+ HTTP_INTERNAL_SERVER_ERROR,
+ resource->info->r);
/* A standard webdav LOCK response doesn't include any information
@@ -956,10 +963,17 @@ 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 ||
+ serr->apr_err == SVN_ERR_FS_NO_SUCH_LOCK ||
+ serr->apr_err == SVN_ERR_FS_LOCK_EXPIRED ||
+ SVN_ERR_IS_LOCK_ERROR(serr)))
+ return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
+ "Failed to refresh existing lock.",
+ resource->pool);
else if (serr)
- return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
- "Failed to refresh existing lock.",
- resource->pool);
+ return dav_svn__sanitize_error(serr, "Failed to refresh existing lock.",
+ HTTP_INTERNAL_SERVER_ERROR,
+ resource->info->r);
/* Convert the refreshed lock into a dav_lock and return it. */
svn_lock_to_dav_lock(&dlock, slock, FALSE, resource->exists, resource->pool);
Modified: subversion/branches/compressed-pristines/subversion/mod_dav_svn/mirror.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/mod_dav_svn/mirror.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/mod_dav_svn/mirror.c (original)
+++ subversion/branches/compressed-pristines/subversion/mod_dav_svn/mirror.c Thu Aug 16 10:17:48 2012
@@ -54,6 +54,16 @@ static void proxy_request_fixup(request_
(char *)NULL),
r->pool);
r->handler = "proxy-server";
+
+ /* ### FIXME: Seems we could avoid adding some or all of these
+ filters altogether when the root_dir (that is, the slave's
+ location, relative to the server root) and path portion of
+ the master_uri (the master's location, relative to the
+ server root) are identical, rather than adding them here
+ and then trying to remove them later. (See the filter
+ removal logic in dav_svn__location_in_filter() and
+ dav_svn__location_body_filter(). -- cmpilato */
+
ap_add_output_filter("LocationRewrite", NULL, r, r->connection);
ap_add_output_filter("ReposRewrite", NULL, r, r->connection);
ap_add_input_filter("IncomingRewrite", NULL, r, r->connection);
Modified: subversion/branches/compressed-pristines/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/compressed-pristines/subversion/mod_dav_svn/mod_dav_svn.c?rev=1373783&r1=1373782&r2=1373783&view=diff
==============================================================================
--- subversion/branches/compressed-pristines/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/branches/compressed-pristines/subversion/mod_dav_svn/mod_dav_svn.c Thu Aug 16 10:17:48 2012
@@ -95,6 +95,7 @@ typedef struct dir_conf_t {
const char *activities_db; /* path to activities database(s) */
enum conf_flag txdelta_cache; /* whether to enable txdelta caching */
enum conf_flag fulltext_cache; /* whether to enable fulltext caching */
+ enum conf_flag revprop_cache; /* whether to enable revprop caching */
apr_hash_t *hooks_env; /* environment for hook scripts */
} dir_conf_t;
@@ -224,6 +225,7 @@ merge_dir_config(apr_pool_t *p, void *ba
newconf->list_parentpath = INHERIT_VALUE(parent, child, list_parentpath);
newconf->txdelta_cache = INHERIT_VALUE(parent, child, txdelta_cache);
newconf->fulltext_cache = INHERIT_VALUE(parent, child, fulltext_cache);
+ newconf->revprop_cache = INHERIT_VALUE(parent, child, revprop_cache);
newconf->root_dir = INHERIT_VALUE(parent, child, root_dir);
newconf->hooks_env = INHERIT_VALUE(parent, child, hooks_env);
@@ -476,6 +478,19 @@ SVNCacheFullTexts_cmd(cmd_parms *cmd, vo
}
static const char *
+SVNCacheRevProps_cmd(cmd_parms *cmd, void *config, int arg)
+{
+ dir_conf_t *conf = config;
+
+ if (arg)
+ conf->revprop_cache = CONF_FLAG_ON;
+ else
+ conf->revprop_cache = CONF_FLAG_OFF;
+
+ return NULL;
+}
+
+static const char *
SVNInMemoryCacheSize_cmd(cmd_parms *cmd, void *config, const char *arg1)
{
svn_cache_config_t settings = *svn_cache_config_get();
@@ -847,6 +862,16 @@ dav_svn__get_fulltext_cache_flag(request
}
+svn_boolean_t
+dav_svn__get_revprop_cache_flag(request_rec *r)
+{
+ dir_conf_t *conf;
+
+ conf = ap_get_module_config(r->per_dir_config, &dav_svn_module);
+ return conf->revprop_cache == CONF_FLAG_ON;
+}
+
+
int
dav_svn__get_compression_level(void)
{
@@ -1083,6 +1108,14 @@ static const command_rec cmds[] =
"if sufficient in-memory cache is available "
"(default is Off)."),
+ /* per directory/location */
+ AP_INIT_FLAG("SVNCacheRevProps", SVNCacheRevProps_cmd, NULL,
+ ACCESS_CONF|RSRC_CONF,
+ "speeds up 'svn ls -v', export and checkout operations"
+ "but should only be enabled under the conditions described"
+ "in the documentation"
+ "(default is Off)."),
+
/* per server */
AP_INIT_TAKE1("SVNInMemoryCacheSize", SVNInMemoryCacheSize_cmd, NULL,
RSRC_CONF,