subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r1449262 [11/25] - in /subversion/branches/ev2-export: ./ build/ build/ac-macros/ build/generator/ build/generator/swig/ build/generator/templates/ build/win32/ contrib/server-side/fsfsfixer/fixer/ contrib/server-side/svncutter/ notes/ note...
Date Sat, 23 Feb 2013 01:25:44 GMT
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/diff_local.c?rev=1449262&r1=1449261&r2=1449262&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/diff_local.c Sat Feb 23 01:25:38 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.
- */
-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.
+/* 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 *
-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_kind_t base_kind;
+    svn_kind_t db_kind = svn__kind_from_node_kind(status->kind, FALSE);
+    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_kind_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_kind_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_kind_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_kind_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_kind_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_kind_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_kind_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;
 }
 
@@ -546,6 +441,7 @@ svn_wc_diff6(svn_wc_context_t *wc_ctx,
   struct diff_baton eb = { 0 };
   svn_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,
@@ -554,24 +450,41 @@ svn_wc_diff6(svn_wc_context_t *wc_ctx,
                                scratch_pool));
 
   if (kind == svn_kind_dir)
-      eb.anchor_abspath = local_abspath;
+    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 +499,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/ev2-export/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/externals.c?rev=1449262&r1=1449261&r2=1449262&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/externals.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/externals.c Sat Feb 23 01:25:38 2013
@@ -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));
     }
 

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/info.c?rev=1449262&r1=1449261&r2=1449262&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/info.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/info.c Sat Feb 23 01:25:38 2013
@@ -536,10 +536,13 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
 
       if (!repos_root_url)
         {
-          SVN_ERR(svn_wc__internal_get_repos_info(&repos_root_url,
+          SVN_ERR(svn_wc__internal_get_repos_info(NULL, NULL,
+                                                  &repos_root_url,
                                                   &repos_uuid,
                                                   wc_ctx->db,
-                                                  local_abspath,
+                                                  svn_dirent_dirname(
+                                                            local_abspath,
+                                                            iterpool),
                                                   scratch_pool,
                                                   iterpool));
         }

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/merge.c?rev=1449262&r1=1449261&r2=1449262&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/merge.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/merge.c Sat Feb 23 01:25:38 2013
@@ -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)
@@ -1396,11 +1397,27 @@ svn_wc_merge5(enum svn_wc_merge_outcome_
                                scratch_pool));
 
       if (conflict_skel && conflict_func)
-        SVN_ERR(svn_wc__conflict_invoke_resolver(wc_ctx->db, target_abspath,
-                                                 conflict_skel, merge_options,
-                                                 conflict_func, conflict_baton,
-                                                 cancel_func, cancel_baton,
-                                                 scratch_pool));
+        {
+          svn_boolean_t text_conflicted, prop_conflicted;
+
+          SVN_ERR(svn_wc__conflict_invoke_resolver(
+                    wc_ctx->db, target_abspath,
+                    conflict_skel, merge_options,
+                    conflict_func, conflict_baton,
+                    cancel_func, cancel_baton,
+                    scratch_pool));
+
+          /* Reset *MERGE_CONTENT_OUTCOME etc. if a conflict was resolved. */
+          SVN_ERR(svn_wc__internal_conflicted_p(
+                    &text_conflicted, &prop_conflicted, NULL,
+                    wc_ctx->db, target_abspath, scratch_pool));
+          if (*merge_props_outcome == svn_wc_notify_state_conflicted
+              && ! prop_conflicted)
+            *merge_props_outcome = svn_wc_notify_state_merged;
+          if (*merge_content_outcome == svn_wc_merge_conflict
+              && ! text_conflicted)
+            *merge_content_outcome = svn_wc_merge_merged;
+        }
     }
   
   return SVN_NO_ERROR;

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/node.c?rev=1449262&r1=1449261&r2=1449262&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/node.c Sat Feb 23 01:25:38 2013
@@ -139,44 +139,37 @@ svn_wc__node_get_children(const apr_arra
 
 
 svn_error_t *
-svn_wc__internal_get_repos_info(const char **repos_root_url,
+svn_wc__internal_get_repos_info(svn_revnum_t *revision,
+                                const char **repos_relpath,
+                                const char **repos_root_url,
                                 const char **repos_uuid,
                                 svn_wc__db_t *db,
                                 const char *local_abspath,
                                 apr_pool_t *result_pool,
                                 apr_pool_t *scratch_pool)
 {
-  svn_error_t *err;
   svn_wc__db_status_t status;
+  svn_boolean_t have_work;
 
-  err = svn_wc__db_read_info(&status, NULL, NULL, NULL,
-                             repos_root_url, repos_uuid,
-                             NULL, NULL, NULL, NULL, NULL, NULL,
-                             NULL, NULL, NULL, NULL, NULL, NULL,
-                             NULL, NULL, NULL, NULL, NULL, NULL,
-                             NULL, NULL, NULL,
-                             db, local_abspath,
-                             result_pool, scratch_pool);
-  if (err)
-    {
-      if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND
-          && err->apr_err != SVN_ERR_WC_NOT_WORKING_COPY)
-        return svn_error_trace(err);
+  SVN_ERR(svn_wc__db_read_info(&status, NULL, revision, repos_relpath,
+                               repos_root_url, repos_uuid,
+                               NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, &have_work,
+                               db, local_abspath,
+                               result_pool, scratch_pool));
 
-      /* This node is not versioned. Return NULL repos info.  */
-      svn_error_clear(err);
+  if ((repos_relpath ? *repos_relpath != NULL : TRUE)
+      && (repos_root_url ? *repos_root_url  != NULL: TRUE)
+      && (repos_uuid ? *repos_uuid != NULL : TRUE))
+    return SVN_NO_ERROR; /* We got the requested information */
 
-      if (repos_root_url)
-        *repos_root_url = NULL;
-      if (repos_uuid)
-        *repos_uuid = NULL;
-      return SVN_NO_ERROR;
+  if (!have_work) /* not-present, (server-)excluded? */
+    {
+      return SVN_NO_ERROR; /* Can't fetch more */
     }
 
-  if (((repos_root_url && *repos_root_url) || !repos_root_url)
-      && ((repos_uuid && *repos_uuid) || !repos_uuid))
-    return SVN_NO_ERROR;
-
   if (status == svn_wc__db_status_deleted)
     {
       const char *base_del_abspath, *wrk_del_abspath;
@@ -187,113 +180,82 @@ svn_wc__internal_get_repos_info(const ch
                                        scratch_pool, scratch_pool));
 
       if (base_del_abspath)
-        SVN_ERR(svn_wc__db_scan_base_repos(NULL,repos_root_url,
-                                           repos_uuid, db, base_del_abspath,
+        {
+          SVN_ERR(svn_wc__db_base_get_info(NULL, NULL, NULL, repos_relpath,
+                                           repos_root_url, repos_uuid, NULL,
+                                           NULL, NULL, NULL, NULL, NULL, NULL,
+                                           NULL, NULL, NULL,
+                                           db, base_del_abspath,
                                            result_pool, scratch_pool));
+
+          /* If we have a repos_relpath, it is of the op-root */
+          if (repos_relpath)
+            *repos_relpath = svn_relpath_join(*repos_relpath,
+                                svn_dirent_skip_ancestor(base_del_abspath,
+                                                         local_abspath),
+                                              result_pool);
+          /* We keep revision as SVN_INVALID_REVNUM */
+        }
       else if (wrk_del_abspath)
-        SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL,
-                                         repos_root_url, repos_uuid,
-                                         NULL, NULL, NULL, NULL, NULL, NULL,
-                                         db, svn_dirent_dirname(
+        {
+          const char *op_root_abspath = NULL;
+
+          SVN_ERR(svn_wc__db_scan_addition(NULL, repos_relpath
+                                                    ? &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),
-                                         result_pool, scratch_pool));
+                                           result_pool, scratch_pool));
+
+          /* If we have a repos_relpath, it is of the op-root */
+          if (repos_relpath)
+            *repos_relpath = svn_relpath_join(
+                                    *repos_relpath,
+                                    svn_dirent_skip_ancestor(op_root_abspath,
+                                                             local_abspath),
+                                    result_pool);
+        }
     }
-  else if (status == svn_wc__db_status_added)
+  else /* added, or WORKING incomplete */
     {
+      const char *op_root_abspath = NULL;
+
       /* We have an addition. scan_addition() will find the intended
          repository location by scanning up the tree.  */
-      SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL,
-                                       repos_root_url, repos_uuid,
-                                       NULL, NULL, NULL, NULL, NULL, NULL,
+      SVN_ERR(svn_wc__db_scan_addition(NULL, repos_relpath
+                                                    ? &op_root_abspath : NULL,
+                                       repos_relpath, repos_root_url,
+                                       repos_uuid, NULL, NULL, NULL, NULL,
+                                       NULL, NULL,
                                        db, local_abspath,
                                        result_pool, scratch_pool));
     }
-  else
-    SVN_ERR(svn_wc__db_scan_base_repos(NULL, repos_root_url, repos_uuid,
-                                       db, local_abspath,
-                                       result_pool, scratch_pool));
 
   SVN_ERR_ASSERT(repos_root_url == NULL || *repos_root_url != NULL);
   SVN_ERR_ASSERT(repos_uuid == NULL || *repos_uuid != NULL);
   return SVN_NO_ERROR;
 }
 
-/* ### This is essentially a copy-paste of svn_wc__internal_get_url().
- * ### If we decide to keep this one, then it should be rewritten to avoid
- * ### code duplication.*/
 svn_error_t *
-svn_wc__internal_get_repos_relpath(const char **repos_relpath,
-                                   svn_wc__db_t *db,
-                                   const char *local_abspath,
-                                   apr_pool_t *result_pool,
-                                   apr_pool_t *scratch_pool)
-{
-  svn_wc__db_status_t status;
-  svn_boolean_t have_base;
-
-  SVN_ERR(svn_wc__db_read_info(&status, NULL, NULL, repos_relpath,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL, NULL,
-                               &have_base, NULL, NULL,
-                               db, local_abspath,
-                               result_pool, scratch_pool));
-  if (*repos_relpath == NULL)
-    {
-      if (status == svn_wc__db_status_added)
-        {
-          SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, repos_relpath,
-                                           NULL, NULL, NULL, NULL,
-                                           NULL, NULL, NULL, NULL,
-                                           db, local_abspath,
-                                           result_pool, scratch_pool));
-        }
-      else if (have_base)
-        {
-          SVN_ERR(svn_wc__db_scan_base_repos(repos_relpath, NULL,
-                                             NULL,
-                                             db, local_abspath,
-                                             result_pool, scratch_pool));
-        }
-      else if (status == svn_wc__db_status_excluded
-               || (!have_base && (status == svn_wc__db_status_deleted)))
-        {
-          const char *parent_abspath, *name, *parent_relpath;
-
-          svn_dirent_split(&parent_abspath, &name, local_abspath,
-                           scratch_pool);
-          SVN_ERR(svn_wc__internal_get_repos_relpath(&parent_relpath, db,
-                                                     parent_abspath,
-                                                     scratch_pool,
-                                                     scratch_pool));
-
-          if (parent_relpath)
-            *repos_relpath = svn_relpath_join(parent_relpath, name,
-                                              result_pool);
-        }
-      else
-        {
-          /* Status: obstructed, obstructed_add */
-          *repos_relpath = NULL;
-          return SVN_NO_ERROR;
-        }
-    }
-
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_wc__node_get_repos_info(const char **repos_root_url,
+svn_wc__node_get_repos_info(svn_revnum_t *revision,
+                            const char **repos_relpath,
+                            const char **repos_root_url,
                             const char **repos_uuid,
                             svn_wc_context_t *wc_ctx,
                             const char *local_abspath,
                             apr_pool_t *result_pool,
                             apr_pool_t *scratch_pool)
 {
-  return svn_error_trace(svn_wc__internal_get_repos_info(
-            repos_root_url, repos_uuid, wc_ctx->db, local_abspath,
-            result_pool, scratch_pool));
+  return svn_error_trace(
+            svn_wc__internal_get_repos_info(revision,
+                                            repos_relpath,
+                                            repos_root_url,
+                                            repos_uuid,
+                                            wc_ctx->db, local_abspath,
+                                            result_pool, scratch_pool));
 }
 
 /* Convert DB_KIND into the appropriate NODE_KIND value.
@@ -311,23 +273,7 @@ convert_db_kind_to_node_kind(svn_node_ki
                              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 = svn__node_kind_from_kind(db_kind);
 
   /* Make sure hidden nodes return svn_node_none. */
   if (! show_hidden)
@@ -412,20 +358,6 @@ svn_wc__node_get_url(const char **url,
                                              result_pool, scratch_pool));
 }
 
