Modified: subversion/branches/issue-2779-dev/subversion/tests/cmdline/switch_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/cmdline/switch_tests.py?rev=980551&r1=980550&r2=980551&view=diff ============================================================================== --- subversion/branches/issue-2779-dev/subversion/tests/cmdline/switch_tests.py (original) +++ subversion/branches/issue-2779-dev/subversion/tests/cmdline/switch_tests.py Thu Jul 29 19:38:44 2010 @@ -805,35 +805,92 @@ def bad_intermediate_urls(sbox): "bad intermediate urls in use" sbox.build() wc_dir = sbox.wc_dir + url = sbox.repo_url + + A = os.path.join(wc_dir, 'A') + A_Z = os.path.join(wc_dir, 'A', 'Z') + url_A_C = url + '/A/C' + url_A_C_A = url + '/A/C/A' + url_A_C_A_Z = url + '/A/C/A/Z' # We'll be switching our working copy to (a modified) A/C in the Greek tree. # First, make an extra subdirectory in C to match one in the root, plus # another one inside of that. - C_url = sbox.repo_url + '/A/C' - C_A_url = sbox.repo_url + '/A/C/A' - C_A_Z_url = sbox.repo_url + '/A/C/A/Z' svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 2.\n'], [], 'mkdir', '-m', 'log msg', - C_A_url, C_A_Z_url) + url_A_C_A, url_A_C_A_Z) # Now, we'll drop a conflicting path under the root. - A_path = os.path.join(wc_dir, 'A') - A_Z_path = os.path.join(A_path, 'Z') - svntest.main.file_append(A_Z_path, 'Look, Mom, no ... switch success.') + svntest.main.file_append(A_Z, 'Look, Mom, a ... tree conflict.') + + #svntest.factory.make(sbox, """ + # svn switch url/A/C wc_dir + # # svn info A + # # check that we can recover from the tree conflict + # rm A/Z + # svn up + # """) + #exit(0) + + # svn switch url/A/C wc_dir + expected_output = svntest.wc.State(wc_dir, { + 'A/mu' : Item(status='D '), + 'A/Z' : Item(status=' ', treeconflict='C'), + 'A/C' : Item(status='D '), + 'A/B' : Item(status='D '), + 'A/D' : Item(status='D '), + 'iota' : Item(status='D '), + }) - # This switch should fail for reasons of obstruction. - exit_code, out, err = svntest.main.run_svn(1, 'switch', - C_url, wc_dir) - if not err: - raise svntest.Failure + expected_disk = svntest.main.greek_state.copy() + expected_disk.remove('iota', 'A/B', 'A/B/E', 'A/B/E/beta', 'A/B/E/alpha', + 'A/B/F', 'A/B/lambda', 'A/D', 'A/D/G', 'A/D/G/rho', 'A/D/G/pi', + 'A/D/G/tau', 'A/D/H', 'A/D/H/psi', 'A/D/H/omega', 'A/D/H/chi', + 'A/D/gamma', 'A/mu', 'A/C') + expected_disk.add({ + 'A/Z' : Item(contents="Look, Mom, a ... tree conflict."), + }) - # However, the URL for A should now reflect A/C/A, not something else. + expected_status = actions.get_virginal_state(wc_dir, 2) + expected_status.remove('iota', 'A/B', 'A/B/E', 'A/B/E/beta', 'A/B/E/alpha', + 'A/B/F', 'A/B/lambda', 'A/D', 'A/D/G', 'A/D/G/rho', 'A/D/G/pi', + 'A/D/G/tau', 'A/D/H', 'A/D/H/psi', 'A/D/H/omega', 'A/D/H/chi', + 'A/D/gamma', 'A/mu', 'A/C') + expected_status.add({ + 'A/Z' : Item(status='? ', treeconflict='C'), + }) + + actions.run_and_verify_switch(wc_dir, wc_dir, url_A_C, expected_output, + expected_disk, expected_status, None, None, None, None, None, False) + + + # However, the URL for wc/A should now reflect ^/A/C/A, not something else. expected_infos = [ { 'URL' : '.*/A/C/A$' }, ] - svntest.actions.run_and_verify_info(expected_infos, A_path) + svntest.actions.run_and_verify_info(expected_infos, A) + + + # check that we can recover from the tree conflict + # rm A/Z + os.remove(A_Z) + + # svn up + expected_output = svntest.wc.State(wc_dir, { + 'A/Z' : Item(status='A '), + }) + + expected_disk.tweak('A/Z', contents=None) + + expected_status.tweak(status=' ', wc_rev='2') + expected_status.tweak('A/Z', treeconflict=None) + + actions.run_and_verify_update(wc_dir, expected_output, expected_disk, + expected_status, None, None, None, None, None, False, wc_dir) + + #---------------------------------------------------------------------- @@ -1283,40 +1340,40 @@ def forced_switch_failures(sbox): # """ # # Add a directory to obstruct a file. # mkdir A/B/F/pi - # + # # # Add a file to obstruct a directory. # echo "The file 'H'" > A/C/H - # + # # # Test three cases where forced switch should cause a tree conflict - # + # # # 1) A forced switch that tries to add a file when an unversioned # # directory of the same name already exists. (Currently fails) # svn switch --force url/A/D A/C - # + # # # 2) A forced switch that tries to add a dir when a file of the same # # name already exists. (Tree conflict) # svn switch --force url/A/D/G A/B/F # svn info A/B/F/pi - # + # # # 3) A forced update that tries to add a directory when a versioned # # directory of the same name already exists. - # + # # # Make dir A/D/H/I in repos. # svn mkdir -m "Log message" url/A/D/H/I - # + # # # Make A/D/G/I and co A/D/H/I into it. # mkdir A/D/G/I # svn co url/A/D/H/I A/D/G/I - # + # # # Try the forced switch. A/D/G/I obstructs the dir A/D/G/I coming # # from the repos, causing an error. # svn switch --force url/A/D/H A/D/G - # + # # # Delete all three obstructions and finish the update. # rm -rf A/D/G/I # rm A/B/F/pi # rm A/C/H - # + # # # A/B/F is switched to A/D/G # # A/C is switched to A/D # # A/D/G is switched to A/D/H @@ -1350,19 +1407,13 @@ def forced_switch_failures(sbox): # 1) A forced switch that tries to add a file when an unversioned # directory of the same name already exists. (Currently fails) # svn switch --force url/A/D A/C - expected_error = ('Failed to add directory.*' + re.escape(A_C_H) + - '.*a non-directory object.*already exists') - - actions.run_and_verify_switch(wc_dir, A_C, url_A_D, None, None, None, - expected_error, None, None, None, None, False, '--force') - - # 2) A forced switch that tries to add a dir when a file of the same - # name already exists. - # svn switch --force url/A/D/G A/B/F expected_output = svntest.wc.State(wc_dir, { - 'A/B/F/rho' : Item(status='A '), - 'A/B/F/pi' : Item(status=' ', treeconflict='C'), - 'A/B/F/tau' : Item(status='A '), + 'A/C/G' : Item(status='A '), + 'A/C/G/pi' : Item(status='A '), + 'A/C/G/rho' : Item(status='A '), + 'A/C/G/tau' : Item(status='A '), + 'A/C/gamma' : Item(status='A '), + 'A/C/H' : Item(status=' ', treeconflict='C'), }) expected_disk = svntest.main.greek_state.copy() @@ -1374,23 +1425,44 @@ def forced_switch_failures(sbox): 'A/C/G/tau' : Item(contents="This is the file 'tau'.\n"), 'A/C/H' : Item(contents="The file 'H'\n"), 'A/B/F/pi' : Item(), - 'A/B/F/rho' : Item(contents="This is the file 'rho'.\n"), - 'A/B/F/tau' : Item(contents="This is the file 'tau'.\n"), }) expected_status = actions.get_virginal_state(wc_dir, 1) expected_status.add({ - 'A/B/F/tau' : Item(status=' ', wc_rev='1'), - 'A/B/F/pi' : Item(status='? ', treeconflict='C'), - 'A/B/F/rho' : Item(status=' ', wc_rev='1'), 'A/C/G' : Item(status=' ', wc_rev='1'), 'A/C/G/rho' : Item(status=' ', wc_rev='1'), - 'A/C/G/pi' : Item(status=' ', wc_rev='1'), 'A/C/G/tau' : Item(status=' ', wc_rev='1'), + 'A/C/G/pi' : Item(status=' ', wc_rev='1'), + 'A/C/H' : Item(status='? ', treeconflict='C'), 'A/C/gamma' : Item(status=' ', wc_rev='1'), }) + expected_status.tweak('A/C', switched='S') + + actions.run_and_verify_switch(wc_dir, A_C, url_A_D, expected_output, + expected_disk, expected_status, None, None, None, None, None, False, + '--force') + + + # 2) A forced switch that tries to add a dir when a file of the same + # name already exists. (Tree conflict) + # svn switch --force url/A/D/G A/B/F + expected_output = svntest.wc.State(wc_dir, { + 'A/B/F/rho' : Item(status='A '), + 'A/B/F/pi' : Item(status=' ', treeconflict='C'), + 'A/B/F/tau' : Item(status='A '), + }) + + expected_disk.add({ + 'A/B/F/rho' : Item(contents="This is the file 'rho'.\n"), + 'A/B/F/tau' : Item(contents="This is the file 'tau'.\n"), + }) + + expected_status.add({ + 'A/B/F/tau' : Item(status=' ', wc_rev='1'), + 'A/B/F/pi' : Item(status='? ', treeconflict='C'), + 'A/B/F/rho' : Item(status=' ', wc_rev='1'), + }) expected_status.tweak('A/B/F', switched='S') - expected_status.tweak('A/C', status='! ', switched='S') actions.run_and_verify_switch(wc_dir, A_B_F, url_A_D_G, expected_output, expected_disk, expected_status, None, None, None, None, None, False, @@ -1490,14 +1562,13 @@ def forced_switch_failures(sbox): 'A/D/G/psi' : Item(status=' ', wc_rev='2'), 'A/D/G/chi' : Item(status=' ', wc_rev='2'), 'A/D/H/I' : Item(status=' ', wc_rev='2'), - 'A/C/H' : Item(status=' ', wc_rev='2'), 'A/C/H/psi' : Item(status=' ', wc_rev='2'), 'A/C/H/omega' : Item(status=' ', wc_rev='2'), 'A/C/H/chi' : Item(status=' ', wc_rev='2'), 'A/C/H/I' : Item(status=' ', wc_rev='2'), }) expected_status.tweak(wc_rev='2', status=' ') - expected_status.tweak('A/B/F/pi', treeconflict=None) + expected_status.tweak('A/B/F/pi', 'A/C/H', treeconflict=None) expected_status.tweak('A/D/G', switched='S') actions.run_and_verify_update(wc_dir, expected_output, expected_disk, @@ -1541,10 +1612,7 @@ def switch_with_obstructing_local_adds(s # Setup expected results of switch. expected_output = svntest.wc.State(sbox.wc_dir, { "A/B/F/gamma" : Item(status=' ', treeconflict='C'), - "A/B/F/G" : Item(status='E '), - "A/B/F/G/pi" : Item(status=' ', treeconflict='C'), - "A/B/F/G/rho" : Item(status='A '), - "A/B/F/G/tau" : Item(status=' ', treeconflict='C'), + "A/B/F/G" : Item(status=' ', treeconflict='C'), "A/B/F/H" : Item(status='A '), "A/B/F/H/chi" : Item(status='A '), "A/B/F/H/omega" : Item(status='A '), @@ -1556,7 +1624,6 @@ def switch_with_obstructing_local_adds(s "A/B/F/gamma" : Item("This is the file 'gamma'.\n"), "A/B/F/G" : Item(), "A/B/F/G/pi" : Item("This is the OBSTRUCTING file 'pi'.\n"), - "A/B/F/G/rho" : Item("This is the file 'rho'.\n"), "A/B/F/G/tau" : Item("This is the file 'tau'.\n"), "A/B/F/G/upsilon" : Item("This is the unversioned file 'upsilon'.\n"), "A/B/F/H" : Item(), @@ -1568,19 +1635,17 @@ def switch_with_obstructing_local_adds(s expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1) expected_status.tweak('A/B/F', switched='S') expected_status.add({ - "A/B/F/gamma" : Item(status='R ', treeconflict='C', wc_rev='1'), - - "A/B/F/G" : Item(status=' ', wc_rev=1), - "A/B/F/G/pi" : Item(status='R ', treeconflict='C', wc_rev='1'), - "A/B/F/G/rho" : Item(status=' ', wc_rev=1), - "A/B/F/G/tau" : Item(status='R ', treeconflict='C', wc_rev='1'), - "A/B/F/G/upsilon" : Item(status='A ', wc_rev=0), - "A/B/F/H" : Item(status=' ', wc_rev=1), - "A/B/F/H/chi" : Item(status=' ', wc_rev=1), - "A/B/F/H/omega" : Item(status=' ', wc_rev=1), - "A/B/F/H/psi" : Item(status=' ', wc_rev=1), - "A/B/F/I" : Item(status='A ', wc_rev=0), - }) + 'A/B/F/gamma' : Item(status='R ', treeconflict='C', wc_rev='1'), + 'A/B/F/G' : Item(status='A ', treeconflict='C', wc_rev='0'), + 'A/B/F/G/pi' : Item(status='A ', wc_rev='0'), + 'A/B/F/G/tau' : Item(status='A ', wc_rev='0'), + 'A/B/F/G/upsilon' : Item(status='A ', wc_rev='0'), + 'A/B/F/H' : Item(status=' ', wc_rev='1'), + 'A/B/F/H/chi' : Item(status=' ', wc_rev='1'), + 'A/B/F/H/omega' : Item(status=' ', wc_rev='1'), + 'A/B/F/H/psi' : Item(status=' ', wc_rev='1'), + 'A/B/F/I' : Item(status='A ', wc_rev='0'), + }) # "Extra" files that we expect to result from the conflicts. extra_files = ['pi\.r0', 'pi\.r1', 'pi\.mine']
Modified: subversion/branches/issue-2779-dev/subversion/tests/cmdline/trans_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/cmdline/trans_tests.py?rev=980551&r1=980550&r2=980551&view=diff ============================================================================== --- subversion/branches/issue-2779-dev/subversion/tests/cmdline/trans_tests.py (original) +++ subversion/branches/issue-2779-dev/subversion/tests/cmdline/trans_tests.py Thu Jul 29 19:38:44 2010 @@ -868,9 +868,10 @@ def props_only_file_update(sbox): # We used to leave some temporary files around. Make sure that we don't. temps = os.listdir(os.path.join(wc_dir, svntest.main.get_admin_name(), 'tmp')) - temps.remove('prop-base') - temps.remove('props') - temps.remove('text-base') + if os.path.exists(os.path.join(wc_dir, svntest.main.get_admin_name(), + 'tmp', 'props')): + temps.remove('prop-base') + temps.remove('props') if temps: print('Temporary files leftover: %s' % (', '.join(temps),)) raise svntest.Failure Modified: subversion/branches/issue-2779-dev/subversion/tests/cmdline/update_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/cmdline/update_tests.py?rev=980551&r1=980550&r2=980551&view=diff ============================================================================== --- subversion/branches/issue-2779-dev/subversion/tests/cmdline/update_tests.py (original) +++ subversion/branches/issue-2779-dev/subversion/tests/cmdline/update_tests.py Thu Jul 29 19:38:44 2010 @@ -324,17 +324,23 @@ def update_missing(sbox): svntest.main.safe_rmtree(E_path) svntest.main.safe_rmtree(H_path) + # In single-db mode all missing items will just be restored + if svntest.main.wc_is_singledb(wc_dir): + A_or_Restored = Item(verb='Restored') + else: + A_or_Restored = Item(status='A ') + # Create expected output tree for an update of the missing items by name expected_output = svntest.wc.State(wc_dir, { 'A/mu' : Item(verb='Restored'), 'A/D/G/rho' : Item(verb='Restored'), - 'A/B/E' : Item(status='A '), - 'A/B/E/alpha' : Item(status='A '), - 'A/B/E/beta' : Item(status='A '), - 'A/D/H' : Item(status='A '), - 'A/D/H/chi' : Item(status='A '), - 'A/D/H/omega' : Item(status='A '), - 'A/D/H/psi' : Item(status='A '), + 'A/B/E' : A_or_Restored, + 'A/B/E/alpha' : A_or_Restored, + 'A/B/E/beta' : A_or_Restored, + 'A/D/H' : A_or_Restored, + 'A/D/H/chi' : A_or_Restored, + 'A/D/H/omega' : A_or_Restored, + 'A/D/H/psi' : A_or_Restored, }) # Create expected disk tree for the update. @@ -793,15 +799,25 @@ def obstructed_update_alters_wc_props(sb # Update the WC to that newer rev to trigger the obstruction. #print "Updating WC" - expected_output = svntest.wc.State(wc_dir, {}) + # svntest.factory.make(sbox, 'svn update') + # exit(0) + expected_output = svntest.wc.State(wc_dir, { + 'A/foo' : Item(status=' ', treeconflict='C'), + }) + expected_disk = svntest.main.greek_state.copy() - expected_status = svntest.actions.get_virginal_state(wc_dir, 1) - error_re = 'Failed to add directory.*object of the same name already exists' - svntest.actions.run_and_verify_update(wc_dir, - expected_output, - expected_disk, - expected_status, - error_re) + expected_disk.add({ + 'A/foo' : Item(contents="an obstruction"), + }) + + expected_status = actions.get_virginal_state(wc_dir, 2) + expected_status.add({ + 'A/foo' : Item(status='? ', treeconflict='C'), + }) + + actions.run_and_verify_update(wc_dir, expected_output, expected_disk, + expected_status, None, None, None, None, None, False, wc_dir) + # Remove the file which caused the obstruction. #print "Removing obstruction" @@ -1062,6 +1078,17 @@ def update_deleted_missing_dir(sbox): 'A/D/H' : Item(status='D '), }) + # In single-db mode the missing items are restored before the update + if svntest.main.wc_is_singledb(wc_dir): + expected_output.add({ + 'A/D/H/psi' : Item(verb='Restored'), + 'A/D/H/omega' : Item(verb='Restored'), + 'A/D/H/chi' : Item(verb='Restored'), + 'A/B/E/beta' : Item(verb='Restored'), + 'A/B/E/alpha' : Item(verb='Restored') + # A/B/E and A/D/H are also restored, but are then overriden by the delete + }) + # Create expected disk tree for the update. expected_disk = svntest.main.greek_state.copy() expected_disk.remove('A/B/E', 'A/B/E/alpha', 'A/B/E/beta') @@ -1087,6 +1114,12 @@ def update_deleted_missing_dir(sbox): # This time we're updating the whole working copy expected_status.tweak(wc_rev=2) + # And now we don't expect restore operations + expected_output = svntest.wc.State(wc_dir, { + 'A/B/E' : Item(status='D '), + 'A/D/H' : Item(status='D '), + }) + # Do the update, on the whole working copy this time svntest.actions.run_and_verify_update(wc_dir, expected_output, @@ -1134,12 +1167,23 @@ def another_hudson_problem(sbox): # Update missing directory to receive the delete, this should mark G # as 'deleted' and should not alter gamma's entry. + if not svntest.main.wc_is_singledb(wc_dir): + expected_output = ['D '+G_path+'\n', + 'Updated to revision 3.\n', + ] + else: + expected_output = ['Restored \'' + G_path + '\'\n', + 'Restored \'' + G_path + os.path.sep + 'pi\'\n', + 'Restored \'' + G_path + os.path.sep + 'rho\'\n', + 'Restored \'' + G_path + os.path.sep + 'tau\'\n', + 'D '+G_path+'\n', + 'Updated to revision 3.\n', + ] + # Sigh, I can't get run_and_verify_update to work (but not because # of issue 919 as far as I can tell) svntest.actions.run_and_verify_svn(None, - ['D '+G_path+'\n', - 'Updated to revision 3.\n', - ], [], + expected_output, [], 'up', G_path) # Both G and gamma should be 'deleted', update should produce no output @@ -1545,6 +1589,9 @@ def nested_in_read_only(sbox): sbox.build() wc_dir = sbox.wc_dir + if svntest.main.wc_is_singledb(wc_dir): + raise svntest.Skip('Unsupported in single-db') + # Delete/commit a file alpha_path = os.path.join(wc_dir, 'A', 'B', 'E', 'alpha') svntest.actions.run_and_verify_svn(None, None, [], 'rm', alpha_path) @@ -2176,36 +2223,97 @@ def forced_update_failures(sbox): # A forced update that tries to add a directory when an unversioned file # of the same name already exists should fail. - C_Path = os.path.join(wc_backup, 'A', 'C') - svntest.actions.run_and_verify_update(C_Path, None, None, None, - ".*Failed to add directory.*" + \ - "a non-directory object of the " + \ - "same name already exists", - None, None, None, None, 0, C_Path, - '--force') - - # Clean-up what we have done so far. Remove the unversioned file A/C/I - # and the unversioned directory A/B/F/nu. Then update the backup to - # r2, except for A/C, update that to r1 so A/C/I isn't present. - # working copy. - os.remove(I_path) - os.rmdir(nu_path) - svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [], - 'up', wc_backup) - svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [], - 'up', '-r', '1', C_Path) - - # Checkout %URL%/A/C/i...@2 directly to A/C/I. A/C, being at r1, views - # this as an unversioned object. - I_url = sbox.repo_url + "/A/C/I" - exit_code, so, se = svntest.actions.run_and_verify_svn( - "Unexpected error during co", - ['Checked out revision 2.\n'], [], - "co", I_url, I_path) - svntest.actions.run_and_verify_update(C_Path, None, None, None, - "Failed to add directory '.*I'.*already exists", - None, None, None, None, 0, C_Path, - '--force') + # svntest.factory.make(sbox, """ + # svn up --force wc_dir_backup/A/C + # rm -rf wc_dir_backup/A/C/I wc_dir_backup/A/B/F/nu + # svn up wc_dir_backup + # svn up -r1 wc_dir_backup/A/C + # svn co url/A/C/I wc_dir_backup/A/C/I + # svn up --force wc_dir_backup/A/C + # """) + # exit(0) + url = sbox.repo_url + wc_dir_backup = sbox.wc_dir + '.backup' + + backup_A_B_F_nu = os.path.join(wc_dir_backup, 'A', 'B', 'F', 'nu') + backup_A_C = os.path.join(wc_dir_backup, 'A', 'C') + backup_A_C_I = os.path.join(wc_dir_backup, 'A', 'C', 'I') + url_A_C_I = url + '/A/C/I' + + # svn up --force wc_dir_backup/A/C + expected_output = svntest.wc.State(wc_dir_backup, { + 'A/C/I' : Item(status=' ', treeconflict='C'), + }) + + expected_disk = svntest.main.greek_state.copy() + expected_disk.add({ + 'A/B/F/nu' : Item(), + 'A/C/I' : + Item(contents="This is the file 'I'...shouldn't I be a dir?\n"), + }) + + expected_status = actions.get_virginal_state(wc_dir_backup, 1) + expected_status.add({ + 'A/C/I' : Item(status='? ', treeconflict='C'), + 'A/B/F/nu' : Item(status='? ', treeconflict='C'), + }) + expected_status.tweak('A/C', 'A/B/F', wc_rev='2') + + actions.run_and_verify_update(wc_dir_backup, expected_output, + expected_disk, expected_status, None, None, None, None, None, False, + '--force', backup_A_C) + + # rm -rf wc_dir_backup/A/C/I wc_dir_backup/A/B/F/nu + os.remove(backup_A_C_I) + svntest.main.safe_rmtree(backup_A_B_F_nu) + + # svn up wc_dir_backup + expected_output = svntest.wc.State(wc_dir_backup, { + 'A/C/I' : Item(status='A '), + 'A/B/F/nu' : Item(status='A '), + }) + + expected_disk.tweak('A/B/F/nu', contents="This is the file 'nu'\n") + expected_disk.tweak('A/C/I', contents=None) + + expected_status.tweak(wc_rev='2', status=' ') + expected_status.tweak('A/C/I', 'A/B/F/nu', treeconflict=None) + + actions.run_and_verify_update(wc_dir_backup, expected_output, + expected_disk, expected_status, None, None, None, None, None, False, + wc_dir_backup) + + # svn up -r1 wc_dir_backup/A/C + expected_output = svntest.wc.State(wc_dir_backup, { + 'A/C/I' : Item(status='D '), + }) + + expected_disk.remove('A/C/I') + + expected_status.remove('A/C/I') + expected_status.tweak('A/C', wc_rev='1') + + actions.run_and_verify_update(wc_dir_backup, expected_output, + expected_disk, expected_status, None, None, None, None, None, False, + '-r1', backup_A_C) + + # svn co url/A/C/I wc_dir_backup/A/C/I + expected_output = svntest.wc.State(wc_dir_backup, {}) + + expected_disk = svntest.wc.State(wc_dir, {}) + + actions.run_and_verify_checkout2(False, url_A_C_I, backup_A_C_I, + expected_output, expected_disk, None, None, None, None) + + # svn up --force wc_dir_backup/A/C + expected_error = ( + "svn: Failed to add directory .*I.*working copy with the same name " + + "already exists" + ) + + actions.run_and_verify_update(wc_dir_backup, None, None, None, + expected_error, None, None, None, None, False, '--force', backup_A_C) + #---------------------------------------------------------------------- # Test for issue #2556. The tests maps a virtual drive to a working copy Modified: subversion/branches/issue-2779-dev/subversion/tests/cmdline/upgrade_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/cmdline/upgrade_tests.py?rev=980551&r1=980550&r2=980551&view=diff ============================================================================== --- subversion/branches/issue-2779-dev/subversion/tests/cmdline/upgrade_tests.py (original) +++ subversion/branches/issue-2779-dev/subversion/tests/cmdline/upgrade_tests.py Thu Jul 29 19:38:44 2010 @@ -107,6 +107,60 @@ def check_dav_cache(dir_path, wc_id, exp db.close() +# Very simple working copy property diff handler for single line textual properties +# Should probably be moved to svntest/actions.py after some major refactoring. +def simple_property_verify(dir_path, expected_props): + + # Shows all items in dict1 that are not also in dict2 + def diff_props(dict1, dict2, name, match): + + equal = True; + for key in dict1: + node = dict1[key] + node2 = dict2.get(key, None) + if node2: + for prop in node: + v1 = node[prop] + v2 = node2.get(prop, None) + + if not v2: + print('\'%s\' property on \'%s\' not found in %s' % + (prop, key, name)) + equal = False + if match and v1 != v2: + print('Expected \'%s\' on \'%s\' to be \'%s\', but found \'%s\'' % + (prop, key, v1, v2)) + equal = False + else: + print('\'%s\': %s not found in %s' % (key, dict1[key], name)) + equal = False + + return equal + + + exit_code, output, errput = svntest.main.run_svn(None, 'proplist', '-R', + '-v', dir_path) + + actual_props = {} + target = None + name = None + + for i in output: + if i.startswith('Properties on '): + target = i[15+len(dir_path)+1:-3].replace(os.path.sep, '/') + elif not i.startswith(' '): + name = i.strip() + else: + v = actual_props.get(target, {}) + v[name] = i.strip() + actual_props[target] = v + + v1 = diff_props(expected_props, actual_props, 'actual', True) + v2 = diff_props(actual_props, expected_props, 'expected', False) + + if not v1 or not v2: + print('Actual properties: %s' % actual_props) + raise svntest.Failure("Properties unequal") def run_and_verify_status_no_server(wc_dir, expected_status): "same as svntest.actions.run_and_verify_status(), but without '-u'" @@ -401,6 +455,29 @@ def do_x3_upgrade(sbox): }) run_and_verify_status_no_server(sbox.wc_dir, expected_status) + simple_property_verify(sbox.wc_dir, { + 'A/B_new/E/beta' : {'x3' : '3x', + 'svn:eol-style': 'native'}, + 'A/B/E/beta' : {'s' : 't', + 'svn:eol-style': 'native'}, + 'A/B_new/B/E/alpha' : {'svn:eol-style': 'native'}, + 'A/B/E/alpha' : {'q': 'r', + 'svn:eol-style': 'native'}, + 'A_new/alpha' : {'svn:eol-style': 'native'}, + 'A/B_new/B/new' : {'svn:eol-style': 'native'}, + 'A/B_new/E/alpha' : {'svn:eol-style': 'native', + 'u': 'v'}, + 'A/B_new/B/E' : {'q': 'r'}, + 'A/B_new/lambda' : {'svn:eol-style': 'native'}, + 'A/B_new/E' : {'x3': '3x'}, + 'A/B_new/new' : {'svn:eol-style': 'native'}, + 'A/B/lambda' : {'svn:eol-style': 'native'}, + 'A/B_new/B/E/beta' : {'svn:eol-style': 'native'}, + 'A/B_new/B/lambda' : {'svn:eol-style': 'native'}, + 'A/B/new' : {'svn:eol-style': 'native'}, + 'A/G_new/rho' : {'svn:eol-style': 'native'} + }) + svntest.actions.run_and_verify_svn(None, 'Reverted.*', [], 'revert', '-R', sbox.wc_dir) @@ -425,6 +502,12 @@ def do_x3_upgrade(sbox): }) run_and_verify_status_no_server(sbox.wc_dir, expected_status) + simple_property_verify(sbox.wc_dir, { + 'A/B/E/beta' : {'svn:eol-style': 'native'}, +# 'A/B/lambda' : {'svn:eol-style': 'native'}, + 'A/B/E/alpha' : {'svn:eol-style': 'native'} + }) + def x3_1_4_0(sbox): "3x same wc upgrade 1.4.0 test" @@ -462,7 +545,9 @@ test_list = [ None, logs_left_1_5, upgrade_wcprops, basic_upgrade_1_0, - x3_1_4_0, + # Upgrading from 1.4.0-1.4.5 with specific states fails + # See issue #2530 + XFail(x3_1_4_0), x3_1_4_6, x3_1_6_12, ] Modified: subversion/branches/issue-2779-dev/subversion/tests/libsvn_client/client-test.c URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/libsvn_client/client-test.c?rev=980551&r1=980550&r2=980551&view=diff ============================================================================== --- subversion/branches/issue-2779-dev/subversion/tests/libsvn_client/client-test.c (original) +++ subversion/branches/issue-2779-dev/subversion/tests/libsvn_client/client-test.c Thu Jul 29 19:38:44 2010 @@ -470,6 +470,14 @@ test_wc_add_scenarios(const svn_test_opt SVN_ERR(svn_wc_adm_open3(&adm_access, NULL, wc_path, TRUE, -1, NULL, NULL, pool)); + /* ### The above svn_wc_adm_open3 creates a new svn_wc__db_t + ### instance. The svn_wc_add3 below doesn't work while the + ### original svn_wc__db_t created by svn_client_create_context + ### remains open. Closing the wc-context gets around the + ### problem but is obviously a hack. */ + SVN_ERR(svn_wc_context_destroy(ctx->wc_ctx)); + SVN_ERR(svn_wc_context_create(&ctx->wc_ctx, NULL, pool, pool)); + /* Fix up copy as add with history */ SVN_ERR(svn_wc_add3(new_dir_path, adm_access, svn_depth_infinity, repos_url, committed_rev, NULL, NULL, NULL, NULL, Modified: subversion/branches/issue-2779-dev/subversion/tests/libsvn_diff/parse-diff-test.c URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/tests/libsvn_diff/parse-diff-test.c?rev=980551&r1=980550&r2=980551&view=diff ============================================================================== --- subversion/branches/issue-2779-dev/subversion/tests/libsvn_diff/parse-diff-test.c (original) +++ subversion/branches/issue-2779-dev/subversion/tests/libsvn_diff/parse-diff-test.c Thu Jul 29 19:38:44 2010 @@ -179,6 +179,42 @@ static const char *bad_git_diff_header = "## -0,0 +1 ##" NL "+value" NL; + /* A unidiff containing diff symbols in the body of the hunks. */ + static const char *diff_symbols_in_prop_unidiff = + "Index: iota" NL + "===================================================================" NL + "--- iota" NL + "+++ iota" NL + "" NL + "Property changes on: iota" NL + "___________________________________________________________________" NL + "Added: prop_add" NL + "## -0,0 +1,3 ##" NL + "+Added: bogus_prop" NL + "+## -0,0 +20 ##" NL + "+@@ -1,2 +0,0 @@" NL + "Deleted: prop_del" NL + "## -1,2 +0,0 ##" NL + "---- iota" NL + "-+++ iota" NL + "Modified: non-existent" NL + "blah, just noise - no valid hunk header" NL + "Modified: prop_mod" NL + "## -1,4 +1,4 ##" NL + "-## -1,2 +1,2 ##" NL + "+## -1,3 +1,3 ##" NL + " ## -1,5 -0,0 ##" NL + " @@ -1,5 -0,0 @@" NL + " Modified: prop_mod" NL + "## -10,4 +10,4 ##" NL + " context" NL + " context" NL + " context" NL + "-## -0,0 +1 ##" NL + "+## -1,2 +1,4 ##" NL + "" NL; + + /* Create a PATCH_FILE with name FNAME containing the contents of DIFF. */ static svn_error_t * create_patch_file(apr_file_t **patch_file, const char *fname, @@ -651,6 +687,106 @@ test_parse_property_and_text_diff(apr_po return SVN_NO_ERROR; } +static svn_error_t * +test_parse_diff_symbols_in_prop_unidiff(apr_pool_t *pool) +{ + svn_patch_t *patch; + apr_file_t *patch_file; + svn_prop_patch_t *prop_patch; + svn_hunk_t *hunk; + apr_array_header_t *hunks; + const char *fname = "test_parse_diff_symbols_in_prop_unidiff.patch"; + + SVN_ERR(create_patch_file(&patch_file, fname, diff_symbols_in_prop_unidiff, + pool)); + + SVN_ERR(svn_diff_parse_next_patch(&patch, patch_file, + FALSE, /* reverse */ + FALSE, /* ignore_whitespace */ + pool, pool)); + SVN_TEST_ASSERT(patch); + SVN_TEST_ASSERT(! strcmp(patch->old_filename, "iota")); + SVN_TEST_ASSERT(! strcmp(patch->new_filename, "iota")); + SVN_TEST_ASSERT(patch->hunks->nelts == 0); + SVN_TEST_ASSERT(apr_hash_count(patch->prop_patches) == 3); + + /* Check the added property */ + prop_patch = apr_hash_get(patch->prop_patches, "prop_add", + APR_HASH_KEY_STRING); + SVN_TEST_ASSERT(prop_patch->operation == svn_diff_op_added); + + hunks = prop_patch->hunks; + SVN_TEST_ASSERT(hunks->nelts == 1); + hunk = APR_ARRAY_IDX(hunks, 0 , svn_hunk_t *); + + SVN_ERR(check_content(hunk, TRUE, + "", + pool)); + + SVN_ERR(check_content(hunk, FALSE, + "Added: bogus_prop" NL + "## -0,0 +20 ##" NL + "@@ -1,2 +0,0 @@" NL, + pool)); + + /* Check the deleted property */ + prop_patch = apr_hash_get(patch->prop_patches, "prop_del", + APR_HASH_KEY_STRING); + SVN_TEST_ASSERT(prop_patch->operation == svn_diff_op_deleted); + + hunks = prop_patch->hunks; + SVN_TEST_ASSERT(hunks->nelts == 1); + hunk = APR_ARRAY_IDX(hunks, 0 , svn_hunk_t *); + + SVN_ERR(check_content(hunk, TRUE, + "--- iota" NL + "+++ iota" NL, + pool)); + + SVN_ERR(check_content(hunk, FALSE, + "", + pool)); + + /* Check the modified property */ + prop_patch = apr_hash_get(patch->prop_patches, "prop_mod", + APR_HASH_KEY_STRING); + SVN_TEST_ASSERT(prop_patch->operation == svn_diff_op_modified); + hunks = prop_patch->hunks; + SVN_TEST_ASSERT(hunks->nelts == 2); + hunk = APR_ARRAY_IDX(hunks, 0 , svn_hunk_t *); + + SVN_ERR(check_content(hunk, TRUE, + "## -1,2 +1,2 ##" NL + "## -1,5 -0,0 ##" NL + "@@ -1,5 -0,0 @@" NL + "Modified: prop_mod" NL, + pool)); + + SVN_ERR(check_content(hunk, FALSE, + "## -1,3 +1,3 ##" NL + "## -1,5 -0,0 ##" NL + "@@ -1,5 -0,0 @@" NL + "Modified: prop_mod" NL, + pool)); + + hunk = APR_ARRAY_IDX(hunks, 1 , svn_hunk_t *); + + SVN_ERR(check_content(hunk, TRUE, + "context" NL + "context" NL + "context" NL + "## -0,0 +1 ##" NL, + pool)); + + SVN_ERR(check_content(hunk, FALSE, + "context" NL + "context" NL + "context" NL + "## -1,2 +1,4 ##" NL, + pool)); + + return SVN_NO_ERROR; +} /* ========================================================================== */ @@ -669,5 +805,7 @@ struct svn_test_descriptor_t test_funcs[ "test property unidiff parsing"), SVN_TEST_PASS2(test_parse_property_and_text_diff, "test property and text unidiff parsing"), + SVN_TEST_PASS2(test_parse_diff_symbols_in_prop_unidiff, + "test property diffs with odd symbols"), SVN_TEST_NULL }; Modified: subversion/branches/issue-2779-dev/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd?rev=980551&r1=980550&r2=980551&view=diff ============================================================================== --- subversion/branches/issue-2779-dev/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd (original) +++ subversion/branches/issue-2779-dev/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd Thu Jul 29 19:38:44 2010 @@ -23,6 +23,12 @@ SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDE CALL ..\svn-config.cmd IF ERRORLEVEL 1 EXIT /B 1 +svnversion . /1.6.x | find "S" > nul: +IF ERRORLEVEL 1 ( + ECHO --- Building 1.6.x: Skipping bindings --- + EXIT /B 0 +) + IF EXIST "%TESTDIR%\swig" rmdir /s /q "%TESTDIR%\swig" mkdir "%TESTDIR%\swig\py-release\libsvn" mkdir "%TESTDIR%\swig\py-release\svn" @@ -35,5 +41,13 @@ xcopy "subversion\bindings\swig\python\s PATH %PATH%;%TESTDIR%\bin SET PYTHONPATH=%TESTDIR%\swig\py-release +SET result=0 + python subversion\bindings\swig\python\tests\run_all.py -IF ERRORLEVEL 1 EXIT /B 1 +IF ERRORLEVEL 1 SET result=1 + +echo win-tests.py -r -f fsfs --javahl "%TESTDIR%\tests" +win-tests.py -r -f fsfs --javahl "%TESTDIR%\tests" +IF ERRORLEVEL 1 SET result=1 + +exit /b %RESULT% Modified: subversion/branches/issue-2779-dev/tools/buildbot/slaves/win32-SharpSvn/svntest-build-bindings.cmd URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/tools/buildbot/slaves/win32-SharpSvn/svntest-build-bindings.cmd?rev=980551&r1=980550&r2=980551&view=diff ============================================================================== --- subversion/branches/issue-2779-dev/tools/buildbot/slaves/win32-SharpSvn/svntest-build-bindings.cmd (original) +++ subversion/branches/issue-2779-dev/tools/buildbot/slaves/win32-SharpSvn/svntest-build-bindings.cmd Thu Jul 29 19:38:44 2010 @@ -23,5 +23,11 @@ SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDE CALL ..\svn-config.cmd IF ERRORLEVEL 1 EXIT /B 1 +svnversion . /1.6.x | find "S" > nul: +IF ERRORLEVEL 1 ( + ECHO --- Building 1.6.x: Skipping bindings --- + EXIT /B 0 +) + msbuild subversion_vcnet.sln /p:Configuration=Release /p:Platform=win32 /t:__JAVAHL__ /t:__SWIG_PYTHON__ /t:__SWIG_PERL__ /t:__JAVAHL_TESTS__ IF ERRORLEVEL 1 EXIT /B 1 Modified: subversion/branches/issue-2779-dev/tools/client-side/svn-viewspec.py URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/tools/client-side/svn-viewspec.py?rev=980551&r1=980550&r2=980551&view=diff ============================================================================== --- subversion/branches/issue-2779-dev/tools/client-side/svn-viewspec.py (original) +++ subversion/branches/issue-2779-dev/tools/client-side/svn-viewspec.py Thu Jul 29 19:38:44 2010 @@ -20,9 +20,10 @@ # ==================================================================== """\ -Usage: 1. __SCRIPTNAME__ VIEWSPEC-FILE TARGET-DIR - 2. __SCRIPTNAME__ VIEWSPEC-FILE --dump-tree - 3. __SCRIPTNAME__ --help +Usage: 1. __SCRIPTNAME__ checkout VIEWSPEC-FILE TARGET-DIR + 2. __SCRIPTNAME__ examine VIEWSPEC-FILE + 3. __SCRIPTNAME__ help + 4. __SCRIPTNAME__ help-format VIEWSPEC-FILE is the path of a file whose contents describe a Subversion sparse checkouts layout, or '-' if that description should @@ -34,9 +35,14 @@ by this script as it checks out the spec 2. Parse VIEWSPEC-FILE and dump out a human-readable representation of the tree described in the specification. - + 3. Show this usage message. +4. Show information about the file format this program expects. + +""" + +FORMAT_HELP = """\ Viewspec File Format ==================== @@ -93,7 +99,7 @@ script in conjunction with 'svn cat' to versioned viewspec file: $ svn cat http://svn.example.com/specs/dev-spec.txt | - __SCRIPTNAME__ - /path/to/target/directory + __SCRIPTNAME__ checkout - /path/to/target/directory """ @@ -294,32 +300,47 @@ def checkout_spec(viewspec, target_dir): viewspec.tree, target_dir) +def usage_and_exit(errmsg=None): + stream = errmsg and sys.stderr or sys.stdout + msg = __doc__.replace("__SCRIPTNAME__", os.path.basename(sys.argv[0])) + stream.write(msg) + if errmsg: + stream.write("ERROR: %s\n" % (errmsg)) + sys.exit(errmsg and 1 or 0) + def main(): - if len(sys.argv) < 3 or '--help' in sys.argv: - msg = __doc__.replace("__SCRIPTNAME__", os.path.basename(sys.argv[0])) - sys.stderr.write(msg) - sys.exit(1) - if sys.argv[1] == '-': - fp = sys.stdin - else: - fp = open(sys.argv[1], 'r') - if sys.argv[2] == '--dump-tree': - target_dir = None - else: - target_dir = sys.argv[2] - - viewspec = parse_viewspec(fp) - if target_dir is None: - sys.stderr.write("Url: %s\n" % (viewspec.base_url)) + argc = len(sys.argv) + if argc < 2: + usage_and_exit('Not enough arguments.') + subcommand = sys.argv[1] + if subcommand == 'help': + usage_and_exit() + elif subcommand == 'help-format': + msg = FORMAT_HELP.replace("__SCRIPTNAME__", + os.path.basename(sys.argv[0])) + sys.stdout.write(msg) + elif subcommand == 'examine': + if argc < 3: + usage_and_exit('No viewspec file specified.') + fp = (sys.argv[2] == '-') and sys.stdin or open(sys.argv[2], 'r') + viewspec = parse_viewspec(fp) + sys.stdout.write("Url: %s\n" % (viewspec.base_url)) revision = viewspec.revision if revision != -1: - sys.stderr.write("Revision: %s\n" % (revision)) + sys.stdout.write("Revision: %s\n" % (revision)) else: - sys.stderr.write("Revision: HEAD\n") - sys.stderr.write("\n") + sys.stdout.write("Revision: HEAD\n") + sys.stdout.write("\n") viewspec.tree.dump(True) + elif subcommand == 'checkout': + if argc < 3: + usage_and_exit('No viewspec file specified.') + if argc < 4: + usage_and_exit('No target directory specified.') + fp = (sys.argv[2] == '-') and sys.stdin or open(sys.argv[2], 'r') + checkout_spec(parse_viewspec(fp), sys.argv[3]) else: - checkout_spec(viewspec, target_dir) - + usage_and_exit('Unknown subcommand "%s".' % (subcommand)) + if __name__ == "__main__": main() Modified: subversion/branches/issue-2779-dev/tools/dev/unix-build/Makefile.svn URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/tools/dev/unix-build/Makefile.svn?rev=980551&r1=980550&r2=980551&view=diff ============================================================================== --- subversion/branches/issue-2779-dev/tools/dev/unix-build/Makefile.svn (original) +++ subversion/branches/issue-2779-dev/tools/dev/unix-build/Makefile.svn Thu Jul 29 19:38:44 2010 @@ -2,31 +2,6 @@ # # WARNING: This may or may not work on your system. This Makefile is # an example, rather than a ready-made universal solution. -# -# This Makefile builds and installs Subversion, and many of its -# dependencies, on UNIX-like systems, in the current working directory. -# Indirect dependencies are not covered, e.g. you need OpenSSL installed -# to get SSL support in neon and serf. -# -# The Makefile can also run Subversion's regression test suite via all -# repository backends and RA methods. It generates the necessary configuration -# files and starts svnserve and httpd daemons automatically on non-privileged -# ports. -# -# Some version of Subversion is required to be in $PATH and will be used -# to check out working copies. -# -# The default is to compile trunk. -# Pass the branch you want to build in BRANCH, e.g. -# $ make BRANCH="1.5.x" -# You can also pass a tag to build: -# $ make TAG="1.6.6" -# And you can specify a working copy to use, in case you need more -# than one working copy of the same branch: -# $ make BRANCH="1.6.x" WC="1.6.x-test2" -# -# After the build, point your PATH to the Subversion build you want to use. -# Note that this Makefile requires GNU make. ENABLE_PYTHON_BINDINGS ?= yes ENABLE_RUBY_BINDINGS ?= yes Modified: subversion/branches/issue-2779-dev/win-tests.py URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/win-tests.py?rev=980551&r1=980550&r2=980551&view=diff ============================================================================== --- subversion/branches/issue-2779-dev/win-tests.py (original) +++ subversion/branches/issue-2779-dev/win-tests.py Thu Jul 29 19:38:44 2010 @@ -27,7 +27,7 @@ For a list of options, run this script w # $HeadURL$ # $LastChangedRevision$ -import os, sys +import os, sys, subprocess import filecmp import shutil import traceback @@ -59,6 +59,7 @@ def _usage_exit(): print(" -u URL, --url=URL : run ra_dav or ra_svn tests against URL;") print(" will start svnserve for ra_svn tests") print(" -v, --verbose : talk more") + print(" -q, --quiet : talk less") print(" -f, --fs-type=type : filesystem type to use (fsfs is default)") print(" -c, --cleanup : cleanup after running a test") print(" -t, --test=TEST : Run the TEST test (all is default); use") @@ -76,6 +77,7 @@ def _usage_exit(): print(" --httpd-daemon : Run Apache httpd as daemon") print(" --httpd-service : Run Apache httpd as Windows service (default)") print(" --http-library : dav library to use, neon (default) or serf") + print(" --javahl : Run the javahl tests instead of the normal tests") print(" --list : print test doc strings only") print(" --enable-sasl : enable Cyrus SASL authentication for") print(" svnserve") @@ -110,19 +112,19 @@ for section in gen_obj.sections.values() dll_basename = section.name + "-" + str(gen_obj.version) + ".dll" svn_dlls.append(os.path.join("subversion", section.name, dll_basename)) -opts, args = my_getopt(sys.argv[1:], 'hrdvct:pu:f:', - ['release', 'debug', 'verbose', 'cleanup', 'test=', - 'url=', 'svnserve-args=', 'fs-type=', 'asp.net-hack', +opts, args = my_getopt(sys.argv[1:], 'hrdvqct:pu:f:', + ['release', 'debug', 'verbose', 'quiet', 'cleanup', + 'test=', 'url=', 'svnserve-args=', 'fs-type=', 'asp.net-hack', 'httpd-dir=', 'httpd-port=', 'httpd-daemon', 'httpd-server', 'http-library=', 'help', - 'fsfs-packing', 'fsfs-sharding=', + 'fsfs-packing', 'fsfs-sharding=', 'javahl', 'list', 'enable-sasl', 'bin=', 'parallel', 'config-file=', 'server-minor-version=']) if len(args) > 1: print('Warning: non-option arguments after the first one will be ignored') # Interpret the options and set parameters -base_url, fs_type, verbose, cleanup = None, None, None, None +base_url, fs_type, verbose, quiet, cleanup = None, None, None, None, None repo_loc = 'local repository.' objdir = 'Debug' log = 'tests.log' @@ -134,6 +136,7 @@ httpd_port = None httpd_service = None http_library = 'neon' list_tests = None +test_javahl = None enable_sasl = None svn_bin = None parallel = None @@ -152,6 +155,8 @@ for opt, val in opts: fs_type = val elif opt in ('-v', '--verbose'): verbose = 1 + elif opt in ('-q', '--quiet'): + quiet = 1 elif opt in ('-c', '--cleanup'): cleanup = 1 elif opt in ('-t', '--test'): @@ -180,6 +185,8 @@ for opt, val in opts: fsfs_sharding = int(val) elif opt == '--fsfs-packing': fsfs_packing = 1 + elif opt == '--javahl': + test_javahl = 1 elif opt == '--list': list_tests = 1 elif opt == '--enable-sasl': @@ -642,25 +649,65 @@ else: print('Testing %s configuration on %s' % (objdir, repo_loc)) sys.path.insert(0, os.path.join(abs_srcdir, 'build')) -import run_tests -th = run_tests.TestHarness(abs_srcdir, abs_builddir, - os.path.join(abs_builddir, log), - os.path.join(abs_builddir, faillog), - base_url, fs_type, http_library, - server_minor_version, 1, cleanup, - enable_sasl, parallel, config_file, - fsfs_sharding, fsfs_packing, - list_tests, svn_bin) -old_cwd = os.getcwd() -try: - os.chdir(abs_builddir) - failed = th.run(tests_to_run) -except: - os.chdir(old_cwd) - raise -else: - os.chdir(old_cwd) +if not test_javahl: + import run_tests + th = run_tests.TestHarness(abs_srcdir, abs_builddir, + os.path.join(abs_builddir, log), + os.path.join(abs_builddir, faillog), + base_url, fs_type, http_library, + server_minor_version, not quiet, + cleanup, enable_sasl, parallel, config_file, + fsfs_sharding, fsfs_packing, + list_tests, svn_bin) + old_cwd = os.getcwd() + try: + os.chdir(abs_builddir) + failed = th.run(tests_to_run) + except: + os.chdir(old_cwd) + raise + else: + os.chdir(old_cwd) +else: + failed = False + args = ( + 'java.exe', + '-Dtest.rootdir=' + os.path.join(abs_builddir, 'javahl'), + '-Dtest.srcdir=' + os.path.join(abs_srcdir, + 'subversion/bindings/javahl'), + '-Dtest.rooturl=', + '-Dtest.fstype=' + fs_type , + '-Dtest.tests=', + + '-Djava.library.path=' + + os.path.join(abs_objdir, + 'subversion/bindings/javahl/native'), + '-classpath', + os.path.join(abs_srcdir, 'subversion/bindings/javahl/classes') +';' + + gen_obj.junit_path + ) + + sys.stderr.flush() + print('Running org.apache.subversion tests:') + sys.stdout.flush() + + r = subprocess.call(args + tuple(['org.apache.subversion.javahl.RunTests'])) + sys.stdout.flush() + sys.stderr.flush() + if (r != 0): + print('[Test runner reported failure]') + failed = True + + print('Running org.tigris.subversion tests:') + sys.stdout.flush() + r = subprocess.call(args + tuple(['org.tigris.subversion.javahl.RunTests'])) + sys.stdout.flush() + sys.stderr.flush() + if (r != 0): + print('[Test runner reported failure]') + failed = True + # Stop service daemon, if any if daemon: del daemon
