You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2010/07/20 16:10:12 UTC

svn commit: r965855 - in /subversion/trunk/subversion: libsvn_wc/adm_files.c libsvn_wc/wc_db.c tests/libsvn_wc/entries-compat.c

Author: philip
Date: Tue Jul 20 14:10:12 2010
New Revision: 965855

URL: http://svn.apache.org/viewvc?rev=965855&view=rev
Log:
Extend entries-compat-test to test some of the legacy API.

* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_temp_get_format): Don't reset wcroot if not single-db.
  (svn_wc__db_temp_forget_directory): Release lock whether or not single-db.

* subversion/libsvn_wc/adm_files.c
  (svn_wc__adm_destroy): Don't try to delete .svn dir if single-db.

* subversion/tests/libsvn_wc/entries-compat.c
  (test_access_baton_like_locking): Explicitly test the legacy API.

Modified:
    subversion/trunk/subversion/libsvn_wc/adm_files.c
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/tests/libsvn_wc/entries-compat.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=965855&r1=965854&r2=965855&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_files.c Tue Jul 20 14:10:12 2010
@@ -757,7 +757,9 @@ svn_wc__adm_destroy(svn_wc__db_t *db,
                     const char *dir_abspath,
                     apr_pool_t *scratch_pool)
 {
+#ifndef SINGLE_DB
   const char *adm_abspath;
+#endif
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(dir_abspath));
 
@@ -767,8 +769,10 @@ svn_wc__adm_destroy(svn_wc__db_t *db,
      directory, which also removes the lock */
   SVN_ERR(svn_wc__db_temp_forget_directory(db, dir_abspath, scratch_pool));
 
+#ifndef SINGLE_DB
   adm_abspath = svn_wc__adm_child(dir_abspath, NULL, scratch_pool);
   SVN_ERR(svn_io_remove_dir2(adm_abspath, FALSE, NULL, NULL, scratch_pool));
+#endif
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=965855&r1=965854&r2=965855&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Jul 20 14:10:12 2010
@@ -7126,6 +7126,7 @@ svn_wc__db_temp_get_format(int *format,
   pdh = svn_wc__db_pdh_get_or_create(db, local_dir_abspath, FALSE,
                                      scratch_pool);
 
+#ifndef SINGLE_DB
   /* ### for per-dir layouts, the wcroot should be this directory. under
      ### wc-ng, the wcroot may have become set for this missing subdir.  */
   if (pdh != NULL && pdh->wcroot != NULL
@@ -7135,6 +7136,7 @@ svn_wc__db_temp_get_format(int *format,
          got set, but has since been constructed.  */
       pdh->wcroot = NULL;
     }
+#endif
 
   /* If the PDH isn't present, or have wcroot information, then do a full
      upward traversal to find the wcroot.  */
@@ -7276,6 +7278,7 @@ svn_wc__db_temp_forget_directory(svn_wc_
 
 #ifndef SVN_WC__SINGLE_DB
       if (pdh->locked)
+#endif
         {
           err = svn_wc__db_wclock_release(db, pdh->local_abspath,
                                           scratch_pool);
@@ -7289,6 +7292,7 @@ svn_wc__db_temp_forget_directory(svn_wc_
             SVN_ERR(err);
         }
 
+#ifndef SVN_WC__SINGLE_DB
       SVN_ERR_ASSERT(!pdh->locked);
 #endif
 

Modified: subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c?rev=965855&r1=965854&r2=965855&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/entries-compat.c Tue Jul 20 14:10:12 2010
@@ -540,6 +540,7 @@ test_access_baton_like_locking(apr_pool_
   const char *D, *D1, *D2, *D3, *D4;
   svn_boolean_t locked_here, locked;
   svn_error_t *err;
+  svn_wc_adm_access_t *adm_access, *subdir_access;
 
 #undef WC_NAME
 #define WC_NAME "test_access_batons"
@@ -554,6 +555,28 @@ test_access_baton_like_locking(apr_pool_
 
   SVN_ERR(svn_io_make_dir_recursively(D4, pool));
 
+  /* Use the legacy interface */
+  SVN_ERR(svn_wc_adm_open3(&adm_access, NULL, local_abspath, TRUE, 0,
+                           NULL, NULL, pool));
+  SVN_ERR(svn_wc_add3(D, adm_access, svn_depth_infinity, NULL,
+                      SVN_INVALID_REVNUM, NULL, NULL, NULL, NULL, pool));
+  SVN_ERR(svn_wc_adm_retrieve(&subdir_access, adm_access, D, pool));
+  SVN_ERR(svn_wc_add3(D1, subdir_access, svn_depth_infinity, NULL,
+                      SVN_INVALID_REVNUM, NULL, NULL, NULL, NULL, pool));
+  SVN_ERR(svn_wc_adm_retrieve(&subdir_access, adm_access, D1, pool));
+  SVN_ERR(svn_wc_add3(D2, subdir_access, svn_depth_infinity, NULL,
+                      SVN_INVALID_REVNUM, NULL, NULL, NULL, NULL, pool));
+  SVN_ERR(svn_wc_adm_retrieve(&subdir_access, adm_access, D2, pool));
+  SVN_ERR(svn_wc_add3(D3, subdir_access, svn_depth_infinity, NULL,
+                      SVN_INVALID_REVNUM, NULL, NULL, NULL, NULL, pool));
+  SVN_ERR(svn_wc_locked(&locked, D3, pool));
+  SVN_TEST_ASSERT(locked);
+  SVN_ERR(svn_wc_revert3(D, adm_access, -1, FALSE,
+                         NULL, NULL, NULL, NULL, NULL, pool));
+  SVN_ERR(svn_wc_locked(&locked, D3, pool));
+  SVN_TEST_ASSERT(!locked);
+  SVN_ERR(svn_wc_adm_close2(adm_access, pool));
+
   SVN_ERR(svn_wc_context_create(&wc_ctx, NULL, pool, pool));
 
   /* Obtain a lock for the root, which is extended on each level */