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 2010/03/24 12:40:41 UTC

svn commit: r927018 - in /subversion/trunk/subversion/libsvn_wc: adm_files.c adm_files.h diff.c update_editor.c

Author: julianfoad
Date: Wed Mar 24 11:40:40 2010
New Revision: 927018

URL: http://svn.apache.org/viewvc?rev=927018&view=rev
Log:
Switch some WC text-base APIs to using abs-paths.

* subversion/libsvn_wc/adm_files.c,
  subversion/libsvn_wc/adm_files.h
  (svn_wc__sync_text_base): Require an abspath as input.
  (svn_wc__text_base_path, svn_wc__text_revert_path): Promise an abspath as
    output.

* subversion/libsvn_wc/diff.c
  (close_file): Remove a conversion to abspath that was already unused.

* subversion/libsvn_wc/update_editor.c
  (choose_base_paths): Promise an abspath as output.
  (svn_wc_add_repos_file4): Avoid a conversion to abspath that is now not
    needed.

Modified:
    subversion/trunk/subversion/libsvn_wc/adm_files.c
    subversion/trunk/subversion/libsvn_wc/adm_files.h
    subversion/trunk/subversion/libsvn_wc/diff.c
    subversion/trunk/subversion/libsvn_wc/update_editor.c

Modified: subversion/trunk/subversion/libsvn_wc/adm_files.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_files.c?rev=927018&r1=927017&r2=927018&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_files.c Wed Mar 24 11:40:40 2010
@@ -223,17 +223,15 @@ make_adm_subdir(const char *path,
 /*** Syncing files in the adm area. ***/
 
 
-/* Rename a tmp text-base file to its real text-base name.
-   The file had better already be closed. */
 svn_error_t *
-svn_wc__sync_text_base(const char *path, apr_pool_t *pool)
+svn_wc__sync_text_base(const char *local_abspath, apr_pool_t *pool)
 {
   const char *parent_path;
   const char *base_name;
   const char *tmp_path;
   const char *base_path;
 
-  svn_dirent_split(path, &parent_path, &base_name, pool);
+  svn_dirent_split(local_abspath, &parent_path, &base_name, pool);
 
   /* Extend tmp name. */
   tmp_path = extend_with_adm_name(parent_path, SVN_WC__BASE_EXT, TRUE, pool,
@@ -249,7 +247,7 @@ svn_wc__sync_text_base(const char *path,
 }
 
 svn_error_t *
-svn_wc__text_base_path(const char **result_path,
+svn_wc__text_base_path(const char **result_abspath,
                        svn_wc__db_t *db,
                        const char *local_abspath,
                        svn_boolean_t tmp,
@@ -260,19 +258,19 @@ svn_wc__text_base_path(const char **resu
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   svn_dirent_split(local_abspath, &newpath, &base_name, pool);
-  *result_path = extend_with_adm_name(newpath,
-                                      SVN_WC__BASE_EXT,
-                                      tmp,
-                                      pool,
-                                      SVN_WC__ADM_TEXT_BASE,
-                                      base_name,
-                                      NULL);
+  *result_abspath = extend_with_adm_name(newpath,
+                                         SVN_WC__BASE_EXT,
+                                         tmp,
+                                         pool,
+                                         SVN_WC__ADM_TEXT_BASE,
+                                         base_name,
+                                         NULL);
 
   return SVN_NO_ERROR;
 }
 
 svn_error_t *
-svn_wc__text_revert_path(const char **result_path,
+svn_wc__text_revert_path(const char **result_abspath,
                          svn_wc__db_t *db,
                          const char *local_abspath,
                          apr_pool_t *pool)
@@ -282,13 +280,13 @@ svn_wc__text_revert_path(const char **re
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   svn_dirent_split(local_abspath, &newpath, &base_name, pool);
-  *result_path = extend_with_adm_name(newpath,
-                                      SVN_WC__REVERT_EXT,
-                                      FALSE,
-                                      pool,
-                                      SVN_WC__ADM_TEXT_BASE,
-                                      base_name,
-                                      NULL);
+  *result_abspath = extend_with_adm_name(newpath,
+                                         SVN_WC__REVERT_EXT,
+                                         FALSE,
+                                         pool,
+                                         SVN_WC__ADM_TEXT_BASE,
+                                         base_name,
+                                         NULL);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_wc/adm_files.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_files.h?rev=927018&r1=927017&r2=927018&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_files.h (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_files.h Wed Mar 24 11:40:40 2010
@@ -53,16 +53,16 @@ svn_boolean_t svn_wc__adm_area_exists(co
 
 
 /* Atomically rename a temporary text-base file to its canonical
-   location.  PATH is the path of the working file whose text-base is
+   location.  LOCAL_ABSPATH is the path of the working file whose text-base is
    to be moved.  The tmp file should be closed already. */
 svn_error_t *
-svn_wc__sync_text_base(const char *path, apr_pool_t *pool);
+svn_wc__sync_text_base(const char *local_abspath, apr_pool_t *pool);
 
 
-/* Set *RESULT_PATH to the absolute path to LOCAL_ABSPATH's text-base file,
+/* Set *RESULT_ABSPATH to the absolute path to LOCAL_ABSPATH's text-base file,
    or, if TMP is set, to its temporary text-base file. */
 svn_error_t *
-svn_wc__text_base_path(const char **result_path,
+svn_wc__text_base_path(const char **result_abspath,
                        svn_wc__db_t *db,
                        const char *local_abspath,
                        svn_boolean_t tmp,

Modified: subversion/trunk/subversion/libsvn_wc/diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/diff.c?rev=927018&r1=927017&r2=927018&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/diff.c (original)
+++ subversion/trunk/subversion/libsvn_wc/diff.c Wed Mar 24 11:40:40 2010
@@ -1551,7 +1551,6 @@ close_file(void *file_baton,
   const char *localfile;
   /* The path to the temporary copy of the pristine repository version. */
   const char *temp_file_path;
-  const char *temp_file_abspath;
   svn_boolean_t modified;
   /* The working copy properties at the base of the wc->repos
      comparison: either BASE or WORKING. */
@@ -1590,8 +1589,6 @@ close_file(void *file_baton,
   if (!temp_file_path)
     SVN_ERR(svn_wc__text_base_path(&temp_file_path, eb->db, fb->local_abspath,
                                    FALSE, fb->pool));
-  SVN_ERR(svn_dirent_get_absolute(&temp_file_abspath, temp_file_path,
-                                  fb->pool));
 
   /* If the file isn't in the working copy (either because it was added
      in the BASE->repos diff or because we're diffing against WORKING

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=927018&r1=927017&r2=927018&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Wed Mar 24 11:40:40 2010
@@ -4063,8 +4063,8 @@ open_file(const char *path,
   return SVN_NO_ERROR;
 }
 
-/* For the given PATH, fill out OLD_TEXT_BASE with the permanent text-base
-   path, or (if the entry is replaced with history) to the permanent
+/* For the given LOCAL_ABSPATH, set *OLD_TEXT_BASE_ABSPATH to the permanent
+   text-base path, or (if the entry is replaced with history) to the permanent
    revert-base path.
 
    If REPLACED_P is non-NULL, set *REPLACED_P to whether or not the
@@ -4072,13 +4072,10 @@ open_file(const char *path,
    use the revert base).  If CHECKSUM_P is non-NULL and the path
    already has an entry, set *CHECKSUM_P to the entry's checksum.
 
-   ROOT_ACCESS is an access baton which can be used to find associated
-   batons for the directory that PATH resides within.
-
    Use SCRATCH_POOL for temporary allocation and for *CHECKSUM_P (if
-   applicable), but allocate OLD_TEXT_BASE in RESULT_POOL. */
+   applicable), but allocate OLD_TEXT_BASE_ABSPATH in RESULT_POOL. */
 static svn_error_t *
-choose_base_paths(const char **old_text_base,
+choose_base_paths(const char **old_text_base_abspath,
                   const char **checksum_p,
                   svn_boolean_t *replaced_p,
                   svn_wc__db_t *db,
@@ -4095,10 +4092,10 @@ choose_base_paths(const char **old_text_
   replaced = entry && entry->schedule == svn_wc_schedule_replace;
   /* ### Should use pristine api here */
   if (replaced)
-    SVN_ERR(svn_wc__text_revert_path(old_text_base,
+    SVN_ERR(svn_wc__text_revert_path(old_text_base_abspath,
                                      db, local_abspath, result_pool));
   else
-    SVN_ERR(svn_wc__text_base_path(old_text_base,
+    SVN_ERR(svn_wc__text_base_path(old_text_base_abspath,
                                    db, local_abspath, FALSE, result_pool));
 
   if (checksum_p)
@@ -5852,17 +5849,17 @@ svn_wc_add_repos_file4(svn_wc_context_t 
 {
   svn_wc__db_t *db = wc_ctx->db;
   const char *dir_abspath = svn_dirent_dirname(local_abspath, pool);
-  const char *tmp_text_base_path;
+  const char *tmp_text_base_abspath;
   svn_checksum_t *base_checksum;
   svn_stream_t *tmp_base_contents;
-  const char *text_base_path;
+  const char *text_base_abspath;
   const char *temp_dir_abspath;
   svn_stringbuf_t *pre_props_accum;
   svn_stringbuf_t *post_props_accum;
   struct last_change_info *last_change = NULL;
   svn_error_t *err;
 
-  SVN_ERR(svn_wc__text_base_path(&text_base_path, db, local_abspath,
+  SVN_ERR(svn_wc__text_base_path(&text_base_abspath, db, local_abspath,
                                  FALSE, pool));
   SVN_ERR(svn_wc__db_temp_wcroot_tempdir(&temp_dir_abspath, db,
                                          local_abspath, pool, pool));
@@ -5939,7 +5936,8 @@ svn_wc_add_repos_file4(svn_wc_context_t 
                                              pool));
 
             SVN_ERR(svn_wc__loggy_move(&pre_props_accum, dir_abspath,
-                                       text_base_path, dst_rtext, pool, pool));
+                                       text_base_abspath, dst_rtext,
+                                       pool, pool));
             SVN_ERR(svn_wc__loggy_revert_props_create(&pre_props_accum, db,
                                                       local_abspath,
                                                       dir_abspath,
@@ -6009,7 +6007,8 @@ svn_wc_add_repos_file4(svn_wc_context_t 
 
   /* Copy the text base contents into a temporary file so our log
      can refer to it. Compute its checksum as we copy. */
-  SVN_ERR(svn_wc__open_writable_base(&tmp_base_contents, &tmp_text_base_path,
+  SVN_ERR(svn_wc__open_writable_base(&tmp_base_contents,
+                                     &tmp_text_base_abspath,
                                      wc_ctx->db, local_abspath,
                                      pool, pool));
   new_base_contents = svn_stream_checksummed2(new_base_contents,
@@ -6049,15 +6048,11 @@ svn_wc_add_repos_file4(svn_wc_context_t 
 
   /* Install new text base. */
   {
-    const char *tmp_text_base_abspath;
     svn_wc_entry_t tmp_entry;
 
-    SVN_ERR(svn_dirent_get_absolute(&tmp_text_base_abspath, tmp_text_base_path,
-                                    pool));
-
     /* Write out log commands to set up the new text base and its checksum. */
     SVN_ERR(install_text_base(&post_props_accum, dir_abspath,
-                              tmp_text_base_abspath, text_base_path,
+                              tmp_text_base_abspath, text_base_abspath,
                               pool, pool));
     tmp_entry.checksum = svn_checksum_to_cstring(base_checksum, pool);