-svn_error_t *
-svn_wc__node_get_repos_relpath(const char **repos_relpath,
-                               svn_wc_context_t *wc_ctx,
-                               const char *local_abspath,
-                               apr_pool_t *result_pool,
-                               apr_pool_t *scratch_pool)
-{
-  return svn_error_trace(svn_wc__internal_get_repos_relpath(repos_relpath,
-                                                            wc_ctx->db,
-                                                            local_abspath,
-                                                            result_pool,
-                                                            scratch_pool));
-}
-
 /* A recursive node-walker, helper for svn_wc__internal_walk_children().
  *
  * Call WALK_CALLBACK with WALK_BATON on all children (recursively) of
@@ -644,17 +576,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);
@@ -713,16 +658,19 @@ svn_wc__node_get_base(svn_revnum_t *revi
                       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,
                       apr_pool_t *result_pool,
                       apr_pool_t *scratch_pool)
 {
   svn_error_t *err;
+  svn_wc__db_lock_t *lock;
 
   err = svn_wc__db_base_get_info(NULL, NULL, revision, repos_relpath,
                                  repos_root_url, repos_uuid, NULL,
-                                 NULL, NULL, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, NULL, NULL,
+                                 lock_token ? &lock : NULL,
                                  NULL, NULL, NULL,
                                  wc_ctx->db, local_abspath,
                                  result_pool, scratch_pool);
@@ -737,10 +685,15 @@ svn_wc__node_get_base(svn_revnum_t *revi
         *repos_root_url = NULL;
       if (repos_uuid)
         *repos_uuid = NULL;
+      if (lock_token)
+        *lock_token = NULL;
       return SVN_NO_ERROR;
     }
   SVN_ERR(err);
 
+  if (lock_token)
+    *lock_token = lock ? lock->token : NULL;
+
   SVN_ERR_ASSERT(!revision || SVN_IS_VALID_REVNUM(*revision));
   SVN_ERR_ASSERT(!repos_relpath || *repos_relpath);
   SVN_ERR_ASSERT(!repos_root_url || *repos_root_url);
@@ -785,52 +738,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 */
-    }
-
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_wc__node_get_lock_info(const char **lock_token,
-                           const char **lock_owner,
-                           const char **lock_comment,
-                           apr_time_t *lock_date,
-                           svn_wc_context_t *wc_ctx,
-                           const char *local_abspath,
-                           apr_pool_t *result_pool,
-                           apr_pool_t *scratch_pool)
-{
-  svn_wc__db_lock_t *lock;
-  svn_error_t *err;
-
-  err = svn_wc__db_base_get_info(NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                                 NULL, NULL, NULL, NULL, NULL, &lock, NULL,
-                                 NULL, NULL,
-                                 wc_ctx->db, local_abspath,
-                                 result_pool, scratch_pool);
-
-  if (err)
-    {
-      if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
-        return svn_error_trace(err);
-
-      svn_error_clear(err);
-      lock = NULL;
-    }
-  if (lock_token)
-    *lock_token = lock ? lock->token : NULL;
-  if (lock_owner)
-    *lock_owner = lock ? lock->owner : NULL;
-  if (lock_comment)
-    *lock_comment = lock ? lock->comment : NULL;
-  if (lock_date)
-    *lock_date = lock ? lock->date : 0;
+  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;
 }
