88
88
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
89
expected_status, None,
92
91
## Now we should update to the previous version, verify that no
93
92
## symlink is present, then update back to HEAD and see if the symlink
94
93
## is regenerated properly.
95
svntest.actions.run_and_verify_svn(None, None, [],
94
svntest.actions.run_and_verify_svn(None, [],
96
95
'up', '-r', '1', wc_dir)
98
97
# Is the symlink gone?
99
98
if os.path.isfile(newfile_path) or os.path.islink(newfile_path):
100
99
raise svntest.Failure
102
svntest.actions.run_and_verify_svn(None, None, [],
101
svntest.actions.run_and_verify_svn(None, [],
103
102
'up', '-r', '2', wc_dir)
105
104
# Is the symlink back?
213
212
for export_src, dest_dir in [(sbox.wc_dir, 'export-wc'),
214
213
(sbox.repo_url, 'export-url')]:
215
214
export_target = sbox.add_wc_path(dest_dir)
216
svntest.actions.run_and_verify_svn(None, None, [],
215
svntest.actions.run_and_verify_svn(None, [],
217
216
'export', export_src, export_target)
219
218
# is the link at the correct place?
252
251
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
253
expected_status, None, wc_dir)
255
254
H_path = os.path.join(wc_dir, 'A', 'D', 'H')
256
255
H2_path = os.path.join(wc_dir, 'A', 'D', 'H2')
257
svntest.actions.run_and_verify_svn(None, None, [], 'cp', H_path, H2_path)
256
svntest.actions.run_and_verify_svn(None, [], 'cp', H_path, H2_path)
259
258
# 'svn status' should show just "A/D/H2 A +". Nothing broken.
260
259
expected_status.add({
551
545
"\\ No newline at end of property\n"
553
svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
547
svntest.actions.run_and_verify_svn(expected_output, [], 'diff',
555
549
# We should get the same output if we the diff the symlink itself.
556
svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff', 'link')
550
svntest.actions.run_and_verify_svn(expected_output, [], 'diff', 'link')
558
552
#----------------------------------------------------------------------
559
553
# Issue 2692 (part of): Check that the client can check out a repository
604
599
expected_output = svntest.wc.State(wc_dir, {
607
error_re_string = 'E145001: (Entry|Node).*has.*changed (special|kind)'
602
error_re_string = '.*E145001: (Entry|Node).*has.*changed (special|kind).*'
609
604
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
610
None, error_re_string, wc_dir)
605
None, error_re_string)
612
607
# test for issue #1808: svn up deletes local symlink that obstructs
615
@SkipUnless(svntest.main.is_posix_os)
616
610
def update_obstructing_symlink(sbox):
617
611
"symlink obstructs incoming delete"
620
614
wc_dir = sbox.wc_dir
621
mu_path = os.path.join(wc_dir, 'A', 'mu')
622
mu_url = sbox.repo_url + '/A/mu'
623
iota_path = os.path.join(wc_dir, 'iota')
625
# delete A/mu and replace it with a symlink
626
svntest.main.run_svn(None, 'rm', mu_path)
627
os.symlink(iota_path, mu_path)
629
svntest.main.run_svn(None, 'rm', mu_url,
632
svntest.main.run_svn(None,
615
mu_path = sbox.ospath('A/mu')
617
iota_abspath = os.path.abspath(sbox.ospath('iota'))
619
# delete mu and replace it with an (not-added) symlink
620
sbox.simple_rm('A/mu')
621
sbox.simple_symlink(iota_abspath, 'A/mu')
623
# delete pi and replace it with an added symlink
624
sbox.simple_rm('A/D/G/pi')
625
sbox.simple_add_symlink(iota_abspath, 'A/D/G/pi')
627
if not os.path.exists(mu_path):
628
raise svntest.Failure("mu should be there")
630
# Now remove mu and pi in the repository
631
svntest.main.run_svn(None, 'rm', '-m', 'log msg',
632
sbox.repo_url + '/A/mu',
633
sbox.repo_url + '/A/D/G/pi')
635
# We expect tree conflicts
636
expected_output = svntest.wc.State(wc_dir, {
637
'A/mu': Item(status=' ', treeconflict='C'),
638
'A/D/G/pi': Item(status=' ', treeconflict='C')
641
expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
642
expected_status.tweak('A/mu', status='? ', treeconflict='C',
645
expected_status.tweak('A/D/G/pi', status='A ',treeconflict='C',
648
svntest.actions.run_and_verify_update(wc_dir,
649
expected_output, None,
654
'Path': re.escape(sbox.ospath('A/D/G/pi')),
655
'Tree conflict': 'local file replace, incoming file delete or move.*'
658
'Path': re.escape(sbox.ospath('A/mu')),
659
'Tree conflict': 'local file delete, incoming file delete or move.*'
663
svntest.actions.run_and_verify_info(expected_info,
664
sbox.ospath('A/D/G/pi'),
635
667
# check that the symlink is still there
636
target = os.readlink(mu_path)
637
if target != iota_path:
638
raise svntest.Failure
668
if not os.path.exists(mu_path):
669
raise svntest.Failure("mu should be there")
670
if svntest.main.is_posix_os():
671
target = os.readlink(mu_path)
672
if target != iota_abspath:
673
raise svntest.Failure("mu no longer points to the same location")
641
675
def warn_on_reserved_name(sbox):
642
676
"warn when attempt operation on a reserved name"
644
678
reserved_path = os.path.join(sbox.wc_dir, svntest.main.get_admin_name())
645
679
svntest.actions.run_and_verify_svn(
646
"Locking a file with a reserved name failed to result in an error",
648
681
".*Skipping argument: E200025: '.+' ends in a reserved name.*",
649
682
'lock', reserved_path)
679
712
'iota2' : Item(status=' ', wc_rev=2),
681
714
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
682
expected_status, None,
685
717
svntest.main.run_svn(None, 'update', wc_dir)
686
svntest.actions.run_and_verify_svn(None, expected_propval, [],
687
'propget', '--strict', 'svn:special',
718
svntest.actions.run_and_verify_svn(expected_propval, [],
719
'propget', '--no-newline', 'svn:special',
703
735
os.symlink('omega', 'psi') # omega is versioned!
704
736
svntest.main.run_svn(None, 'changelist', 'chi cl', 'chi')
705
svntest.actions.run_and_verify_svn(None, None, [], 'commit',
737
svntest.actions.run_and_verify_svn(None, [], 'commit',
706
738
'--changelist', 'chi cl',
707
739
'-m', 'psi changed special status')
746
778
svntest.actions.run_and_verify_status(wc_dir, expected_status)
748
780
# Issue 3972, repeat revert produces no output
749
svntest.actions.run_and_verify_svn(None, [], [], 'revert', '-R', wc_dir)
781
svntest.actions.run_and_verify_svn([], [], 'revert', '-R', wc_dir)
750
782
svntest.actions.run_and_verify_status(wc_dir, expected_status)
752
784
# Now replace the symlink with a normal file and try to commit, we
1218
1245
expected_output,
1220
1247
expected_status,
1221
None, None, None, None, None,
1250
#----------------------------------------------------------------------
1252
def multiline_special(sbox):
1253
"multiline file with svn:special"
1256
wc_dir = sbox.wc_dir
1258
sbox.simple_append('iota', 'A second line.\n')
1259
sbox.simple_commit();
1260
tmp = sbox.get_tempname()
1261
svntest.main.file_write(tmp, '*', 'w+')
1262
svntest.main.run_svnmucc('propsetf', 'svn:special', tmp,
1263
sbox.repo_url + '/iota',
1264
'-m', 'set svn:special')
1266
sbox.simple_update(revision=1);
1267
sbox.simple_update();
1269
expected_disk = svntest.main.greek_state.copy()
1270
expected_disk.tweak()
1271
expected_disk.tweak('iota',
1272
contents="This is the file 'iota'.\nA second line.\n",
1273
props={'svn:special' : '*'})
1274
svntest.actions.verify_disk(wc_dir, expected_disk.old_tree(), True)
1276
#----------------------------------------------------------------------
1278
@XFail(svntest.main.is_posix_os)
1279
def multiline_symlink_special(sbox):
1280
"multiline link file with svn:special"
1283
wc_dir = sbox.wc_dir
1285
sbox.simple_append('dodgy-link1', 'link foo\n')
1286
sbox.simple_append('dodgy-link2', 'link foo\nbar\n')
1287
svntest.main.run_svnmucc('put', sbox.ospath('dodgy-link1'), 'dodgy-link1',
1288
'put', sbox.ospath('dodgy-link2'), 'dodgy-link2',
1289
'propset', 'svn:special', 'X', 'dodgy-link1',
1290
'propset', 'svn:special', 'X', 'dodgy-link2',
1291
'-U', sbox.repo_url,
1292
'-m', 'Create dodgy symlinks')
1293
os.remove(sbox.ospath('dodgy-link1'))
1294
os.remove(sbox.ospath('dodgy-link2'))
1296
sbox.simple_update();
1298
expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
1299
expected_status.add({
1300
'dodgy-link1' : Item(status=' ', wc_rev=2),
1301
'dodgy-link2' : Item(status=' ', wc_rev=2),
1303
# XFAIL: Only content before \n used when creating the link but all
1304
# content used when detecting modifications, so the pristine working
1305
# copy shows up as modified.
1306
svntest.actions.run_and_verify_status(wc_dir, expected_status)
1224
1308
########################################################################
1225
1309
# Run the tests