~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to subversion/tests/cmdline/special_tests.py

  • Committer: Package Import Robot
  • Author(s): James McCoy, Peter Samuelson, James McCoy
  • Date: 2014-01-12 19:48:33 UTC
  • mfrom: (0.2.10)
  • Revision ID: package-import@ubuntu.com-20140112194833-w3axfwksn296jn5x
Tags: 1.8.5-1
[ Peter Samuelson ]
* New upstream release.  (Closes: #725787) Rediff patches:
  - Remove apr-abi1 (applied upstream), rename apr-abi2 to apr-abi
  - Remove loosen-sqlite-version-check (shouldn't be needed)
  - Remove java-osgi-metadata (applied upstream)
  - svnmucc prompts for a changelog if none is provided. (Closes: #507430)
  - Remove fix-bdb-version-detection, upstream uses "apu-config --dbm-libs"
  - Remove ruby-test-wc (applied upstream)
  - Fix “svn diff -r N file” when file has svn:mime-type set.
    (Closes: #734163)
  - Support specifying an encoding for mod_dav_svn's environment in which
    hooks are run.  (Closes: #601544)
  - Fix ordering of “svnadmin dump” paths with certain APR versions.
    (Closes: #687291)
  - Provide a better error message when authentication fails with an
    svn+ssh:// URL.  (Closes: #273874)
  - Updated Polish translations.  (Closes: #690815)

[ James McCoy ]
* Remove all traces of libneon, replaced by libserf.
* patches/sqlite_3.8.x_workaround: Upstream fix for wc-queries-test test
  failurse.
* Run configure with --with-apache-libexecdir, which allows removing part of
  patches/rpath.
* Re-enable auth-test as upstream has fixed the problem of picking up
  libraries from the environment rather than the build tree.
  (Closes: #654172)
* Point LD_LIBRARY_PATH at the built auth libraries when running the svn
  command during the build.  (Closes: #678224)
* Add a NEWS entry describing how to configure mod_dav_svn to understand
  UTF-8.  (Closes: #566148)
* Remove ancient transitional package, libsvn-ruby.
* Enable compatibility with Sqlite3 versions back to Wheezy.
* Enable hardening flags.  (Closes: #734918)
* patches/build-fixes: Enable verbose build logs.
* Build against the default ruby version.  (Closes: #722393)

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
######################################################################
26
26
 
27
27
# General modules
28
 
import sys, os, re
 
28
import sys, os, re, copy
29
29
 
30
30
# Our testing module
31
31
import svntest
32
32
 
33
 
from svntest.main import server_has_mergeinfo
 
33
from svntest.main import server_has_mergeinfo, run_svn, file_write
34
34
 
35
35
# (abbreviation)
36
36
Skip = svntest.testcase.Skip_deco
49
49
 
50
50
 
51
51
#----------------------------------------------------------------------
52
 
@SkipUnless(svntest.main.is_posix_os)
53
52
def general_symlink(sbox):
54
53
  "general symlink handling"
55
54
 
57
56
  wc_dir = sbox.wc_dir
58
57
 
59
58
  # First try to just commit a symlink
60
 
  newfile_path = os.path.join(wc_dir, 'newfile')
61
 
  linktarget_path = os.path.join(wc_dir, 'linktarget')
62
 
  svntest.main.file_append(linktarget_path, 'this is just a link target')
63
 
  os.symlink('linktarget', newfile_path)
64
 
  svntest.main.run_svn(None, 'add', newfile_path, linktarget_path)
 
59
  newfile_path = sbox.ospath('newfile')
 
60
 
 
61
  sbox.simple_append('linktarget', 'this is just a link target')
 
62
  sbox.simple_add('linktarget')
 
63
  sbox.simple_add_symlink('linktarget', 'newfile')
65
64
 
66
65
  expected_output = svntest.wc.State(wc_dir, {
67
66
    'newfile' : Item(verb='Adding'),
104
103
                                     'up', '-r', '2', wc_dir)
105
104
 
106
105
  # Is the symlink back?
107
 
  new_target = os.readlink(newfile_path)
108
 
  if new_target != 'linktarget':
109
 
    raise svntest.Failure
 
106
  if svntest.main.is_posix_os():
 
107
    new_target = os.readlink(newfile_path)
 
108
    if new_target != 'linktarget':
 
109
      raise svntest.Failure
110
110
 
111
111
  ## Now change the target of the symlink, verify that it is shown as
112
112
  ## modified and that a commit succeeds.
113
113
  os.remove(newfile_path)
114
 
  os.symlink('A', newfile_path)
 
114
  if svntest.main.is_posix_os():
 
115
    os.symlink('A', newfile_path)
 
116
  else:
 
117
    sbox.simple_append('newfile', 'link A', truncate = True)
115
118
 
116
119
  was_cwd = os.getcwd()
117
120
  os.chdir(wc_dir)
223
226
#----------------------------------------------------------------------
224
227
# Regression test for issue 1986
225
228
@Issue(1986)
226
 
@SkipUnless(svntest.main.is_posix_os)
227
229
def copy_tree_with_symlink(sbox):
228
230
  "'svn cp dir1 dir2' which contains a symlink"
229
231
 
231
233
  wc_dir = sbox.wc_dir
232
234
 
233
235
  # Create a versioned symlink within directory 'A/D/H'.
234
 
  newfile_path = os.path.join(wc_dir, 'A', 'D', 'H', 'newfile')
235
 
  linktarget_path = os.path.join(wc_dir, 'A', 'D', 'H', 'linktarget')
236
 
  svntest.main.file_append(linktarget_path, 'this is just a link target')
237
 
  os.symlink('linktarget', newfile_path)
238
 
  svntest.main.run_svn(None, 'add', newfile_path, linktarget_path)
 
236
  newfile_path = sbox.ospath('A/D/H/newfile')
 
237
  sbox.simple_append('A/D/H/linktarget', 'this is just a link target')
 
238
  sbox.simple_add('A/D/H/linktarget')
 
239
  sbox.simple_add_symlink('linktarget', 'A/D/H/newfile')
239
240
 
240
241
  expected_output = svntest.wc.State(wc_dir, {
241
242
    'A/D/H/newfile' : Item(verb='Adding'),
301
302
 
302
303
  # Now replace the symlink with a normal file and try to commit, we
303
304
  # should get an error
304
 
  os.remove(newfile_path);
305
 
  svntest.main.file_append(newfile_path, "text of actual file");
 
305
  os.remove(newfile_path)
 
306
  svntest.main.file_append(newfile_path, "text of actual file")
306
307
 
307
308
  # Does status show the obstruction?
308
309
  was_cwd = os.getcwd()
323
324
    raise svntest.Failure
324
325
 
325
326
 
326
 
@SkipUnless(svntest.main.is_posix_os)
 
327
#----------------------------------------------------------------------
327
328
def remove_symlink(sbox):
328
329
  "remove a symlink"
329
330
 
334
335
  newfile_path = os.path.join(wc_dir, 'newfile')
335
336
  linktarget_path = os.path.join(wc_dir, 'linktarget')
336
337
  svntest.main.file_append(linktarget_path, 'this is just a link target')
337
 
  os.symlink('linktarget', newfile_path)
338
 
  svntest.main.run_svn(None, 'add', newfile_path, linktarget_path)
 
338
  sbox.simple_add_symlink('linktarget', 'newfile')
 
339
  sbox.simple_add('linktarget')
339
340
 
340
341
  expected_output = svntest.wc.State(wc_dir, {
341
342
    'newfile' : Item(verb='Adding'),
367
368
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
368
369
                                        expected_status, None, wc_dir)
369
370
 
370
 
@SkipUnless(svntest.main.is_posix_os)
 
371
#----------------------------------------------------------------------
371
372
@SkipUnless(server_has_mergeinfo)
372
373
@Issue(2530)
373
374
def merge_symlink_into_file(sbox):
378
379
  d_url = sbox.repo_url + '/A/D'
379
380
  dprime_url = sbox.repo_url + '/A/Dprime'
380
381
 
381
 
  gamma_path = os.path.join(wc_dir, 'A', 'D', 'gamma')
382
 
  gamma_prime_path = os.path.join(wc_dir, 'A', 'Dprime', 'gamma')
 
382
  gamma_path = sbox.ospath('A/D/gamma')
 
383
  gamma_prime_path = sbox.ospath('A/Dprime/gamma')
383
384
 
384
385
  # create a copy of the D directory to play with
385
386
  svntest.main.run_svn(None,
400
401
  # Commit a symlink in its place
401
402
  linktarget_path = os.path.join(wc_dir, 'linktarget')
402
403
  svntest.main.file_append(linktarget_path, 'this is just a link target')
403
 
  os.symlink('linktarget', gamma_prime_path)
404
 
  svntest.main.run_svn(None, 'add', gamma_prime_path)
 
404
  sbox.simple_add_symlink('linktarget', 'A/Dprime/gamma')
405
405
 
406
406
  expected_output = svntest.wc.State(wc_dir, {
407
407
    'A/Dprime/gamma' : Item(verb='Adding'),
435
435
 
436
436
 
437
437
 
438
 
@SkipUnless(svntest.main.is_posix_os)
 
438
#----------------------------------------------------------------------
439
439
def merge_file_into_symlink(sbox):
440
440
  "merge file into symlink"
441
441
 
466
466
  # Commit a symlink in its place
467
467
  linktarget_path = os.path.join(wc_dir, 'linktarget')
468
468
  svntest.main.file_append(linktarget_path, 'this is just a link target')
469
 
  os.symlink('linktarget', gamma_prime_path)
470
 
  svntest.main.run_svn(None, 'add', gamma_prime_path)
 
469
  sbox.simple_add_symlink('linktarget', 'A/Dprime/gamma')
471
470
 
472
471
  expected_output = svntest.wc.State(wc_dir, {
473
472
    'A/Dprime/gamma' : Item(verb='Adding'),
520
519
                                          expected_output,
521
520
                                          expected_wc)
522
521
 
 
522
#----------------------------------------------------------------------
523
523
# Issue 2716: 'svn diff' against a symlink to a directory within the wc
524
524
@Issue(2716)
525
 
@SkipUnless(svntest.main.is_posix_os)
526
525
def diff_symlink_to_dir(sbox):
527
526
  "diff a symlink to a directory"
528
527
 
529
528
  sbox.build(read_only = True)
 
529
 
 
530
  # Create a symlink to A/D as link.
 
531
  d_path = os.path.join('A', 'D')
 
532
  sbox.simple_add_symlink('A/D', 'link')
 
533
 
530
534
  os.chdir(sbox.wc_dir)
531
535
 
532
 
  # Create a symlink to A/D/.
533
 
  d_path = os.path.join('A', 'D')
534
 
  link_path = 'link'
535
 
  os.symlink(d_path, link_path)
536
 
 
537
 
  # Add the symlink.
538
 
  svntest.main.run_svn(None, 'add', link_path)
539
 
 
540
536
  # Now diff the wc itself and check the results.
541
537
  expected_output = [
542
538
    "Index: link\n",
544
540
    "--- link\t(revision 0)\n",
545
541
    "+++ link\t(working copy)\n",
546
542
    "@@ -0,0 +1 @@\n",
547
 
    "+link " + d_path + "\n",
 
543
    "+link A/D\n",
548
544
    "\ No newline at end of file\n",
549
545
    "\n",
550
546
    "Property changes on: link\n",
557
553
  svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
558
554
                                     '.')
559
555
  # We should get the same output if we the diff the symlink itself.
560
 
  svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
561
 
                                     link_path)
 
556
  svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff', 'link')
562
557
 
 
558
#----------------------------------------------------------------------
563
559
# Issue 2692 (part of): Check that the client can check out a repository
564
560
# that contains an unknown special file type.
565
561
@Issue(2692)
593
589
 
594
590
  # Now replace the symlink with a directory and try to commit, we
595
591
  # should get an error
596
 
  os.remove(from_path);
597
 
  os.mkdir(from_path);
 
592
  os.remove(from_path)
 
593
  os.mkdir(from_path)
598
594
 
599
595
  # Does status show the obstruction?
600
596
  was_cwd = os.getcwd()
608
604
  expected_output = svntest.wc.State(wc_dir, {
609
605
  })
610
606
 
611
 
  if svntest.main.is_posix_os():
612
 
    error_re_string = '.*E145001: Entry.*has unexpectedly changed special.*'
613
 
  else:
614
 
    error_re_string = None
 
607
  error_re_string = 'E145001: (Entry|Node).*has.*changed (special|kind)'
 
608
 
615
609
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
616
610
                                        None, error_re_string, wc_dir)
617
611
 
712
706
                                     '--changelist', 'chi cl',
713
707
                                     '-m', 'psi changed special status')
714
708
 
715
 
 
 
709
#----------------------------------------------------------------------
716
710
@Issue(3972)
717
 
@SkipUnless(svntest.main.is_posix_os)
718
711
def symlink_destination_change(sbox):
719
712
  "revert a symlink destination change"
720
713
 
723
716
 
724
717
  # Create a new symlink and commit it.
725
718
  newfile_path = os.path.join(wc_dir, 'newfile')
726
 
  os.symlink('linktarget', newfile_path)
727
 
  svntest.main.run_svn(None, 'add', newfile_path)
 
719
  sbox.simple_add_symlink('linktarget', 'newfile')
728
720
 
729
721
  expected_output = svntest.wc.State(wc_dir, {
730
722
    'newfile' : Item(verb='Adding'),
740
732
 
741
733
  # Modify the symlink to point somewhere else
742
734
  os.remove(newfile_path)
743
 
  os.symlink('linktarget2', newfile_path)
 
735
  if svntest.main.is_posix_os():
 
736
    os.symlink('linktarget2', newfile_path)
 
737
  else:
 
738
    sbox.simple_append('newfile', 'link linktarget2', truncate = True)
744
739
 
745
740
  expected_status.tweak('newfile', status='M ')
746
741
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
760
755
# This used to lose the special status in the target working copy
761
756
# (disk and metadata).
762
757
@Issue(3884)
763
 
@SkipUnless(svntest.main.is_posix_os)
764
 
@XFail()
765
758
def merge_foreign_symlink(sbox):
766
759
  "merge symlink-add from foreign repos"
767
760
 
780
773
  zeta2_path = sbox2.ospath('A/zeta')
781
774
 
782
775
  # sbox2 r2: create zeta2 in sbox2
783
 
  os.symlink('target', zeta2_path)
784
 
  sbox2.simple_add('A/zeta')
 
776
  sbox2.simple_add_symlink('target', 'A/zeta')
785
777
  sbox2.simple_commit('A/zeta')
786
778
 
787
779
 
792
784
  # Verify special status.
793
785
  expected_disk = svntest.main.greek_state.copy()
794
786
  expected_disk.add({
795
 
    'A/zeta': Item(props={ 'svn:special': '*' })
 
787
    'A/zeta': Item(contents="link target", props={ 'svn:special': '*' })
796
788
  })
797
789
  svntest.actions.verify_disk(sbox.ospath(''), expected_disk, True)
798
790
 
822
814
  wc_uuid = svntest.actions.get_wc_uuid(wc_dir)
823
815
  expected_info = [{
824
816
      'Path' : re.escape(os.path.join(symlink_path)),
825
 
      'Working Copy Root Path' : re.escape(os.path.abspath(symlink_path)),
 
817
      'Working Copy Root Path' : re.escape(os.path.abspath(wc_dir)),
826
818
      'Repository Root' : sbox.repo_url,
827
819
      'Repository UUID' : wc_uuid,
828
820
      'Revision' : '1',
831
823
  }, {
832
824
      'Name' : 'iota',
833
825
      'Path' : re.escape(os.path.join(symlink_path, 'iota')),
834
 
      'Working Copy Root Path' : re.escape(os.path.abspath(symlink_path)),
 
826
      'Working Copy Root Path' : re.escape(os.path.abspath(wc_dir)),
835
827
      'Repository Root' : sbox.repo_url,
836
828
      'Repository UUID' : wc_uuid,
837
829
      'Revision' : '1',
862
854
                                            symlink_path, sbox.repo_url,
863
855
                                            [ "1\n" ], [])
864
856
 
 
857
#----------------------------------------------------------------------
865
858
# Regression in 1.7.0: Update fails to change a symlink
866
 
@SkipUnless(svntest.main.is_posix_os)
867
859
def update_symlink(sbox):
868
860
  "update a symlink"
869
861
 
876
868
  symlink_path = sbox.ospath('symlink')
877
869
 
878
870
  # create a symlink to /A/mu
879
 
  os.symlink("A/mu", symlink_path)
880
 
  sbox.simple_add('symlink')
 
871
  sbox.simple_add_symlink("A/mu", 'symlink')
881
872
  sbox.simple_commit()
882
873
 
883
874
  # change the symlink to /iota
884
875
  os.remove(symlink_path)
885
 
  os.symlink("iota", symlink_path)
 
876
  if svntest.main.is_posix_os():
 
877
    os.symlink("iota", symlink_path)
 
878
  else:
 
879
    file_write(symlink_path, 'link iota')
886
880
  sbox.simple_commit()
887
881
 
888
882
  # update back to r2
899
893
  expected_status.add({
900
894
    'symlink'           : Item(status='  ', wc_rev='3'),
901
895
  })
 
896
 
 
897
  if not svntest.main.is_posix_os():
 
898
    expected_disk = None
 
899
 
902
900
  svntest.actions.run_and_verify_update(wc_dir,
903
901
                                        expected_output,
904
902
                                        expected_disk,
906
904
                                        None, None, None,
907
905
                                        None, None, 1)
908
906
 
 
907
#----------------------------------------------------------------------
 
908
@Issue(4091)
 
909
def replace_symlinks(sbox):
 
910
  "replace symlinks"
 
911
  sbox.build()
 
912
  wc = sbox.ospath
 
913
 
 
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.
 
917
 
 
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')
 
924
 
 
925
  sbox.simple_add_symlink('../Y', 'A/D/H/Z')
 
926
  sbox.simple_add_symlink('../Y', 'A/D/Hx/Z')
 
927
 
 
928
  for p in ['Ax/mu',
 
929
            'A/D/Gx/pi',
 
930
            'A/D/Hx/chi',
 
931
            ]:
 
932
      file_write(wc(p), 'This starts as a normal file.\n')
 
933
      sbox.simple_add(p)
 
934
  for p in ['iota.sh',
 
935
            'A/mu.sh',
 
936
            'Ax/mu.sh',
 
937
            'A/D/gamma.sh',
 
938
            'A/B/E/beta.sh',
 
939
            'A/D/G/rho.sh',
 
940
            'A/D/Gx/rho.sh',
 
941
            'A/D/H/psi.sh',
 
942
            'A/D/Hx/psi.sh',
 
943
            ]:
 
944
      file_write(wc(p), '#!/bin/sh\necho "hello, svn!"\n')
 
945
      os.chmod(wc(p), 0775)
 
946
      sbox.simple_add(p)
 
947
      if not svntest.main.is_posix_os():
 
948
        sbox.simple_propset('svn:executable', 'X', p)
 
949
  sbox.simple_commit() # r2
 
950
  sbox.simple_update()
 
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),
 
973
    })
 
974
  expected_status_r2 = copy.deepcopy(expected_status)
 
975
  svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status_r2)
 
976
 
 
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')
 
981
 
 
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')
 
985
 
 
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',
 
989
                 'A/D/G/rho.sh',
 
990
                 #'A/D/G/Z', # Ooops, not compatible with --bin=svn1.6.
 
991
                 )
 
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')
 
995
 
 
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',
 
999
                 'A/D/H/psi.sh',
 
1000
                 #'A/D/H/Z',
 
1001
                 )
 
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')
 
1005
 
 
1006
  # Replace a normal {file, exec} with a symlink to {exec, file} via
 
1007
  # Subversion replacement.
 
1008
  sbox.simple_rm('A/mu',
 
1009
                 'A/mu.sh')
 
1010
  sbox.simple_add_symlink('../iota2', 'A/mu')
 
1011
  sbox.simple_add_symlink('../iota', 'A/mu.sh')
 
1012
 
 
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'))
 
1020
  else:
 
1021
    # At least modify the file a bit
 
1022
 
 
1023
    # ### Somehow this breaks the test when using multiline data?
 
1024
    # ### Is that intended behavior?
 
1025
 
 
1026
    file_write(sbox.ospath('Ax/mu'), 'Link to iota2')
 
1027
    file_write(sbox.ospath('Ax/mu.sh'), 'Link to iota')
 
1028
 
 
1029
  sbox.simple_propset('svn:special', 'X',
 
1030
                      'Ax/mu',
 
1031
                      'Ax/mu.sh')
 
1032
  sbox.simple_propdel('svn:executable', 'Ax/mu.sh')
 
1033
 
 
1034
  ### TODO Replace a normal {file, exec, dir, dir} with a symlink to
 
1035
  ### {dir, dir, file, exec}.  And the same symlink-to-normal.
 
1036
 
 
1037
  expected_status.tweak('A/D/G/pi',
 
1038
                        'A/D/G/rho.sh',
 
1039
                        'A/D/H/psi.sh',
 
1040
                        'A/D/H/chi',
 
1041
                        'A/mu',
 
1042
                        'A/mu.sh',
 
1043
                        status='RM')
 
1044
  expected_status.tweak('A/B/E/beta.sh',
 
1045
                        'A/B/E/alpha',
 
1046
                        status=' M')
 
1047
  expected_status.tweak('Ax/mu',
 
1048
                        'Ax/mu.sh',
 
1049
                        status='MM')
 
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),
 
1053
      })
 
1054
  svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
 
1055
 
 
1056
  sbox.simple_commit() # r3
 
1057
  sbox.simple_update()
 
1058
 
 
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)
 
1062
 
 
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)
 
1069
 
 
1070
 
909
1071
@Issue(4102)
910
1072
@SkipUnless(svntest.main.is_posix_os)
911
1073
def externals_as_symlink_targets(sbox):
935
1097
  sbox.simple_add('sym_ext_E')
936
1098
 
937
1099
  sbox.simple_commit()
938
 
    
 
1100
 
 
1101
#----------------------------------------------------------------------
 
1102
@XFail()
 
1103
@Issue(4119)
 
1104
def cat_added_symlink(sbox):
 
1105
  "cat added symlink"
 
1106
 
 
1107
  sbox.build(read_only = True)
 
1108
 
 
1109
  kappa_path = sbox.ospath('kappa')
 
1110
  sbox.simple_add_symlink('iota', 'kappa')
 
1111
  svntest.actions.run_and_verify_svn(None, "link iota", [],
 
1112
                                     "cat", kappa_path)
939
1113
 
940
1114
#----------------------------------------------------------------------
941
1115
def incoming_symlink_changes(sbox):
1008
1182
  # Update back to r2, to prepare some local changes
1009
1183
  expected_output = svntest.wc.State(wc_dir, {
1010
1184
    # s-replace is D + A
1011
 
    's-replace'         : Item(status='A '),
 
1185
    's-replace'         : Item(status='A ', prev_status='D '),
1012
1186
    's-in-place'        : Item(status='U '),
1013
1187
    's-reverse'         : Item(status=' U'),
1014
1188
    's-type'            : Item(status=' U'),
1029
1203
  sbox.simple_propset('x', 'y', 's-replace', 's-in-place', 's-reverse', 's-type')
1030
1204
 
1031
1205
  expected_output = svntest.wc.State(wc_dir, {
1032
 
    's-replace'         : Item(status='  ', treeconflict='A'),
 
1206
    's-replace'         : Item(prev_status = '  ', prev_treeconflict='C',
 
1207
                               status='  ', treeconflict='A'),
1033
1208
    's-in-place'        : Item(status='U '),
1034
1209
    's-reverse'         : Item(status='  ', treeconflict='C'),
1035
1210
    's-type'            : Item(status='  ', treeconflict='C'),
1073
1248
              symlink_to_wc_basic,
1074
1249
              symlink_to_wc_svnversion,
1075
1250
              update_symlink,
 
1251
              replace_symlinks,
1076
1252
              externals_as_symlink_targets,
 
1253
              cat_added_symlink,
1077
1254
              incoming_symlink_changes,
1078
1255
             ]
1079
1256