You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2012/11/06 23:03:10 UTC

svn commit: r1406367 - in /subversion/branches/tree-read-api/subversion/libsvn_client: diff.c tree.c

Author: julianfoad
Date: Tue Nov  6 22:03:10 2012
New Revision: 1406367

URL: http://svn.apache.org/viewvc?rev=1406367&view=rev
Log:
On the old 'tree-read-api' branch: minor fixes.

* subversion/libsvn_client/diff.c
  (compare_two_trees): Use the path and kind of tree2 where applicable.

* subversion/libsvn_client/tree.c
  (svn_client__open_tree): Distinguish 'unversioned' from not found.

Modified:
    subversion/branches/tree-read-api/subversion/libsvn_client/diff.c
    subversion/branches/tree-read-api/subversion/libsvn_client/tree.c

Modified: subversion/branches/tree-read-api/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_client/diff.c?rev=1406367&r1=1406366&r2=1406367&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_client/diff.c Tue Nov  6 22:03:10 2012
@@ -262,7 +262,7 @@ compare_two_trees(svn_tree_t *tree1,
           SVN_ERR(svn_prop_diffs(&propchanges, props1, props2, scratch_pool));
 
           SVN_ERR(callbacks->file_added(NULL, NULL, NULL,
-                                        relpath1, empty_file, tmpfile2,
+                                        relpath2, empty_file, tmpfile2,
                                         rev, rev, NULL, NULL,
                                         NULL, SVN_INVALID_REVNUM, /* cp-from */
                                         propchanges, props1,
@@ -284,12 +284,12 @@ compare_two_trees(svn_tree_t *tree1,
           break;
         }
         case svn_kind_symlink:
-          SVN_DBG(("compare_two_trees: added symlink '%s'\n", relpath1));
+          SVN_DBG(("compare_two_trees: added symlink '%s'\n", relpath2));
           break;
         default:
           /* Unknown node kind. */
           SVN_DBG(("compare_two_trees: added '%s': unknown node kind %d\n",
-                   relpath1, kind1));
+                   relpath2, kind2));
           break;
         }
     }

Modified: subversion/branches/tree-read-api/subversion/libsvn_client/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_client/tree.c?rev=1406367&r1=1406366&r2=1406367&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_client/tree.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_client/tree.c Tue Nov  6 22:03:10 2012
@@ -741,11 +741,15 @@ svn_client__open_tree(svn_tree_t **tree,
   else
     {
       const char *abspath;
-      int wc_format;
+      svn_error_t *err;
+      svn_node_kind_t kind;
 
+      /* Read the working node kind just to find out whether it is in fact
+       * a versioned node. */
       SVN_ERR(svn_dirent_get_absolute(&abspath, path, scratch_pool));
-      SVN_ERR(svn_wc_check_wc2(&wc_format, ctx->wc_ctx, abspath, scratch_pool));
-      if (wc_format > 0)
+      err = svn_wc_read_kind(&kind, ctx->wc_ctx, abspath,
+                             TRUE /* show_hidden */, scratch_pool);
+      if (! err)
         {
           if (revision->kind == svn_opt_revision_working)
             SVN_ERR(svn_client__wc_working_tree(tree, abspath, ctx,
@@ -753,8 +757,16 @@ svn_client__open_tree(svn_tree_t **tree,
           else
             SVN_ERR(svn_client__wc_base_tree(tree, abspath, ctx, result_pool));
         }
+      else if (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND
+               || err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY)
+        {
+          svn_error_clear(err);
+          SVN_ERR(svn_client__disk_tree(tree, abspath, result_pool));
+        }
       else
-        SVN_ERR(svn_client__disk_tree(tree, abspath, result_pool));
+        {
+          SVN_ERR(err);
+        }
     }
 
   return SVN_NO_ERROR;