You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pr...@apache.org on 2013/03/18 10:35:29 UTC

svn commit: r1457684 [11/22] - in /subversion/branches/verify-keep-going: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ notes/ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/org/apache/subversion/javahl/ subv...

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_local.c?rev=1457684&r1=1457683&r2=1457684&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_local.c Mon Mar 18 09:35:24 2013
@@ -38,15 +38,40 @@
 #include "svn_hash.h"
 
 #include "private/svn_wc_private.h"
+#include "private/svn_diff_tree.h"
 
 #include "wc.h"
 #include "props.h"
 #include "translate.h"
+#include "diff.h"
 
 #include "svn_private_config.h"
 
 /*-------------------------------------------------------------------------*/
 
+/* Baton containing the state of a directory
+   reported open via a diff processor */
+struct node_state_t
+{
+  struct node_state_t *parent;
+
+  apr_pool_t *pool;
+
+  const char *local_abspath;
+  const char *relpath;
+  void *baton;
+
+  svn_diff_source_t *left_src;
+  svn_diff_source_t *right_src;
+  svn_diff_source_t *copy_src;
+
+  svn_boolean_t skip;
+  svn_boolean_t skip_children;
+
+  apr_hash_t *left_props;
+  apr_hash_t *right_props;
+  const apr_array_header_t *propchanges;
+};
 
 /* The diff baton */
 struct diff_baton
@@ -57,10 +82,9 @@ struct diff_baton
   /* Report editor paths relative from this directory */
   const char *anchor_abspath;
 
-  /* The callbacks and callback argument that implement the file comparison
-     functions */
-  const svn_wc_diff_callbacks4_t *callbacks;
-  void *callback_baton;
+  struct node_state_t *cur;
+
+  const svn_diff_tree_processor_t *processor;
 
   /* Should this diff ignore node ancestry? */
   svn_boolean_t ignore_ancestry;
@@ -68,12 +92,6 @@ struct diff_baton
   /* Should this diff not compare copied files with their source? */
   svn_boolean_t show_copies_as_adds;
 
-  /* Are we producing a git-style diff? */
-  svn_boolean_t use_git_diff_format;
-
-  /* Empty file used to diff adds / deletes */
-  const char *empty_file;
-
   /* Hash whose keys are const char * changelist names. */
   apr_hash_t *changelist_hash;
 
@@ -84,341 +102,85 @@ struct diff_baton
   apr_pool_t *pool;
 };
 
-/* Get the empty file associated with the edit baton. This is cached so
- * that it can be reused, all empty files are the same.
+/* Recursively opens directories on the stack in EB, until LOCAL_ABSPATH
+   is reached. If RECURSIVE_SKIP is TRUE, don't open LOCAL_ABSPATH itself,
+   but create it marked with skip+skip_children.
  */
 static svn_error_t *
