You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2012/02/23 16:22:50 UTC

svn commit: r1292827 - in /subversion/trunk/subversion: include/private/svn_wc_private.h libsvn_client/externals.c libsvn_wc/externals.c tests/cmdline/externals_tests.py

Author: pburba
Date: Thu Feb 23 15:22:50 2012
New Revision: 1292827

URL: http://svn.apache.org/viewvc?rev=1292827&view=rev
Log:
Fix issue #4123 'URL-to-WC copy of externals fails on Windows'.

* subversion/include/private/svn_wc_private.h
  (svn_wc__close_db): New wrapper around svn_wc__db_drop_root.

* subversion/libsvn_client/externals.c
  (switch_dir_external): If we need to checkout a new working copy for an
   external, close the DB once the checkout is complete.

* subversion/libsvn_wc/externals.c
  (svn_wc__close_db): New.

* subversion/tests/cmdline/externals_tests.py
  (url_to_wc_copy_of_externals): Remove the XFail decorator and adjust the
   comments re the failure status.

Modified:
    subversion/trunk/subversion/include/private/svn_wc_private.h
    subversion/trunk/subversion/libsvn_client/externals.c
    subversion/trunk/subversion/libsvn_wc/externals.c
    subversion/trunk/subversion/tests/cmdline/externals_tests.py

Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1292827&r1=1292826&r2=1292827&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Thu Feb 23 15:22:50 2012
@@ -263,6 +263,15 @@ svn_wc__externals_gather_definitions(apr
                                      apr_pool_t *result_pool,
                                      apr_pool_t *scratch_pool);
 
+/* Close the DB for LOCAL_ABSPATH.  Perform temporary allocations in
+   SCRATCH_POOL.
+
+   Wraps svn_wc__db_drop_root(). */
+svn_error_t *
+svn_wc__close_db(const char *external_abspath,
+                 svn_wc_context_t *wc_ctx,
+                 apr_pool_t *scratch_pool);
+
 /** Set @a *tree_conflict to a newly allocated @c
  * svn_wc_conflict_description_t structure describing the tree
  * conflict state of @a victim_abspath, or to @c NULL if @a victim_abspath

Modified: subversion/trunk/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/externals.c?rev=1292827&r1=1292826&r2=1292827&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/externals.c (original)
+++ subversion/trunk/subversion/libsvn_client/externals.c Thu Feb 23 15:22:50 2012
@@ -299,6 +299,9 @@ switch_dir_external(const char *local_ab
                                       external_peg_rev,
                                       external_rev,
                                       pool));
+    /* Issue #4123: We don't need to keep the newly checked out external's
+       DB open. */
+    SVN_ERR(svn_wc__close_db(local_abspath, ctx->wc_ctx, pool));
   }
 
   return SVN_NO_ERROR;

Modified: subversion/trunk/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/externals.c?rev=1292827&r1=1292826&r2=1292827&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/externals.c (original)
+++ subversion/trunk/subversion/libsvn_wc/externals.c Thu Feb 23 15:22:50 2012
@@ -1363,6 +1363,16 @@ svn_wc__externals_gather_definitions(apr
     }
 }
 
+svn_error_t *
+svn_wc__close_db(const char *external_abspath,
+                 svn_wc_context_t *wc_ctx,
+                 apr_pool_t *scratch_pool)
+{
+  SVN_ERR(svn_wc__db_drop_root(wc_ctx->db, external_abspath,
+                               scratch_pool));
+  return SVN_NO_ERROR;
+}
+
 /* Return the scheme of @a uri in @a scheme allocated from @a pool.
    If @a uri does not appear to be a valid URI, then @a scheme will
    not be updated.  */

Modified: subversion/trunk/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/externals_tests.py?rev=1292827&r1=1292826&r2=1292827&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/externals_tests.py Thu Feb 23 15:22:50 2012
@@ -2787,7 +2787,6 @@ def dir_external_with_dash_r_only(sbox):
 
 # Test for issue #4123 'URL-to-WC copy of externals fails on Windows'
 @Issue(4123)
-@XFail(svntest.main.is_os_windows)
 def url_to_wc_copy_of_externals(sbox):
   "url-to-wc copy of externals"
 
@@ -2805,7 +2804,8 @@ def url_to_wc_copy_of_externals(sbox):
   svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
   # Copy ^/A/C to External-WC-to-URL-Copy.
-  # Currently this fails with:
+  #
+  # Previously this failed with:
   #   >svn copy ^^/A/C External-WC-to-URL-Copy
   #    U   External-WC-to-URL-Copy
   #