subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r882232 - in /subversion/trunk/subversion: libsvn_client/revert.c tests/cmdline/schedule_tests.py
Date Thu, 19 Nov 2009 18:09:08 GMT
Author: hwright
Date: Thu Nov 19 18:09:08 2009
New Revision: 882232

URL: http://svn.apache.org/viewvc?rev=882232&view=rev
Log:
Replace another use of access batons with the working copy locking APIs.
This has the side effect of allowing behavior that would otherwise error, so
update a test to expect the (improved) behavior.

* subversion/tests/cmdline/schedule_tests.py
  (revert_inside_newly_added_dir): Update docs and expectation.

* subversion/libsvn_client/revert.c
  (revert): Use the locking APIs in place of access batons.

Modified:
    subversion/trunk/subversion/libsvn_client/revert.c
    subversion/trunk/subversion/tests/cmdline/schedule_tests.py

Modified: subversion/trunk/subversion/libsvn_client/revert.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/revert.c?rev=882232&r1=882231&r2=882232&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/revert.c (original)
+++ subversion/trunk/subversion/libsvn_client/revert.c Thu Nov 19 18:09:08 2009
@@ -68,19 +68,13 @@
        svn_client_ctx_t *ctx,
        apr_pool_t *pool)
 {
-  svn_wc_adm_access_t *adm_access, *target_access;
-  const char *target, *local_abspath;
+  const char *local_abspath;
   svn_error_t *err;
-  int adm_lock_level = SVN_WC__LEVELS_TO_LOCK_FROM_DEPTH(depth);
-
-  SVN_ERR(svn_wc__adm_open_anchor_in_context(
-                                 &adm_access, &target_access, &target,
-                                 ctx->wc_ctx, path, TRUE, adm_lock_level,
-                                 ctx->cancel_func, ctx->cancel_baton,
-                                 pool));
 
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
 
+  SVN_ERR(svn_wc__acquire_write_lock(ctx->wc_ctx, local_abspath, pool));
+
   err = svn_wc_revert4(ctx->wc_ctx,
                        local_abspath,
                        depth,
@@ -108,7 +102,8 @@
         return svn_error_return(err);
     }
 
-  return svn_wc_adm_close2(adm_access, pool);
+  return svn_error_return(
+    svn_wc__release_write_lock(ctx->wc_ctx, local_abspath, pool));
 }
 
 

Modified: subversion/trunk/subversion/tests/cmdline/schedule_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/schedule_tests.py?rev=882232&r1=882231&r2=882232&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/schedule_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/schedule_tests.py Thu Nov 19 18:09:08 2009
@@ -497,6 +497,8 @@
 #----------------------------------------------------------------------
 # Regression test for issue #854:
 # Revert . inside an svn added empty directory should generate an error.
+# Not anymore!  wc-ng uses absolute paths for everything, which means we
+# can handle this case without too much trouble.
 
 def revert_inside_newly_added_dir(sbox):
   "revert inside a newly added dir"
@@ -511,9 +513,9 @@
   svntest.main.run_svn(None, 'add', 'foo')
 
   # Now change into the newly added directory, revert and make sure
-  # an error is output.
+  # no error is output.
   os.chdir('foo')
-  svntest.actions.run_and_verify_svn(None, None, svntest.verify.AnyOutput,
+  svntest.actions.run_and_verify_svn(None, None, [],
                                      'revert', '.')
 
 #----------------------------------------------------------------------



Mime
View raw message