Modified: subversion/branches/issue-3975/subversion/svnrdump/svnrdump.c URL: http://svn.apache.org/viewvc/subversion/branches/issue-3975/subversion/svnrdump/svnrdump.c?rev=1154351&r1=1154350&r2=1154351&view=diff ============================================================================== --- subversion/branches/issue-3975/subversion/svnrdump/svnrdump.c (original) +++ subversion/branches/issue-3975/subversion/svnrdump/svnrdump.c Fri Aug 5 18:49:28 2011 @@ -79,6 +79,7 @@ enum svn_svnrdump__longopt_t opt_auth_nocache, opt_non_interactive, opt_incremental, + opt_trust_server_cert, opt_version, }; @@ -87,6 +88,7 @@ enum svn_svnrdump__longopt_t opt_auth_username, \ opt_auth_password, \ opt_auth_nocache, \ + opt_trust_server_cert, \ opt_non_interactive static const svn_opt_subcommand_desc2_t svnrdump__cmd_table[] = @@ -138,6 +140,12 @@ static const apr_getopt_option_t svnrdum "For example:\n" " " " servers:global:http-library=serf")}, + {"trust-server-cert", opt_trust_server_cert, 0, + N_("accept SSL server certificates from unknown\n" + " " + "certificate authorities without prompting (but only\n" + " " + "with '--non-interactive')") }, {0, 0, 0, 0} }; @@ -250,6 +258,7 @@ init_client_context(svn_client_ctx_t **c const char *password, const char *config_dir, svn_boolean_t no_auth_cache, + svn_boolean_t trust_server_cert, apr_array_header_t *config_options, apr_pool_t *pool) { @@ -276,9 +285,9 @@ init_client_context(svn_client_ctx_t **c /* Default authentication providers for non-interactive use */ SVN_ERR(svn_cmdline_create_auth_baton(&(ctx->auth_baton), non_interactive, username, password, config_dir, - no_auth_cache, FALSE, cfg_config, - ctx->cancel_func, ctx->cancel_baton, - pool)); + no_auth_cache, trust_server_cert, + cfg_config, ctx->cancel_func, + ctx->cancel_baton, pool)); *ctx_p = ctx; return SVN_NO_ERROR; } @@ -665,6 +674,7 @@ main(int argc, const char **argv) const char *username = NULL; const char *password = NULL; svn_boolean_t no_auth_cache = FALSE; + svn_boolean_t trust_server_cert = FALSE; svn_boolean_t non_interactive = FALSE; apr_array_header_t *config_options = NULL; apr_getopt_t *os; @@ -794,6 +804,9 @@ main(int argc, const char **argv) case opt_incremental: opt_baton->incremental = TRUE; break; + case opt_trust_server_cert: + trust_server_cert = TRUE; + break; case opt_config_option: if (!config_options) config_options = @@ -901,6 +914,15 @@ main(int argc, const char **argv) exit(EXIT_SUCCESS); } + /* --trust-server-cert can only be used with --non-interactive */ + if (trust_server_cert && !non_interactive) + { + err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL, + _("--trust-server-cert requires " + "--non-interactive")); + return svn_cmdline_handle_exit_error(err, pool, "svnrdump: "); + } + /* Expect one more non-option argument: the repository URL. */ if (os->ind != os->argc - 1) { @@ -932,6 +954,7 @@ main(int argc, const char **argv) password, config_dir, no_auth_cache, + trust_server_cert, config_options, pool));
Modified: subversion/branches/issue-3975/subversion/tests/cmdline/merge_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/issue-3975/subversion/tests/cmdline/merge_tests.py?rev=1154351&r1=1154350&r2=1154351&view=diff ============================================================================== --- subversion/branches/issue-3975/subversion/tests/cmdline/merge_tests.py (original) +++ subversion/branches/issue-3975/subversion/tests/cmdline/merge_tests.py Fri Aug 5 18:49:28 2011 @@ -16838,6 +16838,140 @@ def merge_adds_subtree_with_mergeinfo(sb None, None, None, None, None, 1, False) +#---------------------------------------------------------------------- +# A test for issue #3978 'reverse merge which adds subtree fails'. +@Issue(3978) +@SkipUnless(server_has_mergeinfo) +def reverse_merge_adds_subtree(sbox): + "reverse merge adds subtree" + + sbox.build() + wc_dir = sbox.wc_dir + wc_disk, wc_status = set_up_branch(sbox) + + A_path = os.path.join(wc_dir, 'A') + chi_path = os.path.join(wc_dir, 'A', 'D', 'H', 'chi') + A_COPY_path = os.path.join(wc_dir, 'A_COPY') + H_COPY_path = os.path.join(wc_dir, 'A_COPY', 'D', 'H') + + # r7 - Delete A\D\H\chi + svntest.actions.run_and_verify_svn(None, None, [], 'delete', chi_path) + svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m', + 'Delete a file', wc_dir) + + # r8 - Merge r7 from A to A_COPY + svntest.actions.run_and_verify_svn(None, None, [], 'merge', + sbox.repo_url + '/A', + A_COPY_path, '-c7') + svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m', + 'Cherry-pick r7 from A to A_COPY', wc_dir) + + # r9 - File depth sync merge from A/D/H to A_COPY/D/H/ + svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir) + svntest.actions.run_and_verify_svn(None, None, [], 'merge', + sbox.repo_url + '/A/D/H', + H_COPY_path, '--depth', 'files') + svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m', + 'Cherry-pick r7 from A to A_COPY', wc_dir) + + # Reverse merge r7 from A to A_COPY + # + # Prior to the issue #3978 fix this merge failed with an assertion: + # + # >svn merge ^/A A_COPY -c-7 + # --- Reverse-merging r7 into 'A_COPY\D\H': + # A A_COPY\D\H\chi + # --- Recording mergeinfo for reverse merge of r7 into 'A_COPY': + # U A_COPY + # --- Recording mergeinfo for reverse merge of r7 into 'A_COPY\D\H': + # U A_COPY\D\H + # ..\..\..\subversion\svn\util.c:913: (apr_err=200020) + # ..\..\..\subversion\libsvn_client\merge.c:10990: (apr_err=200020) + # ..\..\..\subversion\libsvn_client\merge.c:10944: (apr_err=200020) + # ..\..\..\subversion\libsvn_client\merge.c:10944: (apr_err=200020) + # ..\..\..\subversion\libsvn_client\merge.c:10914: (apr_err=200020) + # ..\..\..\subversion\libsvn_client\merge.c:8928: (apr_err=200020) + # ..\..\..\subversion\libsvn_client\merge.c:7850: (apr_err=200020) + # ..\..\..\subversion\libsvn_client\mergeinfo.c:120: (apr_err=200020) + # ..\..\..\subversion\libsvn_wc\props.c:2472: (apr_err=200020) + # ..\..\..\subversion\libsvn_wc\props.c:2247: (apr_err=200020) + # ..\..\..\subversion\libsvn_wc\props.c:2576: (apr_err=200020) + # ..\..\..\subversion\libsvn_subr\mergeinfo.c:705: (apr_err=200020) + # svn: E200020: Could not parse mergeinfo string '-7' + # ..\..\..\subversion\libsvn_subr\mergeinfo.c:688: (apr_err=200022) + # ..\..\..\subversion\libsvn_subr\mergeinfo.c:607: (apr_err=200022) + # ..\..\..\subversion\libsvn_subr\mergeinfo.c:504: (apr_err=200022) + # ..\..\..\subversion\libsvn_subr\kitchensink.c:57: (apr_err=200022) + # svn: E200022: Negative revision number found parsing '-7' + svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir) + svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir) + expected_output = wc.State(A_COPY_path, { + 'D/H/chi' : Item(status='A '), + }) + expected_mergeinfo_output = wc.State(A_COPY_path, { + '' : Item(status=' U'), + 'D/H' : Item(status=' U'), + }) + expected_elision_output = wc.State(A_COPY_path, { + '' : Item(status=' U'), + }) + expected_status = wc.State(A_COPY_path, { + '' : Item(status=' M'), + 'B' : Item(status=' '), + 'mu' : Item(status=' '), + 'B/E' : Item(status=' '), + 'B/E/alpha' : Item(status=' '), + 'B/E/beta' : Item(status=' '), + 'B/lambda' : Item(status=' '), + 'B/F' : Item(status=' '), + 'C' : Item(status=' '), + 'D' : Item(status=' '), + 'D/G' : Item(status=' '), + 'D/G/pi' : Item(status=' '), + 'D/G/rho' : Item(status=' '), + 'D/G/tau' : Item(status=' '), + 'D/gamma' : Item(status=' '), + 'D/H' : Item(status=' M'), + 'D/H/chi' : Item(status='A ', copied='+'), + 'D/H/psi' : Item(status=' '), + 'D/H/omega' : Item(status=' '), + }) + expected_status.tweak(wc_rev=9) + expected_status.tweak('D/H/chi', wc_rev='-') + expected_disk = wc.State('', { + 'B' : Item(), + 'mu' : Item("This is the file 'mu'.\n"), + 'B/E' : Item(), + 'B/E/alpha' : Item("This is the file 'alpha'.\n"), + 'B/E/beta' : Item("This is the file 'beta'.\n"), + 'B/lambda' : Item("This is the file 'lambda'.\n"), + 'B/F' : Item(), + 'C' : Item(), + 'D' : Item(), + 'D/G' : Item(), + 'D/G/pi' : Item("This is the file 'pi'.\n"), + 'D/G/rho' : Item("This is the file 'rho'.\n"), + 'D/G/tau' : Item("This is the file 'tau'.\n"), + 'D/gamma' : Item("This is the file 'gamma'.\n"), + 'D/H' : Item(props={SVN_PROP_MERGEINFO : '/A/D/H:2-6*,8*'}), + 'D/H/chi' : Item("This is the file 'chi'.\n"), + 'D/H/psi' : Item("New content", + props={SVN_PROP_MERGEINFO : '/A/D/H/psi:2-8'}), + 'D/H/omega' : Item("New content", + props={SVN_PROP_MERGEINFO : '/A/D/H/omega:2-8'}), + }) + expected_skip = wc.State('.', { }) + svntest.actions.run_and_verify_merge(A_COPY_path, 7, 6, + sbox.repo_url + '/A', None, + expected_output, + expected_mergeinfo_output, + expected_elision_output, + expected_disk, + expected_status, + expected_skip, + None, None, None, None, + None, 1, False) + ######################################################################## # Run the tests @@ -16963,6 +17097,7 @@ test_list = [ None, dry_run_merge_conflicting_binary, foreign_repos_prop_conflict, merge_adds_subtree_with_mergeinfo, + reverse_merge_adds_subtree, ] if __name__ == '__main__':
