Author: rhuijben
Date: Mon Feb 23 21:48:36 2015
New Revision: 1661792

URL: http://svn.apache.org/r1661792
Log:
* subversion/libsvn_wc/status.c
  (get_repos_root_url_relpath): Avoid code duplication. Just use the new
    db operation to fetch the db info.

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

Modified: subversion/trunk/subversion/libsvn_wc/status.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/status.c?rev=1661792&r1=1661791&r2=1661792&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/status.c (original)
+++ subversion/trunk/subversion/libsvn_wc/status.c Mon Feb 23 21:48:36 2015
@@ -275,58 +275,15 @@ get_repos_root_url_relpath(const char **
       *repos_root_url = apr_pstrdup(result_pool, parent_repos_root_url);
       *repos_uuid = apr_pstrdup(result_pool, parent_repos_uuid);
     }
-  else if (info->status == svn_wc__db_status_added)
-    {
-      SVN_ERR(svn_wc__db_scan_addition(NULL, NULL,
-                                       repos_relpath, repos_root_url,
-                                       repos_uuid, NULL, NULL, NULL, NULL,
-                                       db, local_abspath,
-                                       result_pool, scratch_pool));
-    }
-  else if (info->status == svn_wc__db_status_deleted
-           && !info->have_more_work
-           && info->have_base)
-    {
-      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, local_abspath,
-                                       result_pool, scratch_pool));
-    }
-  else if (info->status == svn_wc__db_status_deleted)
-    {
-      const char *work_del_abspath;
-      const char *add_abspath;
-
-      /* Handles working DELETE and the special case where there is just
-         svn_wc__db_status_not_present in WORKING */
-
-      SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL, &work_del_abspath, NULL,
-                                       db, local_abspath,
-                                       scratch_pool, scratch_pool));
-
-      /* The parent of what has been deleted must be added */
-      add_abspath = svn_dirent_dirname(work_del_abspath, scratch_pool);
-
-      SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, repos_relpath,
-                                       repos_root_url, repos_uuid, NULL,
-                                       NULL, NULL, NULL,
-                                       db, add_abspath,
-                                       result_pool, scratch_pool));
-
-      *repos_relpath = svn_relpath_join(*repos_relpath,
-                                        svn_dirent_skip_ancestor(
-                                              add_abspath,
-                                              local_abspath),
-                                        result_pool);
-    }
   else
     {
-      *repos_relpath = NULL;
-      *repos_root_url = NULL;
-      *repos_uuid = NULL;
+      SVN_ERR(svn_wc__db_read_repos_info(NULL,
+                                         repos_relpath, repos_root_url,
+                                         repos_uuid,
+                                         db, local_abspath,
+                                         result_pool, scratch_pool));
     }
+
   return SVN_NO_ERROR;
 }
 


Reply via email to