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

RE: svn commit: r39093 - in trunk/subversion: libsvn_wc tests/cmdline

From: Bert Huijben <rhuijben_at_sharpsvn.net>
Date: Thu, 3 Sep 2009 01:56:18 +0200

> -----Original Message-----
> From: Stephen Butler [mailto:sbutler_at_elego.de]
> Sent: donderdag 3 september 2009 1:35
> To: svn_at_subversion.tigris.org
> Subject: svn commit: r39093 - in trunk/subversion: libsvn_wc
> tests/cmdline
>
> Author: sbutler
> Date: Wed Sep 2 16:35:11 2009
> New Revision: 39093
>
> Log:
> Fix WC-NG handling of "orphaned" items in a replaced dir.
>
> "Orphans" are items deleted by a merge that are within a replaced
> tree, but aren't themselve replaced by the incoming copy operation.
> They should remain deleted, but were being corrupted.
>
> This fix also eliminates the nonsensical "deleted with history" status
> that used to be displayed for orphaned items.
>
> * subversion/libsvn_wc/entries.c
> (write_entry): Fix the logic for translating schedule-delete entries
> to wc_db rows.

Are you sure this can be fixed by changing the entries mapping?

What is the status of this problem in 1.6?
[If this issue is also in 1.6 you can probably skip the rest of the mail.]

It is not unlikely that this situation cannot be handled with the entries
wrapping. The entries handling must stay compatible for old clients. (What
is written in the entries must stay there for compatibility reasons).

To describe things better in WC-NG new code should use a direct mapping to
WC-DB; completely skipping entries. The limited options of expressing
replacements and copying is one of the reasons we are trying to remove all
entries handling (especially for writing) for Subversion 1.7.

        Bert

