[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] simple optimization and new test case for 'svn cp URL wc'

From: Madan U Sreenivasan <madan_at_collab.net>
Date: 2006-08-09 14:58:14 CEST

Hi,

    Please find attached a simple optimization that was possible in
repos_to_wc_copy().

    Also, I almost broke a case trying one more optimization - Using
svn_wc_adm_open3() instead of svn_wc_adm_probe_open3(). But the tests kept
passing - of course, that case was not being tested by the respos_to_wc()
test of copy tests. So, I added it.

    I have provided both of the above in the same patch, because they both
are simple improvements to the repos_to_wc_copy() functionality.

    I have run 'make check' in over ra_local. Am of the view that this
would suffice for wc changes. Please let me know if not.

Regards,
Madan.

Index: subversion/libsvn_client/copy.c
===================================================================
--- subversion/libsvn_client/copy.c (revision 21026)
+++ subversion/libsvn_client/copy.c (working copy)
@@ -762,7 +762,7 @@
   /* Make sure the destination parent is a directory and produce a clear
      error message if it is not. */
   dst_parent = svn_path_dirname(dst_path, pool);
- SVN_ERR(svn_io_check_path(svn_path_dirname(dst_path, pool),
+ SVN_ERR(svn_io_check_path(dst_parent,
                             &dst_parent_kind, pool));
   if (dst_parent_kind != svn_node_dir)
     return svn_error_createf(SVN_ERR_WC_NOT_DIRECTORY, NULL,
Index: subversion/tests/cmdline/copy_tests.py
===================================================================
--- subversion/tests/cmdline/copy_tests.py (revision 21026)
+++ subversion/tests/cmdline/copy_tests.py (working copy)
@@ -1014,7 +1014,30 @@
     })
   svntest.actions.run_and_verify_status (wc_dir, expected_output)
 
+ # Revert everything and verify.
+ svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
+ expected_output = svntest.actions.get_virginal_state(wc_dir, 1)
 
+ # URL->wc copy:
+ # copy a directory to an already existing wc directory.
+ # The source directory should be copied *under* the target directory.
+ B_url = svntest.main.current_repo_url + "/A/B"
+ D_dir = os.path.join (wc_dir, 'A', 'D')
+
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'copy', B_url, D_dir)
+
+ expected_output = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_output.add({
+ 'A/D/B' : Item(status='A ', copied='+', wc_rev='-'),
+ 'A/D/B/lambda' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/D/B/E' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/D/B/E/beta' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/D/B/E/alpha' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A/D/B/F' : Item(status=' ', copied='+', wc_rev='-'),
+ })
+ svntest.actions.run_and_verify_status (wc_dir, expected_output)
+
 #----------------------------------------------------------------------
 # Issue 1084: ra_svn move/copy bug
 

Simple optimization and extra test case for 'svn cp URL wc'.

* subversion/libsvn_client/diff.c
  (repos_to_wc_copy): Use dst_parent instead of calling svn_path_dirname()
   again.

* subversion/tests/cmdline/copy_tests.py
  (repos_to_wc): Add case for copy to already existing directory.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Aug 9 14:28:16 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.