-get_empty_file(struct diff_baton *eb,
-               const char **empty_file,
-               apr_pool_t *scratch_pool)
-{
-  /* Create the file if it does not exist */
-  /* Note that we tried to use /dev/null in r857294, but
-     that won't work on Windows: it's impossible to stat NUL */
-  if (!eb->empty_file)
-    {
-      SVN_ERR(svn_io_open_unique_file3(NULL, &eb->empty_file, NULL,
-                                       svn_io_file_del_on_pool_cleanup,
-                                       eb->pool, scratch_pool));
-    }
-
-  *empty_file = eb->empty_file;
-
-  return SVN_NO_ERROR;
-}
-
-
-/* Return the value of the svn:mime-type property held in PROPS, or NULL
-   if no such property exists. */
-static const char *
-get_prop_mimetype(apr_hash_t *props)
-{
-  return svn_prop_get_value(props, SVN_PROP_MIME_TYPE);
-}
-
-
-/* Diff the file PATH against its text base.  At this
- * stage we are dealing with a file that does exist in the working copy.
- *
- * DIR_BATON is the parent directory baton, PATH is the path to the file to
- * be compared.
- *
- * Do all allocation in POOL.
- *
- * ### TODO: Need to work on replace if the new filename used to be a
- * directory.
- */
-static svn_error_t *
-file_diff(struct diff_baton *eb,
-          const char *local_abspath,
-          const char *path,
-          apr_pool_t *scratch_pool)
+ensure_state(struct diff_baton *eb,
+             const char *local_abspath,
+             svn_boolean_t recursive_skip,
+             apr_pool_t *scratch_pool)
 {
-  svn_wc__db_t *db = eb->db;
-  const char *empty_file;
-  const char *original_repos_relpath;
-  svn_wc__db_status_t status;
-  svn_kind_t kind;
-  svn_revnum_t revision;
-  const svn_checksum_t *checksum;
-  svn_boolean_t op_root;
-  svn_boolean_t had_props, props_mod;
-  svn_boolean_t have_base, have_more_work;
-  svn_boolean_t replaced = FALSE;
-  svn_boolean_t base_replace = FALSE;
-  svn_wc__db_status_t base_status;
-  svn_revnum_t base_revision = SVN_INVALID_REVNUM;
-  const svn_checksum_t *base_checksum;
-  const char *pristine_abspath;
-
-  SVN_ERR(svn_wc__db_read_info(&status, &kind, &revision, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, &checksum, NULL,
-                               &original_repos_relpath, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL,
-                               &op_root, &had_props, &props_mod,
-                               &have_base, &have_more_work, NULL,
-                               db, local_abspath, scratch_pool, scratch_pool));
-
-  if ((status == svn_wc__db_status_added) && (have_base || have_more_work))
+  struct node_state_t *ns;
+  apr_pool_t *ns_pool;
+  if (!eb->cur)
     {
-      SVN_ERR(svn_wc__db_node_check_replace(&replaced, &base_replace,
-                                            NULL, db, local_abspath,
-                                            scratch_pool));
+      if (!svn_dirent_is_ancestor(eb->anchor_abspath, local_abspath))
+        return SVN_NO_ERROR;
 
-      if (replaced && base_replace /* && !have_more_work */)
-        {
-          svn_kind_t base_kind;
-          SVN_ERR(svn_wc__db_base_get_info(&base_status, &base_kind,
-                                           &base_revision,
-                                           NULL, NULL, NULL, NULL, NULL, NULL,
-                                           NULL, &base_checksum, NULL,
-                                           NULL, NULL, NULL, NULL,
-                                           db, local_abspath,
-                                           scratch_pool, scratch_pool));
-
-          if (base_status != svn_wc__db_status_normal
-              || base_kind != kind)
-            {
-              /* We can't show a replacement here */
-              replaced = FALSE;
-              base_replace = FALSE;
-            }
-        }
-      else
-        {
-          /* We can't look in this middle working layer (yet).
-             We just report the change itself.
-
-             And if we could look at it, how would we report the addition
-             of this middle layer (and maybe different layers below that)?
-
-             For 1.7 we just do what we did before: Ignore this layering
-             problem and just show how the current file got in your wc.
-           */
-          replaced = FALSE;
-          base_replace = FALSE;
-        }
+      SVN_ERR(ensure_state(eb,
+                           svn_dirent_dirname(local_abspath,scratch_pool),
+                           FALSE,
+                           scratch_pool));
     }
+  else if (svn_dirent_is_child(eb->cur->local_abspath, local_abspath, NULL))
+    SVN_ERR(ensure_state(eb, svn_dirent_dirname(local_abspath,scratch_pool),
+                         FALSE,
+                         scratch_pool));
+  else
+    return SVN_NO_ERROR;
 
-  /* Now refine ADDED to one of: ADDED, COPIED, MOVED_HERE. Note that only
-     the latter two have corresponding pristine info to diff against.  */
-  if (status == svn_wc__db_status_added)
-    SVN_ERR(svn_wc__db_scan_addition(&status, NULL, NULL, NULL, NULL,
-                                     NULL, NULL, NULL,
-                                     NULL, NULL, NULL, db, local_abspath,
-                                     scratch_pool, scratch_pool));
-
-  SVN_ERR(get_empty_file(eb, &empty_file, scratch_pool));
-
-  /* When we show a delete, we show a diff of the original pristine against
-   * an empty file.
-   * A base-replace is treated like a delete plus an add.
-   *
-   * For this kind of diff we prefer to show the deletion of what was checked
-   * out over showing what was actually deleted (if that was defined by
-   * a higher layer). */
-  if (status == svn_wc__db_status_deleted ||
-      (base_replace && ! eb->ignore_ancestry))
-    {
-      apr_hash_t *del_props;
-      const svn_checksum_t *del_checksum;
-      const char *del_text_abspath;
-      const char *del_mimetype;
-
-      if (base_replace && ! eb->ignore_ancestry)
-        {
-          /* We show a deletion of the information in the BASE layer */
-          SVN_ERR(svn_wc__db_base_get_props(&del_props, db, local_abspath,
-                                            scratch_pool, scratch_pool));
-
-          del_checksum = base_checksum;
-        }
-      else
-        {
-          /* We show a deletion of what was actually deleted */
-          SVN_ERR_ASSERT(status == svn_wc__db_status_deleted);
-
-          SVN_ERR(svn_wc__db_read_pristine_props(&del_props, db, local_abspath,
-                                                 scratch_pool, scratch_pool));
-
-          SVN_ERR(svn_wc__db_read_pristine_info(NULL, NULL, NULL, NULL, NULL,
-                                                NULL, &del_checksum, NULL,
-                                                NULL, NULL,
-                                                db, local_abspath,
-                                                scratch_pool, scratch_pool));
-        }
-
-      SVN_ERR_ASSERT(del_checksum != NULL);
+  if (eb->cur && eb->cur->skip_children)
+    return SVN_NO_ERROR;
 
-      SVN_ERR(svn_wc__db_pristine_get_path(&del_text_abspath, db,
-                                           local_abspath, del_checksum,
-                                           scratch_pool, scratch_pool));
-
-      if (del_props == NULL)
-        del_props = apr_hash_make(scratch_pool);
-
-      del_mimetype = get_prop_mimetype(del_props);
-
-      SVN_ERR(eb->callbacks->file_deleted(NULL, NULL, path,
-                                          del_text_abspath,
-                                          empty_file,
-                                          del_mimetype,
-                                          NULL,
-                                          del_props,
-                                          eb->callback_baton,
-                                          scratch_pool));
+  ns_pool = svn_pool_create(eb->cur ? eb->cur->pool : eb->pool);
+  ns = apr_pcalloc(ns_pool, sizeof(*ns));
 
-      if (status == svn_wc__db_status_deleted)
-        {
-          /* We're here only for showing a delete, so we're done. */
-          return SVN_NO_ERROR;
-        }
-    }
+  ns->pool = ns_pool;
+  ns->local_abspath = apr_pstrdup(ns_pool, local_abspath);
+  ns->relpath = svn_dirent_skip_ancestor(eb->anchor_abspath, ns->local_abspath);
+  ns->parent = eb->cur;
+  eb->cur = ns;
 
-  if (checksum != NULL)
-    SVN_ERR(svn_wc__db_pristine_get_path(&pristine_abspath, db, local_abspath,
-                                         checksum,
-                                         scratch_pool, scratch_pool));
-  else if (base_replace && eb->ignore_ancestry)
-    SVN_ERR(svn_wc__db_pristine_get_path(&pristine_abspath, db, local_abspath,
-                                         base_checksum,
-                                         scratch_pool, scratch_pool));
-  else
-    pristine_abspath = empty_file;
-
- /* Now deal with showing additions, or the add-half of replacements.
-  * If the item is schedule-add *with history*, then we usually want
-  * to see the usual working vs. text-base comparison, which will show changes
-  * made since the file was copied.  But in case we're showing copies as adds,
-  * we need to compare the copied file to the empty file. If we're doing a git
-  * diff, and the file was copied, we need to report the file as added and
-  * diff it against the text base, so that a "copied" git diff header, and
-  * possibly a diff against the copy source, will be generated for it. */
-  if ((! base_replace && status == svn_wc__db_status_added) ||
-     (base_replace && ! eb->ignore_ancestry) ||
-     ((status == svn_wc__db_status_copied ||
-       status == svn_wc__db_status_moved_here) &&
-         (eb->show_copies_as_adds || eb->use_git_diff_format)))
+  if (recursive_skip)
     {
-      const char *translated = NULL;
-      apr_hash_t *pristine_props;
-      apr_hash_t *actual_props;
-      const char *actual_mimetype;
-      apr_array_header_t *propchanges;
-
-
-      /* Get svn:mime-type from ACTUAL props of PATH. */
-      SVN_ERR(svn_wc__get_actual_props(&actual_props, db, local_abspath,
-                                       scratch_pool, scratch_pool));
-      actual_mimetype = get_prop_mimetype(actual_props);
-
-      /* Set the original properties to empty, then compute "changes" from
-         that. Essentially, all ACTUAL props will be "added".  */
-      pristine_props = apr_hash_make(scratch_pool);
-      SVN_ERR(svn_prop_diffs(&propchanges, actual_props, pristine_props,
-                             scratch_pool));
-
-      SVN_ERR(svn_wc__internal_translated_file(
-              &translated, local_abspath, db, local_abspath,
-              SVN_WC_TRANSLATE_TO_NF | SVN_WC_TRANSLATE_USE_GLOBAL_TMP,
-              eb->cancel_func, eb->cancel_baton,
-              scratch_pool, scratch_pool));
-
-      SVN_ERR(eb->callbacks->file_added(NULL, NULL, NULL, path,
-                                        (! eb->show_copies_as_adds &&
-                                         eb->use_git_diff_format &&
-                                         status != svn_wc__db_status_added) ?
-                                          pristine_abspath : empty_file,
-                                        translated,
-                                        0, revision,
-                                        NULL,
-                                        actual_mimetype,
-                                        original_repos_relpath,
-                                        SVN_INVALID_REVNUM, propchanges,
-                                        pristine_props, eb->callback_baton,
-                                        scratch_pool));
+      ns->skip = TRUE;
+      ns->skip_children = TRUE;
+      return SVN_NO_ERROR;
     }
-  else
-    {
-      const char *translated = NULL;
-      apr_hash_t *pristine_props;
-      const char *pristine_mimetype;
-      const char *actual_mimetype;
-      apr_hash_t *actual_props;
-      apr_array_header_t *propchanges;
-      svn_boolean_t modified;
-
-      /* Here we deal with showing pure modifications. */
-      SVN_ERR(svn_wc__internal_file_modified_p(&modified, db, local_abspath,
-                                               FALSE, scratch_pool));
-      if (modified)
-        {
-          /* Note that this might be the _second_ time we translate
-             the file, as svn_wc__text_modified_internal_p() might have used a
-             tmp translated copy too.  But what the heck, diff is
-             already expensive, translating twice for the sake of code
-             modularity is liveable. */
-          SVN_ERR(svn_wc__internal_translated_file(
-                    &translated, local_abspath, db, local_abspath,
-                    SVN_WC_TRANSLATE_TO_NF | SVN_WC_TRANSLATE_USE_GLOBAL_TMP,
-                    eb->cancel_func, eb->cancel_baton,
-                    scratch_pool, scratch_pool));
-        }
-
-      /* Get the properties, the svn:mime-type values, and compute the
-         differences between the two.  */
-      if (base_replace
-          && eb->ignore_ancestry)
-        {
-          /* We don't want the normal pristine properties (which are
-             from the WORKING tree). We want the pristines associated
-             with the BASE tree, which are saved as "revert" props.  */
-          SVN_ERR(svn_wc__db_base_get_props(&pristine_props,
-                                            db, local_abspath,
-                                            scratch_pool, scratch_pool));
-        }
-      else
-        {
-          /* We can only fetch the pristine props (from BASE or WORKING) if
-             the node has not been replaced, or it was copied/moved here.  */
-          SVN_ERR_ASSERT(!replaced
-                         || status == svn_wc__db_status_copied
-                         || status == svn_wc__db_status_moved_here);
-
-          SVN_ERR(svn_wc__db_read_pristine_props(&pristine_props, db,
-                                                 local_abspath,
-                                                 scratch_pool, scratch_pool));
-
-          /* baseprops will be NULL for added nodes */
-          if (!pristine_props)
-            pristine_props = apr_hash_make(scratch_pool);
-        }
-      pristine_mimetype = get_prop_mimetype(pristine_props);
 
-      SVN_ERR(svn_wc__db_read_props(&actual_props, db, local_abspath,
-                                    scratch_pool, scratch_pool));
-      actual_mimetype = get_prop_mimetype(actual_props);
-
-      SVN_ERR(svn_prop_diffs(&propchanges, actual_props, pristine_props,
-                             scratch_pool));
-
-      if (modified || propchanges->nelts > 0)
-        {
-          SVN_ERR(eb->callbacks->file_changed(NULL, NULL, NULL,
-                                              path,
-                                              modified ? pristine_abspath
-                                                       : NULL,
-                                              translated,
-                                              revision,
-                                              SVN_INVALID_REVNUM,
-                                              pristine_mimetype,
-                                              actual_mimetype,
-                                              propchanges,
-                                              pristine_props,
-                                              eb->callback_baton,
-                                              scratch_pool));
-        }
-    }
+  {
+    svn_revnum_t revision;
+    svn_error_t *err;
+
+    err = svn_wc__db_base_get_info(NULL, NULL, &revision, NULL, NULL, NULL,
+                                   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                   NULL, NULL, NULL,
+                                   eb->db, local_abspath,
+                                   scratch_pool, scratch_pool);
+
+    if (err)
+      {
+        if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
+          return svn_error_trace(err);
+        svn_error_clear(err);
+
+        revision = 0; /* Use original revision? */
+      }
+    ns->left_src = svn_diff__source_create(revision, ns->pool);
+    ns->right_src = svn_diff__source_create(SVN_INVALID_REVNUM, ns->pool);
+
+    SVN_ERR(eb->processor->dir_opened(&ns->baton, &ns->skip,
+                                      &ns->skip_children,
+                                      ns->relpath,
+                                      ns->left_src,
+                                      ns->right_src,
+                                      NULL /* copyfrom_source */,
+                                      ns->parent ? ns->parent->baton : NULL,
+                                      eb->processor,
+                                      ns->pool, scratch_pool));
+  }
 
   return SVN_NO_ERROR;
 }