>
> * subversion/libsvn_wc/adm_ops.c
> (mark_tree): Don't set the "copied" flag for orphans.
> (process_committed_leaf): Relax an assertion that assumes the copied
> flag is set for orphans.
>
> * subversion/tests/cmdline/copy_tests.py
> (wc_to_wc_copy_deleted):
> * subversion/tests/cmdline/revert_tests.py
> (status_of_missing_dir_after_revert_replaced_with_history_dir):
> Tweak status expectations for orphaned items: show the wc-rev,
> don't show the '+' ("with history").
>
> * subversion/tests/cmdline/merge_tests.py
> (copy_then_replace_via_merge): Tweak status expectations. Add
> update and commit to check for WC corruption.
> (test_list): Remove XFail() from copy_then_replace_via_merge().
>
> Modified:
> trunk/subversion/libsvn_wc/adm_ops.c
> trunk/subversion/libsvn_wc/entries.c
> trunk/subversion/tests/cmdline/copy_tests.py
> trunk/subversion/tests/cmdline/merge_tests.py
> trunk/subversion/tests/cmdline/revert_tests.py
>
> Modified: trunk/subversion/libsvn_wc/adm_ops.c
> URL:
> http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/adm_ops.c?p
> athrev=39093&r1=39092&r2=39093
> =======================================================================
> =======
> --- trunk/subversion/libsvn_wc/adm_ops.c Wed Sep 2 16:02:04 2009
> (r39092)
> +++ trunk/subversion/libsvn_wc/adm_ops.c Wed Sep 2 16:35:11 2009
> (r39093)
> @@ -421,8 +421,7 @@ process_committed_leaf(int log_number,
> /* If we copy a deleted file, then it will become
> scheduled
> for deletion, but there is no base text for it.
> So we
> cannot get/compute a checksum for this file. */
> - SVN_ERR_ASSERT(entry->copied
> - && entry->schedule ==
> svn_wc_schedule_delete);
> + SVN_ERR_ASSERT(entry->schedule ==
> svn_wc_schedule_delete);
>
> /* checksum will remain NULL in this one case. */
> }
> @@ -841,7 +840,8 @@ svn_wc_process_committed4(const char *pa
> /* Recursively mark a tree ADM_ACCESS with a SCHEDULE, COPIED and/or
> KEEP_LOCAL
> flag, depending on the state of MODIFY_FLAGS (which may contain
> only a
> subset of the possible modification flags, namely, those indicating
> a change
> - to one of the three flags mentioned above). */
> + to one of the three flags mentioned above). If setting the COPIED
> + flag, skip items scheduled for deletion. */
> static svn_error_t *
> mark_tree(svn_wc_adm_access_t *adm_access,
> apr_uint64_t modify_flags,
> @@ -885,6 +885,10 @@ mark_tree(svn_wc_adm_access_t *adm_acces
> if (! strcmp((const char *)key, SVN_WC_ENTRY_THIS_DIR))
> continue;
>
> + /* If setting the COPIED flag, skip deleted items. */
> + if (copied && entry->schedule == svn_wc_schedule_delete)
> + continue;
> +
> base_name = key;
> fullpath = svn_dirent_join(svn_wc_adm_access_path(adm_access),
> base_name,
> subpool);
> @@ -941,7 +945,9 @@ mark_tree(svn_wc_adm_access_t *adm_acces
> this_dir_flags |= SVN_WC__ENTRY_MODIFY_SCHEDULE;
> }
>
> - if (modify_flags & SVN_WC__ENTRY_MODIFY_COPIED)
> + /* If setting the COPIED flag, skip deleted items. */
> + if (modify_flags & SVN_WC__ENTRY_MODIFY_COPIED
> + && entry->schedule != svn_wc_schedule_delete)
> {
> tmp_entry.copied = copied;
> this_dir_flags |= SVN_WC__ENTRY_MODIFY_COPIED;
>
> Modified: trunk/subversion/libsvn_wc/entries.c
> URL:
> http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/entries.c?p
> athrev=39093&r1=39092&r2=39093
> =======================================================================
> =======
> --- trunk/subversion/libsvn_wc/entries.c Wed Sep 2 16:02:04 2009
> (r39092)
> +++ trunk/subversion/libsvn_wc/entries.c Wed Sep 2 16:35:11 2009
> (r39093)
> @@ -1898,10 +1898,12 @@ write_entry(svn_wc__db_t *db,
>
> case svn_wc_schedule_delete:
> working_node = MAYBE_ALLOC(working_node, scratch_pool);
> - if (!this_dir->copied)
> + /* If the entry is part of a REPLACED (not COPIED) subtree,
> + then it needs a BASE node. */
> + if (! (entry->copied
> + || (this_dir->copied
> + && this_dir->schedule == svn_wc_schedule_add)))
> base_node = MAYBE_ALLOC(base_node, scratch_pool);
> - /* ### what about a deleted BASE tree, with a copy over the
> top,
> - ### followed by a delete? there should be a base node
> then... */
> break;
>
> case svn_wc_schedule_replace:
> @@ -2195,9 +2197,12 @@ write_entry(svn_wc__db_t *db,
> }
> else
> {
> - /* If we are part of a COPIED subtree, then the deletion
> is
> - referring to the WORKING tree, not the BASE tree. */
> - if (entry->copied || this_dir->copied)
> + /* If the entry is part of a COPIED (not REPLACED)
> subtree,
> + then the deletion is referring to the WORKING node,
> not
> + the BASE node. */
> + if (entry->copied
> + || (this_dir->copied
> + && this_dir->schedule == svn_wc_schedule_add))
> working_node->presence =
> svn_wc__db_status_not_present;
> else
> working_node->presence =
> svn_wc__db_status_base_deleted;
>
> Modified: trunk/subversion/tests/cmdline/copy_tests.py
> URL:
> http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/copy_te
> sts.py?pathrev=39093&r1=39092&r2=39093
> =======================================================================
> =======
> --- trunk/subversion/tests/cmdline/copy_tests.py Wed Sep 2
> 16:02:04 2009 (r39092)
> +++ trunk/subversion/tests/cmdline/copy_tests.py Wed Sep 2
> 16:35:11 2009 (r39093)
> @@ -1539,7 +1539,7 @@ def wc_to_wc_copy_deleted(sbox):
> 'A/B2' : Item(status='A ', wc_rev='-', copied='+'),
> 'A/B2/E' : Item(status=' ', wc_rev='-', copied='+'),
> 'A/B2/E/beta' : Item(status=' ', wc_rev='-', copied='+'),
> - 'A/B2/E/alpha' : Item(status='D ', wc_rev='-', copied='+'),
> + 'A/B2/E/alpha' : Item(status='D ', wc_rev=2),
> 'A/B2/lambda' : Item(status='D ', wc_rev='-', copied='+'),
> 'A/B2/F' : Item(status='D ', wc_rev='-', copied='+'),
> })
>
> Modified: trunk/subversion/tests/cmdline/merge_tests.py
> URL:
> http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/merge_t
> ests.py?pathrev=39093&r1=39092&r2=39093
> =======================================================================
> =======
> --- trunk/subversion/tests/cmdline/merge_tests.py Wed Sep 2
> 16:02:04 2009 (r39092)
> +++ trunk/subversion/tests/cmdline/merge_tests.py Wed Sep 2
> 16:35:11 2009 (r39093)
> @@ -16211,14 +16211,14 @@ def copy_then_replace_via_merge(sbox):
> main.run_svn(None, 'merge', url_A, branch)
>
> # Check status:
> - # sigma and K from r4 were deleted
> - # theta and L from r4 were replaced by r6
> - # omega and M were added (from r6)
> + # sigma and K are deleted (not copied!)
> + # theta and L are replaced (deleted then copied-here)
> + # omega and M are copied-here
> expected_status = wc.State(branch_J, {
> '' : Item(status='R ', copied='+', wc_rev='-'),
> - 'sigma' : Item(status='D ', copied='+', wc_rev='-'),
> - 'K' : Item(status='D ', copied='+', wc_rev='-'),
> - 'K/zeta' : Item(status='D ', copied='+', wc_rev='-'),
> + 'sigma' : Item(status='D ', wc_rev=6),
> + 'K' : Item(status='D ', wc_rev=6),
> + 'K/zeta' : Item(status='D ', wc_rev=6),
> 'theta' : Item(status=' ', copied='+', wc_rev='-'),
> 'L' : Item(status=' ', copied='+', wc_rev='-'),
> 'L/zeta' : Item(status=' ', copied='+', wc_rev='-'),
> @@ -16228,6 +16228,25 @@ def copy_then_replace_via_merge(sbox):
> })
> actions.run_and_verify_status(branch_J, expected_status)
>
> + # Update and commit, just to make sure the WC isn't busted.
> + main.run_svn(None, 'up', branch_J)
> + expected_output = wc.State(branch_J, {
> + '' : Item(verb='Replacing'),
> + })
> + expected_status = wc.State(branch_J, {
> + '' : Item(status=' ', wc_rev=7),
> + 'theta' : Item(status=' ', wc_rev=7),
> + 'L' : Item(status=' ', wc_rev=7),
> + 'L/zeta' : Item(status=' ', wc_rev=7),
> + 'omega' : Item(status=' ', wc_rev=7),
> + 'M' : Item(status=' ', wc_rev=7),
> + 'M/zeta' : Item(status=' ', wc_rev=7),
> + })
> + actions.run_and_verify_commit(branch_J,
> + expected_output,
> + expected_status,
> + None, branch_J)
> +
> #---------------------------------------------------------------------
> -
>
> def merge_replace_causes_tree_conflict2(sbox):
> @@ -16880,7 +16899,7 @@ test_list = [ None,
> svntest.main.is_ra_type_dav_serf),
> SkipUnless(handle_gaps_in_implicit_mergeinfo,
> server_has_mergeinfo),
> - XFail(copy_then_replace_via_merge),
> + copy_then_replace_via_merge,
> XFail(merge_replace_causes_tree_conflict2),
> XFail(merge_replace_causes_tree_conflict3),
> ]
>
> Modified: trunk/subversion/tests/cmdline/revert_tests.py
> URL:
> http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/revert_
> tests.py?pathrev=39093&r1=39092&r2=39093
> =======================================================================
> =======
> --- trunk/subversion/tests/cmdline/revert_tests.py Wed Sep 2
> 16:02:04 2009 (r39092)
> +++ trunk/subversion/tests/cmdline/revert_tests.py Wed Sep 2
> 16:35:11 2009 (r39093)
> @@ -778,8 +778,6 @@ def status_of_missing_dir_after_revert_r
> svntest.main.run_svn(None, 'up', wc_dir)
>
> # now rollback to r1, thereby reinstating the old 'G'
> - ### Eventually, expected output for 'A/D/G' should be 'R '
> - ### (replaced) instead of 'A ' (added). See issue #571 for details.
> expected_output = svntest.wc.State(wc_dir, {
> 'A/D/G': Item(status='R '),
> 'A/D/G/rho': Item(status='A '),
> @@ -796,9 +794,6 @@ def status_of_missing_dir_after_revert_r
> 'A/D/G/alpha' : Item(status='D ', wc_rev='3'),
> 'A/D/G/beta' : Item(status='D ', wc_rev='3'),
> })
> - ### these nodes are incorrectly reported as COPIED in wc-1. we
> probably
> - ### have to keep the extra COPIED markers in wc-ng.
> - expected_status.tweak('A/D/G/alpha', 'A/D/G/beta', copied='+',
> wc_rev='-')
>
> expected_skip = wc.State(wc_dir, { })
> expected_disk = svntest.main.greek_state.copy()
> @@ -821,11 +816,10 @@ def status_of_missing_dir_after_revert_r
> svntest.actions.run_and_verify_svn(None, expected_output, [],
> "revert", "-R",
> G_path)
>
> + ### Is it a bug that we'd need to run revert twice to finish the
> job?
> expected_output = svntest.verify.UnorderedOutput(
> ["A " + os.path.join(G_path, "pi") + "\n",
> "A " + os.path.join(G_path, "rho") + "\n",
> - "A " + os.path.join(G_path, "alpha") + "\n",
> - "A " + os.path.join(G_path, "beta") + "\n",
> "A " + os.path.join(G_path, "tau") + "\n"])
> svntest.actions.run_and_verify_svn(None, expected_output, [],
> "status", wc_dir)
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageI
> d=2390470

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2390473
Received on 2009-09-03 01:56:09 CEST

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