You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2020/05/23 14:17:03 UTC
svn commit: r1878061 [34/43] - in /subversion/branches/addremove: ./ build/
build/ac-macros/ build/generator/ build/generator/swig/
build/generator/templates/ build/generator/util/ build/win32/
contrib/client-side/ contrib/client-side/svn_load_dirs/ co...
Modified: subversion/branches/addremove/subversion/tests/cmdline/basic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/basic_tests.py?rev=1878061&r1=1878060&r2=1878061&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/basic_tests.py Sat May 23 14:16:56 2020
@@ -3024,16 +3024,19 @@ def peg_rev_on_non_existent_wc_path(sbox
# setup some history
sbox.simple_move('A', 'A2')
sbox.simple_move('A2/mu', 'A2/mu2')
- open(sbox.ospath('A2/mu2'), 'w').write('r2\n')
+ with open(sbox.ospath('A2/mu2'), 'w') as f:
+ f.write('r2\n')
sbox.simple_commit(message='r2')
#
sbox.simple_move('A2/mu2', 'A2/mu3')
sbox.simple_move('A2', 'A3')
- open(sbox.ospath('A3/mu3'), 'w').write('r3\n')
+ with open(sbox.ospath('A3/mu3'), 'w') as f:
+ f.write('r3\n')
sbox.simple_commit(message='r3')
#
sbox.simple_move('A3/mu3', 'A3/mu4')
- open(sbox.ospath('A3/mu4'), 'w').write('r4\n')
+ with open(sbox.ospath('A3/mu4'), 'w') as f:
+ f.write('r4\n')
sbox.simple_move('A3', 'A4')
sbox.simple_commit(message='r4')
@@ -3047,6 +3050,15 @@ def peg_rev_on_non_existent_wc_path(sbox
'cat', '-r2', sbox.ospath('mu3') + '@3')
+@Issue(4532)
+def diff_previous_revision_of_r0(sbox):
+ """diff -rPREV on WC at revision 0"""
+
+ sbox.build(empty=True)
+ svntest.actions.run_and_verify_svn(None, 'svn: E195002: ',
+ 'diff', '-rPREV', sbox.ospath(''))
+
+
# With 'svn mkdir --parents' the target directory may already exist on disk.
# In that case it was wrongly performing a recursive 'add' on its contents.
def mkdir_parents_target_exists_on_disk(sbox):
@@ -3093,7 +3105,7 @@ def plaintext_password_storage_disabled(
servers_file = open(os.path.join(config_dir_path, "servers"), "w")
servers_file.write("[global]\nstore-plaintext-passwords=no\n")
servers_file.close()
-
+
svntest.main.run_command(svntest.main.svn_binary, False, False,
"commit", "--config-dir", config_dir_path,
"-m", "committing with plaintext password storage disabled",
@@ -3114,33 +3126,37 @@ def plaintext_password_storage_disabled(
f.close()
-
+@Skip(svntest.main.is_os_windows)
def filtered_ls(sbox):
"filtered 'svn ls'"
sbox.build(read_only=True)
path = sbox.repo_url + "/A/D"
- # check plain info
- expected = [ "H/omega\n",
- "gamma\n" ]
-
- exit_code, output, error = svntest.actions.run_and_verify_svn(
- expected, [], 'ls', path, '--depth=infinity', '--search=*a')
-
- # check case-insensitivity
- exit_code, output, error = svntest.actions.run_and_verify_svn(
- expected, [], 'ls', path, '--depth=infinity', '--search=*A')
-
- expected = [ "H/\n" ]
- exit_code, output, error = svntest.actions.run_and_verify_svn(
- expected, [], 'ls', path, '--depth=infinity', '--search=h')
-
- # we don't match full paths
- exit_code, output, error = svntest.actions.run_and_verify_svn(
- [], [], 'ls', path, '--depth=infinity', '--search=*/*')
+ # with and without externals, because without externals on a 1.10+ server
+ # a server-side code path is used
+ for extra_opts in [ [], ['--include-externals'] ]:
+
+ expected = [ "H/omega\n",
+ "gamma\n" ]
+
+ exit_code, output, error = svntest.actions.run_and_verify_svn(
+ expected, [], 'ls', path, '--depth=infinity', '--search=*a', *extra_opts)
+
+ # check case-insensitivity
+ exit_code, output, error = svntest.actions.run_and_verify_svn(
+ expected, [], 'ls', path, '--depth=infinity', '--search=*A', *extra_opts)
+
+ expected = [ "H/\n" ]
+ exit_code, output, error = svntest.actions.run_and_verify_svn(
+ expected, [], 'ls', path, '--depth=infinity', '--search=h', *extra_opts)
+
+ # we don't match full paths
+ exit_code, output, error = svntest.actions.run_and_verify_svn(
+ [], [], 'ls', path, '--depth=infinity', '--search=*/*', *extra_opts)
@Issue(4700)
+@XFail(svntest.main.is_fs_type_fsx)
def null_update_last_changed_revision(sbox):
"null 'update' updates last changed rev"
@@ -3169,6 +3185,7 @@ def null_update_last_changed_revision(sb
@Issue(4700)
@XFail(svntest.main.is_fs_type_bdb)
+@XFail(svntest.main.is_fs_type_fsx)
def null_prop_update_last_changed_revision(sbox):
"null 'property update' updates last changed rev"
@@ -3195,6 +3212,36 @@ def null_prop_update_last_changed_revisi
'info', sbox.path('iota'),
'--show-item', 'last-changed-revision')
+@Skip(svntest.main.is_os_windows)
+def filtered_ls_top_level_path(sbox):
+ "filtered 'svn ls' top level path"
+
+ sbox.build(read_only=True, create_wc=False)
+ d_path = sbox.repo_url + "/A/B"
+ f_path = sbox.repo_url + "/A/B/lambda"
+
+ d_expected = svntest.verify.RegexListOutput([
+ r".* \./", # expect '*B*' to match its name which is 'B'
+ r".* E/beta",
+ r".* lambda" ])
+ f_expected = [ "lambda\n" ]
+
+ # with and without externals, because without externals on a 1.10+ server
+ # a server-side code path is used
+ for extra_opts in [ [], ['--include-externals'] ]:
+
+ exit_code, output, error = svntest.actions.run_and_verify_svn(
+ d_expected, [], 'ls', '-v', d_path, '-R', '--search=*B*', *extra_opts)
+
+ exit_code, output, error = svntest.actions.run_and_verify_svn(
+ f_expected, [], 'ls', f_path, '--search=lambda', *extra_opts)
+
+ # we don't match full paths, even for the top level path
+ exit_code, output, error = svntest.actions.run_and_verify_svn(
+ [], [], 'ls', '-v', d_path, '-R', '--search=*/*', *extra_opts)
+ exit_code, output, error = svntest.actions.run_and_verify_svn(
+ [], [], 'ls', f_path, '--search=*/*', *extra_opts)
+
########################################################################
# Run the tests
@@ -3264,11 +3311,13 @@ test_list = [ None,
rm_missing_with_case_clashing_ondisk_item,
delete_conflicts_one_of_many,
peg_rev_on_non_existent_wc_path,
+ diff_previous_revision_of_r0,
mkdir_parents_target_exists_on_disk,
plaintext_password_storage_disabled,
filtered_ls,
null_update_last_changed_revision,
null_prop_update_last_changed_revision,
+ filtered_ls_top_level_path,
]
if __name__ == '__main__':
Modified: subversion/branches/addremove/subversion/tests/cmdline/blame_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/blame_tests.py?rev=1878061&r1=1878060&r2=1878061&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/blame_tests.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/blame_tests.py Sat May 23 14:16:56 2020
@@ -958,7 +958,7 @@ def blame_youngest_to_oldest(sbox):
sbox.simple_commit() #r3
# Delete a line.
- open(iota_moved, 'w').write(line)
+ svntest.main.file_write(iota_moved, line)
sbox.simple_commit() #r4
expected_output = [
Modified: subversion/branches/addremove/subversion/tests/cmdline/changelist_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/changelist_tests.py?rev=1878061&r1=1878060&r2=1878061&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/changelist_tests.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/changelist_tests.py Sat May 23 14:16:56 2020
@@ -73,6 +73,33 @@ def changelist_all_files(wc_dir, name_fu
else:
svntest.main.run_svn(None, "changelist", clname, full_path)
+def select_paths(target_path, depth, changelists, name_func):
+ """Return the subset of paths found on disk at TARGET_PATH, to a depth
+ of DEPTH, that match CHANGELISTS.
+ NAME_FUNC, rather than the working copy, determines what
+ changelist each path is associated with.
+ Returned paths are relative to the CWD.
+
+ ### Only the paths of files are returned.
+ """
+ dot_svn = svntest.main.get_admin_name()
+ for dirpath, dirs, files in os.walk(target_path):
+ # prepare to return paths relative to WC_DIR
+ if dot_svn in dirs:
+ dirs.remove(dot_svn)
+ if not changelists: # When changelists support dirs, add: "or name_func(name) in changelists"
+ yield os.path.normpath(dirpath)
+ if depth == 'empty':
+ dirs[:] = [] # process no subdirs
+ continue # nor files
+ for name in files:
+ if not changelists or name_func(name) in changelists:
+ yield os.path.normpath(os.path.join(dirpath, name))
+ if depth == 'files':
+ dirs[:] = [] # process no subdirs
+ if depth == 'immediates':
+ depth = 'empty' # process subdirs, but no files nor dirs in them
+
def clname_from_lastchar_cb(full_path):
"""Callback for changelist_all_files() that returns a changelist
name matching the last character in the file's name. For example,
@@ -544,6 +571,8 @@ def info_with_changelists(sbox):
#----------------------------------------------------------------------
+@XFail()
+@Issue(4826)
def diff_with_changelists(sbox):
"diff --changelist (wc-wc and repos-wc)"
@@ -553,31 +582,20 @@ def diff_with_changelists(sbox):
# Add a line of text to all the versioned files in the tree.
mod_all_files(wc_dir, "New text.\n")
+ # Also make a property modification on each directory.
+ svntest.main.run_svn(None, 'propset', 'p', 'v', '-R', wc_dir)
+
# Add files to changelists based on the last character in their names.
changelist_all_files(wc_dir, clname_from_lastchar_cb)
# Now, test various combinations of changelist specification and depths.
for is_repos_wc in [0, 1]:
- for clname in [['a'], ['i'], ['a', 'i']]:
- for depth in ['files', 'infinity']:
+ for clname in [['a'], ['a', 'i'], []]:
+ for depth in ['empty', 'files', 'immediates', 'infinity', None]:
+ for subdir in ['.', 'A', 'A/D']:
# Figure out what we expect to see in our diff output.
- expected_paths = []
- if 'a' in clname:
- if depth == 'infinity':
- expected_paths.append('A/B/lambda')
- expected_paths.append('A/B/E/alpha')
- expected_paths.append('A/B/E/beta')
- expected_paths.append('A/D/gamma')
- expected_paths.append('A/D/H/omega')
- if depth == 'files' or depth == 'infinity':
- expected_paths.append('iota')
- if 'i' in clname:
- if depth == 'infinity':
- expected_paths.append('A/D/G/pi')
- expected_paths.append('A/D/H/chi')
- expected_paths.append('A/D/H/psi')
- expected_paths = sorted([os.path.join(wc_dir, x.replace('/', os.sep)) for x in expected_paths])
+ expected_paths = sorted(select_paths(sbox.ospath(subdir), depth, clname, clname_from_lastchar_cb))
# Build the command line.
args = ['diff']
@@ -589,11 +607,11 @@ def diff_with_changelists(sbox):
args.append(depth)
if is_repos_wc:
args.append('--old')
- args.append(sbox.repo_url)
+ args.append(sbox.repo_url + '/' + subdir)
args.append('--new')
- args.append(sbox.wc_dir)
+ args.append(os.path.join(wc_dir, subdir))
else:
- args.append(wc_dir)
+ args.append(os.path.join(wc_dir, subdir))
# Run 'svn diff ...'
exit_code, output, errput = svntest.main.run_svn(None, *args)
@@ -1180,6 +1198,44 @@ def readd_after_revert(sbox):
svntest.actions.run_and_verify_svn(None, [],
'add', dummy)
+#----------------------------------------------------------------------
+
+# A wc-wc diff returned no results if changelists were specified and the
+# diff target dir was not the WC root.
+@Issue(4822)
+def diff_with_changelists_subdir(sbox):
+ "diff --changelist (wc-wc) in subdir of WC"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ expected_paths = sbox.ospaths(['A/D/gamma'])
+ subdir = 'A/D'
+ clname = 'a'
+
+ for path in expected_paths:
+ svntest.main.file_append(path, "New text.\n")
+ svntest.main.run_svn(None, "changelist", clname, *expected_paths)
+
+ # Run 'svn diff ...'
+ exit_code, output, errput = svntest.main.run_svn(None,
+ 'diff', '--changelist', clname,
+ sbox.ospath(subdir))
+
+ # Filter the output for lines that begin with 'Index:', and
+ # reduce even those lines to just the actual path.
+ paths = sorted([x[7:].rstrip() for x in output if x[:7] == 'Index: '])
+
+ # Diff output on Win32 uses '/' path separators.
+ if sys.platform == 'win32':
+ paths = [x.replace('/', os.sep) for x in paths]
+
+ # And, compare!
+ if (paths != expected_paths):
+ raise svntest.Failure("Expected paths (%s) and actual paths (%s) "
+ "don't gel"
+ % (str(expected_paths), str(paths)))
+
########################################################################
# Run the tests
@@ -1203,6 +1259,7 @@ test_list = [ None,
add_remove_non_existent_target,
add_remove_unversioned_target,
readd_after_revert,
+ diff_with_changelists_subdir,
]
if __name__ == '__main__':
Modified: subversion/branches/addremove/subversion/tests/cmdline/commit_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/commit_tests.py?rev=1878061&r1=1878060&r2=1878061&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/commit_tests.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/commit_tests.py Sat May 23 14:16:56 2020
@@ -2823,7 +2823,8 @@ def commit_add_subadd(sbox):
# prepare targets file
targets = "A/D A/D/H A/D/H/chi A/D/H/omega A/D/H/psi".split()
- open(targets_file, 'w').write("\n".join(targets))
+ with open(targets_file, 'w') as f:
+ f.write("\n".join(targets))
# r2: rm A/D
sbox.simple_rm('A/D')
@@ -3113,6 +3114,73 @@ def commit_xml(sbox):
sbox.simple_append('index.html', '<Q></R>', True)
sbox.simple_commit()
+@Issue(4722)
+def commit_issue4722_checksum(sbox):
+ "commit that triggered checksum failure"
+
+ sbox.build()
+
+ # This bug only ever affected FSFS in 1.9.7. The test could be
+ # considered a bit "fragile" as any change to the on-disk
+ # representation may well make it pass trivially. On the other hand
+ # it should still pass irrespective of that representation, and for
+ # all other repository types.
+
+ # Enough data to allow the bug to occur
+ with open(sbox.ospath('f'), 'w') as fp:
+ for i in range(0, 2001):
+ fp.write('abcdefghijklmnopqrstuvwxyz')
+ sbox.simple_add('f')
+ sbox.simple_commit()
+
+ # Just the right data to trigger the bug
+ with open(sbox.ospath('f'), 'w') as fp:
+ for i in range(0, 8713):
+ fp.write(str(i))
+ fp.write("11111")
+ sbox.simple_commit()
+
+ # Trigger deduplication which is when the bug occurred
+ with open(sbox.ospath('f'), 'w') as fp:
+ for i in range(0, 2001):
+ fp.write('abcdefghijklmnopqrstuvwxyz')
+ sbox.simple_commit()
+
+@XFail()
+def commit_sees_tree_conflict_on_unversioned_path(sbox):
+ "commit sees tree conflict on unversioned path"
+
+ sbox.build(empty=True)
+ was_cwd = os.getcwd()
+ os.chdir(sbox.wc_dir)
+ sbox.wc_dir = '.'
+
+ # create a tree conflict victim at an unversioned path
+ sbox.simple_mkdir('topdir')
+ sbox.simple_commit()
+ sbox.simple_mkdir('topdir/subdir')
+ sbox.simple_commit()
+ sbox.simple_update()
+ sbox.simple_rm('topdir')
+ sbox.simple_commit()
+ sbox.simple_update()
+ svntest.actions.run_and_verify_svn(
+ None, [],
+ 'merge', '-c2', sbox.wc_dir, '--ignore-ancestry', '--accept', 'postpone')
+ # check that we did create a conflict
+ svntest.actions.run_and_verify_svn(
+ None, 'svn: E155015:.*existing.*conflict.*',
+ 'merge', '-c1', sbox.wc_dir, '--ignore-ancestry', '--accept', 'postpone')
+
+ # attempt to commit; should fail
+ expected_err = "svn: E155015: .* '.*topdir' remains in conflict"
+ svntest.actions.run_and_verify_commit(sbox.wc_dir, None, None,
+ expected_err,
+ sbox.wc_dir)
+
+ os.chdir(was_cwd)
+
+
########################################################################
# Run the tests
@@ -3190,6 +3258,8 @@ test_list = [ None,
commit_mergeinfo_ood,
mkdir_conflict_proper_error,
commit_xml,
+ commit_issue4722_checksum,
+ commit_sees_tree_conflict_on_unversioned_path,
]
if __name__ == '__main__':
Modified: subversion/branches/addremove/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/copy_tests.py?rev=1878061&r1=1878060&r2=1878061&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/copy_tests.py Sat May 23 14:16:56 2020
@@ -1021,6 +1021,76 @@ def repos_to_wc(sbox):
os.path.join(D_dir, 'B'))
#----------------------------------------------------------------------
+def foreign_repos_to_wc(sbox):
+ "foreign repository to WC copy"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ def move_url(repo_url, source, dest):
+ svntest.main.run_svn(False, 'move', '-m', svntest.main.make_log_msg(),
+ repo_url + '/' + source,
+ repo_url + '/' + dest)
+
+ # Scenarios:
+ # (parent-path-under-'A/', base-name, child-paths, mergeinfo-inheritance)
+ scenarios = [
+ ('B', 'E', ['alpha','beta'], 'explicit'),
+ ('B', 'F', [], 'inherited'),
+ ('D/G', 'pi', [], 'explicit'),
+ ('D/G', 'rho', [], 'inherited'),
+ ]
+
+ # Add some mergeinfo, which should be discarded by a foreign repo copy.
+ # On each path of interest, add either explicit or inherited mergeinfo:
+ # the implementation handles these cases differently.
+ # (We commit these initially in the original repo just for convenience: as
+ # we already have a WC. Really they only need to be in the 'other' repo.)
+ for parent, name, children, mi_inheritance in scenarios:
+ if mi_inheritance == 'explicit':
+ sbox.simple_propset(SVN_PROP_MERGEINFO,
+ '/branch/' + name + ':1', 'A/' + parent + '/' + name)
+ else:
+ sbox.simple_propset(SVN_PROP_MERGEINFO,
+ '/branch/' + name + ':1', 'A/' + parent)
+ sbox.simple_commit()
+
+ # We have a standard repository and working copy. Now we create a
+ # second repository with the same greek tree, but different UUID.
+ repo_dir = sbox.repo_dir
+ other_repo_dir, other_repo_url = sbox.add_repo_path('other')
+ svntest.main.copy_repos(repo_dir, other_repo_dir, 2, 1)
+ move_url(other_repo_url, 'A', 'A2')
+ move_url(other_repo_url, 'A2', 'A3')
+
+ # URL->wc copy:
+ # copy a file and a directory from a foreign repository.
+ # we should get some scheduled additions *without history*.
+ peg_rev = '3'
+ op_rev = '2'
+
+ for parent, name, children, mi_inheritance in scenarios:
+ src_url = other_repo_url + '/A2/' + parent + '/' + name
+ src_url_resolved = src_url.replace('/A2/', '/A/')
+
+ expected_output = svntest.verify.UnorderedOutput([
+ '--- Copying from foreign repository URL \'%s\':\n' % src_url_resolved,
+ 'A %s\n' % sbox.ospath(name),
+ ] + [
+ 'A %s\n' % sbox.ospath(name + '/' + child)
+ for child in children
+ ])
+ svntest.actions.run_and_verify_svn(expected_output, [],
+ 'copy', '-r' + op_rev,
+ src_url + '@' + peg_rev,
+ wc_dir)
+
+ # Validate the mergeinfo of the copy destination (we expect none)
+ svntest.actions.run_and_verify_svn([], '.*W200017: Property.*not found',
+ 'propget', SVN_PROP_MERGEINFO,
+ sbox.ospath(name))
+
+#----------------------------------------------------------------------
# Issue 1084: ra_svn move/copy bug
@Issue(1084)
def copy_to_root(sbox):
@@ -3504,6 +3574,50 @@ def copy_make_parents_wc_wc(sbox):
expected_output,
expected_status)
+
+#----------------------------------------------------------------------
+# Test copying and creating parents in the wc with dst directory being
+# precreated and unversioned
+
+def copy_make_parents_wc_wc_existing_unversioned_dst(sbox):
+ "svn cp --parents WC_PATH WC_PATH (ex. unver. dst)"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ iota_path = sbox.ospath('iota')
+ new_iota_path = sbox.ospath('X/Y/Z/iota')
+ os.makedirs(os.path.dirname(new_iota_path))
+
+ # Copy iota
+ svntest.actions.run_and_verify_svn(None, [],
+ 'cp', '--parents',
+ iota_path, new_iota_path)
+
+ # Create expected output
+ expected_output = svntest.wc.State(wc_dir, {
+ 'X' : Item(verb='Adding'),
+ 'X/Y' : Item(verb='Adding'),
+ 'X/Y/Z' : Item(verb='Adding'),
+ 'X/Y/Z/iota' : Item(verb='Adding'),
+ })
+
+ # Create expected status tree
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+
+ # Add the moved files
+ expected_status.add({
+ 'X' : Item(status=' ', wc_rev=2),
+ 'X/Y' : Item(status=' ', wc_rev=2),
+ 'X/Y/Z' : Item(status=' ', wc_rev=2),
+ 'X/Y/Z/iota' : Item(status=' ', wc_rev=2),
+ })
+
+ svntest.actions.run_and_verify_commit(wc_dir,
+ expected_output,
+ expected_status)
+
+
#----------------------------------------------------------------------
# Test copying and creating parents from the repo to the wc
@@ -3546,6 +3660,49 @@ def copy_make_parents_repo_wc(sbox):
#----------------------------------------------------------------------
+# Test copying and creating parents from the repo to the wc with dst
+# directory being precreated and unversioned
+
+def copy_make_parents_repo_wc_existing_unversioned_dst(sbox):
+ "svn cp --parents URL WC_PATH with (ex. unver. dst)"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ iota_url = sbox.repo_url + '/iota'
+ new_iota_path = sbox.ospath('X/Y/Z/iota')
+ os.makedirs(os.path.dirname(new_iota_path))
+
+ # Copy iota
+ svntest.actions.run_and_verify_svn(None, [],
+ 'cp', '--parents',
+ iota_url, new_iota_path)
+
+ # Create expected output
+ expected_output = svntest.wc.State(wc_dir, {
+ 'X' : Item(verb='Adding'),
+ 'X/Y' : Item(verb='Adding'),
+ 'X/Y/Z' : Item(verb='Adding'),
+ 'X/Y/Z/iota' : Item(verb='Adding'),
+ })
+
+ # Create expected status tree
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+
+ # Add the moved files
+ expected_status.add({
+ 'X' : Item(status=' ', wc_rev=2),
+ 'X/Y' : Item(status=' ', wc_rev=2),
+ 'X/Y/Z' : Item(status=' ', wc_rev=2),
+ 'X/Y/Z/iota' : Item(status=' ', wc_rev=2),
+ })
+
+ svntest.actions.run_and_verify_commit(wc_dir,
+ expected_output,
+ expected_status)
+
+
+#----------------------------------------------------------------------
# Test copying and creating parents from the wc to the repo
def copy_make_parents_wc_repo(sbox):
@@ -3651,70 +3808,49 @@ def URI_encoded_repos_to_wc(sbox):
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_disk = svntest.main.greek_state.copy()
+ def path_join(head, tail):
+ if not head: return tail
+ if not tail: return head
+ return head + '/' + tail
+
+ def greek_file_item(path):
+ if path[-1:].islower():
+ basename = re.sub('.*/', '', path)
+ return Item("This is the file '" + basename + "'.\n")
+ return Item()
+
+ A_paths = [
+ "",
+ "B",
+ "B/lambda",
+ "B/E",
+ "B/E/alpha",
+ "B/E/beta",
+ "B/F",
+ "mu",
+ "C",
+ "D",
+ "D/gamma",
+ "D/G",
+ "D/G/pi",
+ "D/G/rho",
+ "D/G/tau",
+ "D/H",
+ "D/H/chi",
+ "D/H/omega",
+ "D/H/psi",
+ ]
+
def copy_URL_to_WC(URL_rel_path, dest_name, rev):
- lines = [
- "A " + os.path.join(wc_dir, dest_name, "B") + "\n",
- "A " + os.path.join(wc_dir, dest_name, "B", "lambda") + "\n",
- "A " + os.path.join(wc_dir, dest_name, "B", "E") + "\n",
- "A " + os.path.join(wc_dir, dest_name, "B", "E", "alpha") + "\n",
- "A " + os.path.join(wc_dir, dest_name, "B", "E", "beta") + "\n",
- "A " + os.path.join(wc_dir, dest_name, "B", "F") + "\n",
- "A " + os.path.join(wc_dir, dest_name, "mu") + "\n",
- "A " + os.path.join(wc_dir, dest_name, "C") + "\n",
- "A " + os.path.join(wc_dir, dest_name, "D") + "\n",
- "A " + os.path.join(wc_dir, dest_name, "D", "gamma") + "\n",
- "A " + os.path.join(wc_dir, dest_name, "D", "G") + "\n",
- "A " + os.path.join(wc_dir, dest_name, "D", "G", "pi") + "\n",
- "A " + os.path.join(wc_dir, dest_name, "D", "G", "rho") + "\n",
- "A " + os.path.join(wc_dir, dest_name, "D", "G", "tau") + "\n",
- "A " + os.path.join(wc_dir, dest_name, "D", "H") + "\n",
- "A " + os.path.join(wc_dir, dest_name, "D", "H", "chi") + "\n",
- "A " + os.path.join(wc_dir, dest_name, "D", "H", "omega") + "\n",
- "A " + os.path.join(wc_dir, dest_name, "D", "H", "psi") + "\n",
- "Checked out revision " + str(rev - 1) + ".\n",
- "A " + os.path.join(wc_dir, dest_name) + "\n"]
- expected = svntest.verify.UnorderedOutput(lines)
- expected_status.add({
- dest_name + "/B" : Item(status=' ', wc_rev=rev),
- dest_name + "/B/lambda" : Item(status=' ', wc_rev=rev),
- dest_name + "/B/E" : Item(status=' ', wc_rev=rev),
- dest_name + "/B/E/alpha" : Item(status=' ', wc_rev=rev),
- dest_name + "/B/E/beta" : Item(status=' ', wc_rev=rev),
- dest_name + "/B/F" : Item(status=' ', wc_rev=rev),
- dest_name + "/mu" : Item(status=' ', wc_rev=rev),
- dest_name + "/C" : Item(status=' ', wc_rev=rev),
- dest_name + "/D" : Item(status=' ', wc_rev=rev),
- dest_name + "/D/gamma" : Item(status=' ', wc_rev=rev),
- dest_name + "/D/G" : Item(status=' ', wc_rev=rev),
- dest_name + "/D/G/pi" : Item(status=' ', wc_rev=rev),
- dest_name + "/D/G/rho" : Item(status=' ', wc_rev=rev),
- dest_name + "/D/G/tau" : Item(status=' ', wc_rev=rev),
- dest_name + "/D/H" : Item(status=' ', wc_rev=rev),
- dest_name + "/D/H/chi" : Item(status=' ', wc_rev=rev),
- dest_name + "/D/H/omega" : Item(status=' ', wc_rev=rev),
- dest_name + "/D/H/psi" : Item(status=' ', wc_rev=rev),
- dest_name : Item(status=' ', wc_rev=rev)})
- expected_disk.add({
- dest_name : Item(props={}),
- dest_name + '/B' : Item(),
- dest_name + '/B/lambda' : Item("This is the file 'lambda'.\n"),
- dest_name + '/B/E' : Item(),
- dest_name + '/B/E/alpha' : Item("This is the file 'alpha'.\n"),
- dest_name + '/B/E/beta' : Item("This is the file 'beta'.\n"),
- dest_name + '/B/F' : Item(),
- dest_name + '/mu' : Item("This is the file 'mu'.\n"),
- dest_name + '/C' : Item(),
- dest_name + '/D' : Item(),
- dest_name + '/D/gamma' : Item("This is the file 'gamma'.\n"),
- dest_name + '/D/G' : Item(),
- dest_name + '/D/G/pi' : Item("This is the file 'pi'.\n"),
- dest_name + '/D/G/rho' : Item("This is the file 'rho'.\n"),
- dest_name + '/D/G/tau' : Item("This is the file 'tau'.\n"),
- dest_name + '/D/H' : Item(),
- dest_name + '/D/H/chi' : Item("This is the file 'chi'.\n"),
- dest_name + '/D/H/omega' : Item("This is the file 'omega'.\n"),
- dest_name + '/D/H/psi' : Item("This is the file 'psi'.\n"),
- })
+ expected = svntest.verify.UnorderedOutput(
+ [ "A " + sbox.ospath(path_join(dest_name, p)) + "\n"
+ for p in A_paths ])
+ expected_status.add(
+ { path_join(dest_name, p) : Item(status=' ', wc_rev=rev)
+ for p in A_paths })
+ expected_disk.add(
+ { path_join(dest_name, p) : greek_file_item(p)
+ for p in A_paths })
# Make a copy
svntest.actions.run_and_verify_svn(expected, [],
@@ -4333,7 +4469,7 @@ def copy_added_dir_with_copy(sbox):
def copy_broken_symlink(sbox):
"""copy broken symlink"""
- ## See http://subversion.tigris.org/issues/show_bug.cgi?id=3303. ##
+ ## See https://issues.apache.org/jira/browse/SVN-3303. ##
sbox.build()
wc_dir = sbox.wc_dir
@@ -5904,7 +6040,9 @@ test_list = [ None,
copy_peg_rev_url,
old_dir_wc_to_wc,
copy_make_parents_wc_wc,
+ copy_make_parents_wc_wc_existing_unversioned_dst,
copy_make_parents_repo_wc,
+ copy_make_parents_repo_wc_existing_unversioned_dst,
copy_make_parents_wc_repo,
copy_make_parents_repo_repo,
URI_encoded_repos_to_wc,
@@ -5955,6 +6093,7 @@ test_list = [ None,
ext_wc_copy_deleted,
copy_subtree_deleted,
resurrect_at_root,
+ foreign_repos_to_wc,
]
if __name__ == '__main__':
Modified: subversion/branches/addremove/subversion/tests/cmdline/dav-mirror-autocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/dav-mirror-autocheck.sh?rev=1878061&r1=1878060&r2=1878061&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/dav-mirror-autocheck.sh (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/dav-mirror-autocheck.sh Sat May 23 14:16:56 2020
@@ -31,7 +31,7 @@
#
# The set of changes sent through the system is currently
# just the test case for issue 2939, using svnmucc
-# http://subversion.tigris.org/issues/show_bug.cgi?id=2939
+# https://issues.apache.org/jira/browse/SVN-2939
# But of course, any svn traffic liable to break over
# mirroring would be a good addition.
#
@@ -100,6 +100,7 @@ function setup_config() {
say "setting up config: " $1
cat > "$1" <<__EOF__
+$LOAD_MOD_MPM
$LOAD_MOD_LOG_CONFIG
$LOAD_MOD_MIME
$LOAD_MOD_UNIXD
@@ -114,9 +115,30 @@ $LOAD_MOD_AUTHZ_CORE
$LOAD_MOD_AUTHZ_USER
$LOAD_MOD_AUTHZ_HOST
+__EOF__
+
+if "$HTTPD" -v | grep '/2\.[012]' >/dev/null; then
+ cat >> "$1" <<__EOF__
LockFile lock
User $(id -un)
Group $(id -gn)
+__EOF__
+else
+HTTPD_LOCK="$HTTPD_ROOT/lock"
+mkdir "$HTTPD_LOCK" \
+ || fail "couldn't create lock directory '$HTTPD_LOCK'"
+ cat >> "$1" <<__EOF__
+# worker and prefork MUST have a mpm-accept lockfile in 2.3.0+
+<IfModule worker.c>
+ Mutex "file:$HTTPD_LOCK" mpm-accept
+</IfModule>
+<IfModule prefork.c>
+ Mutex "file:$HTTPD_LOCK" mpm-accept
+</IfModule>
+__EOF__
+fi
+
+cat >> "$1" <<__EOF__
Listen ${TEST_PORT}
ServerName localhost
PidFile "${HTTPD_ROOT}/pid"
@@ -133,6 +155,9 @@ MaxRequestsPerChild 0
<IfModule worker.c>
ThreadsPerChild 8
</IfModule>
+<IfModule event.c>
+ ThreadsPerChild 8
+</IfModule>
MaxClients 16
HostNameLookups Off
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" format
@@ -202,6 +227,12 @@ function usage() {
SCRIPT=$(basename $0)
+NO_TESTS=
+if [ "x$1" = 'x--no-tests' ]; then
+ NO_TESTS=1
+ shift
+fi
+
if [ $# -ne 1 ] ; then
usage
fi
@@ -249,7 +280,7 @@ HTPASSWD=$(get_prog_name htpasswd htpass
SVN=$ABS_BUILDDIR/subversion/svn/svn
SVNADMIN=$ABS_BUILDDIR/subversion/svnadmin/svnadmin
SVNSYNC=$ABS_BUILDDIR/subversion/svnsync/svnsync
-SVNMUCC=${SVNMUCC:-$ABS_BUILDDIR/tools/client-side/svnmucc/svnmucc}
+SVNMUCC=$ABS_BUILDDIR/subversion/svnmucc/svnmucc
SVNLOOK=$ABS_BUILDDIR/subversion/svnlook/svnlook
[ -x $HTTPD ] || fail "HTTPD '$HTTPD' not executable"
@@ -259,9 +290,7 @@ SVNLOOK=$ABS_BUILDDIR/subversion/svnlook
[ -x $SVNADMIN ] || fail "SVNADMIN $SVNADMIN not built"
[ -x $SVNSYNC ] || fail "SVNSYNC $SVNSYNC not built"
[ -x $SVNLOOK ] || fail "SVNLOOK $SVNLOOK not built"
-[ -x $SVNMUCC ] \
- || fail SVNMUCC $SVNMUCC executable not built, needed for test. \
- \'cd $ABS_BUILDDIR\; make svnmucc\' to fix.
+[ -x $SVNMUCC ] || fail "SVNMUCC $SVNMUCC not built"
say HTTPD: $HTTPD
say SVN: $SVN
@@ -309,6 +338,10 @@ LOAD_MOD_AUTHN_FILE="$(get_loadmodule_co
LOAD_MOD_AUTHZ_USER="$(get_loadmodule_config mod_authz_user)" \
|| fail "Authz_User module not found."
}
+if [ ${APACHE_MPM:+set} ]; then
+ LOAD_MOD_MPM=$(get_loadmodule_config mod_mpm_$APACHE_MPM) \
+ || fail "MPM module not found"
+fi
if [ ${MODULE_PATH:+set} ]; then
MOD_DAV_SVN="$MODULE_PATH/mod_dav_svn.so"
@@ -365,7 +398,9 @@ $SVNADMIN create "$SLAVE_REPOS" || fail
$SVNADMIN dump "$MASTER_REPOS" | $SVNADMIN load "$SLAVE_REPOS" \
|| fail "duplicate repositories failed"
# make sure uuid's match
-[ `cat "$SLAVE_REPOS/db/uuid"` = `cat "$MASTER_REPOS/db/uuid"` ] \
+read MASTER_UUID < "$MASTER_REPOS/db/uuid"
+read SLAVE_UUID < "$SLAVE_REPOS/db/uuid"
+[ "$SLAVE_UUID" = "$MASTER_UUID" ] \
|| fail "master/slave uuid mismatch"
# setup hooks:
# slave allows revprop changes
@@ -397,12 +432,18 @@ $SVNSYNC initialize --non-interactive "$
--username=svnsync --password=svnsync \
|| fail "svnsync initialize failed"
+if [ $NO_TESTS ]; then
+ echo "MASTER_URL=$MASTER_URL"
+ echo "SLAVE_URL=$SLAVE_URL"
+ exit
+fi
+
# OK, let's start testing! Commit changes to slave, expect
# them to proxy through to the master, and then
# svnsync back to the slave
#
# reproducible test case from:
-# http://subversion.tigris.org/issues/show_bug.cgi?id=2939
+# https://issues.apache.org/jira/browse/SVN-2939
#
BASE_URL="$SLAVE_URL"
say running svnmucc test to $BASE_URL
Modified: subversion/branches/addremove/subversion/tests/cmdline/davautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/davautocheck.sh?rev=1878061&r1=1878060&r2=1878061&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/davautocheck.sh (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/davautocheck.sh Sat May 23 14:16:56 2020
@@ -52,6 +52,7 @@
# Run this script with the test suite name and test number to execute just this
# test:
# subversion/tests/cmdline/davautocheck.sh basic 4
+# This script can also be invoked via "make davautocheck".
#
# If the temporary directory is not deleted, it can be reused for further
# manual DAV protocol interoperation testing. HTTPD must be started by
@@ -65,22 +66,23 @@
# APXS=/opt/svn/1.4.x/bin/apxs MODULE_PATH=/opt/svn/1.4.x/modules \
# subversion/tests/cmdline/davautocheck.sh
#
-# To prevent the server from advertising httpv2, pass USE_HTTPV1 in
-# the environment.
+# Other environment variables that are interpreted by this script:
#
-# To enable "SVNCacheRevProps on" set CACHE_REVPROPS in the environment.
+# make davautocheck CACHE_REVPROPS=1 # sets SVNCacheRevProps on
#
-# To test over https set USE_SSL in the environment.
+# make davautocheck BLOCK_READ=1 # sets SVNBlockRead on
#
-# To use value for "SVNPathAuthz" directive set SVN_PATH_AUTHZ with
-# appropriate value in the environment.
+# make davautocheck USE_SSL=1 # run over https
#
-# To load an MPM module for Apache 2.4 use APACHE_MPM=event in the
-# environment.
+# make davautocheck USE_HTTPV1=1 # sets SVNAdvertiseV2Protocol off
+#
+# make davautocheck APACHE_MPM=event # specifies the 2.4 MPM
+#
+# make davautocheck SVN_PATH_AUTHZ=short_circuit # SVNPathAuthz short_circuit
#
# Passing --no-tests as argv[1] will have the script start a server
-# but not run any tests. Passing --gdb will do the same, and in addition
-# spawn gdb in the foreground attached to the running server.
+# but not run any tests. Passing --gdb or --lldb will do the same, and in
+# addition spawn gdb/lldb in the foreground attached to the running server.
PYTHON=${PYTHON:-python}
@@ -222,6 +224,11 @@ if [ ${CACHE_REVPROPS:+set} ]; then
CACHE_REVPROPS_SETTING=on
fi
+BLOCK_READ_SETTING=off
+if [ ${BLOCK_READ:+set} ]; then
+ BLOCK_READ_SETTING=on
+fi
+
if [ ${MODULE_PATH:+set} ]; then
MOD_DAV_SVN="$MODULE_PATH/mod_dav_svn.so"
MOD_AUTHZ_SVN="$MODULE_PATH/mod_authz_svn.so"
@@ -274,6 +281,9 @@ say "Using '$HTPASSWD'..."
LOAD_MOD_DAV=$(get_loadmodule_config mod_dav) \
|| fail "DAV module not found"
+LOAD_MOD_DAV_FS=$(get_loadmodule_config mod_dav_fs) \
+ || fail "Filesystem DAV module not found"
+
LOAD_MOD_LOG_CONFIG=$(get_loadmodule_config mod_log_config) \
|| fail "log_config module not found"
@@ -440,6 +450,7 @@ $LOAD_MOD_MIME
$LOAD_MOD_ALIAS
$LOAD_MOD_UNIXD
$LOAD_MOD_DAV
+$LOAD_MOD_DAV_FS
LoadModule dav_svn_module "$MOD_DAV_SVN"
$LOAD_MOD_AUTH
$LOAD_MOD_AUTHN_CORE
@@ -475,6 +486,13 @@ mkdir "$HTTPD_LOCK" \
__EOF__
fi
+HTTPD_DAV="$HTTPD_ROOT/dav"
+mkdir "$HTTPD_DAV" \
+ || fail "couldn't create DAV lock directory '$HTTPD_DAV'"
+cat >> "$HTTPD_CFG" <<__EOF__
+DavLockDB "$HTTPD_DAV/lock.db"
+__EOF__
+
if [ ${USE_SSL:+set} ]; then
cat >> "$HTTPD_CFG" <<__EOF__
SSLEngine on
@@ -518,40 +536,59 @@ CustomLog "$HTTPD_ROOT/ops" "%
#Require all granted
</Directory>
+Alias /nodavroot $ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/nodavroot
+<Directory $ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/nodavroot>
+</Directory>
+
+Alias /fsdavroot $ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/fsdavroot
+<Directory $ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/fsdavroot>
+ DAV filesystem
+</Directory>
+
<Location /svn-test-work/repositories>
+__EOF__
+location_common() {
+cat >> "$HTTPD_CFG" <<__EOF__
DAV svn
- SVNParentPath "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/repositories"
AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile $HTTPD_USERS
- Require valid-user
SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
+ SVNListParentPath On
+ SVNBlockRead ${BLOCK_READ_SETTING}
+__EOF__
+}
+location_common
+cat >> "$HTTPD_CFG" <<__EOF__
+ SVNParentPath "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/repositories"
+ Require valid-user
${SVN_PATH_AUTHZ_LINE}
</Location>
<Location /ddt-test-work/repositories>
- DAV svn
+__EOF__
+location_common
+cat >> "$HTTPD_CFG" <<__EOF__
SVNParentPath "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/repositories"
- AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
- AuthType Basic
- AuthName "Subversion Repository"
- AuthUserFile $HTTPD_USERS
Require valid-user
- SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
- SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
${SVN_PATH_AUTHZ_LINE}
DontDoThatConfigFile "$HTTPD_DONTDOTHAT"
</Location>
<Location /svn-test-work/local_tmp/repos>
- DAV svn
+__EOF__
+location_common
+cat >> "$HTTPD_CFG" <<__EOF__
SVNPath "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp/repos"
- AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
- AuthType Basic
- AuthName "Subversion Repository"
- AuthUserFile $HTTPD_USERS
Require valid-user
- SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
+ ${SVN_PATH_AUTHZ_LINE}
+</Location>
+<Location /svn-test-work/local_tmp/trojan>
+__EOF__
+location_common
+cat >> "$HTTPD_CFG" <<__EOF__
+ SVNPath "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp/trojan"
+ Require valid-user
${SVN_PATH_AUTHZ_LINE}
</Location>
<Location /authz-test-work/anon>
@@ -574,84 +611,54 @@ CustomLog "$HTTPD_ROOT/ops" "%
${SVN_PATH_AUTHZ_LINE}
</Location>
<Location /authz-test-work/mixed>
- DAV svn
+__EOF__
+location_common
+cat >> "$HTTPD_CFG" <<__EOF__
SVNParentPath "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
- AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
- SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
- SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
- SVNListParentPath On
- AuthType Basic
- AuthName "Subversion Repository"
- AuthUserFile $HTTPD_USERS
Require valid-user
Satisfy Any
${SVN_PATH_AUTHZ_LINE}
</Location>
<Location /authz-test-work/mixed-noauthwhenanon>
- DAV svn
+__EOF__
+location_common
+cat >> "$HTTPD_CFG" <<__EOF__
SVNParentPath "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
- AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
- SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
- SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
- SVNListParentPath On
- AuthType Basic
- AuthName "Subversion Repository"
- AuthUserFile $HTTPD_USERS
Require valid-user
AuthzSVNNoAuthWhenAnonymousAllowed On
SVNPathAuthz On
</Location>
<Location /authz-test-work/authn>
- DAV svn
+__EOF__
+location_common
+cat >> "$HTTPD_CFG" <<__EOF__
SVNParentPath "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
- AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
- SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
- SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
- SVNListParentPath On
- AuthType Basic
- AuthName "Subversion Repository"
- AuthUserFile $HTTPD_USERS
Require valid-user
${SVN_PATH_AUTHZ_LINE}
</Location>
<Location /authz-test-work/authn-anonoff>
- DAV svn
+__EOF__
+location_common
+cat >> "$HTTPD_CFG" <<__EOF__
SVNParentPath "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
- AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
- SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
- SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
- SVNListParentPath On
- AuthType Basic
- AuthName "Subversion Repository"
- AuthUserFile $HTTPD_USERS
Require valid-user
AuthzSVNAnonymous Off
SVNPathAuthz On
</Location>
<Location /authz-test-work/authn-lcuser>
- DAV svn
+__EOF__
+location_common
+cat >> "$HTTPD_CFG" <<__EOF__
SVNParentPath "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
- AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
- SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
- SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
- SVNListParentPath On
- AuthType Basic
- AuthName "Subversion Repository"
- AuthUserFile $HTTPD_USERS
Require valid-user
AuthzForceUsernameCase Lower
${SVN_PATH_AUTHZ_LINE}
</Location>
<Location /authz-test-work/authn-group>
- DAV svn
+__EOF__
+location_common
+cat >> "$HTTPD_CFG" <<__EOF__
SVNParentPath "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
- AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
- SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
- SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
- SVNListParentPath On
- AuthType Basic
- AuthName "Subversion Repository"
- AuthUserFile $HTTPD_USERS
AuthGroupFile $HTTPD_GROUPS
Require group random
AuthzSVNAuthoritative Off
@@ -659,15 +666,10 @@ CustomLog "$HTTPD_ROOT/ops" "%
</Location>
<IfModule mod_authz_core.c>
<Location /authz-test-work/sallrany>
- DAV svn
+__EOF__
+location_common
+cat >> "$HTTPD_CFG" <<__EOF__
SVNParentPath "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
- AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
- SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
- SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
- SVNListParentPath On
- AuthType Basic
- AuthName "Subversion Repository"
- AuthUserFile $HTTPD_USERS
AuthzSendForbiddenOnFailure On
Satisfy All
<RequireAny>
@@ -677,15 +679,10 @@ CustomLog "$HTTPD_ROOT/ops" "%
${SVN_PATH_AUTHZ_LINE}
</Location>
<Location /authz-test-work/sallrall>
- DAV svn
+__EOF__
+location_common
+cat >> "$HTTPD_CFG" <<__EOF__
SVNParentPath "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
- AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
- SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
- SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
- SVNListParentPath On
- AuthType Basic
- AuthName "Subversion Repository"
- AuthUserFile $HTTPD_USERS
AuthzSendForbiddenOnFailure On
Satisfy All
<RequireAll>
@@ -763,6 +760,12 @@ if [ $# -eq 1 ] && [ "x$1" = 'x--no-test
exit
fi
+if [ $# -eq 1 ] && [ "x$1" = 'x--lldb' ]; then
+ echo "http://localhost:$HTTPD_PORT/svn-test-work/repositories"
+ $STOPSCRIPT && lldb --one-line=run -- $START -X
+ exit
+fi
+
if [ $# -eq 1 ] && [ "x$1" = 'x--gdb' ]; then
echo "http://localhost:$HTTPD_PORT/svn-test-work/repositories"
$STOPSCRIPT && gdb -silent -ex r -args $START -X
Modified: subversion/branches/addremove/subversion/tests/cmdline/depth_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/depth_tests.py?rev=1878061&r1=1878060&r2=1878061&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/depth_tests.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/depth_tests.py Sat May 23 14:16:56 2020
@@ -1073,7 +1073,7 @@ def commit_depth_immediates(sbox):
# Message-ID: <46...@collab.net>
# Date: Thu, 12 Jul 2007 15:59:45 -0400
#
- # See also http://subversion.tigris.org/issues/show_bug.cgi?id=2882.
+ # See also https://issues.apache.org/jira/browse/SVN-2882.
#
# Outline of the test:
# ====================
@@ -2846,7 +2846,7 @@ def commit_excluded(sbox):
expected_output = svntest.wc.State(wc_dir, {
'D' : Item(verb='Adding'),
})
-
+
expected_status.add({
'D' : Item(status=' ', wc_rev='2'),
'D/H' : Item(status=' ', wc_rev='2'),
@@ -2971,10 +2971,10 @@ def fold_tree_with_unversioned_items(sbo
# Set A to be excluded.
svntest.main.run_svn(None, 'update', '--set-depth=exclude', A_path)
-
+
# try a simple update afterwards
sbox.simple_update()
-
+
#----------------------------------------------------------------------
# list all tests here, starting with None:
test_list = [ None,
Modified: subversion/branches/addremove/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/diff_tests.py?rev=1878061&r1=1878060&r2=1878061&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/diff_tests.py Sat May 23 14:16:56 2020
@@ -36,7 +36,6 @@ from svntest import err, wc
from prop_tests import binary_mime_type_on_text_file_warning
from svntest.verify import make_diff_header, make_no_diff_deleted_header, \
- make_diff_header, make_no_diff_deleted_header, \
make_git_diff_header, make_diff_prop_header, \
make_diff_prop_val, make_diff_prop_deleted, \
make_diff_prop_added, make_diff_prop_modified
@@ -2712,7 +2711,7 @@ def diff_ignore_eolstyle(sbox):
" Bb\n",
"-Cc\n",
"+Cc\n",
- "\ No newline at end of file\n" ]
+ "\\ No newline at end of file\n" ]
svntest.actions.run_and_verify_svn(expected_output, [],
'diff', '-x', '--ignore-eol-style',
@@ -3855,7 +3854,7 @@ def diff_arbitrary_files_and_dirs(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- # diff iota with A/mu
+ # diff files (iota with A/mu)
expected_output = make_diff_header("iota", "working copy", "working copy",
"iota", "A/mu") + [
"@@ -1 +1 @@\n",
@@ -3866,7 +3865,11 @@ def diff_arbitrary_files_and_dirs(sbox):
'diff', '--old', sbox.ospath('iota'),
'--new', sbox.ospath('A/mu'))
- # diff A/B/E with A/D
+ # diff dirs (A/B/E with A/D)
+ # .../gamma is to show as replaced; .../beta is to show as modified
+ sbox.simple_mkdir('A/B/E/gamma')
+ sbox.simple_propset('p', 'v', 'A/B/E/gamma')
+ sbox.simple_add_text("This is a different beta file.\n", 'A/D/beta')
expected_output = make_diff_header("G/pi", "nonexistent", "working copy",
"B/E", "D") + [
"@@ -0,0 +1 @@\n",
@@ -3896,11 +3899,16 @@ def diff_arbitrary_files_and_dirs(sbox):
"@@ -1 +0,0 @@\n",
"-This is the file 'alpha'.\n"
] + make_diff_header("beta", "working copy",
- "nonexistent", "B/E", "D") + [
- "@@ -1 +0,0 @@\n",
- "-This is the file 'beta'.\n"
- ] + make_diff_header("gamma", "nonexistent",
"working copy", "B/E", "D") + [
+ "@@ -1 +1 @@\n",
+ "-This is the file 'beta'.\n",
+ "+This is a different beta file.\n"
+ ] + make_diff_header("gamma", "working copy",
+ "nonexistent", "B/E", "D") \
+ + make_diff_prop_header("gamma") \
+ + make_diff_prop_deleted("p", "v") \
+ + make_diff_header("gamma", "nonexistent",
+ "working copy", "B/E", "D") + [
"@@ -0,0 +1 @@\n",
"+This is the file 'gamma'.\n"
]
@@ -5140,6 +5148,187 @@ def diff_peg_resolve(sbox):
repo_url + '/branches/A2',
wc_dir, '-r1:2')
+@XFail()
+@Issue(4706)
+def diff_unversioned_files_git(sbox):
+ "diff unversioned files in git format"
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ svntest.main.file_write(sbox.ospath('foo'), "foo\n")
+ svntest.main.file_write(sbox.ospath('A/bar'), "bar\n")
+ expected_output = make_diff_header("foo", "working copy", "working copy",
+ "foo", "A/bar") + [
+ "@@ -1 +1 @@\n",
+ "-foo\n",
+ "+bar\n"
+ ]
+ svntest.actions.run_and_verify_svn(expected_output, [],
+ 'diff', '--git',
+ '--old', sbox.ospath('foo'),
+ '--new', sbox.ospath('A/bar'))
+
+# Summary diff with a repository source side and a local copy target side.
+# This particular combination crashed in 1.10.0 and earlier releases.
+def diff_summary_repo_wc_local_copy(sbox):
+ "diff summary repo wc local copy"
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ sbox.simple_copy('iota', 'iota2')
+ sbox.simple_append('iota2', 'hello\n')
+ expected_diff = svntest.wc.State(wc_dir, {
+ 'iota': Item(status='M '),
+ })
+ svntest.actions.run_and_verify_diff_summarize(
+ expected_diff,
+ '--old=' + sbox.ospath('iota') + '@HEAD',
+ '--new=' + sbox.ospath('iota2'))
+
+# Summary diff with a repository source side and a local copy target side.
+# Svn reported the unmodified copy as modified in 1.10.0 and earlier releases.
+@XFail()
+def diff_summary_repo_wc_local_copy_unmodified(sbox):
+ "diff summary repo wc local copy unmodified"
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ sbox.simple_copy('iota', 'iota2')
+ expected_diff = svntest.wc.State(wc_dir, {
+ })
+ svntest.actions.run_and_verify_diff_summarize(
+ expected_diff,
+ '--old=' + sbox.ospath('iota') + '@HEAD',
+ '--new=' + sbox.ospath('iota2'))
+
+# Fails with "Can't open file '.../iota': Too many levels of symbolic links"
+# on Unix.
+@XFail()
+@Skip(svntest.main.is_os_windows)
+def diff_file_replaced_by_symlink(sbox):
+ "diff base vs working: symlink replaces a file"
+ sbox.build(read_only=True)
+ wc_dir = sbox.wc_dir
+
+ iota_path = sbox.ospath('iota')
+ os.remove(iota_path)
+
+ # create a symlink pointing to itself
+ # alternatively it could point to a non-existing path
+ sbox.simple_symlink('iota', 'iota')
+
+ # TODO: add a full expected output
+ expected_output = svntest.verify.AnyOutput
+ svntest.actions.run_and_verify_svn(expected_output, [], 'diff', wc_dir)
+
+# Test 'svn diff --git' with a copy.
+#
+# When this diff is rooted at a path below the repository root directory,
+# it errored out while printing the git diff header, due to confusion of
+# diff-relative and repository-relative copyfrom paths.
+@XFail()
+def diff_git_format_copy(sbox):
+ "diff git format copy"
+ sbox.build(create_wc=False)
+ svntest.actions.run_and_verify_svn(None, [], 'checkout',
+ sbox.repo_url + '/A/B',
+ sbox.wc_dir)
+ os.chdir(sbox.wc_dir)
+ sbox.wc_dir = ''
+
+ sbox.simple_copy('E/alpha', 'alpha_copied')
+ sbox.simple_append('alpha_copied', "This is a copy of 'alpha'.\n")
+
+ expected_output = \
+ make_git_diff_header('alpha_copied', 'A/B/alpha_copied',
+ "revision 1", "working copy",
+ copyfrom_path="A/B/E/alpha",
+ copyfrom_rev='1', cp=True,
+ text_changes=True) + [
+ "@@ -1 +1,2 @@\n",
+ " This is the file 'alpha'.\n",
+ "+This is a copy of 'alpha'.\n",
+ ]
+
+ svntest.actions.run_and_verify_svn(expected_output, [], 'diff',
+ '--git', '.')
+
+#----------------------------------------------------------------------
+# Regression test for issue #1722: 'svn diff' produced a wrong header,
+# indicating one revision as being in the working copy when it should
+# be 'nonexistent'
+@Issue(1722)
+def diff_nonexistent_in_wc(sbox):
+ "nonexistent in working copy"
+
+ sbox.build(empty=True)
+ wc_dir = sbox.wc_dir
+
+ # We mirror the actions of the reproduction script (with one exception:
+ # we 'svn up -r 0' instead of checking out a second working copy)
+
+ sbox.simple_add_text('test\n', 'file')
+ sbox.simple_commit()
+ sbox.simple_update(revision=0)
+
+ # Expected output is empty for these cases:
+ # svn diff -r BASE
+ # svn diff -r 0:BASE
+ # svn diff -r 0
+
+ # Expected output for:
+ # svn diff -r BASE:HEAD
+ # svn diff -r 0:HEAD
+ # svn diff -r 0:1
+ expected_output_base_head = make_diff_header("file", "nonexistent",
+ "revision 1") + [
+ "@@ -0,0 +1 @@\n",
+ "+test\n",
+ ]
+
+ # Expected output for:
+ # svn diff -r HEAD:BASE
+ # svn diff -r HEAD
+ # svn diff -r 1:0
+ # svn diff -r 1
+ expected_output_head_base = make_diff_header("file", "revision 1",
+ "nonexistent") + [
+ "@@ -1 +0,0 @@\n",
+ "-test\n"
+ ]
+
+ os.chdir(wc_dir)
+
+ svntest.actions.run_and_verify_svn(expected_output_base_head, [],
+ 'diff', '-r', 'BASE:HEAD')
+
+ svntest.actions.run_and_verify_svn(expected_output_head_base, [],
+ 'diff', '-r', 'HEAD:BASE')
+
+ svntest.actions.run_and_verify_svn([], [],
+ 'diff', '-r', 'BASE')
+
+ svntest.actions.run_and_verify_svn(expected_output_head_base, [],
+ 'diff', '-r', 'HEAD')
+
+ svntest.actions.run_and_verify_svn([], [],
+ 'diff', '-r', '0:BASE')
+
+ svntest.actions.run_and_verify_svn(expected_output_base_head, [],
+ 'diff', '-r', '0:HEAD')
+
+ svntest.actions.run_and_verify_svn(expected_output_base_head, [],
+ 'diff', '-r', '0:1')
+
+ svntest.actions.run_and_verify_svn(expected_output_head_base, [],
+ 'diff', '-r', '1:0')
+
+ svntest.actions.run_and_verify_svn([], [],
+ 'diff', '-r', '0')
+
+ svntest.actions.run_and_verify_svn(expected_output_head_base, [],
+ 'diff', '-r', '1')
+
########################################################################
#Run the tests
@@ -5236,6 +5425,12 @@ test_list = [ None,
diff_incomplete_props,
diff_symlinks,
diff_peg_resolve,
+ diff_unversioned_files_git,
+ diff_summary_repo_wc_local_copy,
+ diff_summary_repo_wc_local_copy_unmodified,
+ diff_file_replaced_by_symlink,
+ diff_git_format_copy,
+ diff_nonexistent_in_wc,
]
if __name__ == '__main__':
Modified: subversion/branches/addremove/subversion/tests/cmdline/entries-dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/entries-dump.c?rev=1878061&r1=1878060&r2=1878061&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/entries-dump.c (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/entries-dump.c Sat May 23 14:16:56 2020
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <stdio.h>
+#include <assert.h>
#include <apr_pools.h>
#include <apr_general.h>
@@ -34,6 +35,7 @@
#include "svn_pools.h"
#include "svn_wc.h"
#include "svn_dirent_uri.h"
+#include "svn_xml.h"
#include "private/svn_wc_private.h"
@@ -41,12 +43,45 @@
#include "../../libsvn_wc/lock.h"
static void
-str_value(const char *name, const char *value)
+print_prefix(void)
+{
+ puts("class Entry(object):\n"
+ " \"\"\"An Entry object represents one node's entry in a pre-1.6"
+ " .svn/entries file.\n\n"
+ "Similar to #svn_wc_entry_t, but not all fields are populated.\n\n"
+ "Entry objects are generated by the 'entries-dump'"
+ " test helper tool.\"\"\"\n\n"
+ " if b'' == '':\n"
+ " def set_strval(self, name, val):\n"
+ " self.__setattr__(name, val)\n"
+ " else:\n"
+ " def set_strval(self, name, val):\n"
+ " self.__setattr__(name, val.decode('utf-8', "
+ "'surrogateescape'))\n");
+}
+
+static void
+str_value(const char *name, const char *value, apr_pool_t *pool)
{
if (value == NULL)
printf("e.%s = None\n", name);
else
- printf("e.%s = '%s'\n", name, value);
+ {
+ svn_stringbuf_t *escaped_value = NULL;
+ svn_xml_escape_attr_cstring(&escaped_value, value, pool);
+
+ /* Print the human-readable value. */
+ assert(NULL == strchr(escaped_value->data, '\n'));
+ printf("# e.%s = %s\n", name, escaped_value->data);
+
+ /* Print the machine-readable value. */
+ printf("e.set_strval('%s', b'", name);
+ while(*value)
+ {
+ printf("\\x%02x", (unsigned int)(unsigned char)*value++);
+ }
+ printf("')\n");
+ }
}
@@ -130,38 +165,38 @@ entries_dump(const char *dir_path, svn_w
SVN_ERR_ASSERT(strcmp(key, entry->name) == 0);
printf("e = Entry()\n");
- str_value("name", entry->name);
+ str_value("name", entry->name, pool);
int_value("revision", entry->revision);
- str_value("url", entry->url);
- str_value("repos", entry->repos);
- str_value("uuid", entry->uuid);
+ str_value("url", entry->url, pool);
+ str_value("repos", entry->repos, pool);
+ str_value("uuid", entry->uuid, pool);
int_value("kind", entry->kind);
int_value("schedule", entry->schedule);
bool_value("copied", entry->copied);
bool_value("deleted", entry->deleted);
bool_value("absent", entry->absent);
bool_value("incomplete", entry->incomplete);
- str_value("copyfrom_url", entry->copyfrom_url);
+ str_value("copyfrom_url", entry->copyfrom_url, pool);
int_value("copyfrom_rev", entry->copyfrom_rev);
- str_value("conflict_old", entry->conflict_old);
- str_value("conflict_new", entry->conflict_new);
- str_value("conflict_wrk", entry->conflict_wrk);
- str_value("prejfile", entry->prejfile);
+ str_value("conflict_old", entry->conflict_old, pool);
+ str_value("conflict_new", entry->conflict_new, pool);
+ str_value("conflict_wrk", entry->conflict_wrk, pool);
+ str_value("prejfile", entry->prejfile, pool);
/* skip: text_time */
/* skip: prop_time */
/* skip: checksum */
int_value("cmt_rev", entry->cmt_rev);
/* skip: cmt_date */
- str_value("cmt_author", entry->cmt_author);
- str_value("lock_token", entry->lock_token);
- str_value("lock_owner", entry->lock_owner);
- str_value("lock_comment", entry->lock_comment);
+ str_value("cmt_author", entry->cmt_author, pool);
+ str_value("lock_token", entry->lock_token, pool);
+ str_value("lock_owner", entry->lock_owner, pool);
+ str_value("lock_comment", entry->lock_comment, pool);
/* skip: lock_creation_date */
/* skip: has_props */
/* skip: has_prop_mods */
/* skip: cachable_props */
/* skip: present_props */
- str_value("changelist", entry->changelist);
+ str_value("changelist", entry->changelist, pool);
/* skip: working_size */
/* skip: keep_local */
int_value("depth", entry->depth);
@@ -384,15 +419,25 @@ main(int argc, const char *argv[])
cmd = NULL;
if (!cmd || !strcmp(cmd, "--entries"))
- err = entries_dump(path, NULL, pool);
+ {
+ print_prefix();
+ err = entries_dump(path, NULL, pool);
+ }
else if (!strcmp(cmd, "--subdirs"))
- err = directory_dump(path, pool);
+ {
+ err = directory_dump(path, pool);
+ }
else if (!strcmp(cmd, "--tree-dump"))
- err = tree_dump(path, pool);
+ {
+ print_prefix();
+ err = tree_dump(path, pool);
+ }
else
- err = svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL,
- "Invalid command '%s'",
- cmd);
+ {
+ err = svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL,
+ "Invalid command '%s'",
+ cmd);
+ }
if (err)
{
svn_handle_error2(err, stderr, FALSE, "entries-dump: ");
Modified: subversion/branches/addremove/subversion/tests/cmdline/entries_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/entries_tests.py?rev=1878061&r1=1878060&r2=1878061&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/entries_tests.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/entries_tests.py Sat May 23 14:16:56 2020
@@ -121,14 +121,17 @@ def basic_entries(sbox):
G_path, iota_path)
# Add a file over the DELETED 'alpha'. It should be schedule-add.
- open(alpha_path, 'w').write('New alpha contents\n')
+ with open(alpha_path, 'w') as f:
+ f.write('New alpha contents\n')
# Delete 'beta', then add a file over it. Should be schedule-replace.
svntest.actions.run_and_verify_svn(None, [], 'rm', beta_path)
- open(beta_path, 'w').write('New beta contents\n')
+ with open(beta_path, 'w') as f:
+ f.write('New beta contents\n')
# Plain old add. Should have revision == 0.
- open(added_path, 'w').write('Added file contents\n')
+ with open(added_path, 'w') as f:
+ f.write('Added file contents\n')
svntest.actions.run_and_verify_svn(None, [], 'add',
alpha_path, beta_path, added_path)
Modified: subversion/branches/addremove/subversion/tests/cmdline/export_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/export_tests.py?rev=1878061&r1=1878060&r2=1878061&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/export_tests.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/export_tests.py Sat May 23 14:16:56 2020
@@ -610,7 +610,8 @@ def export_file_overwrite_fails(sbox):
os.mkdir(tmpdir)
# Run it for source local
- open(os.path.join(tmpdir, 'iota'), 'w').write(not_iota_contents)
+ with open(os.path.join(tmpdir, 'iota'), 'w') as f:
+ f.write(not_iota_contents)
svntest.actions.run_and_verify_svn([], '.*exist.*',
'export', iota_path, tmpdir)
@@ -621,7 +622,8 @@ def export_file_overwrite_fails(sbox):
svntest.actions.verify_disk(tmpdir, expected_disk)
# Run it for source URL
- open(os.path.join(tmpdir, 'iota'), 'w').write(not_iota_contents)
+ with open(os.path.join(tmpdir, 'iota'), 'w') as f:
+ f.write(not_iota_contents)
svntest.actions.run_and_verify_svn([], '.*exist.*',
'export', iota_url, tmpdir)
@@ -721,7 +723,7 @@ def export_working_copy_ignoring_keyword
def export_with_url_unsafe_characters(sbox):
"export file with URL unsafe characters"
- ## See http://subversion.tigris.org/issues/show_bug.cgi?id=3683 ##
+ ## See https://issues.apache.org/jira/browse/SVN-3683 ##
sbox.build()
wc_dir = sbox.wc_dir
@@ -904,14 +906,16 @@ def export_file_overwrite_with_force(sbo
})
# Run it for WC export
- open(os.path.join(tmpdir, 'iota'), 'w').write(not_iota_contents)
+ with open(os.path.join(tmpdir, 'iota'), 'w') as f:
+ f.write(not_iota_contents)
svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput,
[], 'export', '--force',
iota_path, tmpdir)
svntest.actions.verify_disk(tmpdir, expected_disk)
# Run it for URL export
- open(os.path.join(tmpdir, 'iota'), 'w').write(not_iota_contents)
+ with open(os.path.join(tmpdir, 'iota'), 'w') as f:
+ f.write(not_iota_contents)
svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput,
[], 'export', '--force',
iota_url, tmpdir)
Modified: subversion/branches/addremove/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/externals_tests.py?rev=1878061&r1=1878060&r2=1878061&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/externals_tests.py Sat May 23 14:16:56 2020
@@ -1146,7 +1146,7 @@ def external_into_path_with_spaces(sbox)
repo_url = sbox.repo_url
ext = '^/A/D "A/copy of D"\n' +\
- '^/A/D A/another\ copy\ of\ D'
+ '^/A/D A/another\\ copy\\ of\\ D'
change_external(wc_dir, ext)
expected_output = svntest.wc.State(wc_dir, {
@@ -2818,7 +2818,7 @@ def remap_file_external_with_prop_del(sb
# Now update to bring the new external down.
# This previously segfaulted as described in
- # http://subversion.tigris.org/issues/show_bug.cgi?id=4093#desc1
+ # https://issues.apache.org/jira/browse/SVN-4093#desc1
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
@@ -2946,7 +2946,7 @@ def url_to_wc_copy_of_externals(sbox):
external_tau_path = os.path.join(wc_dir, "External-WC-to-URL-Copy",
"external", "tau")
expected_stdout = verify.UnorderedOutput([
- " U " + external_root_path + "\n",
+ "A " + external_root_path + "\n",
"\n",
"Fetching external item into '" + external_ex_path + "':\n",
"A " + external_pi_path + "\n",
@@ -2954,8 +2954,6 @@ def url_to_wc_copy_of_externals(sbox):
"A " + external_tau_path + "\n",
"Checked out external at revision 2.\n",
"\n",
- "Checked out revision 2.\n",
- "A " + external_root_path + "\n"
])
exit_code, stdout, stderr = svntest.actions.run_and_verify_svn2(
expected_stdout, [], 0, 'copy', repo_url + '/A/C',
@@ -3871,12 +3869,14 @@ def copy_pin_externals_whitespace_dir(sb
extdef = sbox.get_tempname('extdef')
info = sbox.get_tempname('info')
- open(extdef, 'w').write(
+ with open(extdef, 'w') as f:
+ f.write(
'"' + ss_path +'/deps/sqlite" ext/sqlite\n' +
'"^/deps/A P R" \'ext/A P R\'\n' +
- '^/deps/B\ D\ B\' ext/B\ D\ B\'\n' +
+ '^/deps/B\\ D\\ B\' ext/B\\ D\\ B\'\n' +
repo_url + '/deps/wors%23+t ext/wors#+t')
- open(info, 'w').write('info\n')
+ with open(info, 'w') as f:
+ f.write('info\n')
svntest.actions.run_and_verify_svnmucc(None, [], '-U', repo_url,
'mkdir', 'trunk',
@@ -3911,7 +3911,7 @@ def copy_pin_externals_whitespace_dir(sb
branches_url = repo_url + '/branches'
trunk_wc = sbox.ospath('trunk')
- # Create a new revision to creat interesting pinning revisions
+ # Create a new revision to create interesting pinning revisions
sbox.simple_propset('A', 'B', 'trunk')
sbox.simple_commit('trunk')
@@ -4398,6 +4398,55 @@ def invalid_uris_in_repo(sbox):
"-r", revision)
svntest.main.safe_rmtree(sbox.wc_dir)
+# Like issue #3741 'externals not removed when working copy is made shallow'
+# but with --set-depth=exclude instead of --set-depth=empty.
+def update_dir_external_exclude(sbox):
+ "exclude update should remove externals"
+
+ sbox.build()
+
+ # Create an external in r2
+ sbox.simple_propset('svn:externals', '^/A/D/H X', 'A/B/E')
+ sbox.simple_commit()
+
+ # Update to fetch externals
+ expected_output = svntest.wc.State(sbox.wc_dir, {
+ 'A/B/E/X/chi' : Item(status='A '),
+ 'A/B/E/X/omega' : Item(status='A '),
+ 'A/B/E/X/psi' : Item(status='A '),
+ })
+ svntest.actions.run_and_verify_update(sbox.wc_dir,
+ expected_output, None, None,
+ [], False,
+ sbox.ospath('A/B/E'))
+
+ # Now make A/B/E shallow by updating with "--set-depth exclude"
+ expected_output = svntest.wc.State(sbox.wc_dir, {
+ 'A/B/E' : Item(status='D '),
+ 'A/B/E/X' : Item(verb='Removed external'),
+ })
+ svntest.actions.run_and_verify_update(sbox.wc_dir,
+ expected_output, None, None,
+ [], False,
+ '--set-depth=exclude',
+ sbox.ospath('A/B/E'))
+
+ # And bring the external back by updating with "--set-depth infinity"
+ expected_output = svntest.wc.State(sbox.wc_dir, {
+ 'A/B/E' : Item(status='A '),
+ 'A/B/E/alpha' : Item(status='A '),
+ 'A/B/E/beta' : Item(status='A '),
+ 'A/B/E/X/chi' : Item(status='A '),
+ 'A/B/E/X/omega' : Item(status='A '),
+ 'A/B/E/X/psi' : Item(status='A '),
+ })
+ svntest.actions.run_and_verify_update(sbox.wc_dir,
+ expected_output, None, None,
+ [], False,
+ '--set-depth=infinity',
+ sbox.ospath('A/B/E'))
+
+
########################################################################
# Run the tests
@@ -4474,6 +4523,7 @@ test_list = [ None,
file_external_recorded_info,
external_externally_removed,
invalid_uris_in_repo,
+ update_dir_external_exclude,
]
if __name__ == '__main__':
Modified: subversion/branches/addremove/subversion/tests/cmdline/getopt_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/getopt_tests.py?rev=1878061&r1=1878060&r2=1878061&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/getopt_tests.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/getopt_tests.py Sat May 23 14:16:56 2020
@@ -38,10 +38,6 @@ import svntest
#----------------------------------------------------------------------
-# This directory contains all the expected output from svn.
-getopt_output_dir = os.path.join(os.path.dirname(sys.argv[0]),
- 'getopt_tests_data')
-
# Naming convention for golden files: take the svn command line as a
# single string and apply the following sed transformations:
# echo svn option1 option2 ... | sed -e 's/ /_/g' -e 's/_--/--/g'
@@ -51,6 +47,10 @@ getopt_output_dir = os.path.join(os.path
def load_expected_output(basename):
"load the expected standard output and standard error"
+ # This directory contains all the expected output from svn.
+ getopt_output_dir = os.path.join(os.path.dirname(sys.argv[0]),
+ 'getopt_tests_data')
+
stdout_filename = os.path.join(getopt_output_dir, basename + '_stdout')
stderr_filename = os.path.join(getopt_output_dir, basename + '_stderr')
@@ -229,7 +229,7 @@ def getopt_config_option(sbox):
expected_stderr = '.*W205000.*did you mean.*'
expected_stdout = svntest.verify.AnyOutput
svntest.actions.run_and_verify_svn2(expected_stdout, expected_stderr, 0,
- 'info',
+ 'info',
'--config-option',
'config:miscellanous:diff-extensions=' +
'-u -p',
Modified: subversion/branches/addremove/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout?rev=1878061&r1=1878060&r2=1878061&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout Sat May 23 14:16:56 2020
@@ -84,6 +84,10 @@ usage: 1. log [PATH][@REV]
was created:
svn log --stop-on-copy --limit 1 -r0:HEAD ^/branches/foo
+ Show all log messages for commits between the tags ^/tags/2.0 and
+ ^/tags/3.0; assuming that tag 2.0 was created in revision 100:
+ svn log -rHEAD:100 ^/tags/3.0
+
If ^/trunk/foo.c was moved to ^/trunk/bar.c' in revision 22, 'svn log -v'
shows a deletion and a copy in its changed paths list, such as:
D /trunk/foo.c
@@ -127,34 +131,14 @@ Valid options:
-U ARG, --context ARG: Show ARG lines of context
-p, --show-c-function: Show C function name
--search ARG : use ARG as search pattern (glob syntax, case-
- and accent-insensitive)
+ and accent-insensitive, may require quotation marks
+ to prevent shell expansion)
--search-and ARG : combine ARG with the previous search pattern
-Global options:
- --username ARG : specify a username ARG
- --password ARG : specify a password ARG (caution: on many operating
- systems, other users will be able to see this)
- --no-auth-cache : do not cache authentication tokens
- --non-interactive : do no interactive prompting (default is to prompt
- only if standard input is a terminal device)
- --force-interactive : do interactive prompting even if standard input
- is not a terminal device
- --trust-server-cert : deprecated; same as
- --trust-server-cert-failures=unknown-ca
- --trust-server-cert-failures ARG : with --non-interactive, accept SSL server
- certificates with failures; ARG is comma-separated
- list of 'unknown-ca' (Unknown Authority),
- 'cn-mismatch' (Hostname mismatch), 'expired'
- (Expired certificate), 'not-yet-valid' (Not yet
- valid certificate) and 'other' (all other not
- separately classified certificate errors).
- --config-dir ARG : read user configuration files from directory ARG
- --config-option ARG : set user configuration option in the format:
- FILE:SECTION:OPTION=[VALUE]
- For example:
- servers:global:http-library=serf
+(Use '-v' to show global and experimental options.)
-switch (sw): Update the working copy to a different URL within the same repository.
+switch (sw): Update the working copy to a different URL within the same
+repository.
usage: 1. switch URL[@PEGREV] [PATH]
2. switch --relocate FROM-PREFIX TO-PREFIX [PATH...]
@@ -190,9 +174,6 @@ usage: 1. switch URL[@PEGREV] [PATH]
Examples:
svn switch ^/branches/1.x-release
- svn switch --relocate http:// svn://
- svn switch --relocate http://www.example.com/repo/project \
- svn://svn.example.com/repo/project
Valid options:
-r [--revision] ARG : ARG (some commands also take ARG1:ARG2 range)
@@ -203,7 +184,7 @@ Valid options:
'BASE' base rev of item's working copy
'COMMITTED' last commit at or before BASE
'PREV' revision just before COMMITTED
- -N [--non-recursive] : obsolete; try --depth=files or --depth=immediates
+ -N [--non-recursive] : obsolete; same as --depth=files
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
--set-depth ARG : set new working copy depth to ARG ('exclude',
@@ -220,27 +201,5 @@ Valid options:
'p', 'mc', 'tc', 'mf', 'tf', 'e', 'l', 'r')
--relocate : deprecated; use 'svn relocate'
-Global options:
- --username ARG : specify a username ARG
- --password ARG : specify a password ARG (caution: on many operating
- systems, other users will be able to see this)
- --no-auth-cache : do not cache authentication tokens
- --non-interactive : do no interactive prompting (default is to prompt
- only if standard input is a terminal device)
- --force-interactive : do interactive prompting even if standard input
- is not a terminal device
- --trust-server-cert : deprecated; same as
- --trust-server-cert-failures=unknown-ca
- --trust-server-cert-failures ARG : with --non-interactive, accept SSL server
- certificates with failures; ARG is comma-separated
- list of 'unknown-ca' (Unknown Authority),
- 'cn-mismatch' (Hostname mismatch), 'expired'
- (Expired certificate), 'not-yet-valid' (Not yet
- valid certificate) and 'other' (all other not
- separately classified certificate errors).
- --config-dir ARG : read user configuration files from directory ARG
- --config-option ARG : set user configuration option in the format:
- FILE:SECTION:OPTION=[VALUE]
- For example:
- servers:global:http-library=serf
+(Use '-v' to show global and experimental options.)
Modified: subversion/branches/addremove/subversion/tests/cmdline/info_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/info_tests.py?rev=1878061&r1=1878060&r2=1878061&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/info_tests.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/info_tests.py Sat May 23 14:16:56 2020
@@ -716,6 +716,72 @@ def info_item_uncommmitted(sbox):
sbox.ospath('newfile'), sbox.ospath('newdir'))
+def info_item_size_wc_recursive(sbox):
+ "recursive '--show-item=repos-size' on local path"
+
+ sbox.build(read_only=True)
+
+ svntest.actions.run_and_verify_svn(
+ [], [],
+ 'info', '--show-item=repos-size', '--recursive',
+ sbox.ospath(''))
+
+
+def info_item_size_repos(sbox):
+ "non-recursive '--show-item=repos-size' on URL"
+
+ sbox.build(read_only=True)
+
+ svntest.actions.run_and_verify_svn(
+ "25\n", [],
+ 'info', '--show-item=repos-size',
+ sbox.repo_url + "/iota")
+
+ # Same, but without the newline.
+ svntest.actions.run_and_verify_svn(
+ "25", [],
+ 'info', '--show-item=repos-size', '--no-newline',
+ sbox.repo_url + "/iota")
+
+ # Same, but with "human-readable" output.
+ svntest.actions.run_and_verify_svn(
+ "25 B", [],
+ 'info', '--show-item=repos-size', '--human-readable',
+ sbox.repo_url + "/iota")
+
+ # No output when the URL is a directory.
+ svntest.actions.run_and_verify_svn(
+ [], [],
+ 'info', '--show-item=repos-size',
+ sbox.repo_url)
+
+
+def info_item_size_repos_recursive(sbox):
+ "recursive '--show-item=repos-size' on dir URL"
+
+ sbox.build(read_only=True)
+
+ expected_output = svntest.verify.UnorderedOutput([
+ "25 " + sbox.repo_url + "/iota\n",
+ "27 " + sbox.repo_url + "/A/B/lambda\n",
+ "25 " + sbox.repo_url + "/A/B/E/beta\n",
+ "26 " + sbox.repo_url + "/A/B/E/alpha\n",
+ "23 " + sbox.repo_url + "/A/mu\n",
+ "26 " + sbox.repo_url + "/A/D/gamma\n",
+ "23 " + sbox.repo_url + "/A/D/G/pi\n",
+ "24 " + sbox.repo_url + "/A/D/G/rho\n",
+ "24 " + sbox.repo_url + "/A/D/G/tau\n",
+ "26 " + sbox.repo_url + "/A/D/H/omega\n",
+ "24 " + sbox.repo_url + "/A/D/H/psi\n",
+ "24 " + sbox.repo_url + "/A/D/H/chi\n",
+ ])
+
+ svntest.actions.run_and_verify_svn(
+ expected_output, [],
+ 'info', '--show-item=repos-size', '--recursive',
+ sbox.repo_url)
+
+
def info_item_failures(sbox):
"failure modes of 'svn info --show-item'"
@@ -746,6 +812,37 @@ def info_item_failures(sbox):
'info', '--show-item=revision', '--no-newline',
sbox.ospath('A'), sbox.ospath('iota'))
+ svntest.actions.run_and_verify_svn(
+ None, (r".*E200007: can't show in-repository size.*"),
+ 'info', '--show-item=repos-size',
+ sbox.ospath('iota'))
+
+
+@Issue(4837)
+def info_file_in_file_replaced_dir(sbox):
+ "info, file in file-replaced dir"
+
+ sbox.build(empty=True)
+ sbox.simple_mkdir('dir')
+ sbox.simple_add_text('text\n', 'dir/file')
+ sbox.simple_commit(message='Add file')
+
+ sbox.simple_copy('dir/file', 'file-moved')
+ sbox.simple_rm('dir')
+ sbox.simple_add_text('replaced\n', 'dir')
+ sbox.simple_commit(message='Replace dir with file')
+
+ sbox.simple_update()
+
+ expected = {'Relative URL' : r'\^/dir/file',
+ 'Node Kind' : 'file',
+ 'Revision': '1',
+ 'Last Changed Rev': '1',
+ }
+
+ svntest.actions.run_and_verify_info([expected],
+ sbox.repo_url + '/dir/file@1')
+
########################################################################
# Run the tests
@@ -767,7 +864,11 @@ test_list = [ None,
info_item_simple_multiple,
info_item_url,
info_item_uncommmitted,
+ info_item_size_wc_recursive,
+ info_item_size_repos,
+ info_item_size_repos_recursive,
info_item_failures,
+ info_file_in_file_replaced_dir,
]
if __name__ == '__main__':
Modified: subversion/branches/addremove/subversion/tests/cmdline/iprop_authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/iprop_authz_tests.py?rev=1878061&r1=1878060&r2=1878061&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/iprop_authz_tests.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/iprop_authz_tests.py Sat May 23 14:16:56 2020
@@ -105,7 +105,7 @@ def iprops_authz(sbox):
write_authz_file(sbox, {
"/" : svntest.main.wc_author + "=rw",
"/A/D/H/psi" : svntest.main.wc_author + "=",})
- if sbox.repo_url.startswith("http"):
+ if svntest.main.is_ra_type_dav():
expected_err = ".*[Ff]orbidden.*"
else:
expected_err = ".*svn: E170001: Authorization failed.*"