You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/08/10 22:56:05 UTC

svn commit: r984206 [17/35] - in /subversion/branches/ignore-mergeinfo: ./ build/ build/generator/ build/generator/templates/ build/hudson/ build/hudson/jobs/subversion-1.6.x-solaris/ build/hudson/jobs/subversion-1.6.x-ubuntu/ build/hudson/jobs/subvers...

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/entries.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/entries.h?rev=984206&r1=984205&r2=984206&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/entries.h (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/entries.h Tue Aug 10 20:55:56 2010
@@ -37,12 +37,6 @@
 extern "C" {
 #endif /* __cplusplus */
 
-
-/* String representations for svn_node_kind.  This maybe should be
-   abstracted farther out? */
-#define SVN_WC__ENTRIES_ATTR_FILE_STR   "file"
-#define SVN_WC__ENTRIES_ATTR_DIR_STR    "dir"
-
 
 /* The names of the fields used for storing entries' information.
    Used for the names of the XML attributes in XML entries files
@@ -50,31 +44,10 @@ extern "C" {
    and for error reporting when reading a non-XML entries file.
    ### If you add or remove items here, you probably want to make sure
    to do the same for the SVN_WC__ENTRY_MODIFY_* #defines as well. */
-#define SVN_WC__ENTRY_ATTR_NAME               "name"
-#define SVN_WC__ENTRY_ATTR_REVISION           "revision"
-#define SVN_WC__ENTRY_ATTR_URL                "url"
-#define SVN_WC__ENTRY_ATTR_KIND               "kind"
-#define SVN_WC__ENTRY_ATTR_TEXT_TIME          "text-time"
-#define SVN_WC__ENTRY_ATTR_CHECKSUM           "checksum"
-#define SVN_WC__ENTRY_ATTR_SCHEDULE           "schedule"
-#define SVN_WC__ENTRY_ATTR_COPIED             "copied"
-#define SVN_WC__ENTRY_ATTR_DELETED            "deleted"
-#define SVN_WC__ENTRY_ATTR_ABSENT             "absent"
-#define SVN_WC__ENTRY_ATTR_COPYFROM_URL       "copyfrom-url"
-#define SVN_WC__ENTRY_ATTR_COPYFROM_REV       "copyfrom-rev"
 #define SVN_WC__ENTRY_ATTR_CONFLICT_OLD       "conflict-old" /* saved old file */
 #define SVN_WC__ENTRY_ATTR_CONFLICT_NEW       "conflict-new" /* saved new file */
 #define SVN_WC__ENTRY_ATTR_CONFLICT_WRK       "conflict-wrk" /* saved wrk file */
 #define SVN_WC__ENTRY_ATTR_PREJFILE           "prop-reject-file"
-#define SVN_WC__ENTRY_ATTR_CMT_REV            "committed-rev"
-#define SVN_WC__ENTRY_ATTR_CMT_DATE           "committed-date"
-#define SVN_WC__ENTRY_ATTR_CMT_AUTHOR         "last-author"
-#define SVN_WC__ENTRY_ATTR_WORKING_SIZE       "working-size"
-
-/* Attribute values for 'schedule' */
-#define SVN_WC__ENTRY_VALUE_ADD        "add"
-#define SVN_WC__ENTRY_VALUE_DELETE     "delete"
-#define SVN_WC__ENTRY_VALUE_REPLACE    "replace"
 
 
 /* Set *NEW_ENTRY to a new entry, taking attributes from ATTS, whose
@@ -83,7 +56,7 @@ extern "C" {
 
    Set MODIFY_FLAGS to reflect the fields that were present in ATTS. */
 svn_error_t *svn_wc__atts_to_entry(svn_wc_entry_t **new_entry,
-                                   apr_uint64_t *modify_flags,
+                                   int *modify_flags,
                                    apr_hash_t *atts,
                                    apr_pool_t *pool);
 
@@ -91,49 +64,39 @@ svn_error_t *svn_wc__atts_to_entry(svn_w
 /* The MODIFY_FLAGS that tell svn_wc__entry_modify which parameters to
    pay attention to.  ### These should track the changes made to the
    SVN_WC__ENTRY_ATTR_* #defines! */
-/* Note: we use APR_INT64_C because APR 0.9 lacks APR_UINT64_C */
-#define SVN_WC__ENTRY_MODIFY_REVISION           APR_INT64_C(0x0000000000000001)
-#define SVN_WC__ENTRY_MODIFY_URL                APR_INT64_C(0x0000000000000002)
-/* OPEN */
-#define SVN_WC__ENTRY_MODIFY_KIND               APR_INT64_C(0x0000000000000008)
-#define SVN_WC__ENTRY_MODIFY_TEXT_TIME          APR_INT64_C(0x0000000000000010)
-/* OPEN */
-#define SVN_WC__ENTRY_MODIFY_CHECKSUM           APR_INT64_C(0x0000000000000040)
-#define SVN_WC__ENTRY_MODIFY_SCHEDULE           APR_INT64_C(0x0000000000000080)
-#define SVN_WC__ENTRY_MODIFY_COPIED             APR_INT64_C(0x0000000000000100)
-#define SVN_WC__ENTRY_MODIFY_DELETED            APR_INT64_C(0x0000000000000200)
-#define SVN_WC__ENTRY_MODIFY_COPYFROM_URL       APR_INT64_C(0x0000000000000400)
-#define SVN_WC__ENTRY_MODIFY_COPYFROM_REV       APR_INT64_C(0x0000000000000800)
-#define SVN_WC__ENTRY_MODIFY_CONFLICT_OLD       APR_INT64_C(0x0000000000001000)
-#define SVN_WC__ENTRY_MODIFY_CONFLICT_NEW       APR_INT64_C(0x0000000000002000)
-#define SVN_WC__ENTRY_MODIFY_CONFLICT_WRK       APR_INT64_C(0x0000000000004000)
-#define SVN_WC__ENTRY_MODIFY_PREJFILE           APR_INT64_C(0x0000000000008000)
-/* OPEN */
-#define SVN_WC__ENTRY_MODIFY_INCOMPLETE         APR_INT64_C(0x0000000000100000)
-#define SVN_WC__ENTRY_MODIFY_ABSENT             APR_INT64_C(0x0000000000200000)
-/* OPEN */
-#define SVN_WC__ENTRY_MODIFY_WORKING_SIZE       APR_INT64_C(0x0000000100000000)
-/* OPEN */
-#define SVN_WC__ENTRY_MODIFY_FILE_EXTERNAL      APR_INT64_C(0x0000000400000000)
-/* No #define for DEPTH, because it's only meaningful on this-dir anyway. */
+#define SVN_WC__ENTRY_MODIFY_REVISION           0x00000001
+#define SVN_WC__ENTRY_MODIFY_URL                0x00000002
+#define SVN_WC__ENTRY_MODIFY_KIND               0x00000004
+/* ### gap  */
+#define SVN_WC__ENTRY_MODIFY_CHECKSUM           0x00000010
+#define SVN_WC__ENTRY_MODIFY_SCHEDULE           0x00000020
+#define SVN_WC__ENTRY_MODIFY_COPIED             0x00000040
+#define SVN_WC__ENTRY_MODIFY_DELETED            0x00000080
+#define SVN_WC__ENTRY_MODIFY_COPYFROM_URL       0x00000100
+#define SVN_WC__ENTRY_MODIFY_COPYFROM_REV       0x00000200
+#define SVN_WC__ENTRY_MODIFY_CONFLICT_OLD       0x00000400
+#define SVN_WC__ENTRY_MODIFY_CONFLICT_NEW       0x00000800
+#define SVN_WC__ENTRY_MODIFY_CONFLICT_WRK       0x00001000
+#define SVN_WC__ENTRY_MODIFY_PREJFILE           0x00002000
+#define SVN_WC__ENTRY_MODIFY_ABSENT             0x00004000
+/* ### gap  */
 
 /* ...ORed together with this to mean: just set the schedule to the new
    value, instead of treating the new value as a change of state to be
    merged with the current schedule. */
-#define SVN_WC__ENTRY_MODIFY_FORCE              APR_INT64_C(0x4000000000000000)
-
+#define SVN_WC__ENTRY_MODIFY_FORCE              0x00020000
 
-/* TODO ### Rewrite doc string to mention DB, LOCAL_ABSPATH; not ADM_ACCESS, NAME.
 
-   Modify an entry for NAME in access baton ADM_ACCESS by folding in
+/* Modify the entry for LOCAL_ABSPATH in DB by folding in
    ("merging") changes, and sync those changes to disk.  New values
    for the entry are pulled from their respective fields in ENTRY, and
    MODIFY_FLAGS is a bitmask to specify which of those fields to pay
    attention to, formed from the values SVN_WC__ENTRY_MODIFY_....
-   ADM_ACCESS must hold a write lock.
 
-   NAME can be NULL to specify that the caller wishes to modify the
-   "this dir" entry in ADM_ACCESS.
+   ### Old doc: "ADM_ACCESS must hold a write lock."
+
+   If LOCAL_ABSPATH specifies a directory, its full entry will be modified.
+   To modify its "parent stub" entry, use svn_wc__entry_modify_stub().
 
    "Folding in" a change means, in most cases, simply replacing the field
    with the new value. However, for the "schedule" field, unless
@@ -145,45 +108,32 @@ svn_error_t *svn_wc__atts_to_entry(svn_w
    of the node.
 
    Perform all allocations in SCRATCH_POOL.
-
-   -----
-
-   A cross between svn_wc__get_entry() and svn_wc__entry_modify().
-
-   If PARENT_STUB is TRUE, then this function will modify a directory's
-   stub entry in the parent. If PARENT_STUB is FALSE, then it will operate
-   on a directory's real entry.
-
-   PARENT_STUB must be FALSE if KIND==FILE.
-
-   If KIND is svn_kind_unknown, then PARENT_STUB is interpreted based on
-   what is found on disk.  */
+*/
 svn_error_t *
-svn_wc__entry_modify2(svn_wc__db_t *db,
-                      const char *local_abspath,
-                      svn_node_kind_t kind,
-                      svn_boolean_t parent_stub,
-                      svn_wc_entry_t *entry,
-                      apr_uint64_t modify_flags,
-                      apr_pool_t *scratch_pool);
-
+svn_wc__entry_modify(svn_wc__db_t *db,
+                     const char *local_abspath,
+                     svn_node_kind_t kind,
+                     const svn_wc_entry_t *entry,
+                     int modify_flags,
+                     apr_pool_t *scratch_pool);
 
-/* Remove LOCAL_ABSPATH from DB, unconditionally.
 
-   All temporary allocations will be performed in SCRATCH_POOL.  */
+/* Like svn_wc__entry_modify(), but modifies the "parent stub".  */
 svn_error_t *
-svn_wc__entry_remove(svn_wc__db_t *db,
-                     const char *local_abspath,
-                     apr_pool_t *scratch_pool);
+svn_wc__entry_modify_stub(svn_wc__db_t *db,
+                          const char *local_abspath,
+                          const svn_wc_entry_t *entry,
+                          int modify_flags,
+                          apr_pool_t *scratch_pool);
 
 
 /* Tweak the information for LOCAL_ABSPATH in DB.  If NEW_URL is non-null,
  * make this the entry's new url.  If NEW_REV is valid, make this the
  * entry's working revision.
  *
- * If ALLOW_REMOVAL is TRUE the tweaks might cause the entry NAME to
- * be removed from the hash, if ALLOW_REMOVAL is FALSE this will not
- * happen.
+ * If ALLOW_REMOVAL is TRUE the tweaks might cause the entry for
+ * LOCAL_ABSPATH to be removed from the WC; if ALLOW_REMOVAL is FALSE this
+ * will not happen.
  *
  * THIS_DIR should be true if the LOCAL_ABSPATH refers to a directory, and
  * the information to be edited is not in the stub entry.
@@ -211,7 +161,7 @@ svn_wc__tweak_entry(svn_wc__db_t *db,
  * to handle, than detecting the error and clearing it).
  *
  * If you know the entry is a FILE or DIR, then specify that in KIND. If you
- * are unsure, then specific 'svn_node_unknown' for KIND. This value will be
+ * are unsure, then specify 'svn_node_unknown' for KIND. This value will be
  * used to optimize the access to the entry, so it is best to know the kind.
  * If you specify FILE/DIR, and the entry is *something else*, then
  * SVN_ERR_NODE_UNEXPECTED_KIND will be returned.
@@ -256,14 +206,6 @@ svn_error_t *
 svn_wc__entry_is_hidden(svn_boolean_t *hidden, const svn_wc_entry_t *entry);
 
 
-/* Set the depth of a directory.  */
-svn_error_t *
-svn_wc__set_depth(svn_wc__db_t *db,
-                  const char *local_dir_abspath,
-                  svn_depth_t depth,
-                  apr_pool_t *scratch_pool);
-
-
 /* For internal use by entries.c to read/write old-format working copies. */
 svn_error_t *
 svn_wc__read_entries_old(apr_hash_t **entries,

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/lock.c?rev=984206&r1=984205&r2=984206&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/lock.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/lock.c Tue Aug 10 20:55:56 2010
@@ -185,7 +185,7 @@ pool_cleanup_locked(void *p)
 
       /* If there is no ADM area, then we definitely have no work items
          or physical locks to worry about. Bail out.  */
-      if (!svn_wc__adm_area_exists(lock, lock->pool))
+      if (!svn_wc__adm_area_exists(lock->abspath, lock->pool))
         return APR_SUCCESS;
 
       /* Creating a subpool is safe within a pool cleanup, as long as
@@ -370,8 +370,7 @@ add_to_shared(svn_wc_adm_access_t *lock,
                                                             scratch_pool);
     if (IS_MISSING(prior))
       SVN_ERR(svn_wc__db_temp_close_access(lock->db, lock->abspath,
-                                           (svn_wc_adm_access_t *)&missing,
-                                           scratch_pool));
+                                           prior, scratch_pool));
   }
 
   svn_wc__db_temp_set_access(lock->db, lock->abspath, lock,
@@ -521,7 +520,7 @@ close_single(svn_wc_adm_access_t *adm_ac
                                                       scratch_pool);
           if (err)
             {
-              if (svn_wc__adm_area_exists(adm_access, scratch_pool))
+              if (svn_wc__adm_area_exists(adm_access->abspath, scratch_pool))
                 return err;
               svn_error_clear(err);
             }
@@ -561,9 +560,6 @@ svn_wc__adm_available(svn_boolean_t *ava
   svn_wc__db_status_t status;
   svn_depth_t depth;
 
-  *available = TRUE;
-  if (obstructed)
-    *obstructed = FALSE;
   if (kind)
     *kind = svn_wc__db_kind_unknown;
 
@@ -573,21 +569,18 @@ svn_wc__adm_available(svn_boolean_t *ava
                                NULL, NULL, NULL,
                                db, local_abspath, scratch_pool, scratch_pool));
 
-  if (status == svn_wc__db_status_obstructed ||
-      status == svn_wc__db_status_obstructed_add ||
-      status == svn_wc__db_status_obstructed_delete)
-    {
-      *available = FALSE;
-      if (obstructed)
-        *obstructed = TRUE;
-    }
-  else if (status == svn_wc__db_status_absent ||
-           status == svn_wc__db_status_excluded ||
-           status == svn_wc__db_status_not_present ||
-           depth == svn_depth_exclude)
-    {
-      *available = FALSE;
-    }
+  if (obstructed)
+    *obstructed = (status == svn_wc__db_status_obstructed ||
+                   status == svn_wc__db_status_obstructed_add ||
+                   status == svn_wc__db_status_obstructed_delete);
+
+  *available = !(status == svn_wc__db_status_obstructed ||
+                 status == svn_wc__db_status_obstructed_add ||
+                 status == svn_wc__db_status_obstructed_delete ||
+                 status == svn_wc__db_status_absent ||
+                 status == svn_wc__db_status_excluded ||
+                 status == svn_wc__db_status_not_present ||
+                 depth == svn_depth_exclude);
 
   return SVN_NO_ERROR;
 }
@@ -859,6 +852,7 @@ svn_wc__adm_retrieve_internal2(svn_wc__d
 }
 
 
+/* SVN_DEPRECATED */
 svn_error_t *
 svn_wc_adm_retrieve(svn_wc_adm_access_t **adm_access,
                     svn_wc_adm_access_t *associated,
@@ -946,6 +940,7 @@ svn_wc_adm_retrieve(svn_wc_adm_access_t 
 }
 
 
+/* SVN_DEPRECATED */
 svn_error_t *
 svn_wc_adm_probe_retrieve(svn_wc_adm_access_t **adm_access,
                           svn_wc_adm_access_t *associated,
@@ -988,6 +983,8 @@ svn_wc_adm_probe_retrieve(svn_wc_adm_acc
   return SVN_NO_ERROR;
 }
 
+
+/* SVN_DEPRECATED */
 svn_error_t *
 svn_wc_adm_probe_try3(svn_wc_adm_access_t **adm_access,
                       svn_wc_adm_access_t *associated,
@@ -1339,21 +1336,6 @@ svn_wc_adm_open_anchor(svn_wc_adm_access
 }
 
 
-svn_error_t *
-svn_wc__adm_retrieve_from_context(svn_wc_adm_access_t **adm_access,
-                                  svn_wc_context_t *wc_ctx,
-                                  const char *local_abspath,
-                                  apr_pool_t *pool)
-{
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
-
-  *adm_access = svn_wc__adm_retrieve_internal2(wc_ctx->db,
-                                               local_abspath,
-                                               pool);
-
-  return SVN_NO_ERROR;
-}
-
 /* Does the work of closing the access baton ADM_ACCESS.  Any physical
    locks are removed from the working copy if PRESERVE_LOCK is FALSE, or
    are left if PRESERVE_LOCK is TRUE.  Any associated access batons that
@@ -1409,12 +1391,16 @@ do_close(svn_wc_adm_access_t *adm_access
                                        scratch_pool));
 }
 
+
+/* SVN_DEPRECATED */
 svn_error_t *
 svn_wc_adm_close2(svn_wc_adm_access_t *adm_access, apr_pool_t *scratch_pool)
 {
   return svn_error_return(do_close(adm_access, FALSE, scratch_pool));
 }
 
+
+/* SVN_DEPRECATED */
 svn_boolean_t
 svn_wc_adm_locked(const svn_wc_adm_access_t *adm_access)
 {
@@ -1472,6 +1458,7 @@ svn_wc_locked2(svn_boolean_t *locked_her
 }
 
 
+/* SVN_DEPRECATED */
 const char *
 svn_wc_adm_access_path(const svn_wc_adm_access_t *adm_access)
 {
@@ -1486,6 +1473,7 @@ svn_wc__adm_access_abspath(const svn_wc_
 }
 
 
+/* SVN_DEPRECATED */
 apr_pool_t *
 svn_wc_adm_access_pool(const svn_wc_adm_access_t *adm_access)
 {
@@ -1551,122 +1539,6 @@ svn_wc__adm_missing(svn_wc__db_t *db,
   return (kind == svn_wc__db_kind_dir) && !available && obstructed;
 }
 
-svn_error_t *
-svn_wc__adm_open_in_context(svn_wc_adm_access_t **adm_access,
-                            svn_wc_context_t *wc_ctx,
-                            const char *path,
-                            svn_boolean_t write_lock,
-                            int levels_to_lock,
-                            svn_cancel_func_t cancel_func,
-                            void *cancel_baton,
-                            apr_pool_t *pool)
-{
-  SVN_ERR_ASSERT(wc_ctx != NULL);
-
-  SVN_ERR(open_all(adm_access, path, wc_ctx->db, TRUE, write_lock,
-                   levels_to_lock, cancel_func, cancel_baton, pool));
-
-  return SVN_NO_ERROR;
-}
-
-/* The following is largely cribbed from svn_wc_adm_probe_open3(). */
-svn_error_t *
-svn_wc__adm_probe_in_context(svn_wc_adm_access_t **adm_access,
-                             svn_wc_context_t *wc_ctx,
-                             const char *path,
-                             svn_boolean_t write_lock,
-                             int levels_to_lock,
-                             svn_cancel_func_t cancel_func,
-                             void *cancel_baton,
-                             apr_pool_t *pool)
-{
-  const char *dir;
-  svn_error_t *err;
-
-  SVN_ERR_ASSERT(wc_ctx != NULL);
-
-  SVN_ERR(probe(wc_ctx->db, &dir, path, pool));
-
-  /* If we moved up a directory, then the path is not a directory, or it
-     is not under version control. In either case, the notion of
-     levels_to_lock does not apply to the provided path.  Disable it so
-     that we don't end up trying to lock more than we need.  */
-  if (dir != path)
-    levels_to_lock = 0;
-
-  err = svn_wc__adm_open_in_context(adm_access, wc_ctx, dir, write_lock,
-                                    levels_to_lock, cancel_func, cancel_baton,
-                                    pool);
-
-  if (err)
-    {
-      svn_error_t *err2;
-
-      /* If we got an error on the parent dir, that means we failed to
-         get an access baton for the child in the first place.  And if
-         the reason we couldn't get the child access baton is that the
-         child is not a versioned directory, then return an error
-         about the child, not the parent. */
-      svn_node_kind_t child_kind;
-      if ((err2 = svn_io_check_path(path, &child_kind, pool)))
-        {
-          svn_error_compose(err, err2);
-          return err;
-        }
-
-      if ((dir != path)
-          && (child_kind == svn_node_dir)
-          && (err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY))
-        {
-          svn_error_clear(err);
-          return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
-                                   _("'%s' is not a working copy"),
-                                   svn_dirent_local_style(path, pool));
-        }
-
-      return err;
-    }
-
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_wc__temp_get_relpath(const char **rel_path,
-                         svn_wc__db_t *db,
-                         const char *local_abspath,
-                         apr_pool_t *result_pool,
-                         apr_pool_t *scratch_pool)
-{
-  const char *suffix = "";
-  const char *abspath = local_abspath;
-
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
-
-  while (TRUE)
-  {
-    svn_wc_adm_access_t *adm_access =
-        svn_wc__adm_retrieve_internal2(db, abspath, scratch_pool);
-
-    if (adm_access != NULL)
-      {
-        *rel_path = svn_dirent_join(svn_wc_adm_access_path(adm_access),
-                                    suffix, result_pool);
-        return SVN_NO_ERROR;
-      }
-
-    if (svn_dirent_is_root(abspath, strlen(abspath)))
-      {
-        /* Not found, so no problem calling it abspath */
-        *rel_path = apr_pstrdup(result_pool, local_abspath);
-        return SVN_NO_ERROR;
-      }
-
-    suffix = svn_dirent_join(suffix, svn_dirent_basename(local_abspath, NULL),
-                             scratch_pool);
-    abspath = svn_dirent_dirname(abspath, scratch_pool);
-  }
-}
-
 
 svn_error_t *
 svn_wc__acquire_write_lock(const char **anchor_abspath,
@@ -1802,14 +1674,18 @@ svn_wc__release_write_lock(svn_wc_contex
   SVN_ERR(svn_wc__db_wq_fetch(&id, &work_item, wc_ctx->db, local_abspath,
                               scratch_pool, scratch_pool));
   if (work_item)
-    return SVN_NO_ERROR;
+    {
+      /* Do not release locks (here or below) if there is work to do.  */
+      return SVN_NO_ERROR;
+    }
 
   /* We need to recursively remove locks (see comment in
      svn_wc__acquire_write_lock(). */
 
-  SVN_ERR(svn_wc__db_read_children(&children, wc_ctx->db, local_abspath,
-                                   scratch_pool, scratch_pool));
   iterpool = svn_pool_create(scratch_pool);
+
+  SVN_ERR(svn_wc__db_read_children(&children, wc_ctx->db, local_abspath,
+                                   scratch_pool, iterpool));
   for (i = 0; i < children->nelts; i ++)
     {
       const char *child_relpath = APR_ARRAY_IDX(children, i, const char *);

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/log.c?rev=984206&r1=984205&r2=984206&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/log.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/log.c Tue Aug 10 20:55:56 2010
@@ -79,6 +79,8 @@
 
 /* Delete the entry SVN_WC__LOG_ATTR_NAME. */
 #define SVN_WC__LOG_DELETE_ENTRY        "delete-entry"
+#define SVN_WC__LOG_ATTR_REVISION       "revision"
+#define SVN_WC__LOG_ATTR_KIND           "kind"
 
 /* Move file SVN_WC__LOG_ATTR_NAME to SVN_WC__LOG_ATTR_DEST. */
 #define SVN_WC__LOG_MV                  "mv"
@@ -88,20 +90,6 @@
    the DEST. */
 #define SVN_WC__LOG_CP_AND_TRANSLATE    "cp-and-translate"
 
-/* Append file from SVN_WC__LOG_ATTR_NAME to SVN_WC__LOG_ATTR_DEST. */
-#define SVN_WC__LOG_APPEND              "append"
-
-/* Make file SVN_WC__LOG_ATTR_NAME readonly */
-#define SVN_WC__LOG_READONLY            "readonly"
-
-/* Make file SVN_WC__LOG_ATTR_NAME readonly if needs-lock property is set
-   and there is no lock token for the file in the working copy. */
-#define SVN_WC__LOG_MAYBE_READONLY "maybe-readonly"
-
-/* Make file SVN_WC__LOG_ATTR_NAME executable if the
-   executable property is set. */
-#define SVN_WC__LOG_MAYBE_EXECUTABLE "maybe-executable"
-
 /* Set SVN_WC__LOG_ATTR_NAME to have timestamp SVN_WC__LOG_ATTR_TIMESTAMP. */
 #define SVN_WC__LOG_SET_TIMESTAMP       "set-timestamp"
 
@@ -117,7 +105,6 @@
 #define SVN_WC__LOG_ATTR_NAME           "name"
 #define SVN_WC__LOG_ATTR_DEST           "dest"
 #define SVN_WC__LOG_ATTR_TIMESTAMP      "timestamp"
-#define SVN_WC__LOG_ATTR_FORCE          "force"
 #define SVN_WC__LOG_ATTR_DATA           "data"
 
 /* This one is for SVN_WC__LOG_CP_AND_TRANSLATE to indicate a versioned
@@ -142,206 +129,85 @@ struct log_runner
 #define LOG_START "<wc-log xmlns=\"http://subversion.tigris.org/xmlns\">\n"
 #define LOG_END "</wc-log>\n"
 
-
-
-/*** The XML handlers. ***/
-
-/* Used by file_xfer_under_path(). */
-enum svn_wc__xfer_action {
-  svn_wc__xfer_mv,
-  svn_wc__xfer_append,
-  svn_wc__xfer_cp_and_translate
-};
-
-
-/* Perform some sort of copy-related ACTION on NAME and DEST:
-
-      svn_wc__xfer_mv:                 do a copy, then remove NAME.
-      svn_wc__xfer_append:             append contents of NAME to DEST
-      svn_wc__xfer_cp_and_translate:   copy NAME to DEST, doing any eol
-                                       and keyword expansion according to
-                                       the current property vals of VERSIONED
-                                       or, if that's NULL, those of DEST.
-*/
-static svn_error_t *
-file_xfer_under_path(svn_wc__db_t *db,
-                     const char *adm_abspath,
-                     const char *name,
-                     const char *dest,
-                     const char *versioned,
-                     enum svn_wc__xfer_action action,
-                     apr_pool_t *scratch_pool)
-{
-  svn_error_t *err;
-  const char *from_abspath;
-  const char *dest_abspath;
-
-  from_abspath = svn_dirent_join(adm_abspath, name, scratch_pool);
-  dest_abspath = svn_dirent_join(adm_abspath, dest, scratch_pool);
-
-  switch (action)
-    {
-    case svn_wc__xfer_append:
-      err = svn_io_append_file(from_abspath, dest_abspath, scratch_pool);
-      if (err)
-        {
-          if (!APR_STATUS_IS_ENOENT(err->apr_err))
-            return svn_error_return(err);
-          svn_error_clear(err);
-        }
-      break;
-
-    case svn_wc__xfer_cp_and_translate:
-      {
-        const char *versioned_abspath;
-        svn_subst_eol_style_t style;
-        const char *eol;
-        apr_hash_t *keywords;
-        svn_boolean_t special;
-
-        if (versioned)
-          versioned_abspath = svn_dirent_join(adm_abspath, versioned,
-                                              scratch_pool);
-        else
-          versioned_abspath = dest_abspath;
-
-          err = svn_wc__get_eol_style(&style, &eol, db, versioned_abspath,
-                                      scratch_pool, scratch_pool);
-        if (! err)
-          err = svn_wc__get_keywords(&keywords, db, versioned_abspath, NULL,
-                                     scratch_pool, scratch_pool);
-        if (! err)
-          err = svn_wc__get_special(&special, db, versioned_abspath,
-                                    scratch_pool);
-
-        if (! err)
-          err = svn_subst_copy_and_translate3
-                (from_abspath, dest_abspath,
-                 eol, TRUE,
-                 keywords, TRUE,
-                 special,
-                 scratch_pool);
-
-        if (err)
-          {
-            if (!APR_STATUS_IS_ENOENT(err->apr_err))
-              return svn_error_return(err);
-            svn_error_clear(err);
-          }
-
-        SVN_ERR(svn_wc__maybe_set_read_only(NULL, db, dest_abspath,
-                                            scratch_pool));
-
-        return svn_error_return(svn_wc__maybe_set_executable(
-                                              NULL, db, dest_abspath,
-                                              scratch_pool));
-      }
-
-    case svn_wc__xfer_mv:
-      err = svn_io_file_rename(from_abspath, dest_abspath, scratch_pool);
-
-      /* If we got an ENOENT, that's ok;  the move has probably
-         already completed in an earlier run of this log.  */
-      if (err)
-        {
-          if (!APR_STATUS_IS_ENOENT(err->apr_err))
-            return svn_error_quick_wrap(err, _("Can't move source to dest"));
-          svn_error_clear(err);
-        }
-      break;
-    }
-
-  return SVN_NO_ERROR;
-}
+/* For log debugging. Generates output about its operation.  */
+/* #define DEBUG_LOG */
 
 
 /* Helper macro for erroring out while running a logfile.
 
    This is implemented as a macro so that the error created has a useful
    line number associated with it. */
-#define SIGNAL_ERROR(loggy, err)                                   \
-  svn_xml_signal_bailout                                           \
-    (svn_error_createf(SVN_ERR_WC_BAD_ADM_LOG, err,                \
-                       _("In directory '%s'"),                     \
-                       svn_dirent_local_style(loggy->adm_abspath,  \
-                                              loggy->pool)),       \
-     loggy->parser)
+#define SIGNAL_ERROR(loggy, err)                                        \
+  svn_xml_signal_bailout(svn_error_createf(                             \
+                           SVN_ERR_WC_BAD_ADM_LOG, err,                 \
+                           _("In directory '%s'"),                      \
+                           svn_dirent_local_style(loggy->adm_abspath,   \
+                                                  loggy->pool)),        \
+                         loggy->parser)
 
 
-
-/*** Dispatch on the xml opening tag. ***/
-
-/* */
 static svn_error_t *
-log_do_file_xfer(struct log_runner *loggy,
-                 const char *name,
-                 enum svn_wc__xfer_action action,
-                 const char **atts)
+log_do_file_cp_and_translate(svn_wc__db_t *db,
+                             const char *from_abspath,
+                             const char *dest_abspath,
+                             const char *versioned_abspath,
+                             apr_pool_t *scratch_pool)
 {
   svn_error_t *err;
-  const char *dest = NULL;
-  const char *versioned;
-
-  /* We have the name (src), and the destination is absolutely required. */
-  dest = svn_xml_get_attr_value(SVN_WC__LOG_ATTR_DEST, atts);
-  versioned = svn_xml_get_attr_value(SVN_WC__LOG_ATTR_ARG_2, atts);
-
-  if (! dest)
-    return svn_error_createf(SVN_ERR_WC_BAD_ADM_LOG, NULL,
-                             _("Missing 'dest' attribute in '%s'"),
-                             svn_dirent_local_style(loggy->adm_abspath,
-                                                    loggy->pool));
+  svn_subst_eol_style_t style;
+  const char *eol;
+  apr_hash_t *keywords;
+  svn_boolean_t special;
+
+  err = svn_wc__get_eol_style(&style, &eol, db, versioned_abspath,
+                              scratch_pool, scratch_pool);
+  if (! err)
+    err = svn_wc__get_keywords(&keywords, db, versioned_abspath, NULL,
+                               scratch_pool, scratch_pool);
+  if (! err)
+    err = svn_wc__get_special(&special, db, versioned_abspath,
+                              scratch_pool);
+
+  if (! err)
+    err = svn_subst_copy_and_translate4(from_abspath, dest_abspath,
+                                        eol, TRUE /* repair */,
+                                        keywords, TRUE /* expand */,
+                                        special,
+                                        NULL, NULL, /* ### cancel */
+                                        scratch_pool);
 
-  err = file_xfer_under_path(loggy->db, loggy->adm_abspath, name, dest,
-                             versioned, action, loggy->pool);
   if (err)
-    SIGNAL_ERROR(loggy, err);
+    {
+      if (!APR_STATUS_IS_ENOENT(err->apr_err))
+        return svn_error_return(err);
+      svn_error_clear(err);
+    }
 
   return SVN_NO_ERROR;
 }
 
-/* Make file NAME in log's CWD readonly */
+
 static svn_error_t *
-log_do_file_readonly(struct log_runner *loggy,
-                     const char *name)
+log_do_file_move(const char *from_abspath,
+                 const char *dest_abspath,
+                 apr_pool_t *scratch_pool)
 {
   svn_error_t *err;
-  const char *local_abspath
-    = svn_dirent_join(loggy->adm_abspath, name, loggy->pool);
 
-  err = svn_io_set_file_read_only(local_abspath, FALSE, loggy->pool);
+  err = svn_io_file_rename(from_abspath, dest_abspath, scratch_pool);
+
+  /* If we got an ENOENT, that's ok;  the move has probably
+     already completed in an earlier run of this log.  */
   if (err)
     {
       if (!APR_STATUS_IS_ENOENT(err->apr_err))
-        return svn_error_return(err);
+        return svn_error_quick_wrap(err, _("Can't move source to dest"));
       svn_error_clear(err);
     }
-  return SVN_NO_ERROR;
-}
-
-/* Maybe make file NAME in log's CWD executable */
-static svn_error_t *
-log_do_file_maybe_executable(struct log_runner *loggy,
-                             const char *name)
-{
-  const char *local_abspath
-    = svn_dirent_join(loggy->adm_abspath, name, loggy->pool);
 
-  return svn_error_return(svn_wc__maybe_set_executable(
-                                NULL, loggy->db, local_abspath, loggy->pool));
+  return SVN_NO_ERROR;
 }
 
-/* Maybe make file NAME in log's CWD readonly */
-static svn_error_t *
-log_do_file_maybe_readonly(struct log_runner *loggy,
-                           const char *name)
-{
-  const char *local_abspath
-    = svn_dirent_join(loggy->adm_abspath, name, loggy->pool);
-
-  return svn_wc__maybe_set_read_only(NULL, loggy->db, local_abspath,
-                                     loggy->pool);
-}
 
 /* Set file NAME in log's CWD to timestamp value in ATTS. */
 static svn_error_t *
@@ -387,94 +253,22 @@ log_do_modify_entry(struct log_runner *l
                     const char *name,
                     const char **atts)
 {
-  svn_error_t *err;
   apr_hash_t *ah = svn_xml_make_att_hash(atts, loggy->pool);
   const char *local_abspath;
   svn_wc_entry_t *entry;
-  apr_uint64_t modify_flags;
-  const char *valuestr;
+  int modify_flags;
 
   local_abspath = svn_dirent_join(loggy->adm_abspath, name, loggy->pool);
 
   /* Convert the attributes into an entry structure. */
   SVN_ERR(svn_wc__atts_to_entry(&entry, &modify_flags, ah, loggy->pool));
 
-  /* svn_wc__atts_to_entry will no-op if the TEXT_TIME timestamp is
-     SVN_WC__TIMESTAMP_WC, so look for that case and fill in the proper
-     value. */
-  valuestr = apr_hash_get(ah, SVN_WC__ENTRY_ATTR_TEXT_TIME,
-                          APR_HASH_KEY_STRING);
-  if ((modify_flags & SVN_WC__ENTRY_MODIFY_TEXT_TIME)
-      && (! strcmp(valuestr, SVN_WC__TIMESTAMP_WC)))
-    {
-      apr_time_t text_time;
-
-      err = svn_io_file_affected_time(&text_time, local_abspath, loggy->pool);
-      if (err)
-        return svn_error_createf
-          (SVN_ERR_WC_BAD_ADM_LOG, err,
-           _("Error getting 'affected time' on '%s'"),
-           svn_dirent_local_style(local_abspath, loggy->pool));
-
-      entry->text_time = text_time;
-    }
-
-  valuestr = apr_hash_get(ah, SVN_WC__ENTRY_ATTR_WORKING_SIZE,
-                          APR_HASH_KEY_STRING);
-  if ((modify_flags & SVN_WC__ENTRY_MODIFY_WORKING_SIZE)
-      && (! strcmp(valuestr, SVN_WC__WORKING_SIZE_WC)))
-    {
-      apr_finfo_t finfo;
-      const svn_wc_entry_t *tfile_entry;
-
-      err = svn_wc__get_entry(&tfile_entry, loggy->db, local_abspath, TRUE,
-                              svn_node_file, FALSE,
-                              loggy->pool, loggy->pool);
-      if (err)
-        SIGNAL_ERROR(loggy, err);
-
-      if (! tfile_entry)
-        return SVN_NO_ERROR;
-
-      err = svn_io_stat(&finfo, local_abspath, APR_FINFO_MIN | APR_FINFO_LINK,
-                        loggy->pool);
-      if (err && APR_STATUS_IS_ENOENT(err->apr_err))
-        {
-          svn_error_clear(err);
-          finfo.size = 0;
-        }
-      else if (err)
-        return svn_error_createf
-          (SVN_ERR_WC_BAD_ADM_LOG, NULL,
-            _("Error getting file size on '%s'"),
-            svn_dirent_local_style(local_abspath, loggy->pool));
-
-      entry->working_size = finfo.size;
-    }
-
-  /* Handle force flag. */
-  valuestr = apr_hash_get(ah, SVN_WC__LOG_ATTR_FORCE,
-                          APR_HASH_KEY_STRING);
-  if (valuestr && strcmp(valuestr, "true") == 0)
-    modify_flags |= SVN_WC__ENTRY_MODIFY_FORCE;
-
-  /* Now write the new entry out. Note that we want to always operate
-     on the stub if name is not THIS_DIR. This loggy function is intended
-     to operate on the data in ADM_ABSPATH, so we do NOT want to reach
-     down into a subdir. For entry_modify2(), it is okay to set PARENT_STUB
-     to TRUE for files (kind errors are not raised).  */
-  err = svn_wc__entry_modify2(loggy->db,
-                              svn_dirent_join(loggy->adm_abspath,
-                                              name,
-                                              loggy->pool),
-                              svn_node_unknown,
-                              *name != '\0' /* parent_stub */,
-                              entry, modify_flags, loggy->pool);
-  if (err)
-    return svn_error_createf(SVN_ERR_WC_BAD_ADM_LOG, err,
-                             _("Error modifying entry for '%s'"), name);
-
-  return SVN_NO_ERROR;
+  /* ### this function never needs to modify a parent stub.
+     ### NOTE: this call to entry_modify MAY create a new node.  */
+  return svn_error_return(svn_wc__entry_modify(loggy->db, local_abspath,
+                                               svn_node_unknown,
+                                               entry, modify_flags,
+                                               loggy->pool));
 }
 
 /* */
@@ -500,30 +294,25 @@ log_do_delete_lock(struct log_runner *lo
 /* Ben sez:  this log command is (at the moment) only executed by the
    update editor.  It attempts to forcefully remove working data. */
 /* Delete a node from version control, and from disk if unmodified.
- * NAME is the name of the file or directory to be deleted, which is a child
- * of the directory represented by LOGGY->adm_access. If it is unversioned,
+ * LOCAL_ABSPATH is the name of the file or directory to be deleted.
+ * If it is unversioned,
  * do nothing and return no error. Otherwise, delete its WC entry and, if
  * the working version is unmodified, delete it from disk. */
 static svn_error_t *
-log_do_delete_entry(struct log_runner *loggy, const char *name)
+basic_delete_entry(svn_wc__db_t *db,
+                   const char *local_abspath,
+                   apr_pool_t *scratch_pool)
 {
-  const char *local_abspath;
   svn_wc__db_kind_t kind;
   svn_boolean_t hidden;
   svn_error_t *err;
 
-  local_abspath = svn_dirent_join(loggy->adm_abspath, name, loggy->pool);
-
   /* Figure out if 'name' is a dir or a file */
-  SVN_ERR(svn_wc__db_read_kind(&kind, loggy->db, local_abspath, TRUE,
-                               loggy->pool));
-
+  SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath, TRUE, scratch_pool));
   if (kind == svn_wc__db_kind_unknown)
     return SVN_NO_ERROR; /* Already gone */
 
-  SVN_ERR(svn_wc__db_node_hidden(&hidden, loggy->db, local_abspath,
-                                 loggy->pool));
-
+  SVN_ERR(svn_wc__db_node_hidden(&hidden, db, local_abspath, scratch_pool));
   if (hidden)
     return SVN_NO_ERROR;
 
@@ -541,8 +330,8 @@ log_do_delete_entry(struct log_runner *l
                                       NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                       NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                       NULL, NULL, NULL, NULL,
-                                      loggy->db, local_abspath,
-                                      loggy->pool, loggy->pool));
+                                   db, local_abspath,
+                                   scratch_pool, scratch_pool));
       if (status == svn_wc__db_status_obstructed ||
           status == svn_wc__db_status_obstructed_add ||
           status == svn_wc__db_status_obstructed_delete)
@@ -556,20 +345,20 @@ log_do_delete_entry(struct log_runner *l
           */
           if (status != svn_wc__db_status_obstructed_add)
             {
-              SVN_ERR(svn_wc__entry_remove(loggy->db, local_abspath,
-                                           loggy->pool));
+              SVN_ERR(svn_wc__db_temp_op_remove_entry(db, local_abspath,
+                                                      scratch_pool));
 
               return SVN_NO_ERROR;
             }
         }
     }
 
-  err = svn_wc__internal_remove_from_revision_control(loggy->db,
+  err = svn_wc__internal_remove_from_revision_control(db,
                                                       local_abspath,
                                                       TRUE, /* destroy */
                                                       FALSE, /* instant_error*/
                                                       NULL, NULL,
-                                                      loggy->pool);
+                                                      scratch_pool);
 
   if (err && err->apr_err == SVN_ERR_WC_LEFT_LOCAL_MOD)
     {
@@ -583,6 +372,44 @@ log_do_delete_entry(struct log_runner *l
 }
 
 
+static svn_error_t *
+log_do_delete_entry(struct log_runner *loggy,
+                    const char *name,
+                    svn_revnum_t revision,
+                    svn_node_kind_t kind)
+{
+  const char *local_abspath;
+  const char *repos_relpath, *repos_root, *repos_uuid;
+
+  local_abspath = svn_dirent_join(loggy->adm_abspath, name, loggy->pool);
+
+  if (SVN_IS_VALID_REVNUM(revision))
+    SVN_ERR(svn_wc__db_scan_base_repos(&repos_relpath, &repos_root,
+                                       &repos_uuid, loggy->db, local_abspath,
+                                       loggy->pool, loggy->pool));
+
+  SVN_ERR(basic_delete_entry(loggy->db, local_abspath, loggy->pool));
+
+  if (SVN_IS_VALID_REVNUM(revision))
+    {
+      SVN_ERR(svn_wc__db_base_add_absent_node(loggy->db,
+                                              local_abspath,
+                                              repos_relpath,
+                                              repos_root,
+                                              repos_uuid,
+                                              revision,
+                                              kind == svn_node_dir 
+                                                   ? svn_wc__db_kind_dir
+                                                   : svn_wc__db_kind_file,
+                                              svn_wc__db_status_not_present,
+                                              NULL,
+                                              NULL,
+                                              loggy->pool));
+    }
+
+  return SVN_NO_ERROR;
+}
+
 /* */
 static svn_error_t *
 log_do_add_tree_conflict(struct log_runner *loggy,
@@ -629,17 +456,13 @@ start_handler(void *userData, const char
 
   if (strcmp(eltname, "wc-log") == 0)   /* ignore expat pacifier */
     return;
-  else if (! name)
-    {
-      SIGNAL_ERROR
-        (loggy, svn_error_createf
-         (SVN_ERR_WC_BAD_ADM_LOG, NULL,
-          _("Log entry missing 'name' attribute (entry '%s' "
-            "for directory '%s')"),
-          eltname,
-          svn_dirent_local_style(loggy->adm_abspath, loggy->pool)));
-      return;
-    }
+
+  /* The NAME attribute should be present.  */
+  SVN_ERR_ASSERT_NO_RETURN(name != NULL);
+
+#ifdef DEBUG_LOG
+  SVN_DBG(("start_handler: name='%s'\n", eltname));
+#endif
 
   /* Dispatch. */
   if (strcmp(eltname, SVN_WC__LOG_MODIFY_ENTRY) == 0) {
@@ -649,25 +472,45 @@ start_handler(void *userData, const char
     err = log_do_delete_lock(loggy, name);
   }
   else if (strcmp(eltname, SVN_WC__LOG_DELETE_ENTRY) == 0) {
-    err = log_do_delete_entry(loggy, name);
+    const char *attr;
+    svn_revnum_t revision;
+    svn_node_kind_t kind;
+
+    attr = svn_xml_get_attr_value(SVN_WC__LOG_ATTR_REVISION, atts);
+    revision = SVN_STR_TO_REV(attr);
+    attr = svn_xml_get_attr_value(SVN_WC__LOG_ATTR_KIND, atts);
+    if (strcmp(attr, "dir") == 0)
+      kind = svn_node_dir;
+    else
+      kind = svn_node_file;
+    err = log_do_delete_entry(loggy, name, revision, kind);
   }
   else if (strcmp(eltname, SVN_WC__LOG_MV) == 0) {
-    err = log_do_file_xfer(loggy, name, svn_wc__xfer_mv, atts);
+    const char *dest = svn_xml_get_attr_value(SVN_WC__LOG_ATTR_DEST, atts);
+    const char *from_abspath;
+    const char *dest_abspath;
+
+    SVN_ERR_ASSERT_NO_RETURN(dest != NULL);
+    from_abspath = svn_dirent_join(loggy->adm_abspath, name, loggy->pool);
+    dest_abspath = svn_dirent_join(loggy->adm_abspath, dest, loggy->pool);
+    err = log_do_file_move(from_abspath, dest_abspath, loggy->pool);
   }
   else if (strcmp(eltname, SVN_WC__LOG_CP_AND_TRANSLATE) == 0) {
-    err = log_do_file_xfer(loggy, name, svn_wc__xfer_cp_and_translate, atts);
-  }
-  else if (strcmp(eltname, SVN_WC__LOG_APPEND) == 0) {
-    err = log_do_file_xfer(loggy, name, svn_wc__xfer_append, atts);
-  }
-  else if (strcmp(eltname, SVN_WC__LOG_READONLY) == 0) {
-    err = log_do_file_readonly(loggy, name);
-  }
-  else if (strcmp(eltname, SVN_WC__LOG_MAYBE_READONLY) == 0) {
-    err = log_do_file_maybe_readonly(loggy, name);
-  }
-  else if (strcmp(eltname, SVN_WC__LOG_MAYBE_EXECUTABLE) == 0) {
-    err = log_do_file_maybe_executable(loggy, name);
+    const char *dest = svn_xml_get_attr_value(SVN_WC__LOG_ATTR_DEST, atts);
+    const char *versioned = svn_xml_get_attr_value(SVN_WC__LOG_ATTR_ARG_2,
+                                                   atts);
+    const char *from_abspath;
+    const char *dest_abspath;
+    const char *versioned_abspath;
+
+    SVN_ERR_ASSERT_NO_RETURN(dest != NULL);
+    SVN_ERR_ASSERT_NO_RETURN(versioned != NULL);
+    from_abspath = svn_dirent_join(loggy->adm_abspath, name, loggy->pool);
+    dest_abspath = svn_dirent_join(loggy->adm_abspath, dest, loggy->pool);
+    versioned_abspath = svn_dirent_join(loggy->adm_abspath, versioned,
+                                        loggy->pool);
+    err = log_do_file_cp_and_translate(loggy->db, from_abspath, dest_abspath,
+                                       versioned_abspath, loggy->pool);
   }
   else if (strcmp(eltname, SVN_WC__LOG_SET_TIMESTAMP) == 0) {
     err = log_do_file_timestamp(loggy, name, atts);
@@ -738,449 +581,243 @@ svn_wc__run_xml_log(svn_wc__db_t *db,
 }
 
 
-/*** Log file generation helpers ***/
-
-/* Extend LOG_ACCUM with log operations to do MOVE_COPY_OP to SRC_PATH and
- * DST_PATH.
- *
- * SRC_PATH and DST_PATH are relative to ADM_ABSPATH.
- */
-static svn_error_t *
-loggy_move_copy_internal(svn_stringbuf_t **log_accum,
-                         svn_boolean_t is_move,
-                         const char *adm_abspath,
-                         const char *src_path, const char *dst_path,
-                         apr_pool_t *result_pool,
-                         apr_pool_t *scratch_pool)
-{
-  svn_node_kind_t kind;
-  const char *src_abspath = svn_dirent_join(adm_abspath, src_path,
-                                            scratch_pool);
-
-  SVN_ERR(svn_io_check_path(src_abspath, &kind, scratch_pool));
-
-  /* Does this file exist? */
-  if (kind != svn_node_none)
-    {
-      svn_xml_make_open_tag(log_accum, result_pool,
-                            svn_xml_self_closing,
-                            is_move
-                              ? SVN_WC__LOG_MV
-                              : SVN_WC__LOG_CP_AND_TRANSLATE,
-                            SVN_WC__LOG_ATTR_NAME,
-                            src_path,
-                            SVN_WC__LOG_ATTR_DEST,
-                            dst_path,
-                            NULL);
-    }
-
-  return SVN_NO_ERROR;
-}
-
-
-
-
-/* Return the portion of PATH that is relative to the working copy directory
- * ADM_ABSPATH, or SVN_WC_ENTRY_THIS_DIR if PATH is that directory. PATH must
- * not be outside that directory. */
+/* Return (in *RELPATH) the portion of ABSPATH that is relative to the
+   working copy directory ADM_ABSPATH, or SVN_WC_ENTRY_THIS_DIR if ABSPATH
+   is that directory. ABSPATH must within ADM_ABSPATH.  */
 static svn_error_t *
-loggy_path(const char **logy_path,
-           const char *path,
+loggy_path(const char **relpath,
+           const char *abspath,
            const char *adm_abspath,
            apr_pool_t *scratch_pool)
 {
-  const char *abspath;
-
-  SVN_ERR(svn_dirent_get_absolute(&abspath, path, scratch_pool));
-  *logy_path = svn_dirent_is_child(adm_abspath, abspath, NULL);
+  *relpath = svn_dirent_is_child(adm_abspath, abspath, NULL);
 
-  if (! (*logy_path))
+  if (*relpath == NULL)
     {
-      if (strcmp(abspath, adm_abspath) == 0) /* same path */
-        *logy_path = SVN_WC_ENTRY_THIS_DIR;
-      else /* not a child path */
-        return svn_error_createf(SVN_ERR_BAD_RELATIVE_PATH, NULL,
-                                 _("Path '%s' is not a child of '%s'"),
-                                 svn_dirent_local_style(path, scratch_pool),
-                                 svn_dirent_local_style(adm_abspath,
-                                                        scratch_pool));
+      SVN_ERR_ASSERT(strcmp(abspath, adm_abspath) == 0);
+
+      *relpath = "";
     }
 
   return SVN_NO_ERROR;
 }
 
-svn_error_t *
-svn_wc__loggy_append(svn_wc__db_t *db,
-                     const char *adm_abspath,
-                     const char *src, const char *dst,
-                     apr_pool_t *scratch_pool)
-{
-  const char *loggy_path1;
-  const char *loggy_path2;
-  svn_stringbuf_t *buf = NULL;
-
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(adm_abspath));
-
-  SVN_ERR(loggy_path(&loggy_path1, src, adm_abspath, scratch_pool));
-  SVN_ERR(loggy_path(&loggy_path2, dst, adm_abspath, scratch_pool));
-  svn_xml_make_open_tag(&buf, scratch_pool,
-                        svn_xml_self_closing, SVN_WC__LOG_APPEND,
-                        SVN_WC__LOG_ATTR_NAME, loggy_path1,
-                        SVN_WC__LOG_ATTR_DEST, loggy_path2,
-                        NULL);
-
-  return svn_error_return(svn_wc__wq_add_loggy(db, adm_abspath, buf,
-                                               scratch_pool));
-}
-
-
-svn_error_t *
-svn_wc__loggy_copy(svn_stringbuf_t **log_accum,
-                   const char *adm_abspath,
-                   const char *src_path, const char *dst_path,
-                   apr_pool_t *result_pool,
-                   apr_pool_t *scratch_pool)
-{
-  const char *loggy_path1;
-  const char *loggy_path2;
-
-  SVN_ERR(loggy_path(&loggy_path1, src_path, adm_abspath, scratch_pool));
-  SVN_ERR(loggy_path(&loggy_path2, dst_path, adm_abspath, scratch_pool));
-  return loggy_move_copy_internal(log_accum, FALSE, adm_abspath,
-                                  loggy_path1, loggy_path2,
-                                  result_pool, scratch_pool);
-}
 
 svn_error_t *
-svn_wc__loggy_translated_file(svn_wc__db_t *db,
+svn_wc__loggy_translated_file(svn_skel_t **work_item,
+                              svn_wc__db_t *db,
                               const char *adm_abspath,
-                              const char *dst,
-                              const char *src,
-                              const char *versioned,
-                              apr_pool_t *scratch_pool)
+                              const char *dst_abspath,
+                              const char *src_abspath,
+                              const char *versioned_abspath,
+                              apr_pool_t *result_pool)
 {
   const char *loggy_path1;
   const char *loggy_path2;
   const char *loggy_path3;
-  svn_stringbuf_t *buf = NULL;
+  svn_stringbuf_t *log_accum = NULL;
+
+  SVN_ERR_ASSERT(svn_dirent_is_absolute(adm_abspath));
+  SVN_ERR_ASSERT(svn_dirent_is_absolute(dst_abspath));
+  SVN_ERR_ASSERT(svn_dirent_is_absolute(src_abspath));
+  SVN_ERR_ASSERT(svn_dirent_is_absolute(versioned_abspath));
+
+  SVN_ERR(loggy_path(&loggy_path1, src_abspath, adm_abspath, result_pool));
+  SVN_ERR(loggy_path(&loggy_path2, dst_abspath, adm_abspath, result_pool));
+  SVN_ERR(loggy_path(&loggy_path3, versioned_abspath, adm_abspath,
+                     result_pool));
 
-  SVN_ERR(loggy_path(&loggy_path1, src, adm_abspath, scratch_pool));
-  SVN_ERR(loggy_path(&loggy_path2, dst, adm_abspath, scratch_pool));
-  SVN_ERR(loggy_path(&loggy_path3, versioned, adm_abspath, scratch_pool));
-  svn_xml_make_open_tag(&buf, scratch_pool, svn_xml_self_closing,
+  svn_xml_make_open_tag(&log_accum, result_pool, svn_xml_self_closing,
                         SVN_WC__LOG_CP_AND_TRANSLATE,
                         SVN_WC__LOG_ATTR_NAME, loggy_path1,
                         SVN_WC__LOG_ATTR_DEST, loggy_path2,
                         SVN_WC__LOG_ATTR_ARG_2, loggy_path3,
                         NULL);
 
-  return svn_error_return(svn_wc__wq_add_loggy(db, adm_abspath, buf,
-                                               scratch_pool));
+  return svn_error_return(svn_wc__wq_build_loggy(work_item,
+                                                 db, adm_abspath, log_accum,
+                                                 result_pool));
 }
 
 svn_error_t *
-svn_wc__loggy_delete_entry(svn_wc__db_t *db,
+svn_wc__loggy_delete_entry(svn_skel_t **work_item,
+                           svn_wc__db_t *db,
                            const char *adm_abspath,
-                           const char *path,
-                           apr_pool_t *scratch_pool)
+                           const char *local_abspath,
+                           svn_revnum_t revision,
+                           svn_wc__db_kind_t kind,
+                           apr_pool_t *result_pool)
 {
   const char *loggy_path1;
-  svn_stringbuf_t *buf = NULL;
+  svn_stringbuf_t *log_accum = NULL;
+
+  SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
-  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
-  svn_xml_make_open_tag(&buf, scratch_pool, svn_xml_self_closing,
+  SVN_ERR(loggy_path(&loggy_path1, local_abspath, adm_abspath, result_pool));
+  svn_xml_make_open_tag(&log_accum, result_pool, svn_xml_self_closing,
                         SVN_WC__LOG_DELETE_ENTRY,
-                        SVN_WC__LOG_ATTR_NAME, loggy_path1,
+                        SVN_WC__LOG_ATTR_NAME,
+                        loggy_path1,
+                        SVN_WC__LOG_ATTR_REVISION,
+                        apr_psprintf(result_pool, "%ld", revision),
+                        SVN_WC__LOG_ATTR_KIND,
+                        kind == svn_wc__db_kind_dir ? "dir" : "file",
                         NULL);
 
-  return svn_error_return(svn_wc__wq_add_loggy(db, adm_abspath, buf,
-                                               scratch_pool));
+  return svn_error_return(svn_wc__wq_build_loggy(work_item,
+                                                 db, adm_abspath, log_accum,
+                                                 result_pool));
 }
 
 svn_error_t *
-svn_wc__loggy_delete_lock(svn_wc__db_t *db,
+svn_wc__loggy_delete_lock(svn_skel_t **work_item,
+                          svn_wc__db_t *db,
                           const char *adm_abspath,
-                          const char *path,
-                          apr_pool_t *scratch_pool)
+                          const char *local_abspath,
+                          apr_pool_t *result_pool)
 {
   const char *loggy_path1;
-  svn_stringbuf_t *buf = NULL;
+  svn_stringbuf_t *log_accum = NULL;
 
-  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
-  svn_xml_make_open_tag(&buf, scratch_pool, svn_xml_self_closing,
+  SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
+
+  SVN_ERR(loggy_path(&loggy_path1, local_abspath, adm_abspath, result_pool));
+  svn_xml_make_open_tag(&log_accum, result_pool, svn_xml_self_closing,
                         SVN_WC__LOG_DELETE_LOCK,
                         SVN_WC__LOG_ATTR_NAME, loggy_path1,
                         NULL);
 
-  return svn_error_return(svn_wc__wq_add_loggy(db, adm_abspath, buf,
-                                               scratch_pool));
+  return svn_error_return(svn_wc__wq_build_loggy(work_item,
+                                                 db, adm_abspath, log_accum,
+                                                 result_pool));
 }
 
 
 svn_error_t *
-svn_wc__loggy_entry_modify(svn_stringbuf_t **log_accum,
+svn_wc__loggy_entry_modify(svn_skel_t **work_item,
+                           svn_wc__db_t *db,
                            const char *adm_abspath,
-                           const char *path,
+                           const char *local_abspath,
                            const svn_wc_entry_t *entry,
                            apr_uint64_t modify_flags,
-                           apr_pool_t *result_pool,
-                           apr_pool_t *scratch_pool)
+                           apr_pool_t *result_pool)
 {
+  svn_stringbuf_t *log_accum = NULL;
   const char *loggy_path1;
-  apr_hash_t *prop_hash = apr_hash_make(scratch_pool);
-  static const char *kind_str[] =
-    { "none",
-      SVN_WC__ENTRIES_ATTR_FILE_STR,
-      SVN_WC__ENTRIES_ATTR_DIR_STR,
-      "unknown",
-    };
-  static const char *schedule_str[] =
-    {
-      "", /* svn_wc_schedule_normal */
-      SVN_WC__ENTRY_VALUE_ADD,
-      SVN_WC__ENTRY_VALUE_DELETE,
-      SVN_WC__ENTRY_VALUE_REPLACE,
-    };
+  apr_hash_t *prop_hash = apr_hash_make(result_pool);
 
+  SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
+  SVN_ERR_ASSERT(modify_flags != 0);
 
-  if (! modify_flags)
-    return SVN_NO_ERROR;
+  /* ### this code has a limited set of modifications. enforce it.  */
+  SVN_ERR_ASSERT((modify_flags & ~(0
+                    /* from props.c  */
+                    | SVN_WC__ENTRY_MODIFY_PREJFILE
+
+                    /* from merge.c  */
+                    | SVN_WC__ENTRY_MODIFY_CONFLICT_OLD
+                    | SVN_WC__ENTRY_MODIFY_CONFLICT_NEW
+                    | SVN_WC__ENTRY_MODIFY_CONFLICT_WRK)) == 0);
 
 #define ADD_ENTRY_ATTR(attr_flag, attr_name, value) \
    if (modify_flags & (attr_flag)) \
      apr_hash_set(prop_hash, (attr_name), APR_HASH_KEY_STRING, value)
 
-  ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_REVISION,
-                 SVN_WC__ENTRY_ATTR_REVISION,
-                 apr_psprintf(scratch_pool, "%ld", entry->revision));
-
-  ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_URL,
-                 SVN_WC__ENTRY_ATTR_URL,
-                 entry->url);
-
-  ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_KIND,
-                 SVN_WC__ENTRY_ATTR_KIND,
-                 kind_str[entry->kind]);
-
-  ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_SCHEDULE,
-                 SVN_WC__ENTRY_ATTR_SCHEDULE,
-                 schedule_str[entry->schedule]);
-
-  ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_COPIED,
-                 SVN_WC__ENTRY_ATTR_COPIED,
-                 entry->copied ? "true" : "false");
-
-  ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_DELETED,
-                 SVN_WC__ENTRY_ATTR_DELETED,
-                 entry->deleted ? "true" : "false");
-
-  ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_ABSENT,
-                 SVN_WC__ENTRY_ATTR_ABSENT,
-                 entry->absent ? "true" : "false");
-
-  ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_COPYFROM_URL,
-                 SVN_WC__ENTRY_ATTR_COPYFROM_URL,
-                 entry->copyfrom_url);
-
-  ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_COPYFROM_REV,
-                 SVN_WC__ENTRY_ATTR_COPYFROM_REV,
-                 apr_psprintf(scratch_pool, "%ld", entry->copyfrom_rev));
-
+  if (modify_flags & SVN_WC__ENTRY_MODIFY_CONFLICT_OLD)
+    SVN_ERR_ASSERT(entry->conflict_old != NULL);
   ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_CONFLICT_OLD,
                  SVN_WC__ENTRY_ATTR_CONFLICT_OLD,
-                 entry->conflict_old ? entry->conflict_old : "");
+                 entry->conflict_old);
 
+  if (modify_flags & SVN_WC__ENTRY_MODIFY_CONFLICT_NEW)
+    SVN_ERR_ASSERT(entry->conflict_new != NULL);
   ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_CONFLICT_NEW,
                  SVN_WC__ENTRY_ATTR_CONFLICT_NEW,
-                 entry->conflict_new ? entry->conflict_new : "");
+                 entry->conflict_new);
 
   ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_CONFLICT_WRK,
                  SVN_WC__ENTRY_ATTR_CONFLICT_WRK,
                  entry->conflict_wrk ? entry->conflict_wrk : "");
 
+  if (modify_flags & SVN_WC__ENTRY_MODIFY_PREJFILE)
+    SVN_ERR_ASSERT(entry->prejfile != NULL);
   ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_PREJFILE,
                  SVN_WC__ENTRY_ATTR_PREJFILE,
-                 entry->prejfile ? entry->prejfile : "");
-
-  ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_TEXT_TIME,
-                 SVN_WC__ENTRY_ATTR_TEXT_TIME,
-                 svn_time_to_cstring(entry->text_time, scratch_pool));
-
-  ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_CHECKSUM,
-                 SVN_WC__ENTRY_ATTR_CHECKSUM,
-                 entry->checksum);
-
-  /* Note: Last-commit flags are no longer passed to this function. */
-
-  /* Note: LOCK flags are no longer passed to this function.  */
-
-  /* Note: ignoring the (deprecated) has_props, has_prop_mods,
-     cachable_props, and present_props fields. */
-
-  ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_WORKING_SIZE,
-                 SVN_WC__ENTRY_ATTR_WORKING_SIZE,
-                 apr_psprintf(scratch_pool, "%" APR_OFF_T_FMT,
-                              entry->working_size));
-
-  ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_FORCE,
-                 SVN_WC__LOG_ATTR_FORCE,
-                 "true");
+                 entry->prejfile);
 
 #undef ADD_ENTRY_ATTR
 
