Author: pburba Date: Mon Dec 21 17:45:34 2009 New Revision: 892902 URL: http://svn.apache.org/viewvc?rev=892902&view=rev Log: Fix 'svn mergeinfo' bug when target is a WC path pegged at HEAD or DATE.
This fixes the failing JavaHL test BasicTests.java:testBasicMerge. See http://svn.haxx.se/dev/archive-2009-12/0346.shtml. * subversion/libsvn_client/url.c (svn_client__derive_location): Follow-up to r886880; contact the server if asking about a working copy path pegged at DATE or HEAD. Previously we tried to resolve the peg rev in this case with a call to svn_client__entry_location(), but since r886880 that function has returned an error if asked about revisions only the repos knows about. * subversion/tests/cmdline/mergeinfo_tests.py (mergeinfo_on_pegged_wc_path): Fix typo, this test should have tested WC paths pegged at HEAD, but was instead twice testing WC paths pegged at BASE. Also add --show-revs=eligible variants of the tests. Modified: subversion/trunk/subversion/libsvn_client/url.c subversion/trunk/subversion/tests/cmdline/mergeinfo_tests.py Modified: subversion/trunk/subversion/libsvn_client/url.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/url.c?rev=892902&r1=892901&r2=892902&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_client/url.c (original) +++ subversion/trunk/subversion/libsvn_client/url.c Mon Dec 21 17:45:34 2009 @@ -93,9 +93,17 @@ it into a URL. */ if (! svn_path_is_url(abspath_or_url)) { - SVN_ERR(svn_client__entry_location(url, peg_revnum, ctx->wc_ctx, - abspath_or_url, peg_revision->kind, - result_pool, scratch_pool)); + /* If we need to contact the repository for *PEG_REVNUM just get + the *URL now. Otherwise the working copy has all the information + we need. */ + if (peg_revision->kind == svn_opt_revision_date + || peg_revision->kind == svn_opt_revision_head) + SVN_ERR(svn_wc__node_get_url(url, ctx->wc_ctx, abspath_or_url, + result_pool, scratch_pool)); + else + SVN_ERR(svn_client__entry_location(url, peg_revnum, ctx->wc_ctx, + abspath_or_url, peg_revision->kind, + result_pool, scratch_pool)); } else { Modified: subversion/trunk/subversion/tests/cmdline/mergeinfo_tests.py URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/mergeinfo_tests.py?rev=892902&r1=892901&r2=892902&view=diff ============================================================================== --- subversion/trunk/subversion/tests/cmdline/mergeinfo_tests.py (original) +++ subversion/trunk/subversion/tests/cmdline/mergeinfo_tests.py Mon Dec 21 17:45:34 2009 @@ -383,7 +383,7 @@ 'ci', wc_dir, '-m', 'Merge r5') - # Ask for merged revisions to A_COPY pegged at various values. + # Ask for merged and eligible revisions to A_COPY pegged at various values. # Prior to issue #3180 fix the peg revision was ignored. # # A_COPY pegged to non-existent revision @@ -399,7 +399,7 @@ # a_c...@head svntest.actions.run_and_verify_mergeinfo( adjust_error_for_server_version(''), - ['3','5','6'], A_path, A_COPY_path + '@BASE', '--show-revs', 'merged') + ['3','5','6'], A_path, A_COPY_path + '@HEAD', '--show-revs', 'merged') # a_c...@4 (Prior to any merges) svntest.actions.run_and_verify_mergeinfo( @@ -417,6 +417,32 @@ adjust_error_for_server_version(''), ['3', '6'], A_path, A_COPY_path + '@PREV', '--show-revs', 'merged') + # a_c...@base + svntest.actions.run_and_verify_mergeinfo( + adjust_error_for_server_version(''), + ['4'], A_path, A_COPY_path + '@BASE', '--show-revs', 'eligible') + + # a_c...@head + svntest.actions.run_and_verify_mergeinfo( + adjust_error_for_server_version(''), + ['4'], A_path, A_COPY_path + '@HEAD', '--show-revs', 'eligible') + + # a_c...@4 (Prior to any merges) + svntest.actions.run_and_verify_mergeinfo( + adjust_error_for_server_version(''), + ['3', '4', '5', '6'], A_path, A_COPY_path + '@4', '--show-revs', 'eligible') + + # a_c...@committed (r8) + svntest.actions.run_and_verify_mergeinfo( + adjust_error_for_server_version(''), + ['4'], A_path, A_COPY_path + '@COMMITTED', '--show-revs', + 'eligible') + + # a_c...@prev (r7) + svntest.actions.run_and_verify_mergeinfo( + adjust_error_for_server_version(''), + ['4', '5'], A_path, A_COPY_path + '@PREV', '--show-revs', 'eligible') + ######################################################################## # Run the tests
