You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2012/10/29 16:00:05 UTC

svn commit: r1403341 - in /subversion/trunk/subversion/libsvn_wc: entries.c entries.h lock.c lock.h old-and-busted.c

Author: stefan2
Date: Mon Oct 29 15:00:04 2012
New Revision: 1403341

URL: http://svn.apache.org/viewvc?rev=1403341&view=rev
Log:
Fix / circumvent the last WCNG-related deprecation warnings:
Provide library-internal API variants with the same function
signature as the deprecated API.

Please note that due to the  legacy API structure, there is no
acceptable way to prevent the internal use of deprecated API
in the implementation of those legacy API functions.

* subversion/libsvn_wc/lock.h
  (svn_wc__adm_access_pool_internal): declare new internal API
* subversion/libsvn_wc/lock.c
  (svn_wc__adm_access_pool_internal): implement it

* subversion/libsvn_wc/entries.h
  (svn_wc__entries_read_internal): declare new internal API
* subversion/libsvn_wc/entries.c
  (svn_wc__entries_read_internal): renamed from svn_wc_entries_read;
   use new private API to access adm pool
  (svn_wc_entries_read): call the above
  (walker_helper): use new internal API

* subversion/libsvn_wc/old-and-busted.c
  (svn_wc_entry): use new internal API

Modified:
    subversion/trunk/subversion/libsvn_wc/entries.c
    subversion/trunk/subversion/libsvn_wc/entries.h
    subversion/trunk/subversion/libsvn_wc/lock.c
    subversion/trunk/subversion/libsvn_wc/lock.h
    subversion/trunk/subversion/libsvn_wc/old-and-busted.c

Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=1403341&r1=1403340&r2=1403341&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Mon Oct 29 15:00:04 2012
@@ -1389,10 +1389,10 @@ entries_read_txn(void *baton, svn_sqlite
 }
 
 svn_error_t *
-svn_wc_entries_read(apr_hash_t **entries,
-                    svn_wc_adm_access_t *adm_access,
-                    svn_boolean_t show_hidden,
-                    apr_pool_t *pool)
+svn_wc__entries_read_internal(apr_hash_t **entries,
+                              svn_wc_adm_access_t *adm_access,
+                              svn_boolean_t show_hidden,
+                              apr_pool_t *pool)
 {
   apr_hash_t *new_entries;
 
@@ -1401,7 +1401,7 @@ svn_wc_entries_read(apr_hash_t **entries
     {
       svn_wc__db_t *db = svn_wc__adm_get_db(adm_access);
       const char *local_abspath = svn_wc__adm_access_abspath(adm_access);
-      apr_pool_t *result_pool = svn_wc_adm_access_pool(adm_access);
+      apr_pool_t *result_pool = svn_wc__adm_access_pool_internal(adm_access);
       svn_sqlite__db_t *sdb;
       struct entries_read_baton_t erb;
 
@@ -1425,12 +1425,21 @@ svn_wc_entries_read(apr_hash_t **entries
     *entries = new_entries;
   else
     SVN_ERR(prune_deleted(entries, new_entries,
-                          svn_wc_adm_access_pool(adm_access),
+                          svn_wc__adm_access_pool_internal(adm_access),
                           pool));
 
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_wc_entries_read(apr_hash_t **entries,
+                    svn_wc_adm_access_t *adm_access,
+                    svn_boolean_t show_hidden,
+                    apr_pool_t *pool)
+{
+  return svn_error_trace(svn_wc__entries_read_internal(entries, adm_access,
+                                                       show_hidden, pool));
+}
 
 /* No transaction required: called from write_entry which is itself
    transaction-wrapped. */
@@ -2445,7 +2454,8 @@ walker_helper(const char *dirpath,
   svn_error_t *err;
   svn_wc__db_t *db = svn_wc__adm_get_db(adm_access);
 
-  err = svn_wc_entries_read(&entries, adm_access, show_hidden, pool);
+  err = svn_wc__entries_read_internal(&entries, adm_access, show_hidden,
+                                      pool);
 
   if (err)
     SVN_ERR(walk_callbacks->handle_error(dirpath, err, walk_baton, pool));

Modified: subversion/trunk/subversion/libsvn_wc/entries.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.h?rev=1403341&r1=1403340&r2=1403341&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.h (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.h Mon Oct 29 15:00:04 2012
@@ -148,6 +148,15 @@ svn_wc__serialize_file_external(const ch
                                 const svn_opt_revision_t *rev,
                                 apr_pool_t *pool);
 
+/* Non-deprecated wrapper variant of svn_wc_entries_read used implement
+   legacy API functions. See svn_wc_entries_read for a detailed description.
+ */
+svn_error_t *
+svn_wc__entries_read_internal(apr_hash_t **entries,
+                              svn_wc_adm_access_t *adm_access,
+                              svn_boolean_t show_hidden,
+                              apr_pool_t *pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/trunk/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/lock.c?rev=1403341&r1=1403340&r2=1403341&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/lock.c (original)
+++ subversion/trunk/subversion/libsvn_wc/lock.c Mon Oct 29 15:00:04 2012
@@ -1478,6 +1478,11 @@ svn_wc_adm_access_pool(const svn_wc_adm_
   return adm_access->pool;
 }
 
+apr_pool_t *
+svn_wc__adm_access_pool_internal(const svn_wc_adm_access_t *adm_access)
+{
+  return adm_access->pool;
+}
 
 void
 svn_wc__adm_access_set_entries(svn_wc_adm_access_t *adm_access,

Modified: subversion/trunk/subversion/libsvn_wc/lock.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/lock.h?rev=1403341&r1=1403340&r2=1403341&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/lock.h (original)
+++ subversion/trunk/subversion/libsvn_wc/lock.h Mon Oct 29 15:00:04 2012
@@ -77,6 +77,13 @@ svn_wc__adm_get_db(const svn_wc_adm_acce
 const char *
 svn_wc__adm_access_abspath(const svn_wc_adm_access_t *adm_access);
 
+/* Return the pool used by access baton ADM_ACCESS.
+ * Note: This is a non-deprecated variant of svn_wc_adm_access_pool for
+ * libsvn_wc internal usage only.
+ */
+apr_pool_t *
+svn_wc__adm_access_pool_internal(const svn_wc_adm_access_t *adm_access);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/trunk/subversion/libsvn_wc/old-and-busted.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/old-and-busted.c?rev=1403341&r1=1403340&r2=1403341&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/old-and-busted.c (original)
+++ subversion/trunk/subversion/libsvn_wc/old-and-busted.c Mon Oct 29 15:00:04 2012
@@ -1327,7 +1327,7 @@ svn_wc_entry(const svn_wc_entry_t **entr
   /* Load an entries hash, and cache it into DIR_ACCESS. Go ahead and
      fetch all entries here (optimization) since we know how to filter
      out a "hidden" node.  */
-  SVN_ERR(svn_wc_entries_read(&entries, dir_access, TRUE, pool));
+  SVN_ERR(svn_wc__entries_read_internal(&entries, dir_access, TRUE, pool));
   *entry = apr_hash_get(entries, entry_name, APR_HASH_KEY_STRING);
 
   if (!show_hidden && *entry != NULL)