subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pbu...@apache.org
Subject svn commit: r1360909 [11/14] - in /subversion/branches/inheritable-props: ./ build/generator/ build/generator/templates/ notes/wc-ng/ subversion/bindings/javahl/native/ subversion/bindings/javahl/tests/org/apache/subversion/javahl/ subversion/bindings/...
Date Thu, 12 Jul 2012 20:24:57 GMT
Modified: subversion/branches/inheritable-props/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_wc/wc_db.h?rev=1360909&r1=1360908&r2=1360909&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_wc/wc_db.h Thu Jul 12 20:24:53
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);
 
 
@@ -1017,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);
 
@@ -1293,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,
@@ -1441,11 +1481,12 @@ 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_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);
 
 
@@ -1499,12 +1540,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.
 
-/* ### caller maintains ACTUAL. we're just recording state. */
-/* ### we probably need to record details of the conflict. how? */
+   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.
+
+   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);
 
 
@@ -1543,9 +1593,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.
@@ -1555,10 +1604,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,
@@ -1606,50 +1652,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 */
 
 
@@ -2186,9 +2188,9 @@ 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 */
@@ -2199,22 +2201,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
@@ -2888,12 +2888,6 @@ svn_wc__db_op_remove_node(svn_wc__db_t *
                           svn_kind_t not_present_kind,
                           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
@@ -2989,40 +2983,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 *

Modified: subversion/branches/inheritable-props/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_wc/workqueue.c?rev=1360909&r1=1360908&r2=1360909&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_wc/workqueue.c Thu Jul 12 20:24:53
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, &not_present_kind,
-                                           &not_present_rev, &repos_relpath,
-                                           &repos_root_url, &repos_uuid, NULL,
+          SVN_ERR(svn_wc__db_base_get_info(NULL, NULL,
+                                           &not_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;
 }
@@ -911,6 +757,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.
@@ -1152,29 +1079,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,
@@ -1322,58 +1254,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. */
 
-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);
+  {
+    /* Check if we should combine with a property conflict... */
+    svn_skel_t *conflicts;
 
-  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;
 }
 
@@ -1402,47 +1318,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;
 }
 
@@ -1456,14 +1368,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/inheritable-props/subversion/libsvn_wc/workqueue.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_wc/workqueue.h?rev=1360909&r1=1360908&r2=1360909&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_wc/workqueue.h (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_wc/workqueue.h Thu Jul 12 20:24:53
2012
@@ -122,6 +122,18 @@ svn_wc__wq_build_file_remove(svn_skel_t 
                              apr_pool_t *result_pool,
                              apr_pool_t *scratch_pool);
 
+/* 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,65 +194,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 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/inheritable-props/subversion/mod_dav_svn/liveprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/mod_dav_svn/liveprops.c?rev=1360909&r1=1360908&r2=1360909&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/mod_dav_svn/liveprops.c (original)
+++ subversion/branches/inheritable-props/subversion/mod_dav_svn/liveprops.c Thu Jul 12 20:24:53
2012
@@ -281,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 */
@@ -785,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 {



Mime
View raw message