@@ -1300,6 +1214,8 @@ svn_error_t *
 svn_wc__check_for_obstructions(svn_wc_notify_state_t *obstruction_state,
                                svn_node_kind_t *kind,
                                svn_boolean_t *deleted,
+                               svn_boolean_t *excluded,
+                               svn_depth_t *parent_depth,
                                svn_wc_context_t *wc_ctx,
                                const char *local_abspath,
                                svn_boolean_t no_wcroot_check,
@@ -1315,6 +1231,10 @@ svn_wc__check_for_obstructions(svn_wc_no
     *kind = svn_node_none;
   if (deleted)
     *deleted = FALSE;
+  if (excluded)
+    *excluded = FALSE;
+  if (parent_depth)
+    *parent_depth = svn_depth_unknown;
 
   SVN_ERR(svn_io_check_path(local_abspath, &disk_kind, scratch_pool));
 
@@ -1337,9 +1257,10 @@ svn_wc__check_for_obstructions(svn_wc_no
         }
 
       err = svn_wc__db_read_info(&status, &db_kind, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, parent_depth, 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, svn_dirent_dirname(local_abspath,
                                                                 scratch_pool),
                                  scratch_pool, scratch_pool);
@@ -1400,6 +1321,9 @@ svn_wc__check_for_obstructions(svn_wc_no
 
       case svn_wc__db_status_excluded:
       case svn_wc__db_status_server_excluded:
+        if (excluded)
+          *excluded = TRUE;
+        /* fall through */
       case svn_wc__db_status_incomplete:
         *obstruction_state = svn_wc_notify_state_missing;
         break;

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/old-and-busted.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/old-and-busted.c?rev=1449262&r1=1449261&r2=1449262&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/old-and-busted.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/old-and-busted.c Sat Feb 23 01:25:38 2013
@@ -1264,7 +1264,7 @@ svn_wc__read_entries_old(apr_hash_t **en
     }
 
   /* Fill in any implied fields. */
-  return resolve_to_defaults(*entries, result_pool);
+  return svn_error_trace(resolve_to_defaults(*entries, result_pool));
 }
 
 

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/props.c?rev=1449262&r1=1449261&r2=1449262&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/props.c Sat Feb 23 01:25:38 2013
@@ -349,12 +349,24 @@ svn_wc_merge_props3(svn_wc_notify_state_
     SVN_ERR(svn_wc__wq_run(db, local_abspath, cancel_func, cancel_baton,
                            scratch_pool));
 
+  /* If there is a conflict, try to resolve it. */
   if (conflict_skel && conflict_func)
-    SVN_ERR(svn_wc__conflict_invoke_resolver(db, local_abspath, conflict_skel,
-                                             NULL /* merge_options */,
-                                             conflict_func, conflict_baton,
-                                             cancel_func, cancel_baton,
-                                             scratch_pool));
+    {
+      svn_boolean_t prop_conflicted;
+
+      SVN_ERR(svn_wc__conflict_invoke_resolver(db, local_abspath, conflict_skel,
+                                               NULL /* merge_options */,
+                                               conflict_func, conflict_baton,
+                                               cancel_func, cancel_baton,
+                                               scratch_pool));
+
+      /* Reset *STATE if all prop conflicts were resolved. */
+      SVN_ERR(svn_wc__internal_conflicted_p(
+                NULL, &prop_conflicted, NULL,
+                wc_ctx->db, local_abspath, scratch_pool));
+      if (! prop_conflicted)
+        *state = svn_wc_notify_state_merged;
+    }
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/props.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/props.h?rev=1449262&r1=1449261&r2=1449262&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/props.h (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/props.h Sat Feb 23 01:25:38 2013
@@ -98,7 +98,13 @@ svn_wc__canonicalize_props(apr_hash_t **
    CONFLICT_SKEL itself must not be NULL.)
 
    If STATE is non-null, set *STATE to the state of the local properties
-   after the merge.  */
+   after the merge, one of:
+
+     svn_wc_notify_state_unchanged
+     svn_wc_notify_state_changed
+     svn_wc_notify_state_merged
+     svn_wc_notify_state_conflicted
+ */
 svn_error_t *
 svn_wc__merge_props(svn_skel_t **conflict_skel,
                     svn_wc_notify_state_t *state,

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/revert.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/revert.c?rev=1449262&r1=1449261&r2=1449262&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/revert.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/revert.c Sat Feb 23 01:25:38 2013
@@ -369,7 +369,7 @@ revert_restore(svn_wc__db_t *db,
       special = FALSE;
 #endif
     }
-  else
+  else if (!err)
     {
       if (finfo.filetype == APR_REG || finfo.filetype == APR_LNK)
         on_disk = svn_node_file;
@@ -382,6 +382,8 @@ revert_restore(svn_wc__db_t *db,
       special = (finfo.filetype == APR_LNK);
 #endif
     }
+  else
+    return svn_error_trace(err);
 
   if (copied_here)
     {

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/status.c?rev=1449262&r1=1449261&r2=1449262&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/status.c Sat Feb 23 01:25:38 2013
@@ -2945,9 +2945,10 @@ internal_status(svn_wc_status3_t **statu
     SVN_ERR(stat_wc_dirent_case_sensitive(&dirent, db, local_abspath,
                                           scratch_pool, scratch_pool));
 
-  if (node_status == svn_wc__db_status_not_present
-           || node_status == svn_wc__db_status_server_excluded
-           || node_status == svn_wc__db_status_excluded)
+  if (node_kind != svn_kind_unknown
+      && (node_status == svn_wc__db_status_not_present
+          || node_status == svn_wc__db_status_server_excluded
+          || node_status == svn_wc__db_status_excluded))
     {
       node_kind = svn_kind_unknown;
     }

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/tree_conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/tree_conflicts.c?rev=1449262&r1=1449261&r2=1449262&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/tree_conflicts.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/tree_conflicts.c Sat Feb 23 01:25:38 2013
@@ -406,6 +406,12 @@ svn_wc__add_tree_conflict(svn_wc_context
   svn_skel_t *conflict_skel;
   svn_error_t *err;
 
+  SVN_ERR_ASSERT(conflict != NULL);
+  SVN_ERR_ASSERT(conflict->operation == svn_wc_operation_merge
+                 || (conflict->reason != svn_wc_conflict_reason_moved_away
+                     && conflict->reason != svn_wc_conflict_reason_moved_here)
+                );
+
   /* Re-adding an existing tree conflict victim is an error. */
   err = svn_wc__internal_conflicted_p(NULL, NULL, &existing_conflict,
                                       wc_ctx->db, conflict->local_abspath,
@@ -418,7 +424,7 @@ svn_wc__add_tree_conflict(svn_wc_context
       svn_error_clear(err);
     }
   else if (existing_conflict)
-    return svn_error_createf(SVN_ERR_WC_CORRUPT, NULL,
+    return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
                              _("Attempt to add tree conflict that already "
                                "exists at '%s'"),
                              svn_dirent_local_style(conflict->local_abspath,
@@ -432,6 +438,7 @@ svn_wc__add_tree_conflict(svn_wc_context
                                                   conflict->local_abspath,
                                                   conflict->reason,
                                                   conflict->action,
+                                                  NULL,
                                                   scratch_pool, scratch_pool));
 
   switch(conflict->operation)



Mime
View raw message