You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2009/12/07 22:11:14 UTC
svn commit: r888137 - in /subversion/trunk/subversion: libsvn_client/merge.c
tests/cmdline/merge_tests.py
Author: pburba
Date: Mon Dec 7 21:11:11 2009
New Revision: 888137
URL: http://svn.apache.org/viewvc?rev=888137&view=rev
Log:
When merging, do not consider implicit mergeinfo from a WC path's future
history.
We don't consider a WC path's future *explicit* mergeinfo when merging, so
it makes little sense to consider future implicit mergeinfo. This fixes
issue #3121 'Unable to merge into working copy of deleted branch'.
* subversion/libsvn_client/merge.c
(get_full_mergeinfo): Ignore any implicit mergeinfo bounds which are
younger than the WC's base revision.
* subversion/tests/cmdline/merge_tests.py
(merge_file_replace_to_mixed_rev_wc): Adjust this test for issue #2522
to not expect a WC merge target to have implicit mergeinfo (a.k.a.
natural history) from revisions younger than the WC's base revision.
(merge_into_wc_for_deleted_branch): Remove XFail comments.
(test_list): Remove XFail from merge_into_wc_for_deleted_branch.
Modified:
subversion/trunk/subversion/libsvn_client/merge.c
subversion/trunk/subversion/tests/cmdline/merge_tests.py
Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=888137&r1=888136&r2=888137&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Mon Dec 7 21:11:11 2009
@@ -3221,7 +3221,9 @@
If IMPLICIT_MERGEINFO is not NULL then START and END are limits on the
the natural history sought, must both be valid revision numbers, and
- START must be greater than END.
+ START must be greater than END. If TARGET_ABSPATH's base revision
+ is older than START, then the base revision is used as the younger
+ bound in place of START.
Allocate *RECORDED_MERGEINFO and *IMPLICIT_MERGEINFO in RESULT_POOL.
Use SCRATCH_POOL for any temporary allocations. */
@@ -3291,29 +3293,12 @@
ctx, scratch_pool));
}
- /* Our underlying APIs can't yet handle the case where the peg
- revision isn't the youngest of the three revisions. So we'll
- just verify that the source in the peg revision is related to the
- the source in the youngest requested revision (which is all the
- underlying APIs would do in this case right now anyway). */
+ /* Do not ask for implicit mergeinfo from TARGET_ABSPATH's future.
+ TARGET_ABSPATH might not even exist, and even if it does the
+ working copy is *at* TARGET_REV so its implicit history ends
+ at TARGET_REV! */
if (target_rev < start)
- {
- const char *start_url;
- svn_opt_revision_t requested, unspec, pegrev, *start_revision;
- unspec.kind = svn_opt_revision_unspecified;
- requested.kind = svn_opt_revision_number;
- requested.value.number = start;
- pegrev.kind = svn_opt_revision_number;
- pegrev.value.number = target_rev;
-
- SVN_ERR(svn_client__repos_locations(&start_url, &start_revision,
- NULL, NULL, ra_session, url,
- &pegrev, &requested,
- &unspec, ctx, scratch_pool));
- /* ### FIXME: Having a low-brain moment. Shouldn't we check
- that START_URL matches our session URL at this point? */
- target_rev = start;
- }
+ start = target_rev;
/* Fetch the implicit mergeinfo. */
peg_revision.kind = svn_opt_revision_number;
Modified: subversion/trunk/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/merge_tests.py?rev=888137&r1=888136&r2=888137&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/merge_tests.py Mon Dec 7 21:11:11 2009
@@ -3482,7 +3482,21 @@
None, wc_dir)
- # merge changes from r3:1
+ # merge changes from r3:1...
+ #
+ # ...but first:
+ #
+ # Since "." is at revision 2, r3 is not part of "."'s implicit mergeinfo.
+ # Merge tracking permits only reverse merges from explicit or implicit
+ # mergeinfo, so only r2 would be reverse merged if we left the WC as is.
+ # Normally we'd simply update the whole working copy, but since that would
+ # defeat the purpose of this test (see the comment below), instead we'll
+ # update only "." using --depth empty. This preserves the intent of the
+ # orginal mixed-rev test for this issue, but allows the merge tracking
+ # logic to consider r3 as valid for reverse merging.
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'up', '--depth', 'empty', wc_dir)
+ expected_status.tweak('', wc_rev=3)
expected_output = svntest.wc.State(wc_dir, {
'A/D/G/rho': Item(status='R ')
})
@@ -17052,8 +17066,6 @@
# This is a test for issue #3221 'Unable to merge into working copy of
# deleted branch'.
-#
-# Marked as XFail until issue #3221 is fixed.
def merge_into_wc_for_deleted_branch(sbox):
"merge into WC of deleted branch should work"
@@ -17132,7 +17144,7 @@
'D/H/omega' : Item("New content"),
})
expected_skip = wc.State(A_COPY_path, { })
- # Issue #3221: This merge fails with:
+ # Issue #3221: Previously this merge failed with:
# ..\..\..\subversion\svn\util.c:900: (apr_err=160013)
# ..\..\..\subversion\libsvn_client\merge.c:9383: (apr_err=160013)
# ..\..\..\subversion\libsvn_client\merge.c:8029: (apr_err=160013)
@@ -17381,7 +17393,7 @@
skipped_files_get_correct_mergeinfo,
XFail(committed_case_only_move_and_revert,
is_fs_case_insensitive),
- XFail(merge_into_wc_for_deleted_branch),
+ merge_into_wc_for_deleted_branch,
]
if __name__ == '__main__':