You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2014/02/21 17:22:27 UTC

svn commit: r1570619 - /subversion/trunk/subversion/libsvn_wc/node.c

Author: rhuijben
Date: Fri Feb 21 16:22:26 2014
New Revision: 1570619

URL: http://svn.apache.org/r1570619
Log:
* subversion/libsvn_wc/node.c
  (svn_wc__internal_get_origin): Always set output arguments.
    Avoid additional db queries in a few cases.

Modified:
    subversion/trunk/subversion/libsvn_wc/node.c

Modified: subversion/trunk/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=1570619&r1=1570618&r2=1570619&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Fri Feb 21 16:22:26 2014
@@ -926,9 +926,13 @@ svn_wc__internal_get_origin(svn_boolean_
   const char *original_repos_uuid;
   svn_revnum_t original_revision;
   svn_wc__db_status_t status;
+  svn_boolean_t have_more_work;
+  svn_boolean_t op_root;
 
   const char *tmp_repos_relpath;
 
+  if (copy_root_abspath)
+    *copy_root_abspath = NULL;
   if (!repos_relpath)
     repos_relpath = &tmp_repos_relpath;
 
@@ -938,8 +942,8 @@ svn_wc__internal_get_origin(svn_boolean_
                                &original_repos_relpath,
                                &original_repos_root_url,
                                &original_repos_uuid, &original_revision,
-                               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, is_copy,
+                               NULL, NULL, NULL, NULL, NULL, &op_root, NULL,
+                               NULL, NULL, &have_more_work, is_copy,
                                db, local_abspath, result_pool, scratch_pool));
 
   if (*repos_relpath)
@@ -957,6 +961,7 @@ svn_wc__internal_get_origin(svn_boolean_
 
   if (original_repos_relpath)
     {
+      /* We an have a copy */
       *repos_relpath = original_repos_relpath;
       if (revision)
         *revision = original_revision;
@@ -967,21 +972,19 @@ svn_wc__internal_get_origin(svn_boolean_
 
       if (copy_root_abspath == NULL)
         return SVN_NO_ERROR;
+      else if (op_root)
+        {
+          *copy_root_abspath = apr_pstrdup(result_pool, local_abspath);
+          return SVN_NO_ERROR;
+        }
     }
 
   {
     svn_boolean_t scan_working = FALSE;
 
-    if (status == svn_wc__db_status_added)
+    if (status == svn_wc__db_status_added
+        || (status == svn_wc__db_status_deleted && have_more_work))
       scan_working = TRUE;
-    else if (status == svn_wc__db_status_deleted)
-      {
-        svn_boolean_t have_base;
-        /* Is this a BASE or a WORKING delete? */
-        SVN_ERR(svn_wc__db_info_below_working(&have_base, &scan_working,
-                                              &status, db, local_abspath,
-                                              scratch_pool));
-      }
 
     if (scan_working)
       {