@@ -431,99 +193,232 @@ diff_status_callback(void *baton,
                      apr_pool_t *scratch_pool)
 {
   struct diff_baton *eb = baton;
+  svn_wc__db_t *db = eb->db;
+
   switch (status->node_status)
     {
       case svn_wc_status_unversioned:
       case svn_wc_status_ignored:
         return SVN_NO_ERROR; /* No diff */
 
-      case svn_wc_status_obstructed:
-      case svn_wc_status_missing:
-        return SVN_NO_ERROR; /* ### What should we do here? */
-
       default:
         break; /* Go check other conditions */
     }
 
+  /* Not text/prop modified, not copied. Easy out */
+  if (status->node_status == svn_wc_status_normal && !status->copied)
+    return SVN_NO_ERROR;
+
+  /* Mark all directories where we are no longer inside as closed */
+  while (eb->cur
+         && !svn_dirent_is_ancestor(eb->cur->local_abspath, local_abspath))
+    {
+      struct node_state_t *ns = eb->cur;
+
+      if (!ns->skip)
+        {
+          if (ns->propchanges)
+            SVN_ERR(eb->processor->dir_changed(ns->relpath,
+                                               ns->left_src,
+                                               ns->right_src,
+                                               ns->left_props,
+                                               ns->right_props,
+                                               ns->propchanges,
+                                               ns->baton,
+                                               eb->processor,
+                                               ns->pool));
+          else
+            SVN_ERR(eb->processor->dir_closed(ns->relpath,
+                                              ns->left_src,
+                                              ns->right_src,
+                                              ns->baton,
+                                              eb->processor,
+                                              ns->pool));
+        }
+      eb->cur = ns->parent;
+      svn_pool_clear(ns->pool);
+    }
+  SVN_ERR(ensure_state(eb, svn_dirent_dirname(local_abspath, scratch_pool),
+                       FALSE, scratch_pool));
+
+  if (eb->cur && eb->cur->skip_children)
+    return SVN_NO_ERROR;
+
   if (eb->changelist_hash != NULL
       && (!status->changelist
           || ! apr_hash_get(eb->changelist_hash, status->changelist,
                             APR_HASH_KEY_STRING)))
     return SVN_NO_ERROR; /* Filtered via changelist */
 
-  /* ### The following checks should probably be reversed as it should decide
-         when *not* to show a diff, because generally all changed nodes should
-         have a diff. */
-  if (status->kind == svn_node_file)
-    {
-      /* Show a diff when
-       *   - The text is modified
-       *   - Or the properties are modified
-       *   - Or when the node has been replaced
-       *   - Or (if in copies as adds or git mode) when a node is copied */
-      if (status->text_status == svn_wc_status_modified
-          || status->prop_status == svn_wc_status_modified
-          || status->node_status == svn_wc_status_deleted
-          || status->node_status == svn_wc_status_replaced
-          || ((eb->show_copies_as_adds || eb->use_git_diff_format)
-              && status->copied))
-        {
-          const char *path = svn_dirent_skip_ancestor(eb->anchor_abspath,
-                                                      local_abspath);
-
-          SVN_ERR(file_diff(eb, local_abspath, path, scratch_pool));
-        }
-    }
-  else  /* it's a directory */
-    {
-      const char *path = svn_dirent_skip_ancestor(eb->anchor_abspath,
-                                                  local_abspath);
+  /* This code does about the same thing as the inner body of
+     walk_local_nodes_diff() in diff_editor.c, except that
+     it is already filtered by the status walker, doesn't have to
+     account for remote changes (and many tiny other details) */
+
+  {
+    svn_boolean_t repos_only;
+    svn_boolean_t local_only;
+    svn_wc__db_status_t db_status;
+    svn_boolean_t have_base;
+    svn_node_kind_t base_kind;
+    svn_node_kind_t db_kind = status->kind;
+    svn_depth_t depth_below_here = svn_depth_unknown;
+
+    const char *child_abspath = local_abspath;
+    const char *child_relpath = svn_dirent_skip_ancestor(eb->anchor_abspath,
+                                                         local_abspath);
+
+
+    repos_only = FALSE;
+    local_only = FALSE;
+
+    /* ### optimize away this call using status info. Should
+           be possible in almost every case (except conflict, missing, obst.)*/
+    SVN_ERR(svn_wc__db_read_info(&db_status, NULL, 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, NULL,
+                                 eb->db, local_abspath,
+                                 scratch_pool, scratch_pool));
+    if (!have_base)
+      {
+        local_only = TRUE; /* Only report additions */
+      }
+    else if (db_status == svn_wc__db_status_normal)
+      {
+        /* Simple diff */
+        base_kind = db_kind;
+      }
+    else if (db_status == svn_wc__db_status_deleted)
+      {
+        svn_wc__db_status_t base_status;
+        repos_only = TRUE;
+        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, NULL,
+                                         eb->db, local_abspath,
+                                         scratch_pool, scratch_pool));
 
-      /* Report the directory as deleted and/or opened or added. */
-      if (status->node_status == svn_wc_status_deleted
-          || status->node_status == svn_wc_status_replaced)
-        SVN_ERR(eb->callbacks->dir_deleted(NULL, NULL, path,
-                                           eb->callback_baton, scratch_pool));
-
-      if (status->node_status == svn_wc_status_added
-          || status->node_status == svn_wc_status_replaced)
-        SVN_ERR(eb->callbacks->dir_added(NULL, NULL, NULL, NULL,
-                                         path, status->revision,
-                                         path, status->revision /* ### ? */,
-                                         eb->callback_baton, scratch_pool));
-      else
-        SVN_ERR(eb->callbacks->dir_opened(NULL, NULL, NULL,
-                                          path, status->revision,
-                                          eb->callback_baton, scratch_pool));
-
-      /* Report the prop change. */
-      /* ### This case should probably be extended for git-diff, but this
-             is what the old diff code provided */
-      if (status->prop_status == svn_wc_status_modified)
-        {
-          apr_array_header_t *propchanges;
-          apr_hash_t *baseprops;
+        if (base_status != svn_wc__db_status_normal)
+          return SVN_NO_ERROR;
+      }
+    else
+      {
+        /* working status is either added or deleted */
+        svn_wc__db_status_t base_status;
+
+        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, NULL,
+                                         eb->db, local_abspath,
+                                         scratch_pool, scratch_pool));
 
-          SVN_ERR(svn_wc__internal_propdiff(&propchanges, &baseprops,
-                                            eb->db, local_abspath,
-                                            scratch_pool, scratch_pool));
-
-          SVN_ERR(eb->callbacks->dir_props_changed(NULL, NULL,
-                                                   path, FALSE /* ### ? */,
-                                                   propchanges, baseprops,
-                                                   eb->callback_baton,
+        if (base_status != svn_wc__db_status_normal)
+          local_only = TRUE;
+        else if (base_kind != db_kind || !eb->ignore_ancestry)
+          {
+            repos_only = TRUE;
+            local_only = TRUE;
+          }
+      }
+
+    if (repos_only)
+      {
+        /* Report repository form deleted */
+        if (base_kind == svn_node_file)
+          SVN_ERR(svn_wc__diff_base_only_file(db, child_abspath,
+                                              child_relpath,
+                                              SVN_INVALID_REVNUM,
+                                              eb->processor,
+                                              eb->cur ? eb->cur->baton : NULL,
+                                              scratch_pool));
+        else if (base_kind == svn_node_dir)
+          SVN_ERR(svn_wc__diff_base_only_dir(db, child_abspath,
+                                             child_relpath,
+                                             SVN_INVALID_REVNUM,
+                                             depth_below_here,
+                                             eb->processor,
+                                             eb->cur ? eb->cur->baton : NULL,
+                                             eb->cancel_func,
+                                             eb->cancel_baton,
+                                             scratch_pool));
+      }
+    else if (!local_only)
+      {
+        /* Diff base against actual */
+        if (db_kind == svn_node_file)
+          {
+            SVN_ERR(svn_wc__diff_base_working_diff(db, child_abspath,
+                                                   child_relpath,
+                                                   SVN_INVALID_REVNUM,
+                                                   eb->changelist_hash,
+                                                   eb->processor,
+                                                   eb->cur 
+                                                        ? eb->cur->baton
+                                                        : NULL,
+                                                   FALSE,
+                                                   eb->cancel_func,
+                                                   eb->cancel_baton,
                                                    scratch_pool));
-        }
+          }
+        else if (db_kind == svn_node_dir)
+          {
+            SVN_ERR(ensure_state(eb, local_abspath, FALSE, scratch_pool));
+
+            if (status->prop_status != svn_wc_status_none
+                && status->prop_status != svn_wc_status_normal)
+              {
+                apr_array_header_t *propchanges;
+                SVN_ERR(svn_wc__db_base_get_props(&eb->cur->left_props,
+                                                  eb->db, local_abspath,
+                                                  eb->cur->pool,
+                                                  scratch_pool));
+                SVN_ERR(svn_wc__db_read_props(&eb->cur->right_props,
+                                              eb->db, local_abspath,
+                                              eb->cur->pool,
+                                              scratch_pool));
+
+                SVN_ERR(svn_prop_diffs(&propchanges,
+                                       eb->cur->right_props,
+                                       eb->cur->left_props,
+                                       eb->cur->pool));
+
+                eb->cur->propchanges = propchanges;
+              }
+          }
+      }
+
+    if (local_only)
+      {
+        if (db_kind == svn_node_file)
+          SVN_ERR(svn_wc__diff_local_only_file(db, child_abspath,
+                                               child_relpath,
+                                               eb->processor,
+                                               eb->cur ? eb->cur->baton : NULL,
+                                               eb->changelist_hash,
+                                               FALSE,
+                                               eb->cancel_func,
+                                               eb->cancel_baton,
+                                               scratch_pool));
+        else if (db_kind == svn_node_dir)
+          SVN_ERR(svn_wc__diff_local_only_dir(db, child_abspath,
+                                              child_relpath, depth_below_here,
+                                              eb->processor,
+                                              eb->cur ? eb->cur->baton : NULL,
+                                              eb->changelist_hash,
+                                              FALSE,
+                                              eb->cancel_func,
+                                              eb->cancel_baton,
+                                              scratch_pool));
+      }
+
+    if (db_kind == svn_node_dir && (local_only || repos_only))
+      SVN_ERR(ensure_state(eb, local_abspath, TRUE /* skip */, scratch_pool));
+  }
 
-      /* Close the dir.
-       * ### This should be done after all children have been processed, not
-       *     yet.  The current Subversion-internal callers don't care. */
-      SVN_ERR(eb->callbacks->dir_closed(
-                        NULL, NULL, NULL, path,
-                        (status->node_status == svn_wc_status_added
-                         || status->node_status == svn_wc_status_replaced),
-                        eb->callback_baton, scratch_pool));
-    }
   return SVN_NO_ERROR;
 }
 