-  if (apr_hash_count(prop_hash) == 0)
-    return SVN_NO_ERROR;
+  SVN_ERR_ASSERT(apr_hash_count(prop_hash) != 0);
 
-  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
+  SVN_ERR(loggy_path(&loggy_path1, local_abspath, adm_abspath, result_pool));
   apr_hash_set(prop_hash, SVN_WC__LOG_ATTR_NAME,
                APR_HASH_KEY_STRING, loggy_path1);
 
-  svn_xml_make_open_tag_hash(log_accum, result_pool,
+  svn_xml_make_open_tag_hash(&log_accum, result_pool,
                              svn_xml_self_closing,
                              SVN_WC__LOG_MODIFY_ENTRY,
                              prop_hash);
-
-  return SVN_NO_ERROR;
+  return svn_error_return(svn_wc__wq_build_loggy(work_item,
+                                                 db, adm_abspath, log_accum,
+                                                 result_pool));
 }
 
 
 svn_error_t *
-svn_wc__loggy_move(svn_stringbuf_t **log_accum,
+svn_wc__loggy_move(svn_skel_t **work_item,
+                   svn_wc__db_t *db,
                    const char *adm_abspath,
-                   const char *src_path, const char *dst_path,
-                   apr_pool_t *result_pool,
-                   apr_pool_t *scratch_pool)
+                   const char *src_abspath,
+                   const char *dst_abspath,
+                   apr_pool_t *result_pool)
 {
+  svn_stringbuf_t *log_accum = NULL;
   const char *loggy_path1;
   const char *loggy_path2;
+  svn_node_kind_t kind;
 
-  SVN_ERR(loggy_path(&loggy_path1, src_path, adm_abspath, scratch_pool));
-  SVN_ERR(loggy_path(&loggy_path2, dst_path, adm_abspath, scratch_pool));
-  return loggy_move_copy_internal(log_accum, TRUE, adm_abspath,
-                                  loggy_path1, loggy_path2,
-                                  result_pool, scratch_pool);
-}
-
-svn_error_t *
-svn_wc__loggy_maybe_set_executable(svn_stringbuf_t **log_accum,
-                                   const char *adm_abspath,
-                                   const char *path,
-                                   apr_pool_t *result_pool,
-                                   apr_pool_t *scratch_pool)
-{
-  const char *loggy_path1;
-
-  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
-  svn_xml_make_open_tag(log_accum,
-                        result_pool,
-                        svn_xml_self_closing,
-                        SVN_WC__LOG_MAYBE_EXECUTABLE,
-                        SVN_WC__LOG_ATTR_NAME, loggy_path1,
-                        NULL);
-
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_wc__loggy_maybe_set_readonly(svn_stringbuf_t **log_accum,
-                                 const char *adm_abspath,
-                                 const char *path,
-                                 apr_pool_t *result_pool,
-                                 apr_pool_t *scratch_pool)
-{
-  const char *loggy_path1;
-
-  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
-  svn_xml_make_open_tag(log_accum,
-                        result_pool,
-                        svn_xml_self_closing,
-                        SVN_WC__LOG_MAYBE_READONLY,
-                        SVN_WC__LOG_ATTR_NAME,
-                        loggy_path1,
-                        NULL);
-
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_wc__loggy_set_entry_timestamp_from_wc(svn_stringbuf_t **log_accum,
-                                          const char *adm_abspath,
-                                          const char *path,
-                                          apr_pool_t *result_pool,
-                                          apr_pool_t *scratch_pool)
-{
-  const char *loggy_path1;
+  SVN_ERR_ASSERT(svn_dirent_is_absolute(src_abspath));
+  SVN_ERR_ASSERT(svn_dirent_is_absolute(dst_abspath));
 
-  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
-  svn_xml_make_open_tag(log_accum,
-                        result_pool,
-                        svn_xml_self_closing,
-                        SVN_WC__LOG_MODIFY_ENTRY,
-                        SVN_WC__LOG_ATTR_NAME,
-                        loggy_path1,
-                        SVN_WC__ENTRY_ATTR_TEXT_TIME,
-                        SVN_WC__TIMESTAMP_WC,
-                        NULL);
+  SVN_ERR(loggy_path(&loggy_path1, src_abspath, adm_abspath, result_pool));
+  SVN_ERR(loggy_path(&loggy_path2, dst_abspath, adm_abspath, result_pool));
 
-  return SVN_NO_ERROR;
-}
+  SVN_ERR(svn_io_check_path(src_abspath, &kind, result_pool));
 
-svn_error_t *
-svn_wc__loggy_set_entry_working_size_from_wc(svn_stringbuf_t **log_accum,
-                                             const char *adm_abspath,
-                                             const char *path,
-                                             apr_pool_t *result_pool,
-                                             apr_pool_t *scratch_pool)
-{
-  const char *loggy_path1;
+  /* ### idiocy of the old world. the file better exist, if we're asking
+     ### to do some work with it.  */
+  SVN_ERR_ASSERT(kind != svn_node_none);
 
-  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
-  svn_xml_make_open_tag(log_accum,
-                        result_pool,
+  svn_xml_make_open_tag(&log_accum, result_pool,
                         svn_xml_self_closing,
-                        SVN_WC__LOG_MODIFY_ENTRY,
+                        SVN_WC__LOG_MV,
                         SVN_WC__LOG_ATTR_NAME,
                         loggy_path1,
-                        SVN_WC__ENTRY_ATTR_WORKING_SIZE,
-                        SVN_WC__WORKING_SIZE_WC,
+                        SVN_WC__LOG_ATTR_DEST,
+                        loggy_path2,
                         NULL);
 
-  return SVN_NO_ERROR;
+  return svn_error_return(svn_wc__wq_build_loggy(work_item,
+                                                 db, adm_abspath, log_accum,
+                                                 result_pool));
 }
 
-svn_error_t *
-svn_wc__loggy_set_readonly(svn_stringbuf_t **log_accum,
-                           const char *adm_abspath,
-                           const char *path,
-                           apr_pool_t *result_pool,
-                           apr_pool_t *scratch_pool)
-{
-  const char *loggy_path1;
-
-  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
-  svn_xml_make_open_tag(log_accum,
-                        result_pool,
-                        svn_xml_self_closing,
-                        SVN_WC__LOG_READONLY,
-                        SVN_WC__LOG_ATTR_NAME,
-                        loggy_path1,
-                        NULL);
-
-  return SVN_NO_ERROR;
-}
 
 svn_error_t *
-svn_wc__loggy_set_timestamp(svn_stringbuf_t **log_accum,
+svn_wc__loggy_set_timestamp(svn_skel_t **work_item,
+                            svn_wc__db_t *db,
                             const char *adm_abspath,
-                            const char *path,
+                            const char *local_abspath,
                             const char *timestr,
-                            apr_pool_t *result_pool,
-                            apr_pool_t *scratch_pool)
+                            apr_pool_t *result_pool)
 {
+  svn_stringbuf_t *log_accum = NULL;
   const char *loggy_path1;
 
-  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
-  svn_xml_make_open_tag(log_accum,
+  SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
+
+  SVN_ERR(loggy_path(&loggy_path1, local_abspath, adm_abspath, result_pool));
+  svn_xml_make_open_tag(&log_accum,
                         result_pool,
                         svn_xml_self_closing,
                         SVN_WC__LOG_SET_TIMESTAMP,
@@ -1190,27 +827,30 @@ svn_wc__loggy_set_timestamp(svn_stringbu
                         timestr,
                         NULL);
 
-  return SVN_NO_ERROR;
+  return svn_error_return(svn_wc__wq_build_loggy(work_item,
+                                                 db, adm_abspath, log_accum,
+                                                 result_pool));
 }
 
 
 svn_error_t *
-svn_wc__loggy_add_tree_conflict(svn_wc__db_t *db,
+svn_wc__loggy_add_tree_conflict(svn_skel_t **work_item,
+                                svn_wc__db_t *db,
                                 const char *adm_abspath,
                                 const svn_wc_conflict_description2_t *conflict,
-                                apr_pool_t *scratch_pool)
+                                apr_pool_t *result_pool)
 {
   svn_stringbuf_t *log_accum = NULL;
   const char *victim_basename;
   svn_skel_t *skel;
   const char *conflict_data;
 
-  victim_basename = svn_dirent_basename(conflict->local_abspath, scratch_pool);
+  victim_basename = svn_dirent_basename(conflict->local_abspath, result_pool);
   SVN_ERR(svn_wc__serialize_conflict(&skel, conflict,
-                                     scratch_pool, scratch_pool));
-  conflict_data = svn_skel__unparse(skel, scratch_pool)->data,
+                                     result_pool, result_pool));
+  conflict_data = svn_skel__unparse(skel, result_pool)->data,
 
-  svn_xml_make_open_tag(&log_accum, scratch_pool, svn_xml_self_closing,
+  svn_xml_make_open_tag(&log_accum, result_pool, svn_xml_self_closing,
                         SVN_WC__LOG_ADD_TREE_CONFLICT,
                         SVN_WC__LOG_ATTR_NAME,
                         victim_basename,
@@ -1218,8 +858,9 @@ svn_wc__loggy_add_tree_conflict(svn_wc__
                         conflict_data,
                         NULL);
 
-  return svn_error_return(svn_wc__wq_add_loggy(db, adm_abspath, log_accum,
-                                               scratch_pool));
+  return svn_error_return(svn_wc__wq_build_loggy(work_item,
+                                                 db, adm_abspath, log_accum,
+                                                 result_pool));
 }
 
 

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/log.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/log.h?rev=984206&r1=984205&r2=984206&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/log.h (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/log.h Tue Aug 10 20:55:56 2010
@@ -32,104 +32,47 @@
 #include "svn_wc.h"
 
 #include "wc_db.h"
+#include "private/svn_skel.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
 
-
-
-/* OVERVIEW OF THE LOGGY API
- *
- * NOTES
- *
- *  * When a doc string says "Extend **LOG_ACCUM", it means: "if *LOG_ACCUM is
- *    NULL then set *LOG_ACCUM to a new stringbuf allocated in RESULT_POOL,
- *    else append to the existing stringbuf there."
- */
 
 /* Each path argument to the svn_wc__loggy_* functions in this section can
    be either absolute or relative to the adm_abspath argument.
 */
 
 
-/* A macro to flush LOG_ACCUM using DB and ADM_ABSPATH.  This writes all
-   current items in LOG_ACCUM to the work queue, and then reinitializes
-   LOG_ACCUM to an empty buffer. */
-#define SVN_WC__FLUSH_LOG_ACCUM(db, adm_abspath, log_accum, scratch_pool)   \
-  if ((log_accum) && !svn_stringbuf_isempty(log_accum))                     \
-    {                                                                       \
-      SVN_ERR(svn_wc__wq_add_loggy(db, adm_abspath, log_accum, scratch_pool));\
-      svn_stringbuf_setempty(log_accum);                                    \
-    }                                                                       \
-  else {}
-
-
-/* Insert into DB a work queue instruction to append the contents
-   of SRC to DST.
-   SRC and DST are relative to ADM_ABSPATH.
-
-   This command fails to be idempotent or atomic: there's no way to
-   tell if you should re-run this!  This function is deprecated; new
-   uses should not be added, and the single current use (constructing
-   human-readable non-parsed property conflict files) should be
-   rewritten.  See Issue #3015.
-*/
-SVN_DEPRECATED
-svn_error_t *
-svn_wc__loggy_append(svn_wc__db_t *db,
-                     const char *adm_abspath,
-                     const char *src, const char *dst,
-                     apr_pool_t *scratch_pool);
-
-
-/* Extend **LOG_ACCUM with log instructions to copy (and translate!) the
-   file SRC_PATH to DST_PATH, if it exists. If it doesn't and
-   REMOVE_DST_IF_NO_SRC is TRUE the file at DST_PATH will be deleted if any.
-
-   The test for existence is made during this call, not at log running time.
-
-   ADM_ABSPATH is the absolute path for the admin directory for PATH.
-   SRC_PATH and DST_PATH are relative to ADM_ABSPATH.
-
-   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
-   temporary allocations.
-*/
-svn_error_t *
-svn_wc__loggy_copy(svn_stringbuf_t **log_accum,
-                   const char *adm_abspath,
-                   const char *src_path, const char *dst_path,
-                   apr_pool_t *result_pool,
-                   apr_pool_t *scratch_pool);
-
-
 /* Insert into DB a work queue instruction to generate a translated
    file from SRC to DST with translation settings from VERSIONED.
    ADM_ABSPATH is the absolute path for the admin directory for PATH.
-   DST and SRC and VERSIONED are relative to ADM_ABSPATH.
-
-   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
-   temporary allocations.
-*/
+   DST and SRC and VERSIONED are relative to ADM_ABSPATH.  */
 svn_error_t *
-svn_wc__loggy_translated_file(svn_wc__db_t *db,
+svn_wc__loggy_translated_file(svn_skel_t **work_item,
+                              svn_wc__db_t *db,
                               const char *adm_abspath,
-                              const char *dst,
-                              const char *src,
-                              const char *versioned,
-                              apr_pool_t *scratch_pool);
+                              const char *dst_abspath,
+                              const char *src_abspath,
+                              const char *versioned_abspath,
+                              apr_pool_t *result_pool);
 
 /* Insert into DB a work queue instruction to delete the entry
    associated with PATH from the entries file.
    ADM_ABSPATH is the absolute path for the access baton for PATH.
 
+   ### REVISION and KIND
+
    Use SCRATCH_POOL for temporary allocations.
 */
 svn_error_t *
-svn_wc__loggy_delete_entry(svn_wc__db_t *db,
+svn_wc__loggy_delete_entry(svn_skel_t **work_item,
+                           svn_wc__db_t *db,
                            const char *adm_abspath,
-                           const char *path,
-                           apr_pool_t *scratch_pool);
+                           const char *local_abspath,
+                           svn_revnum_t revision,
+                           svn_wc__db_kind_t kind,
+                           apr_pool_t *result_pool);
 
 
 /* Insert into DB a work queue instruction to delete lock related
@@ -139,37 +82,35 @@ svn_wc__loggy_delete_entry(svn_wc__db_t 
    Use SCRATCH_POOL for temporary allocations.
 */
 svn_error_t *
-svn_wc__loggy_delete_lock(svn_wc__db_t *db,
+svn_wc__loggy_delete_lock(svn_skel_t **work_item,
+                          svn_wc__db_t *db,
                           const char *adm_abspath,
-                          const char *path,
-                          apr_pool_t *scratch_pool);
+                          const char *local_abspath,
+                          apr_pool_t *result_pool);
 
 
-/* Extend **LOG_ACCUM with commands to modify the entry associated with PATH
+/* Queue operations to modify the entry associated with PATH
    in ADM_ABSPATH according to the flags specified in MODIFY_FLAGS, based on
    the values supplied in *ENTRY.
+
    ADM_ABSPATH is the absolute path for the admin directory for PATH.
 
    The flags in MODIFY_FLAGS are to be taken from the svn_wc__entry_modify()
    parameter by the same name.
 
-   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
-   temporary allocations.
+   Use SCRATCH_POOL for temporary allocations.
 */
 svn_error_t *
-svn_wc__loggy_entry_modify(svn_stringbuf_t **log_accum,
+svn_wc__loggy_entry_modify(svn_skel_t **work_item,
+                           svn_wc__db_t *db,
                            const char *adm_abspath,
-                           const char *path,
+                           const char *local_abspath,
                            const svn_wc_entry_t *entry,
                            apr_uint64_t modify_flags,
-                           apr_pool_t *result_pool,
-                           apr_pool_t *scratch_pool);
+                           apr_pool_t *result_pool);
 
 
-/* Extend **LOG_ACCUM with log instructions to move the file SRC_PATH to
-   DST_PATH, if it exists. If it doesn't and REMOVE_DST_IF_NO_SRC is TRUE
-   the file at DST_PATH will be deleted if any.
-   TODO ### There is no 'REMOVE_DST_IF_NO_SRC' arg; what will happen?
+/* Queue instructions to move the file SRC_PATH to DST_PATH.
 
    The test for existence is made now, not at log run time.
 
@@ -179,143 +120,36 @@ svn_wc__loggy_entry_modify(svn_stringbuf
    Set *DST_MODIFIED (if DST_MODIFIED isn't NULL) to indicate whether the
    destination path will have been modified after running the log: if either
    the move or the remove will have been carried out.
-
-   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
-   temporary allocations.
 */
 svn_error_t *
-svn_wc__loggy_move(svn_stringbuf_t **log_accum,
+svn_wc__loggy_move(svn_skel_t **work_item,
+                   svn_wc__db_t *db,
                    const char *adm_abspath,
-                   const char *src_path, const char *dst_path,
-                   apr_pool_t *result_pool,
-                   apr_pool_t *scratch_pool);
-
-
+                   const char *src_abspath,
+                   const char *dst_abspath,
+                   apr_pool_t *result_pool);
 
-/* Extend **LOG_ACCUM with log instructions to set permissions of PATH
-   to 'executable' if it has the 'executable' property set.
-   ADM_ABSPATH is the absolute path for the admin directory for PATH.
-
-   The property is tested at log run time, within this log instruction.
-
-   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
-   temporary allocations.
-*/
-svn_error_t *
-svn_wc__loggy_maybe_set_executable(svn_stringbuf_t **log_accum,
-                                   const char *adm_abspath,
-                                   const char *path,
-                                   apr_pool_t *result_pool,
-                                   apr_pool_t *scratch_pool);
-
-/* Extend **LOG_ACCUM with log instructions to set permissions of PATH
-   to 'readonly' if it has the 'needs-lock' property set and there is
-   no lock for the file in the working copy.
-   ADM_ABSPATH is the absolute path for the admin directory for PATH.
 
-   The tests are made at log run time, within this log instruction.
-
-   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
-   temporary allocations.
-*/
-svn_error_t *
-svn_wc__loggy_maybe_set_readonly(svn_stringbuf_t **log_accum,
-                                 const char *adm_abspath,
-                                 const char *path,
-                                 apr_pool_t *result_pool,
-                                 apr_pool_t *scratch_pool);
-
-
-/* Extend **LOG_ACCUM with log instructions to set the timestamp of PATH
-   in the entry field with name TIME_PROP.
-   TODO ### Huh? There is no 'TIME_PROP' argument.
-
-   Use one of the SVN_WC__ENTRY_ATTR_* values for TIME_PROP.
-
-   ADM_ABSPATH is the absolute path for the admin directory for PATH.
-
-   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
-   temporary allocations.
-*/
-svn_error_t *
-svn_wc__loggy_set_entry_timestamp_from_wc(svn_stringbuf_t **log_accum,
-                                          const char *adm_abspath,
-                                          const char *path,
-                                          apr_pool_t *result_pool,
-                                          apr_pool_t *scratch_pool);
-
-
-/* Extend **LOG_ACCUM with log instructions to set the file size of PATH
-   in the entries' WORKING_SIZE field.
-   ADM_ABSPATH is the absolute path for the admin directory for PATH.
-
-   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
-   temporary allocations.
-*/
-svn_error_t *
-svn_wc__loggy_set_entry_working_size_from_wc(svn_stringbuf_t **log_accum,
-                                             const char *adm_abspath,
-                                             const char *path,
-                                             apr_pool_t *result_pool,
-                                             apr_pool_t *scratch_pool);
-
-
-/* Extend **LOG_ACCUM with log instructions to set permissions of PATH
-   to 'readonly'.
-   ADM_ABSPATH is the absolute path for the admin directory for PATH.
-
-   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
-   temporary allocations.
-*/
-svn_error_t *
-svn_wc__loggy_set_readonly(svn_stringbuf_t **log_accum,
-                           const char *adm_abspath,
-                           const char *path,
-                           apr_pool_t *result_pool,
-                           apr_pool_t *scratch_pool);
-
-/* Extend **LOG_ACCUM with log instructions to set the timestamp of PATH to
+/* Queue instructions to set the timestamp of PATH to
    the time TIMESTR.
-   ADM_ABSPATH is the absolute path for the admin directory for PATH.
 
-   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
-   temporary allocations.
+   ADM_ABSPATH is the absolute path for the admin directory for PATH.
 */
 svn_error_t *
-svn_wc__loggy_set_timestamp(svn_stringbuf_t **log_accum,
+svn_wc__loggy_set_timestamp(svn_skel_t **work_item,
+                            svn_wc__db_t *db,
                             const char *adm_abspath,
-                            const char *path,
+                            const char *local_abspath,
                             const char *timestr,
-                            apr_pool_t *result_pool,
-                            apr_pool_t *scratch_pool);
+                            apr_pool_t *result_pool);
 
-/* Like svn_wc__add_tree_conflict(), but append to the log accumulator
- * LOG_ACCUM a command to rewrite the entry field, and do not flush the log.
- * This function is meant to be used in the working copy library where
- * log accumulators are usually readily available.
- *
- * If *LOG_ACCUM is NULL then set *LOG_ACCUM to a new stringbug allocated in
- * POOL, else append to the existing stringbuf there.
- */
+/* */
 svn_error_t *
-svn_wc__loggy_add_tree_conflict(svn_wc__db_t *db,
+svn_wc__loggy_add_tree_conflict(svn_skel_t **work_item,
+                                svn_wc__db_t *db,
                                 const char *adm_abspath,
                                 const svn_wc_conflict_description2_t *conflict,
-                                apr_pool_t *scratch_pool);
-
-
-/* Extend LOG_ACCUM with log entries to save the current baseprops of PATH
-   as revert props.
-
-   Makes sure the baseprops are destroyed if DESTROY_BASEPROPS is TRUE,
-   the baseprops are preserved otherwise.
-*/
-svn_error_t *
-svn_wc__loggy_revert_props_create(svn_stringbuf_t **log_accum,
-                                  svn_wc__db_t *db,
-                                  const char *local_abspath,
-                                  const char *adm_abspath,
-                                  apr_pool_t *pool);
+                                apr_pool_t *result_pool);
 
 
 /* TODO ###