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/19 18:45:31 UTC

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

Author: julianfoad
Date: Wed May 19 16:45:31 2010
New Revision: 946268

URL: http://svn.apache.org/viewvc?rev=946268&view=rev
Log:
Rename svn_wc__get_working_node_pristine_file() to
svn_wc__text_base_path_to_read().  A follow-up to r945788.

* subversion/libsvn_wc/adm_files.h,
  subversion/libsvn_wc/adm_files.c
  (svn_wc__get_working_node_pristine_file): Rename to
    svn_wc__text_base_path_to_read() and improve the doc string.

* subversion/libsvn_wc/diff.c
  (delete_entry, close_file): Track the rename.

Modified:
    subversion/trunk/subversion/libsvn_wc/adm_files.c
    subversion/trunk/subversion/libsvn_wc/adm_files.h
    subversion/trunk/subversion/libsvn_wc/diff.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=946268&r1=946267&r2=946268&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_files.c Wed May 19 16:45:31 2010
@@ -269,10 +269,10 @@ svn_wc__text_revert_path(const char **re
 
 
 svn_error_t *
-svn_wc__get_working_node_pristine_file(const char **result_abspath,
-                                       svn_wc__db_t *db,
-                                       const char *local_abspath,
-                                       apr_pool_t *result_pool)
+svn_wc__text_base_path_to_read(const char **result_abspath,
+                               svn_wc__db_t *db,
+                               const char *local_abspath,
+                               apr_pool_t *result_pool)
 {
   SVN_ERR(svn_wc__text_base_path(result_abspath, db, local_abspath,
                                  result_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=946268&r1=946267&r2=946268&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_files.h (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_files.h Wed May 19 16:45:31 2010
@@ -62,8 +62,12 @@ svn_wc__sync_text_base(const char *local
 
 
 /* Set *RESULT_ABSPATH to the absolute path to where LOCAL_ABSPATH's
-   text-base file is or should be created.  The file does not necessarily
-   exist. */
+   "normal text-base" file is or should be created.  The file does not
+   necessarily exist.
+
+   "Normal text-base" means the base of the copied file, if copied or moved,
+   else nothing if it's a simple add (even if replacing an existing node),
+   else the ultimate base. */
 svn_error_t *
 svn_wc__text_base_path(const char **result_abspath,
                        svn_wc__db_t *db,
@@ -134,29 +138,29 @@ svn_error_t *svn_wc__prop_path(const cha
                                apr_pool_t *pool);
 
 /* Set *RESULT_ABSPATH to the absolute path to a readable file containing
-   the WORKING_NODE pristine text of LOCAL_ABSPATH in DB.
+   the WC-1 "normal text-base" of LOCAL_ABSPATH in DB.
 
-   The implementation might create the file as an independent copy on
-   demand, or it might return the path to a shared file.  The file will
-   remain readable until RESULT_POOL is cleared or until LOCAL_ABSPATH's WC
-   metadata is next changed, whichever is sooner.
-     (### The latter doesn't sound like a totally reasonable condition.)
-   After that, if the implementation provided a separate file then the file
-   will automatically be removed, or if it provided a shared file then
-   no guarantees are made about it after this time.
-
-   ### The present implementation just returns the path to the file in the
-     pristine store and does not make any attempt to ensure its lifetime is
-     as promised.
+   "Normal text-base" means the same as in svn_wc__text_base_path().
+   ### May want to check the callers' exact requirements and replace this
+       definition with something easier to comprehend.
+
+   What the callers want:
+     A path to a file that will remain available and unchanged as long as
+     the caller wants it - such as for the lifetime of RESULT_POOL.
+
+   What the current implementation provides:
+     A path to the file in the pristine store.  This file will be removed or
+     replaced the next time this or another Subversion client updates the WC.
 
-   If the node LOCAL_ABSPATH has no pristine text, return an error.
+   If the node LOCAL_ABSPATH has no pristine text, the result is a path
+   where no file exists (in a directory that does exist).
 
    Allocate *RESULT_PATH in RESULT_POOL.  */
 svn_error_t *
-svn_wc__get_working_node_pristine_file(const char **result_abspath,
-                                       svn_wc__db_t *db,
-                                       const char *local_abspath,
-                                       apr_pool_t *result_pool);
+svn_wc__text_base_path_to_read(const char **result_abspath,
+                               svn_wc__db_t *db,
+                               const char *local_abspath,
+                               apr_pool_t *result_pool);
 
 
 

Modified: subversion/trunk/subversion/libsvn_wc/diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/diff.c?rev=946268&r1=946267&r2=946268&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/diff.c (original)
+++ subversion/trunk/subversion/libsvn_wc/diff.c Wed May 19 16:45:31 2010
@@ -1205,9 +1205,9 @@ delete_entry(const char *path,
           apr_hash_t *baseprops = NULL;
           const char *base_mimetype;
 
-          SVN_ERR(svn_wc__get_working_node_pristine_file(&textbase,
-                                                         eb->db, local_abspath,
-                                                         pool));
+          SVN_ERR(svn_wc__text_base_path_to_read(&textbase,
+                                                 eb->db, local_abspath,
+                                                 pool));
 
           SVN_ERR(svn_wc__get_pristine_props(&baseprops, eb->db, local_abspath,
                                              pool, pool));
@@ -1576,9 +1576,9 @@ close_file(void *file_baton,
      the same as BASE. */
   temp_file_path = fb->temp_file_path;
   if (!temp_file_path)
-    SVN_ERR(svn_wc__get_working_node_pristine_file(&temp_file_path,
-                                                   eb->db, fb->local_abspath,
-                                                   fb->pool));
+    SVN_ERR(svn_wc__text_base_path_to_read(&temp_file_path,
+                                           eb->db, fb->local_abspath,
+                                           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
@@ -1641,9 +1641,9 @@ close_file(void *file_baton,
   if (modified)
     {
       if (eb->use_text_base)
-        SVN_ERR(svn_wc__get_working_node_pristine_file(&localfile, eb->db,
-                                                       fb->local_abspath,
-                                                       fb->pool));
+        SVN_ERR(svn_wc__text_base_path_to_read(&localfile,
+                                               eb->db, fb->local_abspath,
+                                               fb->pool));
       else
         /* a detranslated version of the working file */
         SVN_ERR(svn_wc__internal_translated_file(