@@ -544,34 +439,53 @@ svn_wc_diff6(svn_wc_context_t *wc_ctx,
              apr_pool_t *scratch_pool)
 {
   struct diff_baton eb = { 0 };
-  svn_kind_t kind;
+  svn_node_kind_t kind;
   svn_boolean_t get_all;
+  const svn_diff_tree_processor_t *processor;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
   SVN_ERR(svn_wc__db_read_kind(&kind, wc_ctx->db, local_abspath,
                                FALSE /* allow_missing */,
+                               TRUE /* show_deleted */,
                                FALSE /* show_hidden */,
                                scratch_pool));
 
-  if (kind == svn_kind_dir)
-      eb.anchor_abspath = local_abspath;
+  if (kind == svn_node_dir)
+    eb.anchor_abspath = local_abspath;
   else
     eb.anchor_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
 
+  SVN_ERR(svn_wc__wrap_diff_callbacks(&processor,
+                                      callbacks, callback_baton, TRUE,
+                                      scratch_pool, scratch_pool));
+
+  if (use_git_diff_format)
+    show_copies_as_adds = TRUE;
+  if (show_copies_as_adds)
+    ignore_ancestry = FALSE;
+
+
+
+  /*
+  if (reverse_order)
+    processor = svn_diff__tree_processor_reverse_create(processor, NULL, pool);
+   */
+
+  if (! show_copies_as_adds && !use_git_diff_format)
+    processor = svn_diff__tree_processor_copy_as_changed_create(processor,
+                                                                scratch_pool);
+
   eb.db = wc_ctx->db;
-  eb.callbacks = callbacks;
-  eb.callback_baton = callback_baton;
+  eb.processor = processor;
   eb.ignore_ancestry = ignore_ancestry;
   eb.show_copies_as_adds = show_copies_as_adds;
-  eb.use_git_diff_format = use_git_diff_format;
-  eb.empty_file = NULL;
   eb.pool = scratch_pool;
 
   if (changelist_filter && changelist_filter->nelts)
     SVN_ERR(svn_hash_from_cstring_keys(&eb.changelist_hash, changelist_filter,
                                        scratch_pool));
 
-  if (show_copies_as_adds || use_git_diff_format)
+  if (show_copies_as_adds || use_git_diff_format || !ignore_ancestry)
     get_all = TRUE; /* We need unmodified descendants of copies */
   else
     get_all = FALSE;
@@ -586,5 +500,34 @@ svn_wc_diff6(svn_wc_context_t *wc_ctx,
                                        cancel_func, cancel_baton,
                                        scratch_pool));
 
