You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/04/07 13:15:49 UTC
svn commit: r1089826 - in /subversion/trunk/subversion:
libsvn_wc/update_editor.c tests/cmdline/checkout_tests.py
tests/cmdline/switch_tests.py tests/cmdline/update_tests.py
Author: rhuijben
Date: Thu Apr 7 11:15:49 2011
New Revision: 1089826
URL: http://svn.apache.org/viewvc?rev=1089826&view=rev
Log:
Following up on r1089806, also allow update to proceed under an added file,
where we used to skip the update.
* subversion/libsvn_wc/update_editor.c
(add_directory): Use node kind in notification.
(add_file): Just continue as shadowed when a tree conflict is detected and
when an unversioned obstruction is found. Don't set obstruction_found
for just any tree conflict.
(close_file): Directly delete a file when it is a shadowed obstruction.
* subversion/tests/cmdline/checkout_tests.py
(checkout_with_obstructions): Update expected results.
* subversion/tests/cmdline/switch_tests.py
(obstructed_switch,
forced_switch_failures): Update expected results.
* subversion/tests/cmdline/update_tests.py
(forced_update_failures,
restarted_update_should_delete_dir_prop): Update expected result.
Modified:
subversion/trunk/subversion/libsvn_wc/update_editor.c
subversion/trunk/subversion/tests/cmdline/checkout_tests.py
subversion/trunk/subversion/tests/cmdline/switch_tests.py
subversion/trunk/subversion/tests/cmdline/update_tests.py
Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1089826&r1=1089825&r2=1089826&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Thu Apr 7 11:15:49 2011
@@ -2276,7 +2276,7 @@ add_directory(const char *path,
db->already_notified = TRUE;
- do_notification(eb, db->local_abspath, svn_node_unknown,
+ do_notification(eb, db->local_abspath, svn_node_dir,
svn_wc_notify_tree_conflict, pool);
}
@@ -3117,20 +3117,7 @@ add_file(const char *path,
* if unversioned obstructions are allowed. */
if (! (kind == svn_node_file && eb->allow_unver_obstructions))
{
- /* ### Instead of skipping, this should bring in the BASE node
- * and mark some sort of obstruction-conflict. Come, o single-db! */
- fb->skip_this = TRUE;
-
- /* If we are skipping an add, we need to tell the WC that
- * there's a node supposed to be here which we don't have. */
- SVN_ERR(svn_wc__db_base_add_not_present_node(eb->db, fb->local_abspath,
- fb->new_relpath,
- eb->repos_root,
- eb->repos_uuid,
- *eb->target_revision,
- svn_wc__db_kind_file,
- NULL, NULL, scratch_pool));
- SVN_ERR(remember_skipped_tree(eb, fb->local_abspath, scratch_pool));
+ fb->shadowed = TRUE;
/* Mark a conflict */
SVN_ERR(create_tree_conflict(&tree_conflict, eb,
@@ -3146,15 +3133,13 @@ add_file(const char *path,
if (tree_conflict != NULL)
{
- fb->obstruction_found = TRUE;
-
SVN_ERR(svn_wc__db_op_set_tree_conflict(eb->db,
fb->local_abspath,
tree_conflict,
scratch_pool));
fb->already_notified = TRUE;
- do_notification(eb, fb->local_abspath, svn_node_unknown,
+ do_notification(eb, fb->local_abspath, svn_node_file,
svn_wc_notify_tree_conflict, scratch_pool);
}
@@ -4184,6 +4169,12 @@ close_file(void *file_baton,
all_work_items,
scratch_pool));
+ /* ### We can't record an unversioned obstruction yet, so
+ ### we record a delete instead, which will allow resolving the conflict
+ ### to theirs with 'svn revert'. */
+ if (fb->shadowed && fb->obstruction_found)
+ SVN_ERR(svn_wc__db_temp_op_delete(eb->db, fb->local_abspath, pool));
+
/* ### ugh. deal with preserving the file external value in the database.
### there is no official API, so we do it this way. maybe we should
### have a temp API into wc_db. */
Modified: subversion/trunk/subversion/tests/cmdline/checkout_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/checkout_tests.py?rev=1089826&r1=1089825&r2=1089826&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/checkout_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/checkout_tests.py Thu Apr 7 11:15:49 2011
@@ -208,11 +208,10 @@ def checkout_with_obstructions(sbox):
# svn status
expected_status = actions.get_virginal_state(wc_dir, 1)
- expected_status.tweak('iota', status='? ', wc_rev=None,
- treeconflict='C')
- # A is tree conflicted and obstructed
- # Currently we record that as deleted
- expected_status.tweak('A', status='D ', treeconflict='C')
+ # A and iota are tree conflicted and obstructed
+ expected_status.tweak('A', 'iota', status='D ', wc_rev=1,
+ treeconflict='C')
+
expected_status.tweak('A/D', 'A/D/G', 'A/D/G/rho', 'A/D/G/pi', 'A/D/G/tau',
'A/D/H', 'A/D/H/chi', 'A/D/H/omega', 'A/D/H/psi', 'A/D/gamma', 'A/B',
'A/B/E', 'A/B/E/beta', 'A/B/E/alpha', 'A/B/F', 'A/B/lambda', 'A/C',
@@ -226,12 +225,14 @@ def checkout_with_obstructions(sbox):
# Now see to it that we can recover from the obstructions.
# rm -rf A iota
svntest.main.safe_rmtree( os.path.join(wc_dir, 'A') )
- svntest.main.run_svn(None, 'revert', '-R', os.path.join(wc_dir, 'A'))
os.remove( os.path.join(wc_dir, 'iota') )
+
+ svntest.main.run_svn(None, 'revert', '-R', os.path.join(wc_dir, 'A'),
+ os.path.join(wc_dir, 'iota'))
+
# svn up
expected_output = svntest.wc.State(wc_dir, {
- 'iota' : Item(status='A '),
})
expected_disk = svntest.main.greek_state.copy()
Modified: subversion/trunk/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/switch_tests.py?rev=1089826&r1=1089825&r2=1089826&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/switch_tests.py Thu Apr 7 11:15:49 2011
@@ -976,7 +976,7 @@ def obstructed_switch(sbox):
expected_disk.tweak('A/B/E/alpha', contents='hello')
expected_status.add({
- 'A/B/E/alpha' : Item(status='? ', treeconflict='C'),
+ 'A/B/E/alpha' : Item(status='D ', treeconflict='C', wc_rev=3),
})
expected_status.tweak('A/B/E', wc_rev='3', switched='S')
expected_status.tweak('A/B/E/beta', wc_rev='3')
@@ -1503,7 +1503,7 @@ def forced_switch_failures(sbox):
expected_status.add({
'A/B/F/tau' : Item(status=' ', wc_rev='1'),
- 'A/B/F/pi' : Item(status='? ', treeconflict='C'),
+ 'A/B/F/pi' : Item(status='D ', treeconflict='C', wc_rev='1'),
'A/B/F/rho' : Item(status=' ', wc_rev='1'),
})
expected_status.tweak('A/B/F', switched='S')
@@ -1570,8 +1570,9 @@ def forced_switch_failures(sbox):
# rm A/C/H
os.remove(A_C_H)
- # Resolve the tree conflict on A_C_H
+ # Resolve the tree conflict on A_C_H and A_B_F_pi
svntest.main.run_svn(None, 'resolved', A_C_H)
+ svntest.main.run_svn(None, 'revert', A_B_F_pi)
# A/B/F is switched to A/D/G
# A/C is switched to A/D
@@ -1583,7 +1584,6 @@ def forced_switch_failures(sbox):
'A/D/G/I' : Item(status='A '),
'A/D/G/psi' : Item(status='A '),
'A/D/H/I' : Item(status='A '),
- 'A/B/F/pi' : Item(status='A '),
})
# When running the tests over ra_serf, 'A/D/G/omega' and 'A/D/G/psi' do
Modified: subversion/trunk/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/update_tests.py?rev=1089826&r1=1089825&r2=1089826&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/update_tests.py Thu Apr 7 11:15:49 2011
@@ -2219,7 +2219,7 @@ def forced_update_failures(sbox):
expected_status = actions.get_virginal_state(wc_backup, 1)
expected_status.add({
- 'A/B/F/nu' : Item(status='? ', treeconflict='C'),
+ 'A/B/F/nu' : Item(status='D ', treeconflict='C', wc_rev='2'),
})
expected_status.tweak('A/B/F', wc_rev='2')
@@ -2262,7 +2262,7 @@ def forced_update_failures(sbox):
expected_status = actions.get_virginal_state(wc_dir_backup, 1)
expected_status.add({
'A/C/I' : Item(status='D ', treeconflict='C', wc_rev=2),
- 'A/B/F/nu' : Item(status='? ', treeconflict='C'),
+ 'A/B/F/nu' : Item(status='D ', treeconflict='C', wc_rev=2),
})
expected_status.tweak('A/C', 'A/B/F', wc_rev='2')
@@ -2274,11 +2274,10 @@ def forced_update_failures(sbox):
os.remove(backup_A_C_I)
svntest.main.safe_rmtree(backup_A_B_F_nu)
- svntest.main.run_svn(None, 'revert', backup_A_C_I)
+ svntest.main.run_svn(None, 'revert', backup_A_C_I, backup_A_B_F_nu)
# svn up wc_dir_backup
expected_output = svntest.wc.State(wc_dir_backup, {
- 'A/B/F/nu' : Item(status='A '),
})
expected_disk.tweak('A/B/F/nu', contents="This is the file 'nu'\n")
@@ -4086,6 +4085,7 @@ def restarted_update_should_delete_dir_p
expected_status, None, wc_dir)
# Create a second working copy.
+ ### Does this hack still work with wc-ng?
other_wc = sbox.add_wc_path('other')
svntest.actions.duplicate_dir(wc_dir, other_wc)
@@ -4130,7 +4130,7 @@ def restarted_update_should_delete_dir_p
expected_status = actions.get_virginal_state(wc_dir, 3)
expected_status.add({
- 'A/zeta' : Item(status='? ', treeconflict='C'),
+ 'A/zeta' : Item(status='D ', treeconflict='C', wc_rev='3'),
})
actions.run_and_verify_update(wc_dir, expected_output, expected_disk,
@@ -4139,8 +4139,9 @@ def restarted_update_should_delete_dir_p
# Now, delete the obstructing path and rerun the update.
os.unlink(zeta_path)
+ svntest.main.run_svn(None, 'revert', zeta_path)
+
expected_output = svntest.wc.State(wc_dir, {
- 'A/zeta' : Item(status='A '),
})
expected_disk = svntest.main.greek_state.copy()