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/05/20 17:58:56 UTC

svn commit: r946680 - in /subversion/trunk/subversion/libsvn_wc: adm_files.c adm_files.h workqueue.c

Author: julianfoad
Date: Thu May 20 15:58:56 2010
New Revision: 946680

URL: http://svn.apache.org/viewvc?rev=946680&view=rev
Log:
Tweak svn_wc__sync_text_base(), mainly to ensure it uses
svn_wc__text_base_path() so that all references to the text base path go
through that one function.  No functional change.

* subversion/libsvn_wc/adm_files.h,
  subversion/libsvn_wc/adm_files.c
  (svn_wc__sync_text_base): Take a 'db' argument, as functions like this
    usually do.  Rename 'pool' to 'scratch_pool'.  In the implementation,
    use svn_wc__text_base_path() instead of in-line equivalent code.

* subversion/libsvn_wc/workqueue.c
  (install_committed_file): Pass a 'db' argument to svn_wc__sync_text_base().

Modified:
    subversion/trunk/subversion/libsvn_wc/adm_files.c
    subversion/trunk/subversion/libsvn_wc/adm_files.h
    subversion/trunk/subversion/libsvn_wc/workqueue.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=946680&r1=946679&r2=946680&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_files.c Thu May 20 15:58:56 2010
@@ -189,23 +189,19 @@ make_adm_subdir(const char *path,
 
 
 svn_error_t *
-svn_wc__sync_text_base(const char *local_abspath,
+svn_wc__sync_text_base(svn_wc__db_t *db,
+                       const char *local_abspath,
                        const char *tmp_text_base_abspath,
-                       apr_pool_t *pool)
+                       apr_pool_t *scratch_pool)
 {
-  const char *parent_path;
-  const char *base_name;
   const char *base_path;
 
-  svn_dirent_split(local_abspath, &parent_path, &base_name, pool);
+  SVN_ERR(svn_wc__text_base_path(&base_path, db, local_abspath, scratch_pool));
 
-  /* Extend real name. */
-  base_path = simple_extend(parent_path, FALSE, SVN_WC__ADM_TEXT_BASE,
-                            base_name, SVN_WC__BASE_EXT, pool);
-
-  /* Rename. */
-  SVN_ERR(svn_io_file_rename(tmp_text_base_abspath, base_path, pool));
-  return svn_error_return(svn_io_set_file_read_only(base_path, FALSE, pool));
+  SVN_ERR(svn_io_file_rename(tmp_text_base_abspath, base_path, scratch_pool));
+  SVN_ERR(svn_io_set_file_read_only(base_path, FALSE, scratch_pool));
+
+  return SVN_NO_ERROR;
 }
 
 svn_error_t *

Modified: subversion/trunk/subversion/libsvn_wc/adm_files.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_files.h?rev=946680&r1=946679&r2=946680&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_files.h (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_files.h Thu May 20 15:58:56 2010
@@ -53,12 +53,13 @@ svn_boolean_t svn_wc__adm_area_exists(co
 
 
 /* Atomically rename a temporary text-base file TMP_TEXT_BASE_ABSPATH to its
-   canonical location.  LOCAL_ABSPATH is the path of the working file whose
+   canonical location.  LOCAL_ABSPATH in DB is 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 *local_abspath,
+svn_wc__sync_text_base(svn_wc__db_t *db,
+                       const char *local_abspath,
                        const char *tmp_text_base_path,
-                       apr_pool_t *pool);
+                       apr_pool_t *scratch_pool);
 
 
 /* Set *RESULT_ABSPATH to the absolute path to where LOCAL_ABSPATH's

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=946680&r1=946679&r2=946680&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Thu May 20 15:58:56 2010
@@ -1195,7 +1195,8 @@ install_committed_file(svn_boolean_t *ov
 
   /* Install the new text base if one is waiting. */
   if (tmp_text_base_abspath != NULL)
-    SVN_ERR(svn_wc__sync_text_base(file_abspath, tmp_text_base_abspath, scratch_pool));
+    SVN_ERR(svn_wc__sync_text_base(db, file_abspath, tmp_text_base_abspath,
+                                   scratch_pool));
 
   return SVN_NO_ERROR;
 }