subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject svn commit: r936240 - /subversion/trunk/subversion/libsvn_wc/entries.c
Date Wed, 21 Apr 2010 10:04:42 GMT
Author: gstein
Date: Wed Apr 21 10:04:42 2010
New Revision: 936240

URL: http://svn.apache.org/viewvc?rev=936240&view=rev
Log:
Revamp and simplify the central entry-fetching function,
svn_wc__get_entry. It no longer worries about the entries cache, and
always goes to the database to fetch the parent/entry pair of entries.

* subversion/libsvn_wc/entries.c:
  (svn_wc__get_entry): strip out the access baton and entries cacheing
    considerations from this function. use read_entry_pair to grab the
    target entry. only use the RESULT_POOL and SCRATCH_POOL rather than an
    access baton's pool.

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

Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=936240&r1=936239&r2=936240&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Wed Apr 21 10:04:42 2010
@@ -1393,9 +1393,6 @@ svn_wc__get_entry(const svn_wc_entry_t *
 {
   const char *dir_abspath;
   const char *entry_name;
-  svn_wc_adm_access_t *adm_access;
-  apr_hash_t *entries;
-  apr_pool_t *source_pool;
 
   /* Can't ask for the parent stub if the node is a file.  */
   SVN_ERR_ASSERT(!need_parent_stub || kind != svn_node_file);
@@ -1404,16 +1401,11 @@ svn_wc__get_entry(const svn_wc_entry_t *
                                 kind, need_parent_stub, scratch_pool,
                                 scratch_pool));
 
-  /* Is there an existing access baton for this path?  */
-  adm_access = svn_wc__adm_retrieve_internal2(db, dir_abspath, scratch_pool);
-  if (adm_access == NULL)
     {
+      const svn_wc_entry_t *parent_entry;
       svn_error_t *err;
 
-      /* No access baton. Just read the entries into the scratch pool.
-         No place to cache them, so they won't stick around.
-
-         NOTE: if KIND is UNKNOWN and we decided to examine the *parent*
+      /* NOTE: if KIND is UNKNOWN and we decided to examine the *parent*
          directory, then it is possible we moved out of the working copy.
          If the on-disk node is a DIR, and we asked for a stub, then we
          obviously can't provide that (parent has no info). If the on-disk
@@ -1425,8 +1417,9 @@ svn_wc__get_entry(const svn_wc_entry_t *
          obstructed on-disk by some other node kind (NONE, FILE, UNKNOWN),
          then this will throw an error.  */
 
-      err = read_entries(&entries, db, dir_abspath,
-                         scratch_pool, scratch_pool);
+      err = read_entry_pair(&parent_entry, entry,
+                            db, dir_abspath, entry_name,
+                            result_pool, scratch_pool);
       if (err)
         {
           if (err->apr_err != SVN_ERR_WC_MISSING || kind != svn_node_unknown
@@ -1470,29 +1463,8 @@ svn_wc__get_entry(const svn_wc_entry_t *
                                  svn_dirent_local_style(local_abspath,
                                                         scratch_pool));
         }
-
-      /* The entries are allocated in scratch_pool right now.  */
-      source_pool = scratch_pool;
-    }
-  else
-    {
-      /* We have a place to cache the results.  */
-
-      /* The entries are currently, or will be, allocated in the access
-         baton's pool.  */
-      source_pool = svn_wc_adm_access_pool(adm_access);
-
-      entries = svn_wc__adm_access_entries(adm_access);
-      if (entries == NULL)
-        {
-          /* See note above about reading the entries for an UNKNOWN.  */
-          SVN_ERR(read_entries(&entries, db, dir_abspath,
-                               source_pool, scratch_pool));
-          svn_wc__adm_access_set_entries(adm_access, entries);
-        }
     }
 
-  *entry = apr_hash_get(entries, entry_name, APR_HASH_KEY_STRING);
   if (*entry == NULL)
     {
       if (allow_unversioned)
@@ -1503,10 +1475,6 @@ svn_wc__get_entry(const svn_wc_entry_t *
                                                       scratch_pool));
     }
 
-  /* Give the caller a valid entry.  */
-  if (result_pool != source_pool)
-    *entry = svn_wc_entry_dup(*entry, result_pool);
-
   /* The caller had the wrong information.  */
   if ((kind == svn_node_file && (*entry)->kind != svn_node_file)
       || (kind == svn_node_dir && (*entry)->kind != svn_node_dir))



Mime
View raw message