You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/09/06 21:13:44 UTC
svn commit: r993127 [11/11] - in /subversion/branches/performance: ./ build/
build/generator/ notes/ notes/tree-conflicts/
subversion/bindings/javahl/native/
subversion/bindings/javahl/src/org/apache/subversion/javahl/
subversion/bindings/javahl/src/or...
Modified: subversion/branches/performance/subversion/tests/cmdline/switch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/cmdline/switch_tests.py?rev=993127&r1=993126&r2=993127&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/cmdline/switch_tests.py (original)
+++ subversion/branches/performance/subversion/tests/cmdline/switch_tests.py Mon Sep 6 19:13:39 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/performance/subversion/tests/cmdline/trans_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/cmdline/trans_tests.py?rev=993127&r1=993126&r2=993127&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/cmdline/trans_tests.py (original)
+++ subversion/branches/performance/subversion/tests/cmdline/trans_tests.py Mon Sep 6 19:13:39 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/performance/subversion/tests/cmdline/update_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/cmdline/update_tests.py?rev=993127&r1=993126&r2=993127&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/branches/performance/subversion/tests/cmdline/update_tests.py Mon Sep 6 19:13:39 2010
@@ -793,15 +793,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"
@@ -2176,36 +2186,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/performance/subversion/tests/libsvn_diff/parse-diff-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/libsvn_diff/parse-diff-test.c?rev=993127&r1=993126&r2=993127&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/libsvn_diff/parse-diff-test.c (original)
+++ subversion/branches/performance/subversion/tests/libsvn_diff/parse-diff-test.c Mon Sep 6 19:13:39 2010
@@ -148,9 +148,19 @@ static const char *bad_git_diff_header =
"Property changes on: iota" NL
"___________________________________________________________________" NL
"Modified: prop_mod" NL
- "## -1 +1 ##" NL
+ "## -1,4 +1,4 ##" NL
"-value" NL
- "+new value" NL;
+ "+new value" NL
+ " context" NL
+ " context" NL
+ " context" NL
+ "## -10,4 +10,4 ##" NL
+ " context" NL
+ " context" NL
+ " context" NL
+ "-value" NL
+ "+new value" NL
+ "" NL;
/* ### Add edge cases like context lines stripped from leading whitespaces
* ### that starts with 'Added: ', 'Deleted: ' or 'Modified: '. */
@@ -489,6 +499,7 @@ test_parse_property_diff(apr_pool_t *poo
{
apr_file_t *patch_file;
svn_patch_t *patch;
+ svn_prop_patch_t *prop_patch;
svn_hunk_t *hunk;
apr_array_header_t *hunks;
const char *fname = "test_parse_property_diff.patch";
@@ -503,44 +514,82 @@ test_parse_property_diff(apr_pool_t *poo
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->property_hunks) == 3);
+ SVN_TEST_ASSERT(apr_hash_count(patch->prop_patches) == 3);
+
+ /* 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;
- /* Check the added property */
- hunks = apr_hash_get(patch->property_hunks, "prop_add", APR_HASH_KEY_STRING);
SVN_TEST_ASSERT(hunks->nelts == 1);
hunk = APR_ARRAY_IDX(hunks, 0 , svn_hunk_t *);
SVN_ERR(check_content(hunk, TRUE,
- "",
+ "value" NL,
pool));
SVN_ERR(check_content(hunk, FALSE,
- "value" NL,
+ "",
pool));
- /* Check the deleted property */
- hunks = apr_hash_get(patch->property_hunks, "prop_del", APR_HASH_KEY_STRING);
+ /* Check the added property */
+ prop_patch = apr_hash_get(patch->prop_patches, "prop_add",
+ APR_HASH_KEY_STRING);
+
+ SVN_TEST_ASSERT(!strcmp("prop_add", prop_patch->name));
+ 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,
- "value" NL,
+ "",
pool));
SVN_ERR(check_content(hunk, FALSE,
- "",
+ "value" NL,
pool));
/* Check the modified property */
- hunks = apr_hash_get(patch->property_hunks, "prop_mod", APR_HASH_KEY_STRING);
- SVN_TEST_ASSERT(hunks->nelts == 1);
+ 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,
+ "value" NL
+ "context" NL
+ "context" NL
+ "context" NL,
+ pool));
+
+ SVN_ERR(check_content(hunk, FALSE,
+ "new value" NL
+ "context" NL
+ "context" NL
+ "context" NL,
+ pool));
+
+ hunk = APR_ARRAY_IDX(hunks, 1 , svn_hunk_t *);
+
+ SVN_ERR(check_content(hunk, TRUE,
+ "context" NL
+ "context" NL
+ "context" NL
"value" NL,
pool));
SVN_ERR(check_content(hunk, FALSE,
+ "context" NL
+ "context" NL
+ "context" NL
"new value" NL,
pool));
@@ -552,6 +601,7 @@ test_parse_property_and_text_diff(apr_po
{
apr_file_t *patch_file;
svn_patch_t *patch;
+ svn_prop_patch_t *prop_patch;
svn_hunk_t *hunk;
apr_array_header_t *hunks;
const char *fname = "test_parse_property_and_text_diff.patch";
@@ -567,7 +617,7 @@ test_parse_property_and_text_diff(apr_po
SVN_TEST_ASSERT(! strcmp(patch->old_filename, "iota"));
SVN_TEST_ASSERT(! strcmp(patch->new_filename, "iota"));
SVN_TEST_ASSERT(patch->hunks->nelts == 1);
- SVN_TEST_ASSERT(apr_hash_count(patch->property_hunks) == 1);
+ SVN_TEST_ASSERT(apr_hash_count(patch->prop_patches) == 1);
/* Check contents of text hunk */
hunk = APR_ARRAY_IDX(patch->hunks, 0, svn_hunk_t *);
@@ -582,7 +632,11 @@ test_parse_property_and_text_diff(apr_po
pool));
/* Check the added property */
- hunks = apr_hash_get(patch->property_hunks, "prop_add", APR_HASH_KEY_STRING);
+ 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 *);
Modified: subversion/branches/performance/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/libsvn_wc/db-test.c?rev=993127&r1=993126&r2=993127&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/branches/performance/subversion/tests/libsvn_wc/db-test.c Mon Sep 6 19:13:39 2010
@@ -321,9 +321,13 @@ create_fake_wc(const char *subdir, int f
svn_sqlite__db_t *sdb;
const char * const my_statements[] = {
statements[STMT_CREATE_SCHEMA],
+#ifdef SVN_WC__NODE_DATA
+ statements[STMT_CREATE_NODE_DATA],
+#endif
TESTING_DATA,
NULL
};
+ int i;
SVN_ERR(svn_io_make_dir_recursively(dirpath, scratch_pool));
svn_error_clear(svn_io_remove_file(dbpath, scratch_pool));
@@ -332,11 +336,8 @@ create_fake_wc(const char *subdir, int f
0, NULL,
scratch_pool, scratch_pool));
- /* Create the database's schema. */
- SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ 0));
-
- /* Throw our extra data into the database. */
- SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ 1));
+ for (i = 0; my_statements[i] != NULL; i++)
+ SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ i));
return SVN_NO_ERROR;
}
Modified: subversion/branches/performance/subversion/tests/libsvn_wc/entries-compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/libsvn_wc/entries-compat.c?rev=993127&r1=993126&r2=993127&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/libsvn_wc/entries-compat.c (original)
+++ subversion/branches/performance/subversion/tests/libsvn_wc/entries-compat.c Mon Sep 6 19:13:39 2010
@@ -337,6 +337,7 @@ make_one_db(const char *dirpath,
{
const char *dbpath = svn_dirent_join(dirpath, "wc.db", scratch_pool);
svn_sqlite__db_t *sdb;
+ int i;
/* Create fake-wc/SUBDIR/.svn/ for placing the metadata. */
SVN_ERR(svn_io_make_dir_recursively(dirpath, scratch_pool));
@@ -347,11 +348,8 @@ make_one_db(const char *dirpath,
0, NULL,
scratch_pool, scratch_pool));
- /* Create the database's schema. */
- SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ 0));
-
- /* Throw our extra data into the database. */
- SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ 1));
+ for (i = 0; my_statements[i] != NULL; i++)
+ SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ i));
return SVN_NO_ERROR;
}
@@ -360,24 +358,33 @@ make_one_db(const char *dirpath,
static svn_error_t *
create_fake_wc(const char *subdir, int format, apr_pool_t *scratch_pool)
{
+ const char *root;
const char *dirpath;
const char * const my_statements[] = {
statements[STMT_CREATE_SCHEMA],
+#ifdef SVN_WC__NODE_DATA
+ statements[STMT_CREATE_NODE_DATA],
+#endif
TESTING_DATA,
NULL
};
const char * const M_statements[] = {
statements[STMT_CREATE_SCHEMA],
+#ifdef SVN_WC__NODE_DATA
+ statements[STMT_CREATE_NODE_DATA],
+#endif
M_TESTING_DATA,
NULL
};
- dirpath = svn_dirent_join_many(scratch_pool,
- "fake-wc", subdir, ".svn", NULL);
+ root = svn_dirent_join("fake-wc", subdir, scratch_pool);
+
+ SVN_ERR(svn_io_remove_dir2(root, TRUE, NULL, NULL, scratch_pool));
+
+ dirpath = svn_dirent_join(root, ".svn", scratch_pool);
SVN_ERR(make_one_db(dirpath, my_statements, scratch_pool));
- dirpath = svn_dirent_join_many(scratch_pool,
- "fake-wc", subdir, "M", ".svn", NULL);
+ dirpath = svn_dirent_join_many(scratch_pool, root, "M", ".svn", NULL);
SVN_ERR(make_one_db(dirpath, M_statements, scratch_pool));
return SVN_NO_ERROR;
@@ -524,6 +531,169 @@ test_stubs(apr_pool_t *pool)
return SVN_NO_ERROR;
}
+static svn_error_t *
+test_access_baton_like_locking(apr_pool_t *pool)
+{
+ svn_wc__db_t *db;
+ svn_wc_context_t *wc_ctx, *wc_ctx2;
+ const char *local_abspath;
+ const char *D, *D1, *D2, *D3, *D4;
+ svn_boolean_t locked_here, locked;
+ svn_error_t *err;
+ svn_wc_adm_access_t *adm_access, *subdir_access;
+
+#undef WC_NAME
+#define WC_NAME "test_access_batons"
+ SVN_ERR(create_open(&db, &local_abspath, WC_NAME, pool));
+
+ D = svn_dirent_join(local_abspath, "DD", pool);
+
+ D1 = svn_dirent_join(D, "DD", pool);
+ D2 = svn_dirent_join(D1, "DD", pool);
+ D3 = svn_dirent_join(D2, "DD", pool);
+ D4 = svn_dirent_join(D3, "DD", pool);
+
+ SVN_ERR(svn_io_make_dir_recursively(D4, pool));
+
+ /* Use the legacy interface */
+ SVN_ERR(svn_wc_adm_open3(&adm_access, NULL, local_abspath, TRUE, 0,
+ NULL, NULL, pool));
+ SVN_ERR(svn_wc_add3(D, adm_access, svn_depth_infinity, NULL,
+ SVN_INVALID_REVNUM, NULL, NULL, NULL, NULL, pool));
+ SVN_ERR(svn_wc_adm_retrieve(&subdir_access, adm_access, D, pool));
+ SVN_ERR(svn_wc_add3(D1, subdir_access, svn_depth_infinity, NULL,
+ SVN_INVALID_REVNUM, NULL, NULL, NULL, NULL, pool));
+ SVN_ERR(svn_wc_adm_retrieve(&subdir_access, adm_access, D1, pool));
+ SVN_ERR(svn_wc_add3(D2, subdir_access, svn_depth_infinity, NULL,
+ SVN_INVALID_REVNUM, NULL, NULL, NULL, NULL, pool));
+ SVN_ERR(svn_wc_adm_retrieve(&subdir_access, adm_access, D2, pool));
+ SVN_ERR(svn_wc_add3(D3, subdir_access, svn_depth_infinity, NULL,
+ SVN_INVALID_REVNUM, NULL, NULL, NULL, NULL, pool));
+ SVN_ERR(svn_wc_locked(&locked, D3, pool));
+ SVN_TEST_ASSERT(locked);
+ SVN_ERR(svn_wc_revert3(D, adm_access, -1, FALSE,
+ NULL, NULL, NULL, NULL, NULL, pool));
+ SVN_ERR(svn_wc_locked(&locked, D3, pool));
+ SVN_TEST_ASSERT(!locked);
+ SVN_ERR(svn_wc_adm_close2(adm_access, pool));
+
+ SVN_ERR(svn_wc_context_create(&wc_ctx, NULL, pool, pool));
+
+ /* Obtain a lock for the root, which is extended on each level */
+ SVN_ERR(svn_wc__db_wclock_obtain(wc_ctx->db, local_abspath, 0, FALSE, pool));
+ SVN_ERR(svn_wc_add4(wc_ctx, D, svn_depth_infinity, NULL, SVN_INVALID_REVNUM,
+ NULL, NULL, NULL, NULL, pool));
+ SVN_ERR(svn_wc_add4(wc_ctx, D1, svn_depth_infinity, NULL, SVN_INVALID_REVNUM,
+ NULL, NULL, NULL, NULL, pool));
+ SVN_ERR(svn_wc_add4(wc_ctx, D2, svn_depth_infinity, NULL, SVN_INVALID_REVNUM,
+ NULL, NULL, NULL, NULL, pool));
+ SVN_ERR(svn_wc_add4(wc_ctx, D3, svn_depth_infinity, NULL, SVN_INVALID_REVNUM,
+ NULL, NULL, NULL, NULL, pool));
+
+ SVN_ERR(svn_wc_locked2(&locked_here, &locked, wc_ctx, D3, pool));
+ SVN_TEST_ASSERT(locked_here && locked);
+
+ /* Test if the not added path is already locked */
+ SVN_ERR(svn_wc_locked2(&locked_here, &locked, wc_ctx, D4, pool));
+ SVN_TEST_ASSERT(!locked_here && !locked);
+
+ SVN_ERR(svn_wc_add4(wc_ctx, D4, svn_depth_infinity, NULL, SVN_INVALID_REVNUM,
+ NULL, NULL, NULL, NULL, pool));
+
+ SVN_ERR(svn_wc_locked2(&locked_here, &locked, wc_ctx, D4, pool));
+ SVN_TEST_ASSERT(locked_here && locked);
+
+ SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, local_abspath, pool));
+ /* Should be unlocked */
+ SVN_ERR(svn_wc_locked2(&locked_here, &locked, wc_ctx, local_abspath, pool));
+ SVN_TEST_ASSERT(!locked_here && !locked);
+
+ /* Lock shouldn't be released */
+ SVN_ERR(svn_wc_locked2(&locked_here, &locked, wc_ctx, D, pool));
+ SVN_TEST_ASSERT(locked_here && locked);
+
+ SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, D, pool));
+ SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, D1, pool));
+ SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, D2, pool));
+ SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, D3, pool));
+
+ /* Try reobtaining lock on D3; should succeed */
+ SVN_ERR(svn_wc__db_wclock_obtain(wc_ctx->db, D3, 0, FALSE, pool));
+ SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, D4, pool));
+
+
+ /* D3 should still be locked; try stealing in a different context */
+ SVN_ERR(svn_wc_context_create(&wc_ctx2, NULL, pool, pool));
+ SVN_ERR(svn_wc_locked2(&locked_here, &locked, wc_ctx2, D3, pool));
+ SVN_TEST_ASSERT(!locked_here && locked);
+
+ err = svn_wc__db_wclock_obtain(wc_ctx2->db, D3, 0, FALSE, pool);
+
+ if (err && err->apr_err != SVN_ERR_WC_LOCKED)
+ return svn_error_return(err);
+ svn_error_clear(err);
+
+ SVN_TEST_ASSERT(err != NULL); /* Can't lock, as it is still locked */
+
+ err = svn_wc__db_wclock_release(wc_ctx2->db, D4, pool);
+ if (err && err->apr_err != SVN_ERR_WC_NOT_LOCKED)
+ return svn_error_return(err);
+ svn_error_clear(err);
+
+ SVN_TEST_ASSERT(err != NULL); /* Can't unlock, as it is not ours */
+
+ /* Now steal the lock */
+ SVN_ERR(svn_wc__db_wclock_obtain(wc_ctx2->db, D3, 0, TRUE, pool));
+
+ /* We should own the lock now */
+ SVN_ERR(svn_wc_locked2(&locked_here, &locked, wc_ctx2, D3, pool));
+ SVN_TEST_ASSERT(locked_here && locked);
+
+ err = svn_wc__db_wclock_release(wc_ctx2->db, D4, pool);
+ if (err && err->apr_err != SVN_ERR_WC_NOT_LOCKED)
+ return svn_error_return(err);
+ svn_error_clear(err);
+
+ SVN_TEST_ASSERT(err != NULL); /* Can't unlock a not locked path */
+
+ /* Now create a separate working copy from the same repository directly
+ below this WC and test if our code really sees it as a separate wc,
+ for locking and normal operation */
+ {
+ const char *url, *repos_root_url, *repos_uuid;
+ const char *subdir = svn_dirent_join(local_abspath, "sub-wc", pool);
+
+ svn_boolean_t is_root;
+ SVN_ERR(svn_wc__node_get_url(&url, wc_ctx, local_abspath, pool, pool));
+ SVN_ERR(svn_wc__node_get_repos_info(&repos_root_url, &repos_uuid,
+ wc_ctx, local_abspath, FALSE, FALSE,
+ pool, pool));
+
+ SVN_ERR(svn_io_make_dir_recursively(subdir, pool));
+ SVN_ERR(svn_wc_ensure_adm3(subdir, repos_uuid,
+ svn_uri_join(url, "sub-wc", pool),
+ repos_root_url, 0, svn_depth_infinity,
+ pool));
+
+ SVN_ERR(svn_wc__check_wc_root(&is_root, NULL, NULL, wc_ctx->db, subdir,
+ pool));
+
+ SVN_TEST_ASSERT(is_root);
+
+ SVN_ERR(svn_wc__check_wc_root(&is_root, NULL, NULL, wc_ctx2->db, subdir,
+ pool));
+
+ /* This test was added to show a regression where the next check failed,
+ but the check above this succeeded */
+ SVN_TEST_ASSERT(is_root);
+
+ SVN_ERR(svn_wc_locked2(&locked_here, &locked, wc_ctx2, subdir, pool));
+ SVN_TEST_ASSERT(!locked_here && !locked);
+ }
+
+ return SVN_NO_ERROR;
+}
+
struct svn_test_descriptor_t test_funcs[] =
{
@@ -532,5 +702,7 @@ struct svn_test_descriptor_t test_funcs[
"entries are allocated in access baton"),
SVN_TEST_PASS2(test_stubs,
"access baton mojo can return stubs"),
+ SVN_TEST_PASS2(test_access_baton_like_locking,
+ "access baton like locks must work with wc-ng"),
SVN_TEST_NULL
};
Modified: subversion/branches/performance/subversion/tests/libsvn_wc/pristine-store-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/tests/libsvn_wc/pristine-store-test.c?rev=993127&r1=993126&r2=993127&view=diff
==============================================================================
--- subversion/branches/performance/subversion/tests/libsvn_wc/pristine-store-test.c (original)
+++ subversion/branches/performance/subversion/tests/libsvn_wc/pristine-store-test.c Mon Sep 6 19:13:39 2010
@@ -249,15 +249,21 @@ pristine_get_translated(const svn_test_o
translation. Set some properties on it. */
{
svn_wc_context_t *wc_ctx;
+ const char *dirname = svn_dirent_dirname(versioned_abspath, pool);
SVN_ERR(svn_wc__context_create_with_db(&wc_ctx, NULL, db, pool));
SVN_ERR(svn_io_file_create(versioned_abspath, data, pool));
+
+ SVN_ERR(svn_wc__db_wclock_obtain(wc_ctx->db, dirname, 0, FALSE, pool));
+
SVN_ERR(svn_wc_add4(wc_ctx, versioned_abspath, svn_depth_empty,
NULL, SVN_INVALID_REVNUM, NULL, NULL, NULL, NULL,
pool));
SVN_ERR(svn_wc_prop_set4(wc_ctx, versioned_abspath,
"svn:keywords", svn_string_create("Rev", pool),
FALSE, NULL, NULL, pool));
+
+ SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, dirname, pool));
}
/* Store a pristine text, and set DATA_SHA1 and DATA_MD5. */
Modified: subversion/branches/performance/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd
URL: http://svn.apache.org/viewvc/subversion/branches/performance/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd?rev=993127&r1=993126&r2=993127&view=diff
==============================================================================
--- subversion/branches/performance/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd (original)
+++ subversion/branches/performance/tools/buildbot/slaves/win32-SharpSvn/svntest-bindings.cmd Mon Sep 6 19:13:39 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/performance/tools/buildbot/slaves/win32-SharpSvn/svntest-build-bindings.cmd
URL: http://svn.apache.org/viewvc/subversion/branches/performance/tools/buildbot/slaves/win32-SharpSvn/svntest-build-bindings.cmd?rev=993127&r1=993126&r2=993127&view=diff
==============================================================================
--- subversion/branches/performance/tools/buildbot/slaves/win32-SharpSvn/svntest-build-bindings.cmd (original)
+++ subversion/branches/performance/tools/buildbot/slaves/win32-SharpSvn/svntest-build-bindings.cmd Mon Sep 6 19:13:39 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/performance/tools/client-side/svn-viewspec.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/tools/client-side/svn-viewspec.py?rev=993127&r1=993126&r2=993127&view=diff
==============================================================================
--- subversion/branches/performance/tools/client-side/svn-viewspec.py (original)
+++ subversion/branches/performance/tools/client-side/svn-viewspec.py Mon Sep 6 19:13:39 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/performance/tools/dev/unix-build/Makefile.svn
URL: http://svn.apache.org/viewvc/subversion/branches/performance/tools/dev/unix-build/Makefile.svn?rev=993127&r1=993126&r2=993127&view=diff
==============================================================================
--- subversion/branches/performance/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/branches/performance/tools/dev/unix-build/Makefile.svn Mon Sep 6 19:13:39 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
@@ -84,8 +59,8 @@ FETCH_CMD = wget -c
SUBVERSION_REPOS_URL = https://svn.apache.org/repos/asf/subversion
BDB_URL = http://ftp2.de.freebsd.org/pub/FreeBSD/distfiles/bdb/$(BDB_DIST)
APR_URL = http://svn.apache.org/repos/asf/apr/apr
-APR_ICONV_URL = ftp://ftp.fu-berlin.de/unix/www/apache/apr/$(APR_ICONV_DIST)
-GNU_ICONV_URL = ftp://ftp.fu-berlin.de/unix/gnu/libiconv/$(GNU_ICONV_DIST)
+APR_ICONV_URL = http://www.apache.org/dist/apr/$(APR_ICONV_DIST)
+GNU_ICONV_URL = http://ftp.gnu.org/pub/gnu/libiconv/$(GNU_ICONV_DIST)
APR_UTIL_URL = http://svn.apache.org/repos/asf/apr/apr-util
HTTPD_URL = http://archive.apache.org/dist/httpd/$(HTTPD_DIST)
NEON_URL = http://webdav.org/neon/$(NEON_DIST)
Modified: subversion/branches/performance/win-tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/performance/win-tests.py?rev=993127&r1=993126&r2=993127&view=diff
==============================================================================
--- subversion/branches/performance/win-tests.py (original)
+++ subversion/branches/performance/win-tests.py Mon Sep 6 19:13:39 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
@@ -76,6 +76,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")
@@ -115,7 +116,7 @@ opts, args = my_getopt(sys.argv[1:], 'hr
'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:
@@ -126,6 +127,7 @@ base_url, fs_type, verbose, cleanup = No
repo_loc = 'local repository.'
objdir = 'Debug'
log = 'tests.log'
+faillog = 'fails.log'
run_svnserve = None
svnserve_args = None
run_httpd = None
@@ -133,6 +135,7 @@ httpd_port = None
httpd_service = None
http_library = 'neon'
list_tests = None
+test_javahl = None
enable_sasl = None
svn_bin = None
parallel = None
@@ -179,6 +182,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':
@@ -222,13 +227,16 @@ if base_url:
repo_loc = 'remote repository ' + base_url + '.'
if base_url[:4] == 'http':
log = 'dav-tests.log'
+ faillog = 'dav-fails.log'
elif base_url[:3] == 'svn':
log = 'svn-tests.log'
+ faillog = 'svn-fails.log'
run_svnserve = 1
else:
# Don't know this scheme, but who're we to judge whether it's
# correct or not?
log = 'url-tests.log'
+ faillog = 'url-fails.log'
# Have to move the executables where the tests expect them to be
copied_execs = [] # Store copied exec files to avoid the final dir scan
@@ -638,24 +646,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),
- 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, 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)
+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