Modified: subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/stat_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/stat_tests.py?rev=1370418&r1=1370417&r2=1370418&view=diff ============================================================================== --- subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/stat_tests.py (original) +++ subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/stat_tests.py Tue Aug 7 18:20:26 2012 @@ -1557,6 +1557,82 @@ def status_depth_update(sbox): #---------------------------------------------------------------------- +def status_depth_update_local_modifications(sbox): + "run 'status --depth=X -u' with local changes" + + sbox.build() + wc_dir = sbox.wc_dir + A_path = sbox.ospath('A') + D_path = os.path.join(A_path, 'D') + + mu_path = os.path.join(A_path, 'mu') + gamma_path = os.path.join(D_path, 'gamma') + + svntest.main.run_svn(None, 'propset', 'svn:test', 'value', A_path) + svntest.main.run_svn(None, 'propset', 'svn:test', 'value', D_path) + + svntest.main.file_append(mu_path, 'modified') + svntest.main.file_append(gamma_path, 'modified') + + # depth=empty + expected = svntest.verify.UnorderedOutput( + [" M 1 %s\n" % A_path, + "Status against revision: 1\n"]) + + svntest.actions.run_and_verify_svn(None, + expected, + [], + "status", "-u", "--depth=empty", A_path) + + expected = svntest.verify.UnorderedOutput( + ["M 1 %s\n" % mu_path, + "Status against revision: 1\n"]) + + svntest.actions.run_and_verify_svn(None, + expected, + [], + "status", "-u", "--depth=empty", mu_path) + + # depth=files + expected = svntest.verify.UnorderedOutput( + ["M 1 %s\n" % mu_path, + " M 1 %s\n" % A_path, + "Status against revision: 1\n"]) + + svntest.actions.run_and_verify_svn(None, + expected, + [], + "status", "-u", "--depth=files", + A_path) + + # depth=immediates + expected = svntest.verify.UnorderedOutput( + [" M 1 %s\n" % A_path, + " M 1 %s\n" % D_path, + "M 1 %s\n" % mu_path, + "Status against revision: 1\n"]) + + svntest.actions.run_and_verify_svn(None, + expected, + [], + "status", "-u", "--depth=immediates", + A_path) + + # depth=infinity (the default) + expected = svntest.verify.UnorderedOutput( + [" M 1 %s\n" % A_path, + " M 1 %s\n" % D_path, + "M 1 %s\n" % mu_path, + "M 1 %s\n" % gamma_path, + "Status against revision: 1\n"]) + + svntest.actions.run_and_verify_svn(None, + expected, + [], + "status", "-u", "--depth=infinity", + A_path) + +#---------------------------------------------------------------------- # Test for issue #2420 @Issue(2420) def status_dash_u_deleted_directories(sbox): @@ -1958,6 +2034,7 @@ test_list = [ None, status_dash_u_deleted_directories, status_depth_local, status_depth_update, + status_depth_update_local_modifications, status_dash_u_type_change, status_with_tree_conflicts, status_nested_wc_old_format,
Modified: subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/svnsync_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/svnsync_tests.py?rev=1370418&r1=1370417&r2=1370418&view=diff ============================================================================== --- subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/svnsync_tests.py (original) +++ subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/svnsync_tests.py Tue Aug 7 18:20:26 2012 @@ -394,25 +394,32 @@ def basic_authz(sbox): run_init(dest_sbox.repo_url, sbox.repo_url) + args = map(lambda x: x.authz_name(), [sbox, sbox, dest_sbox]) svntest.main.file_write(sbox.authz_file, - "[svnsync-basic-authz:/]\n" + "[%s:/]\n" "* = r\n" "\n" - "[svnsync-basic-authz:/A/B]\n" + "[%s:/A/B]\n" "* = \n" "\n" - "[svnsync-basic-authz-1:/]\n" - "* = rw\n") + "[%s:/]\n" + "* = rw\n" % tuple(args)) run_sync(dest_sbox.repo_url) lambda_url = dest_sbox.repo_url + '/A/B/lambda' + iota_url = dest_sbox.repo_url + '/iota' # this file should have been blocked by authz svntest.actions.run_and_verify_svn(None, [], svntest.verify.AnyOutput, 'cat', lambda_url) + # this file should have been synced + svntest.actions.run_and_verify_svn(None, + svntest.verify.AnyOutput, [], + 'cat', + iota_url) #---------------------------------------------------------------------- @Skip(svntest.main.is_ra_type_file) @@ -465,29 +472,17 @@ def copy_from_unreadable_dir(sbox): svntest.actions.enable_revprop_changes(dest_sbox.repo_dir) - fp = open(sbox.authz_file, 'w') - - # For mod_dav_svn's parent path setup we need per-repos permissions in - # the authz file... - if sbox.repo_url.startswith('http'): - fp.write("[svnsync-copy-from-unreadable-dir:/]\n" + - "* = r\n" + - "\n" + - "[svnsync-copy-from-unreadable-dir:/A/B]\n" + - "* = \n" + - "\n" + - "[svnsync-copy-from-unreadable-dir-1:/]\n" + - "* = rw") - - # Otherwise we can just go with the permissions needed for the source - # repository. - else: - fp.write("[/]\n" + - "* = r\n" + - "\n" + - "[/A/B]\n" + - "* =\n") - fp.close() + args = map(lambda x: x.authz_name(), [sbox, sbox, dest_sbox]) + open(sbox.authz_file, 'w').write( + "[%s:/]\n" + "* = r\n" + "\n" + "[%s:/A/B]\n" + "* = \n" + "\n" + "[%s:/]\n" + "* = rw" + % tuple(args)) run_init(dest_sbox.repo_url, sbox.repo_url) @@ -591,29 +586,17 @@ def copy_with_mod_from_unreadable_dir(sb svntest.actions.enable_revprop_changes(dest_sbox.repo_dir) - fp = open(sbox.authz_file, 'w') - - # For mod_dav_svn's parent path setup we need per-repos permissions in - # the authz file... - if sbox.repo_url.startswith('http'): - fp.write("[svnsync-copy-with-mod-from-unreadable-dir:/]\n" + - "* = r\n" + - "\n" + - "[svnsync-copy-with-mod-from-unreadable-dir:/A/B]\n" + - "* = \n" + - "\n" + - "[svnsync-copy-with-mod-from-unreadable-dir-1:/]\n" + - "* = rw") - - # Otherwise we can just go with the permissions needed for the source - # repository. - else: - fp.write("[/]\n" + - "* = r\n" + - "\n" + - "[/A/B]\n" + - "* =\n") - fp.close() + args = map(lambda x: x.authz_name(), [sbox, sbox, dest_sbox]) + open(sbox.authz_file, 'w').write( + "[%s:/]\n" + "* = r\n" + "\n" + "[%s:/A/B]\n" + "* = \n" + "\n" + "[%s:/]\n" + "* = rw" + % tuple(args)) run_init(dest_sbox.repo_url, sbox.repo_url) @@ -695,29 +678,17 @@ def copy_with_mod_from_unreadable_dir_an svntest.actions.enable_revprop_changes(dest_sbox.repo_dir) - fp = open(sbox.authz_file, 'w') - - # For mod_dav_svn's parent path setup we need per-repos permissions in - # the authz file... - if sbox.repo_url.startswith('http'): - fp.write("[svnsync-copy-with-mod-from-unreadable-dir-and-copy:/]\n" + - "* = r\n" + - "\n" + - "[svnsync-copy-with-mod-from-unreadable-dir-and-copy:/A/B]\n" + - "* = \n" + - "\n" + - "[svnsync-copy-with-mod-from-unreadable-dir-and-copy-1:/]\n" + - "* = rw") - - # Otherwise we can just go with the permissions needed for the source - # repository. - else: - fp.write("[/]\n" + - "* = r\n" + - "\n" + - "[/A/B]\n" + - "* =\n") - fp.close() + args = map(lambda x: x.authz_name(), [sbox, sbox, dest_sbox]) + open(sbox.authz_file, 'w').write( + "[%s:/]\n" + "* = r\n" + "\n" + "[%s:/A/B]\n" + "* = \n" + "\n" + "[%s:/]\n" + "* = rw" + % tuple(args)) run_init(dest_sbox.repo_url, sbox.repo_url) @@ -1021,6 +992,46 @@ def fd_leak_sync_from_serf_to_local(sbox import resource resource.setrlimit(resource.RLIMIT_NOFILE, (128, 128)) run_test(sbox, "largemods.dump", is_src_ra_local=None, is_dest_ra_local=True) +@Issue(4121) +@Skip(svntest.main.is_ra_type_file) +def copy_delete_unreadable_child(sbox): + "copy, then rm at-src-unreadable child" + + ## Prepare the source: Greek tree (r1), cp+rm (r2). + sbox.build("copy-delete-unreadable-child") + svntest.actions.run_and_verify_svnmucc(None, None, [], + '-m', 'r2', + '-U', sbox.repo_url, + 'cp', 'HEAD', '/', 'branch', + 'rm', 'branch/A') + + ## Create the destination. + dest_sbox = sbox.clone_dependent() + build_repos(dest_sbox) + svntest.actions.enable_revprop_changes(dest_sbox.repo_dir) + + ## Lock down the source. + args = map(lambda x: x.authz_name(), [sbox, sbox]) + write_restrictive_svnserve_conf(sbox.repo_dir, anon_access='read') + svntest.main.file_write(sbox.authz_file, + "[%s:/]\n" + "* = r\n" + "[%s:/A]\n" + "* = \n" + % tuple(args) + ) + + dest_url = svntest.main.file_scheme_prefix \ + + svntest.main.pathname2url(os.path.abspath(dest_sbox.repo_dir)) + run_init(dest_url, sbox.repo_url) + run_sync(dest_url) + + # sanity check + svntest.actions.run_and_verify_svn(None, + ["iota\n"], [], + 'ls', dest_url+'/branch@2') + + ######################################################################## # Run the tests @@ -1062,6 +1073,7 @@ test_list = [ None, descend_into_replace, delete_revprops, fd_leak_sync_from_serf_to_local, + copy_delete_unreadable_child, ] serial_only = True Modified: subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/svntest/sandbox.py URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/svntest/sandbox.py?rev=1370418&r1=1370417&r2=1370418&view=diff ============================================================================== --- subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/svntest/sandbox.py (original) +++ subversion/branches/1.7.x-commit-performance/subversion/tests/cmdline/svntest/sandbox.py Tue Aug 7 18:20:26 2012 @@ -101,6 +101,14 @@ class Sandbox: svntest.actions.make_repo_and_wc(self, create_wc, read_only) self._is_built = True + def authz_name(self, repo_dir=None): + "return this sandbox's name for use in an authz file" + repo_dir = repo_dir or self.repo_dir + if self.repo_url.startswith("http"): + return os.path.basename(repo_dir) + else: + return repo_dir.replace('\\', '/') + def add_test_path(self, path, remove=True): self.test_paths.append(path) if remove: Modified: subversion/branches/1.7.x-commit-performance/subversion/tests/libsvn_wc/op-depth-test.c URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-commit-performance/subversion/tests/libsvn_wc/op-depth-test.c?rev=1370418&r1=1370417&r2=1370418&view=diff ============================================================================== --- subversion/branches/1.7.x-commit-performance/subversion/tests/libsvn_wc/op-depth-test.c (original) +++ subversion/branches/1.7.x-commit-performance/subversion/tests/libsvn_wc/op-depth-test.c Tue Aug 7 18:20:26 2012 @@ -233,7 +233,9 @@ wc_update(svn_test__sandbox_t *b, const apr_array_header_t *result_revs; apr_array_header_t *paths = apr_array_make(b->pool, 1, sizeof(const char *)); - svn_opt_revision_t revision = { svn_opt_revision_number, { revnum } }; + svn_opt_revision_t revision; + revision.kind = svn_opt_revision_number; + revision.value.number = revnum; APR_ARRAY_PUSH(paths, const char *) = wc_path(b, path); SVN_ERR(svn_client_create_context(&ctx, b->pool)); @@ -449,8 +451,12 @@ check_db_rows(svn_test__sandbox_t *b, svn_boolean_t have_row; apr_hash_t *found_hash = apr_hash_make(b->pool); apr_hash_t *expected_hash = apr_hash_make(b->pool); - comparison_baton_t comparison_baton - = { expected_hash, found_hash, b->pool, NULL }; + comparison_baton_t comparison_baton; + + comparison_baton.expected_hash = expected_hash; + comparison_baton.found_hash = found_hash; + comparison_baton.scratch_pool = b->pool; + comparison_baton.errors = NULL; /* Fill ACTUAL_HASH with data from the WC DB. */ SVN_ERR(open_wc_db(&sdb, b->wc_abspath, statements, b->pool, b->pool)); @@ -511,23 +517,23 @@ struct copy_subtest_t nodes_row_t expected[20]; }; +#define source_everything "A/B" + +#define source_base_file "A/B/lambda" +#define source_base_dir "A/B/E" + +#define source_added_file "A/B/file-added" +#define source_added_dir "A/B/D-added" +#define source_added_dir2 "A/B/D-added/D2" + +#define source_copied_file "A/B/lambda-copied" +#define source_copied_dir "A/B/E-copied" + /* Check that all kinds of WC-to-WC copies give correct op_depth results: * create a Greek tree, make copies in it, and check the resulting DB rows. */ static svn_error_t * wc_wc_copies(svn_test__sandbox_t *b) { - const char source_everything[] = "A/B"; - - const char source_base_file[] = "A/B/lambda"; - const char source_base_dir[] = "A/B/E"; - - const char source_added_file[] = "A/B/file-added"; - const char source_added_dir[] = "A/B/D-added"; - const char source_added_dir2[] = "A/B/D-added/D2"; - - const char source_copied_file[] = "A/B/lambda-copied"; - const char source_copied_dir[] = "A/B/E-copied"; - SVN_ERR(add_and_commit_greek_tree(b)); /* Create the various kinds of source node which will be copied */ @@ -744,13 +750,15 @@ repo_wc_copies(svn_test__sandbox_t *b) for (subtest = subtests; subtest->from_path; subtest++) { svn_opt_revision_t rev = { svn_opt_revision_number, { 1 } }; - svn_client_copy_source_t source = { NULL, &rev, &rev }; + svn_client_copy_source_t source; apr_array_header_t *sources = apr_array_make(b->pool, 0, sizeof(svn_client_copy_source_t *)); source.path = svn_path_url_add_component2(b->repos_url, subtest->from_path, b->pool); + source.revision = &rev; + source.peg_revision = &rev; APR_ARRAY_PUSH(sources, svn_client_copy_source_t *) = &source; SVN_ERR(svn_client_copy6(sources, wc_path(b, subtest->to_path),
