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 13:31:57 UTC

svn commit: r927034 - in /subversion/trunk: notes/wc-ng/use-of-tmp-text-base-path subversion/libsvn_wc/adm_files.c subversion/libsvn_wc/adm_files.h subversion/libsvn_wc/workqueue.c

Author: julianfoad
Date: Wed Mar 24 12:31:57 2010
New Revision: 927034

URL: http://svn.apache.org/viewvc?rev=927034&view=rev
Log:
Remove one place where the path to a WC temporary text base file was
re-derived, and pass in the previously obtained path instead.

* subversion/libsvn_wc/adm_files.c,
  subversion/libsvn_wc/adm_files.h
  (svn_wc__sync_text_base): Take the temp base file path as a parameter
    instead of deriving it.

* subversion/libsvn_wc/workqueue.c
  (install_committed_file): Pass the temp text base path when calling
    svn_wc__sync_text_base().

* notes/wc-ng/use-of-tmp-text-base-path
  Update accordingly.

Modified:
    subversion/trunk/notes/wc-ng/use-of-tmp-text-base-path
    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/notes/wc-ng/use-of-tmp-text-base-path
URL: http://svn.apache.org/viewvc/subversion/trunk/notes/wc-ng/use-of-tmp-text-base-path?rev=927034&r1=927033&r2=927034&view=diff
==============================================================================
--- subversion/trunk/notes/wc-ng/use-of-tmp-text-base-path (original)
+++ subversion/trunk/notes/wc-ng/use-of-tmp-text-base-path Wed Mar 24 12:31:57 2010
@@ -1,5 +1,7 @@
 
-Call graphs of the use of the WC-1 temporary text base path, as of r926814.
+Call graphs of the use of the WC-1 temporary text base path, as of the
+revision (r927034 or perhaps a bit higher) in which we start to pass the
+temp text base path in to svn_wc__sync_text_base().
 
 This is to help us eliminate the use of this path and replace it with a more
 encapsulated way of referring to the new text base, as part of migration to a
@@ -50,20 +52,20 @@ path is obtained, and the extent to whic
         |^          log_do_committed()
         |^                    |
         |^          install_committed_file()
-        |^            |^[T]           |
-        |^            |^              |
-        |^            |^              |
-        |^            |^              |
-  svn_wc__text_base_path(tmp=TRUE)    |
-            |^                        |
-            |^    svn_wc__sync_text_base()
+        |^            |^              |v
+        |^            |^              |v
+        |^            |^              |v
+        |^            |^              |v
+  svn_wc__text_base_path(tmp=TRUE)    |v
+            |^                        |v
+            |^                      svn_wc__sync_text_base()
+            |^                                 |v
+            |^                              svn_io_rename()
+            |^    [initialization]            + svn_io_set_file_read_only()
+            |^      |
+            |^    make_adm_subdir()
             |^      |^
             |^      |^
-            |^      |^    [initialization]
-            |^      |^      |
-            |^      |^    make_adm_subdir()
-            |^      |^      |^
-            |^      |^      |^
           extend_with_adm_name(tmp=TRUE)
 
 

Modified: subversion/trunk/subversion/libsvn_wc/adm_files.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_files.c?rev=927034&r1=927033&r2=927034&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_files.c Wed Mar 24 12:31:57 2010
@@ -224,25 +224,22 @@ make_adm_subdir(const char *path,
 
 
 svn_error_t *
-svn_wc__sync_text_base(const char *local_abspath, apr_pool_t *pool)
+svn_wc__sync_text_base(const char *local_abspath,
+                       const char *tmp_text_base_abspath,
+                       apr_pool_t *pool)
 {
   const char *parent_path;
   const char *base_name;
-  const char *tmp_path;
   const char *base_path;
 
   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,
-                                  SVN_WC__ADM_TEXT_BASE, base_name, NULL);
-
   /* Extend real name. */
   base_path = extend_with_adm_name(parent_path, SVN_WC__BASE_EXT, FALSE, pool,
                                    SVN_WC__ADM_TEXT_BASE, base_name, NULL);
 
   /* Rename. */
-  SVN_ERR(svn_io_file_rename(tmp_path, base_path, pool));
+  SVN_ERR(svn_io_file_rename(tmp_text_base_abspath, base_path, pool));
   return svn_io_set_file_read_only(base_path, FALSE, pool);
 }
 

Modified: subversion/trunk/subversion/libsvn_wc/adm_files.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_files.h?rev=927034&r1=927033&r2=927034&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_files.h (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_files.h Wed Mar 24 12:31:57 2010
@@ -52,11 +52,13 @@ svn_boolean_t svn_wc__adm_area_exists(co
                                       apr_pool_t *pool);
 
 
-/* Atomically rename a temporary text-base file to its canonical
-   location.  LOCAL_ABSPATH is the path of the working file whose text-base is
-   to be moved.  The tmp file should be closed already. */
+/* 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
+   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, apr_pool_t *pool);
+svn_wc__sync_text_base(const char *local_abspath,
+                       const char *tmp_text_base_path,
+                       apr_pool_t *pool);
 
 
 /* Set *RESULT_ABSPATH to the absolute path to LOCAL_ABSPATH's text-base file,

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=927034&r1=927033&r2=927034&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Wed Mar 24 12:31:57 2010
@@ -1235,7 +1235,7 @@ install_committed_file(svn_boolean_t *ov
 
   /* Install the new text base if one is waiting. */
   if (kind == svn_node_file)  /* tmp_text_base exists */
-    SVN_ERR(svn_wc__sync_text_base(file_abspath, scratch_pool));
+    SVN_ERR(svn_wc__sync_text_base(file_abspath, tmp_text_base, scratch_pool));
 
   return SVN_NO_ERROR;
 }