906
904
None, None, None,
907
#----------------------------------------------------------------------
909
def replace_symlinks(sbox):
914
# Some of these tests are implemented for git (in test script
915
# t/t9100-git-svn-basic.sh) using the Perl bindings for Subversion.
916
# Our issue #4091 is about 'svn update' failures in the git tests.
918
sbox.simple_mkdir('A/D/G/Z')
919
sbox.simple_mkdir('A/D/Gx')
920
sbox.simple_mkdir('A/D/Gx/Z')
921
sbox.simple_mkdir('A/D/Hx')
922
sbox.simple_mkdir('A/D/Y')
923
sbox.simple_mkdir('Ax')
925
sbox.simple_add_symlink('../Y', 'A/D/H/Z')
926
sbox.simple_add_symlink('../Y', 'A/D/Hx/Z')
932
file_write(wc(p), 'This starts as a normal file.\n')
944
file_write(wc(p), '#!/bin/sh\necho "hello, svn!"\n')
945
os.chmod(wc(p), 0775)
947
if not svntest.main.is_posix_os():
948
sbox.simple_propset('svn:executable', 'X', p)
949
sbox.simple_commit() # r2
951
expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 2)
952
expected_status.add({
953
'A/D/Y' : Item(status=' ', wc_rev=2),
954
'A/D/G/Z' : Item(status=' ', wc_rev=2),
955
'A/D/G/rho.sh' : Item(status=' ', wc_rev=2),
956
'A/D/Hx' : Item(status=' ', wc_rev=2),
957
'A/D/Hx/Z' : Item(status=' ', wc_rev=2),
958
'A/D/Hx/chi' : Item(status=' ', wc_rev=2),
959
'A/D/Hx/psi.sh' : Item(status=' ', wc_rev=2),
960
'A/D/H/psi.sh' : Item(status=' ', wc_rev=2),
961
'A/D/H/Z' : Item(status=' ', wc_rev=2),
962
'A/D/Gx' : Item(status=' ', wc_rev=2),
963
'A/D/Gx/Z' : Item(status=' ', wc_rev=2),
964
'A/D/Gx/pi' : Item(status=' ', wc_rev=2),
965
'A/D/Gx/rho.sh' : Item(status=' ', wc_rev=2),
966
'A/D/gamma.sh' : Item(status=' ', wc_rev=2),
967
'A/B/E/beta.sh' : Item(status=' ', wc_rev=2),
968
'Ax' : Item(status=' ', wc_rev=2),
969
'Ax/mu' : Item(status=' ', wc_rev=2),
970
'Ax/mu.sh' : Item(status=' ', wc_rev=2),
971
'A/mu.sh' : Item(status=' ', wc_rev=2),
972
'iota.sh' : Item(status=' ', wc_rev=2),
974
expected_status_r2 = copy.deepcopy(expected_status)
975
svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status_r2)
977
# Failing git-svn test: 'new symlink is added to a file that was
978
# also just made executable', i.e., in the same revision.
979
sbox.simple_propset("svn:executable", "X", 'A/B/E/alpha')
980
sbox.simple_add_symlink('alpha', 'A/B/E/sym-alpha')
982
# Add a symlink to a file made non-executable in the same revision.
983
sbox.simple_propdel("svn:executable", 'A/B/E/beta.sh')
984
sbox.simple_add_symlink('beta.sh', 'A/B/E/sym-beta.sh')
986
# Replace a normal {file, exec, dir} with a symlink to the same kind
987
# via Subversion replacement.
988
sbox.simple_rm('A/D/G/pi',
990
#'A/D/G/Z', # Ooops, not compatible with --bin=svn1.6.
992
sbox.simple_add_symlink('../gamma', 'A/D/G/pi')
993
sbox.simple_add_symlink('../gamma.sh', 'A/D/G/rho.sh')
994
#sbox.simple_add_symlink('../Y', 'A/D/G/Z')
996
# Replace a symlink to {file, exec, dir} with a normal item of the
997
# same kind via Subversion replacement.
998
sbox.simple_rm('A/D/H/chi',
1002
sbox.simple_add_symlink('../gamma', 'A/D/H/chi')
1003
sbox.simple_add_symlink('../gamma.sh', 'A/D/H/psi.sh')
1004
#sbox.simple_add_symlink('../Y', 'A/D/H/Z')
1006
# Replace a normal {file, exec} with a symlink to {exec, file} via
1007
# Subversion replacement.
1008
sbox.simple_rm('A/mu',
1010
sbox.simple_add_symlink('../iota2', 'A/mu')
1011
sbox.simple_add_symlink('../iota', 'A/mu.sh')
1013
# Ditto, without the Subversion replacement. Failing git-svn test
1014
# 'executable file becomes a symlink to bar/zzz (file)'.
1015
if svntest.main.is_posix_os():
1016
os.remove(wc('Ax/mu'))
1017
os.remove(wc('Ax/mu.sh'))
1018
os.symlink('../iota2', wc('Ax/mu'))
1019
os.symlink('../iota', wc('Ax/mu.sh'))
1021
# At least modify the file a bit
1023
# ### Somehow this breaks the test when using multiline data?
1024
# ### Is that intended behavior?
1026
file_write(sbox.ospath('Ax/mu'), 'Link to iota2')
1027
file_write(sbox.ospath('Ax/mu.sh'), 'Link to iota')
1029
sbox.simple_propset('svn:special', 'X',
1032
sbox.simple_propdel('svn:executable', 'Ax/mu.sh')
1034
### TODO Replace a normal {file, exec, dir, dir} with a symlink to
1035
### {dir, dir, file, exec}. And the same symlink-to-normal.
1037
expected_status.tweak('A/D/G/pi',
1044
expected_status.tweak('A/B/E/beta.sh',
1047
expected_status.tweak('Ax/mu',
1050
expected_status.add({
1051
'A/B/E/sym-alpha' : Item(status='A ', wc_rev=0),
1052
'A/B/E/sym-beta.sh' : Item(status='A ', wc_rev=0),
1054
svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
1056
sbox.simple_commit() # r3
1057
sbox.simple_update()
1059
expected_status.tweak(status=' ', wc_rev=3)
1060
expected_status_r3 = expected_status
1061
svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status_r3)
1063
# Try updating from HEAD-1 to HEAD. This is currently XFAIL as the
1064
# update to HEAD-1 produces a tree conflict.
1065
run_svn(None, 'up', '-r2', sbox.wc_dir)
1066
svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status_r2)
1067
sbox.simple_update()
1068
svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status_r3)
910
1072
@SkipUnless(svntest.main.is_posix_os)
911
1073
def externals_as_symlink_targets(sbox):