+  /* Close the remaining open directories */
+  while (eb.cur)
+    {
+      struct node_state_t *ns = eb.cur;
+
+      if (!ns->skip)
+        {
+          if (ns->propchanges)
+            SVN_ERR(processor->dir_changed(ns->relpath,
+                                           ns->left_src,
+                                           ns->right_src,
+                                           ns->left_props,
+                                           ns->right_props,
+                                           ns->propchanges,
+                                           ns->baton,
+                                           processor,
+                                           ns->pool));
+          else
+            SVN_ERR(processor->dir_closed(ns->relpath,
+                                          ns->left_src,
+                                          ns->right_src,
+                                          ns->baton,
+                                          processor,
+                                          ns->pool));
+        }
+      eb.cur = ns->parent;
+      svn_pool_clear(ns->pool);
+    }
+
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/entries.c?rev=1457684&r1=1457683&r2=1457684&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/entries.c Mon Mar 18 09:35:24 2013
@@ -62,7 +62,7 @@ typedef struct db_node_t {
   const char *parent_relpath;
   svn_wc__db_status_t presence;
   svn_revnum_t revision;
-  svn_node_kind_t kind;  /* ### should switch to svn_kind_t */
+  svn_node_kind_t kind;
   svn_checksum_t *checksum;
   svn_filesize_t recorded_size;
   svn_revnum_t changed_rev;
@@ -149,7 +149,7 @@ check_file_external(svn_wc_entry_t *entr
                     apr_pool_t *scratch_pool)
 {
   svn_wc__db_status_t status;
-  svn_kind_t kind;
+  svn_node_kind_t kind;
   const char *repos_relpath;
   svn_revnum_t peg_revision;
   svn_revnum_t revision;
@@ -170,7 +170,7 @@ check_file_external(svn_wc_entry_t *entr
     }
 
   if (status == svn_wc__db_status_normal
-      && kind == svn_kind_file)
+      && kind == svn_node_file)
     {
       entry->file_external_path = repos_relpath;
       if (SVN_IS_VALID_REVNUM(peg_revision))
@@ -205,7 +205,7 @@ check_file_external(svn_wc_entry_t *entr
 */
 static svn_error_t *
 get_info_for_deleted(svn_wc_entry_t *entry,
-                     svn_kind_t *kind,
+                     svn_node_kind_t *kind,
                      const char **repos_relpath,
                      const svn_checksum_t **checksum,
                      svn_wc__db_lock_t **lock,
@@ -278,7 +278,7 @@ get_info_for_deleted(svn_wc_entry_t *ent
                                        &parent_repos_relpath,
                                        &entry->repos,
                                        &entry->uuid,
-                                       NULL, NULL, NULL, NULL, NULL, NULL,
+                                       NULL, NULL, NULL, NULL,
                                        db, parent_abspath,
                                        result_pool, scratch_pool));
 
@@ -378,7 +378,7 @@ read_one_entry(const svn_wc_entry_t **ne
                apr_pool_t *result_pool,
                apr_pool_t *scratch_pool)
 {
-  svn_kind_t kind;
+  svn_node_kind_t kind;
   svn_wc__db_status_t status;
   svn_wc__db_lock_t *lock;
   const char *repos_relpath;
@@ -610,7 +610,6 @@ read_one_entry(const svn_wc_entry_t **ne
                                            &scanned_original_relpath,
                                            NULL, NULL, /* original_root|uuid */
                                            &original_revision,
-                                           NULL, NULL,
                                            db,
                                            entry_abspath,
                                            result_pool, scratch_pool));
@@ -712,7 +711,7 @@ read_one_entry(const svn_wc_entry_t **ne
                                              NULL, NULL, NULL,
                                              &parent_repos_relpath,
                                              &parent_root_url,
-                                             NULL, NULL, NULL, NULL,
+                                             NULL, NULL,
                                              db, parent_abspath,
                                              scratch_pool,
                                              scratch_pool);
@@ -836,11 +835,11 @@ read_one_entry(const svn_wc_entry_t **ne
   if (entry->depth == svn_depth_unknown)
     entry->depth = svn_depth_infinity;
 
-  if (kind == svn_kind_dir)
+  if (kind == svn_node_dir)
     entry->kind = svn_node_dir;
-  else if (kind == svn_kind_file)
+  else if (kind == svn_node_file)
     entry->kind = svn_node_file;
-  else if (kind == svn_kind_symlink)
+  else if (kind == svn_node_symlink)
     entry->kind = svn_node_file;  /* ### no symlink kind */
   else
     entry->kind = svn_node_unknown;
@@ -938,7 +937,7 @@ read_one_entry(const svn_wc_entry_t **ne
 
   /* Let's check for a file external.  ugh.  */
   if (status == svn_wc__db_status_normal
-      && kind == svn_kind_file)
+      && kind == svn_node_file)
     SVN_ERR(check_file_external(entry, db, entry_abspath, dir_abspath,
                                 result_pool, scratch_pool));
 
@@ -2616,7 +2615,7 @@ svn_wc_walk_entries3(const char *path,
   const char *local_abspath;
   svn_wc__db_t *db = svn_wc__adm_get_db(adm_access);
   svn_error_t *err;
-  svn_kind_t kind;
+  svn_node_kind_t kind;
   svn_depth_t depth;
 
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
@@ -2640,7 +2639,7 @@ svn_wc_walk_entries3(const char *path,
         walk_baton, pool);
     }
 
-  if (kind == svn_kind_file || depth == svn_depth_exclude)
+  if (kind == svn_node_file || depth == svn_depth_exclude)
     {
       const svn_wc_entry_t *entry;
 
@@ -2682,7 +2681,7 @@ svn_wc_walk_entries3(const char *path,
       return SVN_NO_ERROR;
     }
 
-  if (kind == svn_kind_dir)
+  if (kind == svn_node_dir)
     return walker_helper(path, adm_access, walk_callbacks, walk_baton,
                          walk_depth, show_hidden, cancel_func, cancel_baton,
                          pool);

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/externals.c?rev=1457684&r1=1457683&r2=1457684&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/externals.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/externals.c Mon Mar 18 09:35:24 2013
@@ -508,7 +508,7 @@ open_file(const char *path,
           void **file_baton)
 {
   struct edit_baton *eb = parent_baton;
-  svn_kind_t kind;
+  svn_node_kind_t kind;
   if (strcmp(path, eb->name))
       return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
                                _("This editor can only update '%s'"),
@@ -524,7 +524,7 @@ open_file(const char *path,
                                    eb->db, eb->local_abspath,
                                    eb->pool, file_pool));
 
-  if (kind != svn_kind_file)
+  if (kind != svn_node_file)
     return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
                                _("Node '%s' is no existing file external"),
                                svn_dirent_local_style(eb->local_abspath,
@@ -965,6 +965,8 @@ close_edit(void *edit_baton,
                                                        *eb->target_revision,
                                                        apr_hash_make(pool),
                                                        wcroot_iprops,
+                                                       eb->notify_func,
+                                                       eb->notify_baton,
                                                        pool));
     }
 
@@ -1078,7 +1080,7 @@ svn_wc__crawl_file_external(svn_wc_conte
 {
   svn_wc__db_t *db = wc_ctx->db;
   svn_error_t *err;
-  svn_kind_t kind;
+  svn_node_kind_t kind;
   svn_wc__db_lock_t *lock;
   svn_revnum_t revision;
   const char *repos_root_url;
@@ -1093,7 +1095,7 @@ svn_wc__crawl_file_external(svn_wc_conte
                                  scratch_pool, scratch_pool);
 
   if (err
-      || kind == svn_kind_dir
+      || kind == svn_node_dir
       || !update_root)
     {
       if (err && err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
@@ -1177,7 +1179,7 @@ svn_wc__read_external_info(svn_node_kind
 {
   const char *repos_root_url;
   svn_wc__db_status_t status;
-  svn_kind_t kind;
+  svn_node_kind_t kind;
   svn_error_t *err;
 
   err = svn_wc__db_external_read(&status, &kind, defining_abspath,
@@ -1219,11 +1221,11 @@ svn_wc__read_external_info(svn_node_kind
       else
         switch(kind)
           {
-            case svn_kind_file:
-            case svn_kind_symlink:
+            case svn_node_file:
+            case svn_node_symlink:
               *external_kind = svn_node_file;
               break;
-            case svn_kind_dir:
+            case svn_node_dir:
               *external_kind = svn_node_dir;
               break;
             default:
@@ -1308,7 +1310,7 @@ svn_wc__committable_externals_below(apr_
 
       /* Discard dirs for svn_depth_files (s.a.). */
       if (depth == svn_depth_files
-          && xinfo->kind == svn_kind_dir)
+          && xinfo->kind == svn_node_dir)
         continue;
 
       svn_pool_clear(iterpool);
@@ -1389,7 +1391,7 @@ svn_wc__external_remove(svn_wc_context_t
                         apr_pool_t *scratch_pool)
 {
   svn_wc__db_status_t status;
-  svn_kind_t kind;
+  svn_node_kind_t kind;
 
   SVN_ERR(svn_wc__db_external_read(&status, &kind, NULL, NULL, NULL, NULL,
                                    NULL, NULL,
@@ -1402,7 +1404,7 @@ svn_wc__external_remove(svn_wc_context_t
   if (declaration_only)
     return SVN_NO_ERROR;
 
-  if (kind == svn_kind_dir)
+  if (kind == svn_node_dir)
     SVN_ERR(svn_wc_remove_from_revision_control2(wc_ctx, local_abspath,
                                                  TRUE, TRUE,
                                                  cancel_func, cancel_baton,

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/info.c?rev=1457684&r1=1457683&r2=1457684&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/info.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/info.c Mon Mar 18 09:35:24 2013
@@ -85,7 +85,7 @@ build_info_for_node(svn_wc__info2_t **in
   svn_wc__info2_t *tmpinfo;
   const char *repos_relpath;
   svn_wc__db_status_t status;
-  svn_kind_t db_kind;
+  svn_node_kind_t db_kind;
   const char *original_repos_relpath;
   const char *original_repos_root_url;
   const char *original_uuid;
@@ -144,19 +144,27 @@ build_info_for_node(svn_wc__info2_t **in
 
           if (op_root)
             {
+              svn_error_t *err;
               wc_info->copyfrom_url =
                     svn_path_url_add_component2(tmpinfo->repos_root_URL,
                                                 original_repos_relpath,
                                                 result_pool);
 
               wc_info->copyfrom_rev = original_revision;
-            }
 
-          SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL, NULL, NULL, NULL,
-                                           NULL, NULL, NULL,
-                                           &wc_info->moved_from_abspath, NULL,
-                                           db, local_abspath,
-                                           result_pool, scratch_pool));
+              err = svn_wc__db_scan_moved(&wc_info->moved_from_abspath,
+                                          NULL, NULL, NULL,
+                                          db, local_abspath,
+                                          result_pool, scratch_pool);
+
+              if (err)
+                {
+                   if (err->apr_err != SVN_ERR_WC_PATH_UNEXPECTED_STATUS)
+                      return svn_error_trace(err);
+                   svn_error_clear(err);
+                   wc_info->moved_from_abspath = NULL;
+                }
+            }
         }
       else if (op_root)
         {
@@ -164,7 +172,7 @@ build_info_for_node(svn_wc__info2_t **in
           SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, &repos_relpath,
                                            &tmpinfo->repos_root_URL,
                                            &tmpinfo->repos_UUID,
-                                           NULL, NULL, NULL, NULL, NULL, NULL,
+                                           NULL, NULL, NULL, NULL,
                                            db, local_abspath,
                                            result_pool, scratch_pool));
 
@@ -246,7 +254,7 @@ build_info_for_node(svn_wc__info2_t **in
                                            &tmpinfo->repos_root_URL,
                                            &tmpinfo->repos_UUID,
                                            NULL, NULL, NULL,
-                                           &tmpinfo->rev, NULL, NULL,
+                                           &tmpinfo->rev,
                                            db, added_abspath,
                                            result_pool, scratch_pool));
 

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/lock.c?rev=1457684&r1=1457683&r2=1457684&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/lock.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/lock.c Mon Mar 18 09:35:24 2013
@@ -127,7 +127,7 @@ svn_wc__internal_check_wc(int *wc_format
   if (*wc_format >= SVN_WC__WC_NG_VERSION)
     {
       svn_wc__db_status_t db_status;
-      svn_kind_t db_kind;
+      svn_node_kind_t db_kind;
 
       if (check_path)
         {
@@ -161,7 +161,7 @@ svn_wc__internal_check_wc(int *wc_format
       else
         SVN_ERR(err);
 
-      if (db_kind != svn_kind_dir)
+      if (db_kind != svn_node_dir)
         {
           /* The WC thinks there must be a file, so this is not
              a wc-directory */
@@ -595,7 +595,7 @@ open_single(svn_wc_adm_access_t **adm_ac
    ### adminstrative area.  */
 static svn_error_t *
 adm_available(svn_boolean_t *available,
-              svn_kind_t *kind,
+              svn_node_kind_t *kind,
               svn_wc__db_t *db,
               const char *local_abspath,
               apr_pool_t *scratch_pool)
@@ -603,7 +603,7 @@ adm_available(svn_boolean_t *available,
   svn_wc__db_status_t status;
 
   if (kind)
-    *kind = svn_kind_unknown;
+    *kind = svn_node_unknown;
 
   SVN_ERR(svn_wc__db_read_info(&status, kind, NULL, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -661,7 +661,7 @@ do_open(svn_wc_adm_access_t **adm_access
       for (i = 0; i < children->nelts; i++)
         {
           const char *node_abspath;
-          svn_kind_t kind;
+          svn_node_kind_t kind;
           svn_boolean_t available;
           const char *name = APR_ARRAY_IDX(children, i, const char *);
 
@@ -679,7 +679,7 @@ do_open(svn_wc_adm_access_t **adm_access
                                 node_abspath,
                                 scratch_pool));
 
-          if (kind != svn_kind_dir)
+          if (kind != svn_node_dir)
             continue;
 
           if (available)
@@ -887,7 +887,7 @@ svn_wc_adm_retrieve(svn_wc_adm_access_t 
                     apr_pool_t *pool)
 {
   const char *local_abspath;
-  svn_kind_t kind = svn_kind_unknown;
+  svn_node_kind_t kind = svn_node_unknown;
   svn_node_kind_t wckind;
   svn_error_t *err;
 
@@ -924,16 +924,17 @@ svn_wc_adm_retrieve(svn_wc_adm_access_t 
       err = svn_wc__db_read_kind(&kind, svn_wc__adm_get_db(associated),
                                  local_abspath,
                                  TRUE /* allow_missing */,
+                                 TRUE /* show_deleted */,
                                  FALSE /* show_hidden */, pool);
 
       if (err)
         {
-          kind = svn_kind_unknown;
+          kind = svn_node_unknown;
           svn_error_clear(err);
         }
     }
 
-  if (kind == svn_kind_dir && wckind == svn_node_file)
+  if (kind == svn_node_dir && wckind == svn_node_file)
     {
       err = svn_error_createf(
                SVN_ERR_WC_NOT_WORKING_COPY, NULL,
@@ -943,7 +944,7 @@ svn_wc_adm_retrieve(svn_wc_adm_access_t 
       return svn_error_create(SVN_ERR_WC_NOT_LOCKED, err, err->message);
     }
 
-  if (kind != svn_kind_dir && kind != svn_kind_unknown)
+  if (kind != svn_node_dir && kind != svn_node_unknown)
     {
       err = svn_error_createf(
                SVN_ERR_WC_NOT_WORKING_COPY, NULL,
@@ -953,7 +954,7 @@ svn_wc_adm_retrieve(svn_wc_adm_access_t 
       return svn_error_create(SVN_ERR_WC_NOT_LOCKED, err, err->message);
     }
 
-  if (kind == svn_kind_unknown || wckind == svn_node_none)
+  if (kind == svn_node_unknown || wckind == svn_node_none)
     {
       err = svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
                               _("Directory '%s' is missing"),
@@ -978,19 +979,21 @@ svn_wc_adm_probe_retrieve(svn_wc_adm_acc
 {
   const char *dir;
   const char *local_abspath;
-  svn_kind_t kind;
+  svn_node_kind_t kind;
   svn_error_t *err;
 
   SVN_ERR_ASSERT(associated != NULL);
 
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
   SVN_ERR(svn_wc__db_read_kind(&kind, associated->db, local_abspath,
-                               TRUE /* allow_missing */, FALSE /* show_hidden*/,
+                               TRUE /* allow_missing */,
+                               TRUE /* show_deleted */,
+                               FALSE /* show_hidden*/,
                                pool));
 
-  if (kind == svn_kind_dir)
+  if (kind == svn_node_dir)
     dir = path;
-  else if (kind != svn_kind_unknown)
+  else if (kind != svn_node_unknown)
     dir = svn_dirent_dirname(path, pool);
   else
     /* Not a versioned item, probe it */
@@ -1236,7 +1239,7 @@ open_anchor(svn_wc_adm_access_t **anchor
       if (! t_access)
         {
           svn_boolean_t available;
-          svn_kind_t kind;
+          svn_node_kind_t kind;
 
           err = adm_available(&available, &kind, db, local_abspath, pool);
 
@@ -1470,7 +1473,7 @@ svn_wc__acquire_write_lock(const char **
   svn_wc__db_t *db = wc_ctx->db;
   svn_boolean_t is_wcroot;
   svn_boolean_t is_switched;
-  svn_kind_t kind;
+  svn_node_kind_t kind;
   svn_error_t *err;
 
   err = svn_wc__db_is_switched(&is_wcroot, &is_switched, &kind,
@@ -1483,18 +1486,18 @@ svn_wc__acquire_write_lock(const char **
 
       svn_error_clear(err);
 
-      kind = svn_kind_none;
+      kind = svn_node_none;
       is_wcroot = FALSE;
       is_switched = FALSE;
     }
 
-  if (!lock_root_abspath && kind != svn_kind_dir)
+  if (!lock_root_abspath && kind != svn_node_dir)
     return svn_error_createf(SVN_ERR_WC_NOT_DIRECTORY, NULL,
                              _("Can't obtain lock on non-directory '%s'."),
                              svn_dirent_local_style(local_abspath,
                                                     scratch_pool));
 
-  if (lock_anchor && kind == svn_kind_dir)
+  if (lock_anchor && kind == svn_node_dir)
     {
       if (is_wcroot)
         lock_anchor = FALSE;
@@ -1507,12 +1510,12 @@ svn_wc__acquire_write_lock(const char **
 
       parent_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
 
-      if (kind == svn_kind_dir)
+      if (kind == svn_node_dir)
         {
           if (! is_switched)
             local_abspath = parent_abspath;
         }
-      else if (kind != svn_kind_none && kind != svn_kind_unknown)
+      else if (kind != svn_node_none && kind != svn_node_unknown)
         {
           /* In the single-DB world we know parent exists */
           local_abspath = parent_abspath;
@@ -1520,20 +1523,21 @@ svn_wc__acquire_write_lock(const char **
       else
         {
           /* Can't lock parents that don't exist */
-          svn_kind_t parent_kind;
+          svn_node_kind_t parent_kind;
           err = svn_wc__db_read_kind(&parent_kind, db, parent_abspath,
                                      TRUE /* allow_missing */,
+                                     TRUE /* show_deleted */,
                                      FALSE /* show_hidden */,
                                      scratch_pool);
           if (err && SVN_WC__ERR_IS_NOT_CURRENT_WC(err))
             {
               svn_error_clear(err);
-              parent_kind = svn_kind_unknown;
+              parent_kind = svn_node_unknown;
             }
           else
             SVN_ERR(err);
 
-          if (parent_kind != svn_kind_dir)
+          if (parent_kind != svn_node_dir)
             return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
                                      _("'%s' is not a working copy"),
                                      svn_dirent_local_style(local_abspath,
@@ -1542,7 +1546,7 @@ svn_wc__acquire_write_lock(const char **
           local_abspath = parent_abspath;
         }
     }
-  else if (kind != svn_kind_dir)
+  else if (kind != svn_node_dir)
     {
       local_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
     }
@@ -1600,4 +1604,53 @@ svn_wc__call_with_write_lock(svn_wc__wit
 }
 
 
+svn_error_t *
+svn_wc__acquire_write_lock_for_resolve(const char **lock_root_abspath,
+                                       svn_wc_context_t *wc_ctx,
+                                       const char *local_abspath,
+                                       apr_pool_t *result_pool,
+                                       apr_pool_t *scratch_pool)
+{
+  svn_boolean_t locked = FALSE;
+  const char *obtained_abspath;
+  const char *requested_abspath = local_abspath;
+
+  while (!locked)
+    {
+      const char *required_abspath;
+      const char *child;
+
+      SVN_ERR(svn_wc__acquire_write_lock(&obtained_abspath, wc_ctx,
+                                         requested_abspath, FALSE,
+                                         scratch_pool, scratch_pool));
+      locked = TRUE;
+
+      SVN_ERR(svn_wc__required_lock_for_resolve(&required_abspath,
+                                                wc_ctx->db, local_abspath,
+                                                scratch_pool, scratch_pool));
+
+      /* It's possible for the required lock path to be an ancestor
+         of, a descendent of, or equal to, the obtained lock path. If
+         it's an ancestor we have to try again, otherwise the obtained
+         lock will do. */
+      child = svn_dirent_skip_ancestor(required_abspath, obtained_abspath);
+      if (child && child[0])
+        {
+          SVN_ERR(svn_wc__release_write_lock(wc_ctx, obtained_abspath,
+                                             scratch_pool));
+          locked = FALSE;
+          requested_abspath = required_abspath;
+        }
+      else
+        {
+          /* required should be a descendent of, or equal to, obtained */
+          SVN_ERR_ASSERT(!strcmp(required_abspath, obtained_abspath)
+                         || svn_dirent_skip_ancestor(obtained_abspath,
+                                                     required_abspath));
+        }
+    }
+
+  *lock_root_abspath = apr_pstrdup(result_pool, obtained_abspath);
 
+  return SVN_NO_ERROR;
+}

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/merge.c?rev=1457684&r1=1457683&r2=1457684&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/merge.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/merge.c Mon Mar 18 09:35:24 2013
@@ -1238,7 +1238,7 @@ svn_wc_merge5(enum svn_wc_merge_outcome_
   /* Sanity check:  the merge target must be a file under revision control */
   {
     svn_wc__db_status_t status;
-    svn_kind_t kind;
+    svn_node_kind_t kind;
     svn_boolean_t had_props;
     svn_boolean_t props_mod;
     svn_boolean_t conflicted;
@@ -1251,7 +1251,7 @@ svn_wc_merge5(enum svn_wc_merge_outcome_
                                  wc_ctx->db, target_abspath,
                                  scratch_pool, scratch_pool));
 
-    if (kind != svn_kind_file || (status != svn_wc__db_status_normal
+    if (kind != svn_node_file || (status != svn_wc__db_status_normal
                                   && status != svn_wc__db_status_added))
       {
         *merge_content_outcome = svn_wc_merge_no_merge;
@@ -1355,7 +1355,8 @@ svn_wc_merge5(enum svn_wc_merge_outcome_
                                  cancel_func, cancel_baton,
                                  scratch_pool, scratch_pool));
 
-  /* If this isn't a dry run, then run the work!  */
+  /* If this isn't a dry run, then update the DB, run the work, and
+   * call the conflict resolver callback.  */
   if (!dry_run)
     {
       if (conflict_skel)

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/node.c?rev=1457684&r1=1457683&r2=1457684&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/node.c Mon Mar 18 09:35:24 2013
@@ -204,7 +204,6 @@ svn_wc__internal_get_repos_info(svn_revn
                                                     ? &op_root_abspath : NULL,
                                            repos_relpath, repos_root_url,
                                            repos_uuid, NULL, NULL, NULL, NULL,
-                                           NULL, NULL,
                                            db, svn_dirent_dirname(
                                                    wrk_del_abspath,
                                                    scratch_pool),
@@ -229,7 +228,6 @@ svn_wc__internal_get_repos_info(svn_revn
                                                     ? &op_root_abspath : NULL,
                                        repos_relpath, repos_root_url,
                                        repos_uuid, NULL, NULL, NULL, NULL,
-                                       NULL, NULL,
                                        db, local_abspath,
                                        result_pool, scratch_pool));
     }
@@ -261,35 +259,25 @@ svn_wc__node_get_repos_info(svn_revnum_t
 /* Convert DB_KIND into the appropriate NODE_KIND value.
  * If SHOW_HIDDEN is TRUE, report the node kind as found in the DB
  * even if DB_STATUS indicates that the node is hidden.
- * Else, return svn_kind_none for such nodes.
+ * Else, return svn_node_none for such nodes.
  *
  * ### This is a bit ugly. We should consider promoting svn_kind_t
  * ### to the de-facto node kind type instead of converting between them
  * ### in non-backwards compat code.
- * ### See also comments at the definition of svn_kind_t. */
+ * ### See also comments at the definition of svn_kind_t.
+ *
+ * ### In reality, the previous comment is out of date, as there is
+ * ### now only one enumeration for node kinds, and that is
+ * ### svn_node_kind_t (svn_kind_t was merged with that). But it's
+ * ### still ugly.
+ */
 static svn_error_t *
 convert_db_kind_to_node_kind(svn_node_kind_t *node_kind,
-                             svn_kind_t db_kind,
+                             svn_node_kind_t db_kind,
                              svn_wc__db_status_t db_status,
                              svn_boolean_t show_hidden)
 {
-  switch (db_kind)
-    {
-      case svn_kind_file:
-        *node_kind = svn_node_file;
-        break;
-      case svn_kind_dir:
-        *node_kind = svn_node_dir;
-        break;
-      case svn_kind_symlink:
-        *node_kind = svn_node_file;
-        break;
-      case svn_kind_unknown:
-        *node_kind = svn_node_unknown;
-        break;
-      default:
-        SVN_ERR_MALFUNCTION();
-    }
+  *node_kind = db_kind;
 
   /* Make sure hidden nodes return svn_node_none. */
   if (! show_hidden)
@@ -308,21 +296,25 @@ convert_db_kind_to_node_kind(svn_node_ki
 }
 
 svn_error_t *
-svn_wc_read_kind(svn_node_kind_t *kind,
-                 svn_wc_context_t *wc_ctx,
-                 const char *local_abspath,
-                 svn_boolean_t show_hidden,
-                 apr_pool_t *scratch_pool)
+svn_wc_read_kind2(svn_node_kind_t *kind,
+                  svn_wc_context_t *wc_ctx,
+                  const char *local_abspath,
+                  svn_boolean_t show_deleted,
+                  svn_boolean_t show_hidden,
+                  apr_pool_t *scratch_pool)
 {
-  svn_kind_t db_kind;
+  svn_node_kind_t db_kind;
 
   SVN_ERR(svn_wc__db_read_kind(&db_kind,
-                             wc_ctx->db, local_abspath, TRUE, show_hidden,
-                             scratch_pool));
+                               wc_ctx->db, local_abspath,
+                               TRUE,
+                               show_deleted,
+                               show_hidden,
+                               scratch_pool));
 
-  if (db_kind == svn_kind_dir)
+  if (db_kind == svn_node_dir)
     *kind = svn_node_dir;
-  else if (db_kind == svn_kind_file || db_kind == svn_kind_symlink)
+  else if (db_kind == svn_node_file || db_kind == svn_node_symlink)
     *kind = svn_node_file;
   else
     *kind = svn_node_none;
@@ -415,7 +407,7 @@ walker_helper(svn_wc__db_t *db,
     {
       const char *child_name = svn__apr_hash_index_key(hi);
       struct svn_wc__db_walker_info_t *wi = svn__apr_hash_index_val(hi);
-      svn_kind_t child_kind = wi->kind;
+      svn_node_kind_t child_kind = wi->kind;
       svn_wc__db_status_t child_status = wi->status;
       const char *child_abspath;
 
@@ -439,7 +431,7 @@ walker_helper(svn_wc__db_t *db,
           }
 
       /* Return the child, if appropriate. */
-      if ( (child_kind == svn_kind_file
+      if ( (child_kind == svn_node_file
              || depth >= svn_depth_immediates)
            && svn_wc__internal_changelist_match(db, child_abspath,
                                                 changelist_filter,
@@ -458,7 +450,7 @@ walker_helper(svn_wc__db_t *db,
         }
 
       /* Recurse into this directory, if appropriate. */
-      if (child_kind == svn_kind_dir
+      if (child_kind == svn_node_dir
             && depth >= svn_depth_immediates)
         {
           svn_depth_t depth_below_here = depth;
@@ -493,7 +485,7 @@ svn_wc__internal_walk_children(svn_wc__d
                                void *cancel_baton,
                                apr_pool_t *scratch_pool)
 {
-  svn_kind_t db_kind;
+  svn_node_kind_t db_kind;
   svn_node_kind_t kind;
   svn_wc__db_status_t status;
   apr_hash_t *changelist_hash = NULL;
@@ -518,13 +510,13 @@ svn_wc__internal_walk_children(svn_wc__d
                                         changelist_hash, scratch_pool))
     SVN_ERR(walk_callback(local_abspath, kind, walk_baton, scratch_pool));
 
-  if (db_kind == svn_kind_file
+  if (db_kind == svn_node_file
       || status == svn_wc__db_status_not_present
       || status == svn_wc__db_status_excluded
       || status == svn_wc__db_status_server_excluded)
     return SVN_NO_ERROR;
 
-  if (db_kind == svn_kind_dir)
+  if (db_kind == svn_node_dir)
     {
       return svn_error_trace(
         walker_helper(db, local_abspath, show_hidden, changelist_hash,
@@ -592,17 +584,30 @@ svn_wc__node_is_not_present(svn_boolean_
                             svn_boolean_t *is_server_excluded,
                             svn_wc_context_t *wc_ctx,
                             const char *local_abspath,
+                            svn_boolean_t base_only,
                             apr_pool_t *scratch_pool)
 {
   svn_wc__db_status_t status;
 
-  SVN_ERR(svn_wc__db_read_info(&status,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL,
-                               wc_ctx->db, local_abspath,
-                               scratch_pool, scratch_pool));
+  if (base_only)
+    {
+      SVN_ERR(svn_wc__db_base_get_info(&status,
+                                       NULL, NULL, NULL, NULL, NULL, NULL,
+                                       NULL, NULL, NULL, NULL, NULL, NULL,
+                                       NULL, NULL, NULL,
+                                       wc_ctx->db, local_abspath,
+                                       scratch_pool, scratch_pool));
+    }
+  else
+    {
+      SVN_ERR(svn_wc__db_read_info(&status,
+                                   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                   NULL, NULL, NULL, NULL, NULL,
+                                   wc_ctx->db, local_abspath,
+                                   scratch_pool, scratch_pool));
+    }
 
   if (is_not_present)
     *is_not_present = (status == svn_wc__db_status_not_present);
@@ -657,29 +662,53 @@ svn_wc__node_has_working(svn_boolean_t *
 
 
 svn_error_t *
-svn_wc__node_get_base(svn_revnum_t *revision,
+svn_wc__node_get_base(svn_node_kind_t *kind,
+                      svn_revnum_t *revision,
                       const char **repos_relpath,
                       const char **repos_root_url,
                       const char **repos_uuid,
                       const char **lock_token,
                       svn_wc_context_t *wc_ctx,
                       const char *local_abspath,
+                      svn_boolean_t ignore_enoent,
+                      svn_boolean_t show_hidden,
                       apr_pool_t *result_pool,
                       apr_pool_t *scratch_pool)
 {
   svn_error_t *err;
+  svn_wc__db_status_t status;
   svn_wc__db_lock_t *lock;
+  svn_node_kind_t db_kind;
 
-  err = svn_wc__db_base_get_info(NULL, NULL, revision, repos_relpath,
+  err = svn_wc__db_base_get_info(&status, &db_kind, revision, repos_relpath,
                                  repos_root_url, repos_uuid, NULL,
                                  NULL, NULL, NULL, NULL, NULL,
                                  lock_token ? &lock : NULL,
                                  NULL, NULL, NULL,
                                  wc_ctx->db, local_abspath,
                                  result_pool, scratch_pool);
-  if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+
+  if (err && err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
+    return svn_error_trace(err);
+  else if (err
+           || (!err && !show_hidden
+               && (status != svn_wc__db_status_normal
+                   && status != svn_wc__db_status_incomplete)))
     {
+      if (!ignore_enoent)
+        {
+          if (err)
+            return svn_error_trace(err);
+          else
+            return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+                                     _("The node '%s' was not found."),
+                                     svn_dirent_local_style(local_abspath,
+                                                            scratch_pool));
+        }
       svn_error_clear(err);
+
+      if (kind)
+        *kind = svn_node_unknown;
       if (revision)
         *revision = SVN_INVALID_REVNUM;
       if (repos_relpath)
@@ -692,8 +721,9 @@ svn_wc__node_get_base(svn_revnum_t *revi
         *lock_token = NULL;
       return SVN_NO_ERROR;
     }
-  SVN_ERR(err);
 
+  if (kind)
+    *kind = db_kind;
   if (lock_token)
     *lock_token = lock ? lock->token : NULL;
 
@@ -741,13 +771,13 @@ svn_wc__node_get_pre_ng_status_data(svn_
                                      NULL, NULL, NULL, NULL,
                                      wc_ctx->db, local_abspath,
                                      result_pool, scratch_pool));
-  else
-    {
-      /* Sorry, we need a function to peek below the current working and
-         the BASE layer. And we don't have one yet.
-
-         ### Better to report nothing, than the wrong information */
-    }
+  else if (status == svn_wc__db_status_deleted)
+    /* Check the information below a WORKING delete */
+    SVN_ERR(svn_wc__db_read_pristine_info(NULL, NULL, changed_rev,
+                                          changed_date, changed_author, NULL,
+                                          NULL, NULL, NULL, NULL,
+                                          wc_ctx->db, local_abspath,
+                                          result_pool, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -998,7 +1028,7 @@ svn_wc__internal_get_origin(svn_boolean_
         SVN_ERR(svn_wc__db_scan_addition(&status, &op_root_abspath, NULL,
                                          NULL, NULL, &original_repos_relpath,
                                          repos_root_url,
-                                         repos_uuid, revision, NULL, NULL,
+                                         repos_uuid, revision,
                                          db, local_abspath,
                                          result_pool, scratch_pool));
 
@@ -1197,7 +1227,7 @@ svn_wc__check_for_obstructions(svn_wc_no
                                apr_pool_t *scratch_pool)
 {
   svn_wc__db_status_t status;
-  svn_kind_t db_kind;
+  svn_node_kind_t db_kind;
   svn_node_kind_t disk_kind;
   svn_error_t *err;
 
@@ -1250,7 +1280,7 @@ svn_wc__check_for_obstructions(svn_wc_no
       else
         SVN_ERR(err);
 
-      if (db_kind != svn_kind_dir
+      if (db_kind != svn_node_dir
           || (status != svn_wc__db_status_normal
               && status != svn_wc__db_status_added))
         {
@@ -1265,7 +1295,7 @@ svn_wc__check_for_obstructions(svn_wc_no
 
   /* Check for obstructing working copies */
   if (!no_wcroot_check
-      && db_kind == svn_kind_dir
+      && db_kind == svn_node_dir
       && status == svn_wc__db_status_normal)
     {
       svn_boolean_t is_root;
@@ -1361,36 +1391,27 @@ svn_wc__node_was_moved_here(const char *
                             apr_pool_t *result_pool,
                             apr_pool_t *scratch_pool)
 {
-  svn_boolean_t is_added;
+  svn_error_t *err;
 
   if (moved_from_abspath)
     *moved_from_abspath = NULL;
   if (delete_op_root_abspath)
     *delete_op_root_abspath = NULL;
 
-  SVN_ERR(svn_wc__node_is_added(&is_added, wc_ctx, local_abspath,
-                                scratch_pool));
-  if (is_added && (moved_from_abspath || delete_op_root_abspath))
+  err = svn_wc__db_scan_moved(moved_from_abspath, NULL, NULL,
+                              delete_op_root_abspath,
+                              wc_ctx->db, local_abspath,
+                              result_pool, scratch_pool);
+
+  if (err)
     {
-      svn_wc__db_status_t status;
-      const char *db_moved_from_abspath;
-      const char *db_delete_op_root_abspath;
-
-      SVN_ERR(svn_wc__db_scan_addition(&status, NULL,
-                                       NULL, NULL, NULL, NULL, NULL,
-                                       NULL, NULL, &db_moved_from_abspath,
-                                       &db_delete_op_root_abspath,
-                                       wc_ctx->db, local_abspath,
-                                       scratch_pool, scratch_pool));
-      if (status == svn_wc__db_status_moved_here)
-        {
-          if (moved_from_abspath)
-            *moved_from_abspath = apr_pstrdup(result_pool,
-                                              db_moved_from_abspath);
-          if (delete_op_root_abspath)
-            *delete_op_root_abspath = apr_pstrdup(result_pool,
-                                                  db_delete_op_root_abspath);
-        }
+      /* Return error for not added nodes */
+      if (err->apr_err != SVN_ERR_WC_PATH_UNEXPECTED_STATUS)
+        return svn_error_trace(err);
+
+      /* Path not moved here */
+      svn_error_clear(err);
+      return SVN_NO_ERROR;
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/props.c?rev=1457684&r1=1457683&r2=1457684&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/props.c Mon Mar 18 09:35:24 2013
@@ -198,7 +198,7 @@ svn_wc_merge_props3(svn_wc_notify_state_
 {
   int i;
   svn_wc__db_status_t status;
-  svn_kind_t kind;
+  svn_node_kind_t kind;
   apr_hash_t *pristine_props = NULL;
   apr_hash_t *actual_props;
   apr_hash_t *new_actual_props;
@@ -310,7 +310,7 @@ svn_wc_merge_props3(svn_wc_notify_state_
   {
     const char *dir_abspath;
 
-    if (kind == svn_kind_dir)
+    if (kind == svn_node_dir)
       dir_abspath = local_abspath;
     else
       dir_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
@@ -1866,7 +1866,8 @@ svn_wc_prop_set4(svn_wc_context_t *wc_ct
                  apr_pool_t *scratch_pool)
 {
   enum svn_prop_kind prop_kind = svn_property_kind2(name);
-  svn_kind_t kind;
+  svn_wc__db_status_t status;
+  svn_node_kind_t kind;
   svn_wc__db_t *db = wc_ctx->db;
 
   /* we don't do entry properties here */
@@ -1882,8 +1883,23 @@ svn_wc_prop_set4(svn_wc_context_t *wc_ct
                                         name, value, scratch_pool));
     }
 
-  SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath, FALSE, FALSE,
-                               scratch_pool));
+  SVN_ERR(svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL,
+                               wc_ctx->db, local_abspath,
+                               scratch_pool, scratch_pool));
+
+  if (status != svn_wc__db_status_normal
+      && status != svn_wc__db_status_added
+      && status != svn_wc__db_status_incomplete)
+    {
+      return svn_error_createf(SVN_ERR_WC_INVALID_SCHEDULE, NULL,
+                                  _("Can't set properties on '%s':"
+                                  " invalid status for updating properties."),
+                                  svn_dirent_local_style(local_abspath,
+                                                         scratch_pool));
+    }
 
   /* We have to do this little DIR_ABSPATH dance for backwards compat.
      But from 1.7 onwards, all locks are of infinite depth, and from 1.6
@@ -1897,7 +1913,7 @@ svn_wc_prop_set4(svn_wc_context_t *wc_ct
   {
     const char *dir_abspath;
 
-    if (kind == svn_kind_dir)
+    if (kind == svn_node_dir)
       dir_abspath = local_abspath;
     else
       dir_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
@@ -1906,10 +1922,9 @@ svn_wc_prop_set4(svn_wc_context_t *wc_ct
     SVN_ERR(svn_wc__write_check(db, dir_abspath, scratch_pool));
   }
 
-  if (depth == svn_depth_empty || kind != svn_kind_dir)
+  if (depth == svn_depth_empty || kind != svn_node_dir)
     {
       apr_hash_t *changelist_hash = NULL;
-      svn_error_t *err;
 
       if (changelist_filter && changelist_filter->nelts)
         SVN_ERR(svn_hash_from_cstring_keys(&changelist_hash, changelist_filter,
@@ -1919,23 +1934,13 @@ svn_wc_prop_set4(svn_wc_context_t *wc_ct
                                              changelist_hash, scratch_pool))
         return SVN_NO_ERROR;
 
-      err = do_propset(wc_ctx->db, local_abspath,
-                         kind == svn_kind_dir
+      SVN_ERR(do_propset(wc_ctx->db, local_abspath,
+                         kind == svn_node_dir
                             ? svn_node_dir
                             : svn_node_file,
                          name, value, skip_checks,
-                         notify_func, notify_baton, scratch_pool);
-
-      if (err && err->apr_err == SVN_ERR_WC_PATH_UNEXPECTED_STATUS)
-        {
-          err = svn_error_createf(SVN_ERR_WC_INVALID_SCHEDULE, err,
-                                  _("Can't set properties on '%s':"
-                                  " invalid status for updating properties."),
-                                  svn_dirent_local_style(local_abspath,
-                                                         scratch_pool));
-        }
+                         notify_func, notify_baton, scratch_pool));
 
-      SVN_ERR(err);
     }
   else
     {
@@ -2309,7 +2314,7 @@ svn_wc__get_iprops(apr_array_header_t **
                    apr_pool_t *scratch_pool)
 {
   return svn_error_trace(
-            svn_wc__db_read_inherited_props(inherited_props,
+            svn_wc__db_read_inherited_props(inherited_props, NULL,
                                             wc_ctx->db, local_abspath,
                                             propname,
                                             result_pool, scratch_pool));

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/questions.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/questions.c?rev=1457684&r1=1457683&r2=1457684&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/questions.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/questions.c Mon Mar 18 09:35:24 2013
@@ -224,7 +224,7 @@ svn_wc__internal_file_modified_p(svn_boo
   svn_stream_t *pristine_stream;
   svn_filesize_t pristine_size;
   svn_wc__db_status_t status;
-  svn_kind_t kind;
+  svn_node_kind_t kind;
   const svn_checksum_t *checksum;
   svn_filesize_t recorded_size;
   apr_time_t recorded_mod_time;
@@ -245,7 +245,7 @@ svn_wc__internal_file_modified_p(svn_boo
   /* If we don't have a pristine or the node has a status that allows a
      pristine, just say that the node is modified */
   if (!checksum
-      || (kind != svn_kind_file)
+      || (kind != svn_node_file)
       || ((status != svn_wc__db_status_normal)
           && (status != svn_wc__db_status_added)))
     {
@@ -363,13 +363,14 @@ svn_wc_text_modified_p2(svn_boolean_t *m
 
 
 
-svn_error_t *
-svn_wc__internal_conflicted_p(svn_boolean_t *text_conflicted_p,
-                              svn_boolean_t *prop_conflicted_p,
-                              svn_boolean_t *tree_conflicted_p,
-                              svn_wc__db_t *db,
-                              const char *local_abspath,
-                              apr_pool_t *scratch_pool)
+static svn_error_t *
+internal_conflicted_p(svn_boolean_t *text_conflicted_p,
+                      svn_boolean_t *prop_conflicted_p,
+                      svn_boolean_t *tree_conflicted_p,
+                      svn_boolean_t ignore_move_edit,
+                      svn_wc__db_t *db,
+                      const char *local_abspath,
+                      apr_pool_t *scratch_pool)
 {
   svn_node_kind_t kind;
   svn_skel_t *conflicts;
@@ -470,7 +471,19 @@ svn_wc__internal_conflicted_p(svn_boolea
         }
     }
 
-  /* tree_conflicts don't have markers, so don't need checking */
+  if (tree_conflicted_p && *tree_conflicted_p && ignore_move_edit)
+    {
+      svn_wc_conflict_reason_t reason;
+      svn_wc_conflict_action_t action;
+
+      SVN_ERR(svn_wc__conflict_read_tree_conflict(&reason, &action, NULL,
+                                                  db, local_abspath, conflicts,
+                                                  scratch_pool, scratch_pool));
+
+      if (reason == svn_wc_conflict_reason_moved_away
+          && action == svn_wc_conflict_action_edit)
+        *tree_conflicted_p = FALSE;
+    }
 
   if (resolved_text || resolved_props)
     {
@@ -492,6 +505,42 @@ svn_wc__internal_conflicted_p(svn_boolea
 }
 
 svn_error_t *
+svn_wc__internal_conflicted_p(svn_boolean_t *text_conflicted_p,
+                              svn_boolean_t *prop_conflicted_p,
+                              svn_boolean_t *tree_conflicted_p,
+                              svn_wc__db_t *db,
+                              const char *local_abspath,
+                              apr_pool_t *scratch_pool)
+{
+  SVN_ERR(internal_conflicted_p(text_conflicted_p, prop_conflicted_p,
+                                tree_conflicted_p, FALSE,
+                                db, local_abspath, scratch_pool));
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_wc__conflicted_for_update_p(svn_boolean_t *conflicted_p,
+                                svn_wc__db_t *db,
+                                const char *local_abspath,
+                                svn_boolean_t tree_only,
+                                apr_pool_t *scratch_pool)
+{
+  svn_boolean_t text_conflicted, prop_conflicted, tree_conflicted;
+
+  SVN_ERR(internal_conflicted_p(tree_only ? NULL: &text_conflicted,
+                                tree_only ? NULL: &prop_conflicted,
+                                &tree_conflicted, TRUE,
+                                db, local_abspath, scratch_pool));
+  if (tree_only)
+    *conflicted_p = tree_conflicted;
+  else
+    *conflicted_p = text_conflicted || prop_conflicted || tree_conflicted;
+
+  return SVN_NO_ERROR;
+}
+
+
+svn_error_t *
 svn_wc_conflicted_p3(svn_boolean_t *text_conflicted_p,
                      svn_boolean_t *prop_conflicted_p,
                      svn_boolean_t *tree_conflicted_p,

Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/relocate.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/relocate.c?rev=1457684&r1=1457683&r2=1457684&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/relocate.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/relocate.c Mon Mar 18 09:35:24 2013
@@ -85,7 +85,7 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct
                  void *validator_baton,
                  apr_pool_t *scratch_pool)
 {
-  svn_kind_t kind;
+  svn_node_kind_t kind;
   const char *repos_relpath;
   const char *old_repos_root, *old_url;
   const char *new_repos_root, *new_url;
@@ -131,7 +131,7 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct
                                wc_ctx->db, local_abspath, scratch_pool,
                                scratch_pool));
 
-  if (kind != svn_kind_dir)
+  if (kind != svn_node_dir)
     return svn_error_create(SVN_ERR_CLIENT_INVALID_RELOCATION, NULL,
                             _("Cannot relocate a single file"));