Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/tests/cmdline/prop_tests.py view on Meta::CPAN
# well as running status. We want to verify that we truly have a
# *pristine* revision 2 tree, with the original rev 2 props, and no
# local mods at all.
expected_output = svntest.wc.State(wc_dir, {
})
expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
expected_status.tweak('iota', status=' ')
expected_status.tweak('A/B/lambda', status=' ')
expected_disk = svntest.main.greek_state.copy()
expected_disk.tweak('iota', props={'cash-sound' : 'cha-ching!'})
expected_disk.tweak('A/B/lambda', props={'boson' : 'W'})
# scan disk for props too.
svntest.actions.run_and_verify_update(wc_dir,
expected_output,
expected_disk,
expected_status,
None, None, None, None, None,
1)
#----------------------------------------------------------------------
@Issues(920,2065)
def inappropriate_props(sbox):
"try to set inappropriate props"
# Bootstrap
sbox.build()
wc_dir = sbox.wc_dir
A_path = sbox.ospath('A')
E_path = sbox.ospath('A/B/E')
iota_path = sbox.ospath('iota')
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
svntest.actions.run_and_verify_status(wc_dir, expected_status)
# These should produce an error
svntest.actions.run_and_verify_svn('Illegal target',
None, svntest.verify.AnyOutput,
'propset', 'svn:executable', 'on', A_path)
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput, 'propset',
'svn:keywords', 'LastChangedDate',
A_path)
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput, 'propset',
'svn:eol-style', 'native', A_path)
svntest.actions.run_and_verify_svn('Invalid svn:eol-style', None,
svntest.verify.AnyOutput, 'propset',
'svn:eol-style', 'invalid value',
os.path.join(A_path, 'mu'))
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput, 'propset',
'svn:mime-type', 'image/png', A_path)
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput, 'propset',
'svn:ignore', '*.o', iota_path)
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput, 'propset',
'svn:externals',
'foo http://host.com/repos', iota_path)
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput, 'propset',
'svn:author', 'socrates', iota_path)
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput, 'propset',
'svn:log', 'log message', iota_path)
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput, 'propset',
'svn:date', 'Tue Jan 19 04:14:07 2038',
iota_path)
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput, 'propset',
'svn:original-date',
'Thu Jan 1 01:00:00 1970', iota_path)
# Status unchanged
svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Recursive setting of inappropriate dir prop should work on files
svntest.actions.run_and_verify_svn(None, None, [], 'propset', '-R',
'svn:executable', 'on', E_path)
expected_status.tweak('A/B/E/alpha', 'A/B/E/beta', status=' M')
svntest.actions.run_and_verify_status(wc_dir, expected_status)
# Issue #920. Don't allow setting of svn:eol-style on binary files or files
# with inconsistent eol types.
path = sbox.ospath('binary')
svntest.main.file_append(path, "binary")
sbox.simple_add('binary')
svntest.main.run_svn(binary_mime_type_on_text_file_warning,
'propset', 'svn:mime-type', 'application/octet-stream',
sbox.ospath('binary'))
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput,
'propset', 'svn:eol-style',
'CRLF', path)
path = sbox.ospath('multi-eol')
svntest.main.file_append(path, "line1\rline2\n")
sbox.simple_add('multi-eol')
svntest.actions.run_and_verify_svn('Illegal target', None,
svntest.verify.AnyOutput,
( run in 0.784 second using v1.01-cache-2.11-cpan-df04353d9ac )