Author: julianfoad Date: Wed Aug 25 15:57:19 2010 New Revision: 989189 URL: http://svn.apache.org/viewvc?rev=989189&view=rev Log: Remove a special case introduced in r878027 in which "commit" would allow committing a deleted node even while unresolved tree conflicts are still present on or inside that node, if and only if the deletion included the "keep local" flag. We don't want a special case.
* subversion/libsvn_client/commit_util.c (harvest_committables): Ignore the 'keep_local' flag when checking for conflicts. * subversion/tests/cmdline/tree_conflict_tests.py (keep_local_del_tc_inside, keep_local_del_tc_is_target): Delete. (force_del_tc_inside): Remove a comment about keep-local. (test_list): Remove the two deleted tests. Modified: subversion/trunk/subversion/libsvn_client/commit_util.c subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py Modified: subversion/trunk/subversion/libsvn_client/commit_util.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit_util.c?rev=989189&r1=989188&r2=989189&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_client/commit_util.c (original) +++ subversion/trunk/subversion/libsvn_client/commit_util.c Wed Aug 25 15:57:19 2010 @@ -398,7 +398,6 @@ harvest_committables(apr_hash_t *committ svn_boolean_t is_added; const char *node_copyfrom_relpath; svn_revnum_t node_copyfrom_rev; - svn_boolean_t keep_local; svn_wc_context_t *wc_ctx = ctx->wc_ctx; SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath)); @@ -482,12 +481,9 @@ harvest_committables(apr_hash_t *committ } } - SVN_ERR(svn_wc__temp_get_keep_local(&keep_local, ctx->wc_ctx, - local_abspath, scratch_pool)); - if (! keep_local) - SVN_ERR(bail_on_tree_conflicted_children(ctx->wc_ctx, local_abspath, - db_kind, depth, changelists, - scratch_pool)); + SVN_ERR(bail_on_tree_conflicted_children(ctx->wc_ctx, local_abspath, + db_kind, depth, changelists, + scratch_pool)); /* Our own URL wins if not in COPY_MODE. In COPY_MODE the telescoping URLs are used. */ Modified: subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py?rev=989189&r1=989188&r2=989189&view=diff ============================================================================== --- subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py (original) +++ subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py Wed Aug 25 15:57:19 2010 @@ -704,102 +704,11 @@ def merge_dir_add_onto_not_none(sbox): #---------------------------------------------------------------------- -def keep_local_del_tc_inside(sbox): - "--keep-local del on dir with TCs inside" - # A/C <- delete with --keep-local - # A + C A/C/dir - # A + C A/C/file - - sbox.build() - wc_dir = sbox.wc_dir - - C = os.path.join(wc_dir, "A", "C") - dir = os.path.join(wc_dir, "A", "C", "dir") - file = os.path.join(wc_dir, "A", "C", "file") - - # Add dir - main.run_svn(None, 'mkdir', dir) - - # Add file - content = "This is the file 'file'.\n" - main.file_append(file, content) - main.run_svn(None, 'add', file) - - main.run_svn(None, 'commit', '-m', 'Add dir and file', wc_dir) - - # Remove dir and file in r3. - main.run_svn(None, 'delete', dir, file) - main.run_svn(None, 'commit', '-m', 'Remove dir and file', wc_dir) - - # Warp back to -r2, dir and file coming back. - main.run_svn(None, 'update', '-r2', wc_dir) - - # Set a meaningless prop on each dir and file - run_and_verify_svn(None, - ["property 'propname' set on '" + dir + "'\n"], - [], 'ps', 'propname', 'propval', dir) - run_and_verify_svn(None, - ["property 'propname' set on '" + file + "'\n"], - [], 'ps', 'propname', 'propval', file) - - # Update WC to HEAD, tree conflicts result dir and file - # because there are local mods on the props. - expected_output = wc.State(wc_dir, { - 'A/C/dir' : Item(status=' ', treeconflict='C'), - 'A/C/file' : Item(status=' ', treeconflict='C'), - }) - - expected_disk = main.greek_state.copy() - expected_disk.add({ - 'A/C/dir' : Item(props={'propname' : 'propval'}), - 'A/C/file' : Item(contents=content, props={'propname' : 'propval'}), - }) - - expected_status = get_virginal_state(wc_dir, 2) - expected_status.tweak(wc_rev='3') - expected_status.add({ - 'A/C/dir' : Item(status='A ', wc_rev='-', copied='+', treeconflict='C'), - 'A/C/file' : Item(status='A ', wc_rev='-', copied='+', treeconflict='C'), - }) - run_and_verify_update(wc_dir, - expected_output, expected_disk, expected_status, - None, None, None, None, None, 1, - wc_dir) - - # Delete A/C with --keep-local, in effect disarming the tree-conflicts. - run_and_verify_svn(None, - verify.UnorderedOutput(['D ' + C + '\n', - 'D ' + dir + '\n', - 'D ' + file + '\n']), - [], 'delete', C, '--keep-local') - - # Verify deletion status - # Note: the tree conflicts are still in the status. - expected_status.tweak('A/C', status='D ') - expected_status.tweak('A/C/dir', status='? ', copied=None, wc_rev=None) - expected_status.tweak('A/C/file', status='? ', copied=None, wc_rev=None) - - run_and_verify_status(wc_dir, expected_status) - - # Commit, remove the "disarmed" tree-conflict. - expected_output = wc.State(wc_dir, { 'A/C' : Item(verb='Deleting') }) - - expected_status.remove('A/C', 'A/C/dir', 'A/C/file') - - run_and_verify_commit(wc_dir, - expected_output, expected_status, None, - wc_dir) - -#---------------------------------------------------------------------- - def force_del_tc_inside(sbox): "--force del on dir with TCs inside" ### This test is currently marked XFail because we don't remove tree ### conflicts upon "delete --force" yet. They linger and block ### the commit. - ### This should be handled the same as with --keep-local, but - ### the code does not have the proper antennae for that yet. - ### Fixing that separately. # A/C <- delete with --force # A + C A/C/dir @@ -887,95 +796,6 @@ def force_del_tc_inside(sbox): #---------------------------------------------------------------------- -def keep_local_del_tc_is_target(sbox): - "--keep-local del on tree-conflicted targets" - # A/C - # A + C A/C/dir <- delete with --keep-local - # A + C A/C/file <- delete with --keep-local - ### This test currently XFails because the tree-conflicts on dir and - ### file remain in the WC but were supposed to be unversioned by a commit - ### (because of a delete --keep-local). - - sbox.build() - wc_dir = sbox.wc_dir - - C = os.path.join(wc_dir, "A", "C") - dir = os.path.join(wc_dir, "A", "C", "dir") - file = os.path.join(wc_dir, "A", "C", "file") - - # Add dir - main.run_svn(None, 'mkdir', dir) - - # Add file - content = "This is the file 'file'.\n" - main.file_append(file, content) - main.run_svn(None, 'add', file) - - main.run_svn(None, 'commit', '-m', 'Add dir and file', wc_dir) - - # Remove dir and file in r3. - main.run_svn(None, 'delete', dir, file) - main.run_svn(None, 'commit', '-m', 'Remove dir and file', wc_dir) - - # Warp back to -r2, dir and file coming back. - main.run_svn(None, 'update', '-r2', wc_dir) - - # Set a meaningless prop on each dir and file - run_and_verify_svn(None, - ["property 'propname' set on '" + dir + "'\n"], - [], 'ps', 'propname', 'propval', dir) - run_and_verify_svn(None, - ["property 'propname' set on '" + file + "'\n"], - [], 'ps', 'propname', 'propval', file) - - # Update WC to HEAD, tree conflicts result dir and file - # because there are local mods on the props. - expected_output = wc.State(wc_dir, { - 'A/C/dir' : Item(status=' ', treeconflict='C'), - 'A/C/file' : Item(status=' ', treeconflict='C'), - }) - - expected_disk = main.greek_state.copy() - expected_disk.add({ - 'A/C/dir' : Item(props={'propname' : 'propval'}), - 'A/C/file' : Item(contents=content, props={'propname' : 'propval'}), - }) - - expected_status = get_virginal_state(wc_dir, 2) - expected_status.tweak(wc_rev='3') - expected_status.add({ - 'A/C/dir' : Item(status='A ', wc_rev='-', copied='+', treeconflict='C'), - 'A/C/file' : Item(status='A ', wc_rev='-', copied='+', treeconflict='C'), - }) - run_and_verify_update(wc_dir, - expected_output, expected_disk, expected_status, - None, None, None, None, None, 1, - wc_dir) - - # Delete nodes with --keep-local, in effect disarming the tree-conflicts. - run_and_verify_svn(None, - ['D ' + dir + '\n', - 'D ' + file + '\n'], - [], - 'delete', dir, file, '--keep-local') - - expected_status.tweak('A/C/dir', status='? ', copied=None, wc_rev=None) - expected_status.tweak('A/C/file', status='? ', copied=None, wc_rev=None) - run_and_verify_status(wc_dir, expected_status) - - # Commit, remove the "disarmed" tree-conflict. - expected_output = wc.State(wc_dir, {}) - - ### This is why this test currently XFails. We want the conflicts - ### on the unversioned nodes to go away. - expected_status.remove('A/C/dir', 'A/C/file') - - run_and_verify_commit(wc_dir, - expected_output, expected_status, None, - wc_dir) - -#---------------------------------------------------------------------- - def force_del_tc_is_target(sbox): "--force del on tree-conflicted targets" # A/C @@ -1263,9 +1083,7 @@ test_list = [ None, XFail(merge_dir_del_onto_not_same), merge_dir_del_onto_not_dir, merge_dir_add_onto_not_none, - keep_local_del_tc_inside, XFail(force_del_tc_inside), - XFail(keep_local_del_tc_is_target), XFail(force_del_tc_is_target), query_absent_tree_conflicted_dir, XFail(up_add_onto_add_revert),