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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2015-08-07 21:32:47 UTC
  • mfrom: (0.2.15) (4.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20150807213247-ozyewtmgsr6tkewl
Tags: 1.9.0-1
* Upload to unstable
* New upstream release.
  + Security fixes
    - CVE-2015-3184: Mixed anonymous/authenticated path-based authz with
      httpd 2.4
    - CVE-2015-3187: svn_repos_trace_node_locations() reveals paths hidden
      by authz
* Add >= 2.7 requirement for python-all-dev Build-Depends, needed to run
  tests.
* Remove Build-Conflicts against ruby-test-unit.  (Closes: #791844)
* Remove patches/apache_module_dependency in favor of expressing the
  dependencies in authz_svn.load/dav_svn.load.
* Build-Depend on apache2-dev (>= 2.4.16) to ensure ap_some_authn_required()
  is available when building mod_authz_svn and Depend on apache2-bin (>=
  2.4.16) for runtime support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
######################################################################
26
26
 
27
27
# General modules
28
 
import stat, os, re, shutil, logging, sys
 
28
import stat, os, re, shutil, logging
29
29
 
30
30
logger = logging.getLogger()
31
31
 
64
64
 
65
65
  # File scheduled for deletion
66
66
  rho_path = sbox.ospath('A/D/G/rho')
67
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', rho_path)
 
67
  svntest.actions.run_and_verify_svn(None, [], 'rm', rho_path)
68
68
 
69
69
  # Status before attempting copies
70
70
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
77
77
  else:
78
78
    pi_src = sbox.repo_url + '/A/D/G/pi'
79
79
 
80
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
80
  svntest.actions.run_and_verify_svn(None, [],
81
81
                                     'cp', pi_src, rho_path)
82
82
 
83
83
  # Now commit
91
91
    })
92
92
  svntest.actions.run_and_verify_commit(wc_dir,
93
93
                                        expected_output,
94
 
                                        expected_status,
95
 
                                        None, wc_dir)
 
94
                                        expected_status)
96
95
 
97
96
# Helper for wc_copy_replace_with_props and
98
97
# repos_to_wc_copy_replace_with_props
113
112
  # Set props on file which is copy-source later on
114
113
  pi_path = sbox.ospath('A/D/G/pi')
115
114
  rho_path = sbox.ospath('A/D/G/rho')
116
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
115
  svntest.actions.run_and_verify_svn(None, [],
117
116
                                     'ps', 'phony-prop', '-F',
118
117
                                     prop_path, pi_path)
119
118
  os.remove(prop_path)
120
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
119
  svntest.actions.run_and_verify_svn(None, [],
121
120
                                     'ps', 'svn:eol-style', 'LF', rho_path)
122
121
 
123
122
  # Verify props having been set
139
138
  expected_status.tweak('A/D/G/rho', wc_rev='2')
140
139
  svntest.actions.run_and_verify_commit(wc_dir,
141
140
                                        expected_output,
142
 
                                        expected_status,
143
 
                                        None, wc_dir)
 
141
                                        expected_status)
144
142
 
145
143
  # Bring wc into sync
146
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
144
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
147
145
 
148
146
  # File scheduled for deletion
149
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', rho_path)
 
147
  svntest.actions.run_and_verify_svn(None, [], 'rm', rho_path)
150
148
 
151
149
  # Status before attempting copies
152
150
  expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
159
157
  else:
160
158
    pi_src = sbox.repo_url + '/A/D/G/pi'
161
159
 
162
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
160
  svntest.actions.run_and_verify_svn(None, [],
163
161
                                     'cp', pi_src, rho_path)
164
162
 
165
163
  # Verify both content and props have been copied
184
182
    })
185
183
  svntest.actions.run_and_verify_commit(wc_dir,
186
184
                                        expected_output,
187
 
                                        expected_status,
188
 
                                        None, wc_dir)
 
185
                                        expected_status)
189
186
 
190
187
 
191
188
######################################################################
282
279
  svntest.main.file_append(rho_path, 'new appended text for rho')
283
280
 
284
281
  # Copy rho to D -- local mods
285
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp', rho_path, D_path)
 
282
  svntest.actions.run_and_verify_svn(None, [], 'cp', rho_path, D_path)
286
283
 
287
284
  # Copy alpha to C -- no local mods, and rename it to 'alpha2' also
288
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
285
  svntest.actions.run_and_verify_svn(None, [], 'cp',
289
286
                                     alpha_path, alpha2_path)
290
287
 
291
288
  # Move mu to H -- local mods
292
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
289
  svntest.actions.run_and_verify_svn(None, [], 'mv',
293
290
                                     mu_path, H_path)
294
291
 
295
292
  # Move iota to F -- no local mods
296
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv', iota_path, F_path)
 
293
  svntest.actions.run_and_verify_svn(None, [], 'mv', iota_path, F_path)
297
294
 
298
295
  # Created expected output tree for 'svn ci':
299
296
  # We should see four adds, two deletes, and one change in total.
324
321
 
325
322
  svntest.actions.run_and_verify_commit(wc_dir,
326
323
                                        expected_output,
327
 
                                        expected_status,
328
 
                                        None,
329
 
                                        wc_dir)
 
324
                                        expected_status)
330
325
 
331
326
  # Issue 1091, alpha2 would now have the wrong checksum and so a
332
327
  # subsequent commit would fail
337
332
  expected_status.tweak('A/C/alpha2', wc_rev=3)
338
333
  svntest.actions.run_and_verify_commit(wc_dir,
339
334
                                        expected_output,
340
 
                                        expected_status,
341
 
                                        None,
342
 
                                        wc_dir)
 
335
                                        expected_status)
343
336
 
344
337
  # Assure that attempts at local copy and move fail when a log
345
338
  # message is provided.
346
339
  expected_stderr = \
347
340
    ".*Local, non-commit operations do not take a log message"
348
 
  svntest.actions.run_and_verify_svn(None, None, expected_stderr,
 
341
  svntest.actions.run_and_verify_svn(None, expected_stderr,
349
342
                                     'cp', '-m', 'op fails', rho_path, D_path)
350
 
  svntest.actions.run_and_verify_svn(None, None, expected_stderr,
 
343
  svntest.actions.run_and_verify_svn(None, expected_stderr,
351
344
                                     'mv', '-m', 'op fails', rho_path, D_path)
352
345
 
353
346
 
373
366
  newG_path = sbox.ospath('A/B/newG')
374
367
 
375
368
  # Copy directory A/D to A/B/newG
376
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp', G_path, newG_path)
 
369
  svntest.actions.run_and_verify_svn(None, [], 'cp', G_path, newG_path)
377
370
 
378
371
  # Created expected output tree for 'svn ci':
379
372
  expected_output = svntest.wc.State(wc_dir, {
391
384
 
392
385
  svntest.actions.run_and_verify_commit(wc_dir,
393
386
                                        expected_output,
394
 
                                        expected_status,
395
 
                                        None,
396
 
                                        wc_dir)
 
387
                                        expected_status)
397
388
 
398
389
  # Now update the other working copy; it should receive a full add of
399
390
  # the newG directory and its contents.
450
441
  G_path = sbox.ospath('A/D/G')
451
442
 
452
443
  # Delete directory A/D/G, commit that as r2.
453
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', '--force',
 
444
  svntest.actions.run_and_verify_svn(None, [], 'rm', '--force',
454
445
                                     G_path)
455
446
 
456
447
  expected_output = svntest.wc.State(wc_dir, {
465
456
 
466
457
  svntest.actions.run_and_verify_commit(wc_dir,
467
458
                                        expected_output,
468
 
                                        expected_status,
469
 
                                        None,
470
 
                                        wc_dir)
 
459
                                        expected_status)
471
460
 
472
461
  # Use 'svn cp URL@1 URL' to resurrect the deleted directory, where
473
462
  # the two URLs are identical.  This used to trigger a failure.
474
463
  url = sbox.repo_url + '/A/D/G'
475
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
464
  svntest.actions.run_and_verify_svn(None, [], 'cp',
476
465
                                     url + '@1', url,
477
466
                                     '-m', 'logmsg')
478
467
 
503
492
  D_path = sbox.ospath('A/D')
504
493
 
505
494
  # Delete directory A/D, commit that as r2.
506
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', '--force',
 
495
  svntest.actions.run_and_verify_svn(None, [], 'rm', '--force',
507
496
                                     D_path)
508
497
 
509
498
  expected_output = svntest.wc.State(wc_dir, {
512
501
 
513
502
  svntest.actions.run_and_verify_commit(wc_dir,
514
503
                                        expected_output,
515
 
                                        None,
516
 
                                        None,
517
 
                                        wc_dir)
 
504
                                        None)
518
505
 
519
506
  # Ok, copy from a deleted URL into a prefix of that URL, this used to
520
507
  # result in an assert failing.
521
508
  url1 = sbox.repo_url + '/A/D/G'
522
509
  url2 = sbox.repo_url + '/A/D'
523
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
510
  svntest.actions.run_and_verify_svn(None, [], 'cp',
524
511
                                     url1 + '@1', url2,
525
512
                                     '-m', 'logmsg')
526
513
 
547
534
  dirURL2  =  sbox.repo_url + "/A/D/H"
548
535
 
549
536
  # Expect out-of-date failure if 'svn cp URL URL' tries to overwrite a file
550
 
  svntest.actions.run_and_verify_svn("Whoa, I was able to overwrite a file!",
551
 
                                     None, svntest.verify.AnyOutput,
 
537
  svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput,
552
538
                                     'cp', fileURL1, fileURL2,
553
539
                                     '-m', 'fooogle')
554
540
 
555
541
  # Create A/D/H/G by running 'svn cp ...A/D/G .../A/D/H'
556
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
542
  svntest.actions.run_and_verify_svn(None, [],
557
543
                                     'cp', dirURL1, dirURL2,
558
544
                                     '-m', 'fooogle')
559
545
 
560
546
  # Repeat the last command.  It should *fail* because A/D/H/G already exists.
561
547
  svntest.actions.run_and_verify_svn(
562
 
    "Whoa, I was able to overwrite a directory!",
563
 
    None, svntest.verify.AnyOutput,
 
548
    None, ".*'/A/D/H/G'.*",
564
549
    'cp', dirURL1, dirURL2,
565
550
    '-m', 'fooogle')
566
551
 
586
571
  # These copies should fail
587
572
  pi_path = sbox.ospath('A/D/G/pi')
588
573
  rho_path = sbox.ospath('A/D/G/rho')
589
 
  svntest.actions.run_and_verify_svn(None, None, svntest.verify.AnyOutput,
 
574
  svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput,
590
575
                                     'cp', pi_path, rho_path)
591
 
  svntest.actions.run_and_verify_svn(None, None, svntest.verify.AnyOutput,
 
576
  svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput,
592
577
                                     'cp', pi_path, tau_path)
593
578
 
594
579
  # Status after failed copies should not have changed
607
592
  B_path = sbox.ospath('A/B')
608
593
  B2_path = sbox.ospath('A/B2')
609
594
 
610
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
595
  svntest.actions.run_and_verify_svn(None, [], 'cp',
611
596
                                     B_path, B2_path)
612
597
 
613
598
  alpha_path = sbox.ospath('A/B2/E/alpha')
620
605
 
621
606
  svntest.actions.run_and_verify_commit(wc_dir,
622
607
                                        expected_output,
623
 
                                        None,
624
 
                                        None,
625
 
                                        wc_dir)
 
608
                                        None)
626
609
 
627
610
#----------------------------------------------------------------------
628
611
 
637
620
 
638
621
  # Set a property on a file
639
622
  rho_path = sbox.ospath('A/D/G/rho')
640
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
623
  svntest.actions.run_and_verify_svn(None, [],
641
624
                                     'propset', 'pname', 'pval', rho_path)
642
625
 
643
626
  # and commit it
647
630
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
648
631
  expected_status.tweak('A/D/G/rho', status='  ', wc_rev=2)
649
632
  svntest.actions.run_and_verify_commit(wc_dir,
650
 
                                        expected_output, expected_status,
651
 
                                        None, wc_dir)
 
633
                                        expected_output, expected_status)
652
634
 
653
635
  # Set another property, but don't commit it yet
654
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
636
  svntest.actions.run_and_verify_svn(None, [],
655
637
                                     'propset', 'pname2', 'pval2', rho_path)
656
638
 
657
639
  # WC to WC copy of file with committed and uncommitted properties
658
640
  rho_wc_path = sbox.ospath('A/D/G/rho_wc')
659
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
641
  svntest.actions.run_and_verify_svn(None, [],
660
642
                                     'copy', rho_path, rho_wc_path)
661
643
 
662
644
  # REPOS to WC copy of file with properties
663
645
  rho_url_path = sbox.ospath('A/D/G/rho_url')
664
646
  rho_url = sbox.repo_url + '/A/D/G/rho'
665
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
647
  svntest.actions.run_and_verify_svn(None, [],
666
648
                                     'copy', rho_url, rho_url_path)
667
649
 
668
650
  # Properties are not visible in WC status 'A'
674
656
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
675
657
 
676
658
  # Check properties explicitly
677
 
  svntest.actions.run_and_verify_svn(None, ['pval\n'], [],
 
659
  svntest.actions.run_and_verify_svn(['pval\n'], [],
678
660
                                     'propget', 'pname', rho_wc_path)
679
 
  svntest.actions.run_and_verify_svn(None, ['pval2\n'], [],
 
661
  svntest.actions.run_and_verify_svn(['pval2\n'], [],
680
662
                                     'propget', 'pname2', rho_wc_path)
681
 
  svntest.actions.run_and_verify_svn(None, ['pval\n'], [],
 
663
  svntest.actions.run_and_verify_svn(['pval\n'], [],
682
664
                                     'propget', 'pname', rho_url_path)
683
665
 
684
666
  # Commit and properties are visible in status
694
676
    'A/D/G/rho_url' : Item(status='  ', wc_rev=3),
695
677
    })
696
678
  svntest.actions.run_and_verify_commit(wc_dir,
697
 
                                        expected_output, expected_status,
698
 
                                        None, wc_dir)
 
679
                                        expected_output, expected_status)
699
680
 
700
681
#----------------------------------------------------------------------
701
682
 
710
691
  B2_path = sbox.ospath('A/B2')
711
692
 
712
693
  # copy a tree
713
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
694
  svntest.actions.run_and_verify_svn(None, [], 'cp',
714
695
                                     B_path, B2_path)
715
696
 
716
697
  # delete two files
717
698
  lambda_path = sbox.ospath('A/B2/lambda')
718
699
  alpha_path = sbox.ospath('A/B2/E/alpha')
719
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
700
  svntest.actions.run_and_verify_svn(None, [],
720
701
                                     'rm', alpha_path, lambda_path)
721
702
 
722
703
  # commit copied tree containing a deleted file
727
708
    })
728
709
  svntest.actions.run_and_verify_commit(wc_dir,
729
710
                                        expected_output,
730
 
                                        None,
731
 
                                        None,
732
 
                                        wc_dir)
 
711
                                        None)
733
712
 
734
713
  # copy a tree
735
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
714
  svntest.actions.run_and_verify_svn(None, [], 'cp',
736
715
                                     sbox.ospath('A/B'),
737
716
                                     sbox.ospath('A/B3'))
738
717
 
739
718
  # delete a directory
740
719
  E_path = sbox.ospath('A/B3/E')
741
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', E_path)
 
720
  svntest.actions.run_and_verify_svn(None, [], 'rm', E_path)
742
721
 
743
722
  # commit copied tree containing a deleted directory
744
723
  expected_output = svntest.wc.State(wc_dir, {
747
726
    })
748
727
  svntest.actions.run_and_verify_commit(wc_dir,
749
728
                                        expected_output,
750
 
                                        None,
751
 
                                        None,
752
 
                                        wc_dir)
 
729
                                        None)
753
730
 
754
731
 
755
732
#----------------------------------------------------------------------
764
741
  new_E_path = os.path.join(F_path, 'E')
765
742
 
766
743
  # Issue 931: move failed to lock the directory being deleted
767
 
  svntest.actions.run_and_verify_svn(None, None, [], 'move',
 
744
  svntest.actions.run_and_verify_svn(None, [], 'move',
768
745
                                     E_path, F_path)
769
746
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
770
747
  expected_status.tweak('A/B/E/alpha', 'A/B/E/beta', status='D ')
778
755
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
779
756
 
780
757
  # Issue 932: revert failed to lock the parent directory
781
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '--recursive',
 
758
  svntest.actions.run_and_verify_svn(None, [], 'revert', '--recursive',
782
759
                                     new_E_path)
783
760
  expected_status.remove('A/B/F/E', 'A/B/F/E/alpha', 'A/B/F/E/beta')
784
761
  expected_status.tweak('A/B/E', moved_to=None)
803
780
 
804
781
  # Create the first file.
805
782
  svntest.main.file_append(newpath1, "a new file")
806
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', newpath1)
 
783
  svntest.actions.run_and_verify_svn(None, [], 'add', newpath1)
807
784
 
808
785
  mode1 = os.stat(newpath1)[stat.ST_MODE]
809
786
 
810
787
  # Doing this to get the executable bit set on systems that support
811
788
  # that -- the property itself is not the point.
812
 
  svntest.actions.run_and_verify_svn(None, None, [], 'propset',
 
789
  svntest.actions.run_and_verify_svn(None, [], 'propset',
813
790
                                     'svn:executable', 'on', newpath1)
814
791
 
815
792
  mode2 = os.stat(newpath1)[stat.ST_MODE]
819
796
    raise svntest.Failure
820
797
 
821
798
  # Commit the file
822
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci',
 
799
  svntest.actions.run_and_verify_svn(None, [], 'ci',
823
800
                                     '-m', 'create file and set svn:executable',
824
801
                                     wc_dir)
825
802
 
826
803
  # Copy the file
827
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp', newpath1, newpath2)
 
804
  svntest.actions.run_and_verify_svn(None, [], 'cp', newpath1, newpath2)
828
805
 
829
806
  mode3 = os.stat(newpath2)[stat.ST_MODE]
830
807
 
850
827
  # modify some items to be copied
851
828
  svntest.main.file_append(sbox.ospath('A/D/H/omega'),
852
829
                           "new otext\n")
853
 
  svntest.actions.run_and_verify_svn(None, None, [], 'propset', 'foo', 'bar',
 
830
  svntest.actions.run_and_verify_svn(None, [], 'propset', 'foo', 'bar',
854
831
                                     beta_path)
855
832
 
856
833
  # copy a file
857
 
  svntest.actions.run_and_verify_svn(None, None, [], '-m', 'fumble file',
 
834
  svntest.actions.run_and_verify_svn(None, [], '-m', 'fumble file',
858
835
                                     'copy', beta_path, beta2_url)
859
836
  # and a directory
860
 
  svntest.actions.run_and_verify_svn(None, None, [], '-m', 'fumble dir',
 
837
  svntest.actions.run_and_verify_svn(None, [], '-m', 'fumble dir',
861
838
                                     'copy', H_path, H2_url)
862
839
  # copy a file to a directory
863
 
  svntest.actions.run_and_verify_svn(None, None, [], '-m', 'fumble file',
 
840
  svntest.actions.run_and_verify_svn(None, [], '-m', 'fumble file',
864
841
                                     'copy', beta_path, H2_url)
865
842
 
866
843
  # update the working copy.  post-update mereinfo elision will remove
900
877
                                        expected_status)
901
878
 
902
879
  # check local property was copied
903
 
  svntest.actions.run_and_verify_svn(None, ['bar\n'], [],
 
880
  svntest.actions.run_and_verify_svn(['bar\n'], [],
904
881
                                     'propget', 'foo',
905
882
                                     beta_path + "2")
906
883
 
927
904
  pi_url = sbox.repo_url + "/A/D/G/pi"
928
905
  pi_path = sbox.ospath('pi')
929
906
 
930
 
  svntest.actions.run_and_verify_svn(None, None, [], 'copy', E_url, wc_dir)
931
 
  svntest.actions.run_and_verify_svn(None, None, [], 'copy', pi_url, wc_dir)
 
907
  svntest.actions.run_and_verify_svn(None, [], 'copy', E_url, wc_dir)
 
908
  svntest.actions.run_and_verify_svn(None, [], 'copy', pi_url, wc_dir)
932
909
 
933
910
  # Extra test: modify file ASAP to check there was a timestamp sleep
934
911
  svntest.main.file_append(pi_path, 'zig\n')
955
932
    raise svntest.Failure
956
933
 
957
934
  # Revert everything and verify.
958
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
935
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
959
936
 
960
937
  svntest.main.safe_rmtree(sbox.ospath('E'))
961
938
 
966
943
  # Copy an empty directory from the same repository, see issue #1444.
967
944
  C_url = sbox.repo_url + "/A/C"
968
945
 
969
 
  svntest.actions.run_and_verify_svn(None, None, [], 'copy', C_url, wc_dir)
 
946
  svntest.actions.run_and_verify_svn(None, [], 'copy', C_url, wc_dir)
970
947
 
971
948
  expected_output = svntest.actions.get_virginal_state(wc_dir, 1)
972
949
  expected_output.add({
975
952
  svntest.actions.run_and_verify_status(wc_dir, expected_output)
976
953
 
977
954
  # Revert everything and verify.
978
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
955
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
979
956
 
980
957
  svntest.main.safe_rmtree(sbox.ospath('C'))
981
958
 
995
972
    'A         %s\n' % sbox.ospath('E/beta'),
996
973
    'A         %s\n' % sbox.ospath('E/alpha'),
997
974
  ])
998
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
975
  svntest.actions.run_and_verify_svn(expected_output, [],
999
976
                                     'copy', E_url, wc_dir)
1000
977
 
1001
978
  expected_output = [
1002
979
    '--- Copying from foreign repository URL \'%s\':\n' % pi_url,
1003
980
    'A         %s\n' % sbox.ospath('pi'),
1004
981
  ]
1005
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
982
  svntest.actions.run_and_verify_svn(expected_output, [],
1006
983
                                     'copy', pi_url, wc_dir)
1007
984
 
1008
985
  expected_output = svntest.actions.get_virginal_state(wc_dir, 1)
1015
992
  svntest.actions.run_and_verify_status(wc_dir, expected_output)
1016
993
 
1017
994
  # Revert everything and verify.
1018
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
995
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
1019
996
  expected_output = svntest.actions.get_virginal_state(wc_dir, 1)
1020
997
 
1021
998
  # URL->wc copy:
1024
1001
  B_url = sbox.repo_url + "/A/B"
1025
1002
  D_dir = sbox.ospath('A/D')
1026
1003
 
1027
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1004
  svntest.actions.run_and_verify_svn(None, [],
1028
1005
                                     'copy', B_url, D_dir)
1029
1006
 
1030
1007
  expected_output = svntest.actions.get_virginal_state(wc_dir, 1)
1038
1015
    })
1039
1016
  svntest.actions.run_and_verify_status(wc_dir, expected_output)
1040
1017
 
1041
 
  # Validate the merge info of the copy destination (we expect none)
1042
 
  svntest.actions.run_and_verify_svn(None, [], [],
 
1018
  # Validate the mergeinfo of the copy destination (we expect none)
 
1019
  svntest.actions.run_and_verify_svn([], '.*W200017: Property.*not found',
1043
1020
                                     'propget', SVN_PROP_MERGEINFO,
1044
1021
                                     os.path.join(D_dir, 'B'))
1045
1022
 
1055
1032
  root = sbox.repo_url
1056
1033
  mu = root + '/A/mu'
1057
1034
 
1058
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
1035
  svntest.actions.run_and_verify_svn(None, [], 'cp',
1059
1036
                                     '-m', '',
1060
1037
                                     mu, root)
1061
1038
 
1093
1070
  F_url = sbox.repo_url + "/A/B/F"
1094
1071
 
1095
1072
  # Issue 1367 parent/child URL-to-URL was rejected.
1096
 
  svntest.actions.run_and_verify_svn(None,
1097
 
                                     ['\n', 'Committed revision 2.\n'], [],
 
1073
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
1074
                                      'Committed revision 2.\n'], [],
1098
1075
                                     'cp',
1099
1076
                                     '-m', 'a can of worms',
1100
1077
                                     B_url, F_url)
1144
1121
 
1145
1122
  # Want a smaller WC
1146
1123
  svntest.main.safe_rmtree(wc_dir)
1147
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1124
  svntest.actions.run_and_verify_svn(None, [],
1148
1125
                                     'checkout',
1149
1126
                                     B_url, wc_dir)
1150
1127
 
1154
1131
  was_cwd = os.getcwd()
1155
1132
  os.chdir(wc_dir)
1156
1133
 
1157
 
  svntest.actions.run_and_verify_svn(None,
1158
 
                                     ['Adding copy of        .\n',
1159
 
                                     '\n', 'Committed revision 2.\n'], [],
 
1134
  svntest.actions.run_and_verify_svn(['Adding copy of        .\n',
 
1135
                                      'Committing transaction...\n',
 
1136
                                      'Committed revision 2.\n'], [],
1160
1137
                                     'cp',
1161
1138
                                     '-m', 'a larger can',
1162
1139
                                     '.', F_B_url)
1217
1194
 
1218
1195
  # Delete a file in the repository via immediate commit
1219
1196
  rho_url = sbox.repo_url + '/A/D/G/rho'
1220
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1197
  svntest.actions.run_and_verify_svn(None, [],
1221
1198
                                     'rm', rho_url, '-m', 'rev 2')
1222
1199
 
1223
1200
  # Update the wc to HEAD (r2)
1234
1211
                                        expected_status)
1235
1212
 
1236
1213
  # repos->wc copy, to resurrect deleted file.
1237
 
  svntest.actions.run_and_verify_svn("Copy error:", None, [],
 
1214
  svntest.actions.run_and_verify_svn(None, [],
1238
1215
                                     'cp', rho_url + '@1', wc_dir)
1239
1216
 
1240
1217
  # status should now show the file scheduled for addition-with-history
1258
1235
  target_wc_path = sbox.ospath('new_file')
1259
1236
 
1260
1237
  # Copy a file from the repository to the working copy.
1261
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
1238
  svntest.actions.run_and_verify_svn(None, [], 'cp',
1262
1239
                                     iota_repos_path, target_wc_path)
1263
1240
 
1264
1241
  # Run diff.
1265
 
  svntest.actions.run_and_verify_svn(None, None, [], 'diff', wc_dir)
 
1242
  svntest.actions.run_and_verify_svn(None, [], 'diff', wc_dir)
1266
1243
 
1267
1244
 
1268
1245
#-------------------------------------------------------------
1287
1264
                          "Hello\nSubversion\n$LastChangedRevision$\n",
1288
1265
                          "ab")
1289
1266
 
1290
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1267
  svntest.actions.run_and_verify_svn(None, [],
1291
1268
                                     'propset', 'svn:eol-style',
1292
1269
                                     'CRLF', iota_wc_path)
1293
1270
 
1294
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1271
  svntest.actions.run_and_verify_svn(None, [],
1295
1272
                                     'propset', 'svn:keywords',
1296
1273
                                     'Rev', iota_wc_path)
1297
1274
 
1298
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1275
  svntest.actions.run_and_verify_svn(None, [],
1299
1276
                                     'commit', '-m', 'log msg',
1300
1277
                                     wc_dir)
1301
1278
 
1302
1279
  # Copy a file from the repository to the working copy.
1303
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
1280
  svntest.actions.run_and_verify_svn(None, [], 'cp',
1304
1281
                                     iota_repos_path, target_wc_path)
1305
1282
 
1306
1283
  # The original bug was that the copy would seg fault.  So we test
1342
1319
  expected_output = svntest.wc.State(wc_dir, {
1343
1320
    'A/mu' : Item(verb='Sending'), })
1344
1321
  svntest.main.file_append(mu_path, "New r2 text.\n")
1345
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, None,
1346
 
                                        None, wc_dir)
 
1322
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, None)
1347
1323
  svntest.main.file_append(mu_path, "New r3 text.\n")
1348
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, None,
1349
 
                                        None, wc_dir)
1350
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', '-r2', mu_path)
 
1324
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, None)
 
1325
  svntest.actions.run_and_verify_svn(None, [], 'up', '-r2', mu_path)
1351
1326
  svntest.main.file_append(mu_path, "Working copy.\n")
1352
1327
 
1353
1328
  r1 = "This is the file 'mu'.\n"
1369
1344
  for dst, from_rev, text, peg_rev in sub_tests:
1370
1345
    dst_path = os.path.join(wc_dir, dst)
1371
1346
    if peg_rev is None:
1372
 
      svntest.actions.run_and_verify_svn(None, None, [], "copy",
 
1347
      svntest.actions.run_and_verify_svn(None, [], "copy",
1373
1348
                                         mu_path, dst_path)
1374
1349
    else:
1375
 
      svntest.actions.run_and_verify_svn(None, None, [], "copy",
 
1350
      svntest.actions.run_and_verify_svn(None, [], "copy",
1376
1351
                                         mu_path + "@" + peg_rev, dst_path)
1377
1352
    expected_disk.add({ dst: Item(contents=text) })
1378
1353
 
1405
1380
  os.remove(mu_path)
1406
1381
 
1407
1382
  # Try both wc->wc copy and repos->wc copy, expect failures:
1408
 
  svntest.actions.run_and_verify_svn(None, None, svntest.verify.AnyOutput,
 
1383
  svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput,
1409
1384
                                     'cp', iota_path, mu_path)
1410
1385
 
1411
 
  svntest.actions.run_and_verify_svn(None, None, svntest.verify.AnyOutput,
 
1386
  svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput,
1412
1387
                                    'cp', iota_url, mu_path)
1413
1388
 
1414
1389
  # Make sure that the working copy is not corrupted:
1433
1408
 
1434
1409
  # First delete a subdirectory and commit.
1435
1410
  E_path = sbox.ospath('A/B/E')
1436
 
  svntest.actions.run_and_verify_svn(None, None, [], 'delete', E_path)
 
1411
  svntest.actions.run_and_verify_svn(None, [], 'delete', E_path)
1437
1412
  expected_output = svntest.wc.State(wc_dir, {
1438
1413
    'A/B/E' : Item(verb='Deleting'),
1439
1414
    })
1441
1416
  expected_status.remove('A/B/E', 'A/B/E/alpha', 'A/B/E/beta')
1442
1417
  svntest.actions.run_and_verify_commit(wc_dir,
1443
1418
                                        expected_output,
1444
 
                                        expected_status,
1445
 
                                        None, wc_dir)
 
1419
                                        expected_status)
1446
1420
 
1447
1421
  # Now copy the directory back.
1448
1422
  E_url = sbox.repo_url + "/A/B/E@1"
1449
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1423
  svntest.actions.run_and_verify_svn(None, [],
1450
1424
                                     'copy', E_url, E_path)
1451
1425
  expected_status.add({
1452
1426
    'A/B/E'       :  Item(status='A ', copied='+', wc_rev='-'),
1455
1429
    })
1456
1430
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
1457
1431
 
1458
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
1432
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
1459
1433
  expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
1460
1434
  expected_status.add({
1461
1435
    'A/B/E'       :  Item(status='A ', copied='+', wc_rev='-'),
1475
1449
  base_url = sbox.repo_url + '/base'
1476
1450
 
1477
1451
  # rev. 2
1478
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1452
  svntest.actions.run_and_verify_svn(None, [],
1479
1453
                                     'mkdir', '-m', 'mybase',
1480
1454
                                     base_url)
1481
1455
 
1482
1456
  orig_url = base_url + '/foo%20bar'
1483
1457
 
1484
1458
  # rev. 3
1485
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1459
  svntest.actions.run_and_verify_svn(None, [],
1486
1460
                                     'mkdir', '-m', 'r1',
1487
1461
                                     orig_url)
1488
1462
  orig_rev = 3
1489
1463
 
1490
1464
  # rev. 4
1491
1465
  new_url = base_url + '/foo_bar'
1492
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1466
  svntest.actions.run_and_verify_svn(None, [],
1493
1467
                                     'mv', '-m', 'r2',
1494
1468
                                     orig_url, new_url)
1495
1469
 
1496
1470
  # This had failed with ra_neon because "foo bar" would be double-encoded
1497
1471
  # "foo bar" ==> "foo%20bar" ==> "foo%2520bar"
1498
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1472
  svntest.actions.run_and_verify_svn(None, [],
1499
1473
                                     'ls', ('-r'+str(orig_rev)),
1500
1474
                                     '-R', base_url)
1501
1475
 
1536
1510
  B2_path = sbox.ospath('A/B2')
1537
1511
 
1538
1512
  # Schedule for delete
1539
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm',
 
1513
  svntest.actions.run_and_verify_svn(None, [], 'rm',
1540
1514
                                     os.path.join(B_path, 'E', 'alpha'),
1541
1515
                                     os.path.join(B_path, 'lambda'),
1542
1516
                                     os.path.join(B_path, 'F'))
1553
1527
    })
1554
1528
  svntest.actions.run_and_verify_commit(wc_dir,
1555
1529
                                        expected_output,
1556
 
                                        expected_status,
1557
 
                                        None, wc_dir)
 
1530
                                        expected_status)
1558
1531
 
1559
1532
  # Copy including stuff in state not-present
1560
 
  svntest.actions.run_and_verify_svn(None, None, [], 'copy', B_path, B2_path)
 
1533
  svntest.actions.run_and_verify_svn(None, [], 'copy', B_path, B2_path)
1561
1534
  expected_status.add({
1562
1535
    'A/B2'         : Item(status='A ', wc_rev='-', copied='+'),
1563
1536
    'A/B2/E'       : Item(status='  ', wc_rev='-', copied='+'),
1574
1547
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
1575
1548
 
1576
1549
  # Revert the entire copy including the schedule not-present bits
1577
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '--recursive',
 
1550
  svntest.actions.run_and_verify_svn(None, [], 'revert', '--recursive',
1578
1551
                                     B2_path)
1579
1552
  expected_status.remove('A/B2',
1580
1553
                         'A/B2/E',
1586
1559
  svntest.main.safe_rmtree(B2_path)
1587
1560
 
1588
1561
  # Copy again and commit
1589
 
  svntest.actions.run_and_verify_svn(None, None, [], 'copy', B_path, B2_path)
 
1562
  svntest.actions.run_and_verify_svn(None, [], 'copy', B_path, B2_path)
1590
1563
 
1591
1564
  expected_status.add({
1592
1565
    'A/B2'              : Item(status='A ', copied='+', wc_rev='-'),
1610
1583
 
1611
1584
  svntest.actions.run_and_verify_commit(wc_dir,
1612
1585
                                        expected_output,
1613
 
                                        expected_status,
1614
 
                                        None, wc_dir)
 
1586
                                        expected_status)
1615
1587
 
1616
1588
#----------------------------------------------------------------------
1617
1589
# Test for copy into a non-existent URL path
1655
1627
  pi_url = sbox.repo_url + '/A/D/G/pi'
1656
1628
  new_url = sbox.repo_url + '/newfile'
1657
1629
 
1658
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1630
  svntest.actions.run_and_verify_svn(None, [],
1659
1631
                                     'delete',
1660
1632
                                     adg_url, '-m', '')
1661
1633
 
1662
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1634
  svntest.actions.run_and_verify_svn(None, [],
1663
1635
                                     'copy',
1664
1636
                                     pi_url + '@1', new_url,
1665
1637
                                     '-m', '')
1676
1648
  new_url = sbox.repo_url + '/newfile'
1677
1649
 
1678
1650
  # Delete a directory
1679
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1651
  svntest.actions.run_and_verify_svn(None, [],
1680
1652
                                     'delete',
1681
1653
                                     adg_url, '-m', '')
1682
1654
 
1683
1655
  # Copy a file to where the directory used to be
1684
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1656
  svntest.actions.run_and_verify_svn(None, [],
1685
1657
                                     'copy',
1686
1658
                                     iota_url, adg_url,
1687
1659
                                     '-m', '')
1688
1660
 
1689
1661
  # Try copying a file that was in the deleted directory that is now a
1690
1662
  # file
1691
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1663
  svntest.actions.run_and_verify_svn(None, [],
1692
1664
                                     'copy',
1693
1665
                                     pi_url + '@1', new_url,
1694
1666
                                     '-m', '')
1710
1682
    dir_path = os.path.join(wc_dir, dirname)
1711
1683
 
1712
1684
    # try to copy dir to itself
1713
 
    svntest.actions.run_and_verify_svn(None, [],
 
1685
    svntest.actions.run_and_verify_svn([],
1714
1686
                                       '.*Cannot copy .* into its own child.*',
1715
1687
                                       'copy', dir_path, dir_path)
1716
1688
 
1742
1714
  rho_path = sbox.ospath('A/D/G/rho')
1743
1715
 
1744
1716
  # Remove A/D/G/pi, then commit that removal.
1745
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', pi_path)
1746
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1717
  svntest.actions.run_and_verify_svn(None, [], 'rm', pi_path)
 
1718
  svntest.actions.run_and_verify_svn(None, [],
1747
1719
                                     'ci', '-m', "Delete pi.", wc_dir)
1748
1720
 
1749
1721
  # Make a modification to A/D/G/rho, then commit that modification.
1750
1722
  svntest.main.file_append(rho_path, "\nFirst modification to rho.\n")
1751
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1723
  svntest.actions.run_and_verify_svn(None, [],
1752
1724
                                     'ci', '-m', "Modify rho.", wc_dir)
1753
1725
 
1754
1726
  # Make another modification to A/D/G/rho, but don't commit it.
1755
1727
  svntest.main.file_append(rho_path, "Second modification to rho.\n")
1756
1728
 
1757
1729
  # Copy into the source, delete part of the copy, add a non-copied directory
1758
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1730
  svntest.actions.run_and_verify_svn(None, [],
1759
1731
                                     'cp', B_path, X_path)
1760
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1732
  svntest.actions.run_and_verify_svn(None, [],
1761
1733
                                     'rm', alpha_path)
1762
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1734
  svntest.actions.run_and_verify_svn(None, [],
1763
1735
                                     'mkdir', Y_path)
1764
1736
 
1765
1737
  # Now copy local A/D/G to create new directory A/D/Z the repository.
1766
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1738
 
 
1739
  expected_status = svntest.wc.State(G_path, {
 
1740
    ''                  : Item(status='  ', wc_rev='1'),
 
1741
    'X'                 : Item(status='A ', copied='+', wc_rev='-'),
 
1742
    'X/F'               : Item(status='  ', copied='+', wc_rev='-'),
 
1743
    'X/E'               : Item(status='  ', copied='+', wc_rev='-'),
 
1744
    'X/E/alpha'         : Item(status='D ', copied='+', wc_rev='-'),
 
1745
    'X/E/beta'          : Item(status='  ', copied='+', wc_rev='-'),
 
1746
    'X/lambda'          : Item(status='  ', copied='+', wc_rev='-'),
 
1747
    'Y'                 : Item(status='A ', wc_rev='-'),
 
1748
    'rho'               : Item(status='M ', wc_rev='3'),
 
1749
    'tau'               : Item(status='  ', wc_rev='1'),
 
1750
  })
 
1751
 
 
1752
  svntest.actions.run_and_verify_status(G_path, expected_status)
 
1753
 
 
1754
  expected_output = svntest.verify.UnorderedOutput([
 
1755
      'Adding copy of        %s\n' % sbox.ospath('A/D/G'),
 
1756
      'Adding copy of        %s\n' % sbox.ospath('A/D/G/X'),
 
1757
      'Deleting copy of      %s\n' % sbox.ospath('A/D/G/X/E/alpha'),
 
1758
      'Adding copy of        %s\n' % sbox.ospath('A/D/G/Y'),
 
1759
      'Deleting copy of      %s\n' % sbox.ospath('A/D/G/pi'),
 
1760
      'Replacing copy of     %s\n' % sbox.ospath('A/D/G/rho'),
 
1761
      'Transmitting file data .done\n',
 
1762
      'Committing transaction...\n',
 
1763
      'Committed revision 4.\n',
 
1764
  ])
 
1765
  svntest.actions.run_and_verify_svn(expected_output, [],
1767
1766
                                     'cp', '-m', "Make a copy.",
1768
1767
                                     G_path, Z_url)
1769
1768
  expected_output = svntest.verify.UnorderedOutput([
1778
1777
    'A + A/D/Z/rho\n',
1779
1778
    '    (from A/D/G/rho:r3)\n',
1780
1779
    ])
1781
 
  svntest.actions.run_and_verify_svnlook(None, expected_output, [],
 
1780
  svntest.actions.run_and_verify_svnlook(expected_output, [],
1782
1781
                                         'changed', sbox.repo_dir,
1783
1782
                                         '--copy-info')
1784
1783
 
1785
1784
  # Copy from copied source
1786
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1785
  svntest.actions.run_and_verify_svn(None, [],
1787
1786
                                     'cp', '-m', "Make a copy.",
1788
1787
                                     E_path, Z2_url)
1789
1788
  expected_output = svntest.verify.UnorderedOutput([
1791
1790
    '    (from A/B/E/:r1)\n',
1792
1791
    'D   A/D/Z2/alpha\n',
1793
1792
    ])
1794
 
  svntest.actions.run_and_verify_svnlook(None, expected_output, [],
 
1793
  svntest.actions.run_and_verify_svnlook(expected_output, [],
1795
1794
                                         'changed', sbox.repo_dir,
1796
1795
                                         '--copy-info')
1797
1796
 
1798
1797
  # Check out A/D/Z.  If it has pi, that's a bug; or if its rho does
1799
1798
  # not have the second local mod, that's also a bug.
1800
1799
  svntest.main.safe_rmtree(wc_dir)
1801
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1800
  svntest.actions.run_and_verify_svn(None, [],
1802
1801
                                     'co', Z_url, wc_dir)
1803
1802
 
1804
1803
  if os.path.exists(sbox.ospath('pi')):
1848
1847
 
1849
1848
  # File scheduled for deletion.
1850
1849
  rho_path = sbox.ospath('A/D/G/rho')
1851
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', rho_path)
 
1850
  svntest.actions.run_and_verify_svn(None, [], 'rm', rho_path)
1852
1851
 
1853
1852
  # Status before attempting copies
1854
1853
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
1857
1856
 
1858
1857
  # Copy 'pi' over 'rho' with history.
1859
1858
  pi_src = sbox.ospath('A/D/G/pi')
1860
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp', pi_src, rho_path)
 
1859
  svntest.actions.run_and_verify_svn(None, [], 'cp', pi_src, rho_path)
1861
1860
 
1862
1861
  # Check that file copied.
1863
1862
  expected_status.tweak('A/D/G/rho', status='R ', copied='+', wc_rev='-')
1864
1863
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
1865
1864
 
1866
1865
  # Now delete replaced file.
1867
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm',
 
1866
  svntest.actions.run_and_verify_svn(None, [], 'rm',
1868
1867
                                     '--force', rho_path)
1869
1868
 
1870
1869
  # Verify status after deletion.
1889
1888
  svntest.main.file_append(unver_path_2, "another unversioned file")
1890
1889
 
1891
1890
  # Try to move an unversioned file.
1892
 
  svntest.actions.run_and_verify_svn(None, None,
 
1891
  svntest.actions.run_and_verify_svn(None,
1893
1892
                                     ".*unversioned1' " +
1894
1893
                                       "(does not exist|is not under version control)",
1895
1894
                                     'mv', unver_path_1, dest_path_1)
1896
1895
 
1897
1896
  # Try to forcibly move an unversioned file.
1898
 
  svntest.actions.run_and_verify_svn(None, None,
 
1897
  svntest.actions.run_and_verify_svn(None,
1899
1898
                                     ".*unversioned2.* " +
1900
1899
                                       "(does not exist|is not under version control)",
1901
1900
                                     'mv',
1932
1931
  was_cwd = os.getcwd()
1933
1932
  os.chdir(wc_dir)
1934
1933
 
1935
 
  svntest.actions.run_and_verify_svn(None, move_output,
 
1934
  svntest.actions.run_and_verify_svn(move_output,
1936
1935
                                     [],
1937
1936
                                     'move',
1938
1937
                                     file_name, "dest")
1959
1958
  })
1960
1959
  svntest.actions.run_and_verify_commit(wc_dir,
1961
1960
                                        expected_output,
1962
 
                                        expected_status,
1963
 
                                        None, wc_dir)
1964
 
  svntest.actions.run_and_verify_svn('Cat file', expected_file_content, [],
 
1961
                                        expected_status)
 
1962
  svntest.actions.run_and_verify_svn(expected_file_content, [],
1965
1963
                                     'cat',
1966
1964
                                     sbox.repo_url + '/dest')
1967
1965
 
1979
1977
  rho_copy_path_2 = sbox.ospath('A/B/F/rho_copy_2')
1980
1978
 
1981
1979
  # Copy A/D/G/rho to A/D/rho_copy_1
1982
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
1980
  svntest.actions.run_and_verify_svn(None, [], 'cp',
1983
1981
                                     rho_path, rho_copy_path_1)
1984
1982
 
1985
1983
  # Copy the copied file: A/D/rho_copy_1 to A/B/F/rho_copy_2
1986
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
1984
  svntest.actions.run_and_verify_svn(None, [], 'cp',
1987
1985
                                     rho_copy_path_1, rho_copy_path_2)
1988
1986
 
1989
1987
  E_path = sbox.ospath('A/B/E')
1991
1989
  E_path_copy_2 = sbox.ospath('A/D/G/E_copy_2')
1992
1990
 
1993
1991
  # Copy A/B/E to A/B/F/E_copy_1
1994
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
1992
  svntest.actions.run_and_verify_svn(None, [], 'cp',
1995
1993
                                     E_path, E_path_copy_1)
1996
1994
 
1997
1995
  # Copy the copied dir: A/B/F/E_copy_1 to A/D/G/E_copy_2
1998
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
1996
  svntest.actions.run_and_verify_svn(None, [], 'cp',
1999
1997
                                     E_path_copy_1, E_path_copy_2)
2000
1998
 
2001
1999
  # Created expected output tree for 'svn ci':
2021
2019
 
2022
2020
  svntest.actions.run_and_verify_commit(wc_dir,
2023
2021
                                        expected_output,
2024
 
                                        expected_status,
2025
 
                                        None,
2026
 
                                        wc_dir)
 
2022
                                        expected_status)
2027
2023
 
2028
2024
 
2029
2025
def move_copied_file_and_dir(sbox):
2037
2033
  rho_copy_move_path = sbox.ospath('A/B/F/rho_copy_moved')
2038
2034
 
2039
2035
  # Copy A/D/G/rho to A/D/rho_copy
2040
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
2036
  svntest.actions.run_and_verify_svn(None, [], 'cp',
2041
2037
                                     rho_path, rho_copy_path)
2042
2038
 
2043
2039
  # Move the copied file: A/D/rho_copy to A/B/F/rho_copy_moved
2044
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2040
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2045
2041
                                     rho_copy_path, rho_copy_move_path)
2046
2042
 
2047
2043
  E_path = sbox.ospath('A/B/E')
2049
2045
  E_path_copy_move = sbox.ospath('A/D/G/E_copy_moved')
2050
2046
 
2051
2047
  # Copy A/B/E to A/B/F/E_copy
2052
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
2048
  svntest.actions.run_and_verify_svn(None, [], 'cp',
2053
2049
                                     E_path, E_path_copy)
2054
2050
 
2055
2051
  # Move the copied file: A/B/F/E_copy to A/D/G/E_copy_moved
2056
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2052
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2057
2053
                                     E_path_copy, E_path_copy_move)
2058
2054
 
2059
2055
  # Created expected output tree for 'svn ci':
2076
2072
 
2077
2073
  svntest.actions.run_and_verify_commit(wc_dir,
2078
2074
                                        expected_output,
2079
 
                                        expected_status,
2080
 
                                        None,
2081
 
                                        wc_dir)
 
2075
                                        expected_status)
2082
2076
 
2083
2077
 
2084
2078
def move_moved_file_and_dir(sbox):
2092
2086
  rho_move_moved_path = sbox.ospath('A/B/F/rho_move_moved')
2093
2087
 
2094
2088
  # Move A/D/G/rho to A/D/rho_moved
2095
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2089
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2096
2090
                                     rho_path, rho_move_path)
2097
2091
 
2098
2092
  # Move the moved file: A/D/rho_moved to A/B/F/rho_move_moved
2099
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2093
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2100
2094
                                     rho_move_path, rho_move_moved_path)
2101
2095
 
2102
2096
  E_path = sbox.ospath('A/B/E')
2104
2098
  E_path_move_moved = sbox.ospath('A/D/G/E_move_moved')
2105
2099
 
2106
2100
  # Copy A/B/E to A/B/F/E_moved
2107
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2101
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2108
2102
                                     E_path, E_path_moved)
2109
2103
 
2110
2104
  # Move the moved file: A/B/F/E_moved to A/D/G/E_move_moved
2111
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2105
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2112
2106
                                     E_path_moved, E_path_move_moved)
2113
2107
 
2114
2108
  # Created expected output tree for 'svn ci':
2135
2129
 
2136
2130
  svntest.actions.run_and_verify_commit(wc_dir,
2137
2131
                                        expected_output,
2138
 
                                        expected_status,
2139
 
                                        None,
2140
 
                                        wc_dir)
 
2132
                                        expected_status)
2141
2133
 
2142
2134
 
2143
2135
def move_file_within_moved_dir(sbox):
2150
2142
  D_path_moved = sbox.ospath('A/B/F/D_moved')
2151
2143
 
2152
2144
  # Move A/B/D to A/B/F/D_moved
2153
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2145
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2154
2146
                                     D_path, D_path_moved)
2155
2147
 
2156
2148
  chi_path = sbox.ospath('A/B/F/D_moved/H/chi')
2161
2153
 
2162
2154
  # Move A/B/F/D_moved/H/chi to A/B/F/D_moved/H/chi_moved
2163
2155
  # then move that to A/B/F/D_moved/H/chi_moved_again
2164
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2156
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2165
2157
                                     chi_path, chi_moved_path)
2166
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2158
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2167
2159
                                     chi_moved_path,
2168
2160
                                     chi_moved_again_path)
2169
2161
 
2204
2196
 
2205
2197
  svntest.actions.run_and_verify_commit(wc_dir,
2206
2198
                                        expected_output,
2207
 
                                        expected_status,
2208
 
                                        None,
2209
 
                                        wc_dir)
 
2199
                                        expected_status)
2210
2200
 
2211
2201
 
2212
2202
def move_file_out_of_moved_dir(sbox):
2219
2209
  D_path_moved = sbox.ospath('A/B/F/D_moved')
2220
2210
 
2221
2211
  # Move A/B/D to A/B/F/D_moved
2222
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2212
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2223
2213
                                     D_path, D_path_moved)
2224
2214
 
2225
2215
  chi_path = sbox.ospath('A/B/F/D_moved/H/chi')
2229
2219
 
2230
2220
  # Move A/B/F/D_moved/H/chi to A/B/F/D_moved/H/chi_moved
2231
2221
  # then move that to A/C/chi_moved_again
2232
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2222
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2233
2223
                                     chi_path, chi_moved_path)
2234
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2224
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2235
2225
                                     chi_moved_path,
2236
2226
                                     chi_moved_again_path)
2237
2227
 
2272
2262
 
2273
2263
  svntest.actions.run_and_verify_commit(wc_dir,
2274
2264
                                        expected_output,
2275
 
                                        expected_status,
2276
 
                                        None,
2277
 
                                        wc_dir)
 
2265
                                        expected_status)
2278
2266
 
2279
2267
 
2280
2268
def move_dir_within_moved_dir(sbox):
2287
2275
  D_path_moved = sbox.ospath('A/B/F/D_moved')
2288
2276
 
2289
2277
  # Move A/D to A/B/F/D_moved
2290
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2278
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2291
2279
                                     D_path, D_path_moved)
2292
2280
 
2293
2281
  H_path = sbox.ospath('A/B/F/D_moved/H')
2297
2285
 
2298
2286
  # Move A/B/F/D_moved/H to A/B/F/D_moved/H_moved
2299
2287
  # then move that to A/B/F/D_moved/H_moved_again
2300
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2288
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2301
2289
                                     H_path, H_moved_path)
2302
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2290
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2303
2291
                                     H_moved_path,
2304
2292
                                     H_moved_again_path)
2305
2293
 
2340
2328
 
2341
2329
  svntest.actions.run_and_verify_commit(wc_dir,
2342
2330
                                        expected_output,
2343
 
                                        expected_status,
2344
 
                                        None,
2345
 
                                        wc_dir)
 
2331
                                        expected_status)
2346
2332
 
2347
2333
 
2348
2334
def move_dir_out_of_moved_dir(sbox):
2355
2341
  D_path_moved = sbox.ospath('A/B/F/D_moved')
2356
2342
 
2357
2343
  # Move A/D to A/B/F/D_moved
2358
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2344
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2359
2345
                                     D_path, D_path_moved)
2360
2346
 
2361
2347
  H_path = sbox.ospath('A/B/F/D_moved/H')
2364
2350
 
2365
2351
  # Move A/B/F/D_moved/H to A/B/F/D_moved/H_moved
2366
2352
  # then move that to A/C/H_moved_again
2367
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2353
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2368
2354
                                     H_path, H_moved_path)
2369
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2355
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2370
2356
                                     H_moved_path,
2371
2357
                                     H_moved_again_path)
2372
2358
 
2407
2393
 
2408
2394
  svntest.actions.run_and_verify_commit(wc_dir,
2409
2395
                                        expected_output,
2410
 
                                        expected_status,
2411
 
                                        None,
2412
 
                                        wc_dir)
 
2396
                                        expected_status)
2413
2397
 
2414
2398
# Includes regression testing for issue #3429 ("svn mv A B; svn mv B A"
2415
2399
# generates replace without history).
2424
2408
  rho_move_path = sbox.ospath('A/D/rho_moved')
2425
2409
 
2426
2410
  # Move A/D/G/rho away from and then back to its original path
2427
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2411
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2428
2412
                                     rho_path, rho_move_path)
2429
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2413
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2430
2414
                                     rho_move_path, rho_path)
2431
2415
 
2432
2416
  # Check expected status before commit
2438
2422
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
2439
2423
  svntest.actions.run_and_verify_commit(wc_dir,
2440
2424
                                        expected_output,
2441
 
                                        expected_status,
2442
 
                                        None,
2443
 
                                        wc_dir)
 
2425
                                        expected_status)
2444
2426
 
2445
2427
 
2446
2428
# Includes regression testing for issue #3429 ("svn mv A B; svn mv B A"
2456
2438
  D_move_path = sbox.ospath('D_moved')
2457
2439
 
2458
2440
  # Move A/D to D_moved
2459
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2441
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2460
2442
                                     D_path, D_move_path)
2461
2443
 
2462
2444
  # Move the moved dir: D_moved back to its starting
2463
2445
  # location at A/D.
2464
2446
 
2465
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv', D_move_path, D_path)
 
2447
  svntest.actions.run_and_verify_svn(None, [], 'mv', D_move_path, D_path)
2466
2448
 
2467
2449
  # Verify that the status indicates a replace with history
2468
2450
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
2477
2459
  # Create a new file and schedule it for addition
2478
2460
  upsilon_path = sbox.ospath('A/D/upsilon')
2479
2461
  svntest.main.file_write(upsilon_path, "This is the file 'upsilon'\n")
2480
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', upsilon_path)
 
2462
  svntest.actions.run_and_verify_svn(None, [], 'add', upsilon_path)
2481
2463
 
2482
2464
  # Create a dir with children and schedule it for addition
2483
2465
  I_path = sbox.ospath('A/D/I')
2490
2472
  svntest.main.file_write(eta_path, "This is the file 'eta'\n")
2491
2473
  svntest.main.file_write(theta_path, "This is the file 'theta'\n")
2492
2474
  svntest.main.file_write(kappa_path, "This is the file 'kappa'\n")
2493
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', I_path)
 
2475
  svntest.actions.run_and_verify_svn(None, [], 'add', I_path)
2494
2476
 
2495
2477
  # Create another dir and schedule it for addition
2496
2478
  K_path = sbox.ospath('K')
2497
2479
  os.mkdir(K_path)
2498
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', K_path)
 
2480
  svntest.actions.run_and_verify_svn(None, [], 'add', K_path)
2499
2481
 
2500
2482
  # Verify all the adds took place correctly.
2501
2483
  expected_status_after_adds = svntest.actions.get_virginal_state(wc_dir, 1)
2522
2504
 
2523
2505
  # Copy added dir A/D/I to added dir K/I
2524
2506
  I_copy_path = os.path.join(K_path, 'I')
2525
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
2507
  svntest.actions.run_and_verify_svn(None, [], 'cp',
2526
2508
                                     I_path, I_copy_path)
2527
2509
 
2528
2510
  # Copy added file A/D/upsilon into added dir K
2529
2511
  upsilon_copy_path = os.path.join(K_path, 'upsilon')
2530
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
2512
  svntest.actions.run_and_verify_svn(None, [], 'cp',
2531
2513
                                     upsilon_path, upsilon_copy_path)
2532
2514
 
2533
2515
  # Move added file A/D/upsilon to upsilon,
2534
2516
  # then move it again to A/upsilon
2535
2517
  upsilon_move_path = sbox.ospath('upsilon')
2536
2518
  upsilon_move_path_2 = sbox.ospath('A/upsilon')
2537
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2519
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2538
2520
                                     upsilon_path, upsilon_move_path)
2539
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2521
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2540
2522
                                     upsilon_move_path, upsilon_move_path_2)
2541
2523
 
2542
2524
  # Move added dir A/D/I to A/B/I,
2543
2525
  # then move it again to A/D/H/I
2544
2526
  I_move_path = sbox.ospath('A/B/I')
2545
2527
  I_move_path_2 = sbox.ospath('A/D/H/I')
2546
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2528
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2547
2529
                                     I_path, I_move_path)
2548
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
2530
  svntest.actions.run_and_verify_svn(None, [], 'mv',
2549
2531
                                     I_move_path, I_move_path_2)
2550
2532
 
2551
2533
  # Created expected output tree for 'svn ci'
2585
2567
 
2586
2568
  svntest.actions.run_and_verify_commit(wc_dir,
2587
2569
                                        expected_output,
2588
 
                                        expected_status,
2589
 
                                        None,
2590
 
                                        wc_dir)
 
2570
                                        expected_status)
2591
2571
 
2592
2572
  # Run_and_verify_commit() doesn't handle status of unversioned paths
2593
2573
  # so manually confirm unversioned paths got copied and moved too.
2614
2594
  # Create a new file, schedule it for addition and set properties
2615
2595
  upsilon_path = sbox.ospath('A/D/upsilon')
2616
2596
  svntest.main.file_write(upsilon_path, "This is the file 'upsilon'\n")
2617
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', upsilon_path)
2618
 
  svntest.actions.run_and_verify_svn(None, None, [], 'propset',
 
2597
  svntest.actions.run_and_verify_svn(None, [], 'add', upsilon_path)
 
2598
  svntest.actions.run_and_verify_svn(None, [], 'propset',
2619
2599
                                     'foo', 'bar', upsilon_path)
2620
2600
 
2621
2601
  # Create a dir and schedule it for addition and set properties
2622
2602
  I_path = sbox.ospath('A/D/I')
2623
2603
  os.mkdir(I_path)
2624
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', I_path)
2625
 
  svntest.actions.run_and_verify_svn(None, None, [], 'propset',
 
2604
  svntest.actions.run_and_verify_svn(None, [], 'add', I_path)
 
2605
  svntest.actions.run_and_verify_svn(None, [], 'propset',
2626
2606
                                     'foo', 'bar', I_path)
2627
2607
 
2628
2608
  # Verify all the adds took place correctly.
2644
2624
 
2645
2625
  # Copy added dir I to dir A/C
2646
2626
  I_copy_path = sbox.ospath('A/C/I')
2647
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
2627
  svntest.actions.run_and_verify_svn(None, [], 'cp',
2648
2628
                                     I_path, I_copy_path)
2649
2629
 
2650
2630
  # Copy added file A/upsilon into dir A/C
2651
2631
  upsilon_copy_path = sbox.ospath('A/C/upsilon')
2652
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
2632
  svntest.actions.run_and_verify_svn(None, [], 'cp',
2653
2633
                                     upsilon_path, upsilon_copy_path)
2654
2634
 
2655
2635
  # Created expected output tree for 'svn ci'
2678
2658
 
2679
2659
  svntest.actions.run_and_verify_commit(wc_dir,
2680
2660
                                        expected_output,
2681
 
                                        expected_status,
2682
 
                                        None,
2683
 
                                        wc_dir)
 
2661
                                        expected_status)
2684
2662
  svntest.actions.verify_disk(wc_dir, expected_disk.old_tree(), True)
2685
2663
 
2686
2664
def copy_added_paths_to_URL(sbox):
2692
2670
  # Create a new file and schedule it for addition
2693
2671
  upsilon_path = sbox.ospath('A/D/upsilon')
2694
2672
  svntest.main.file_write(upsilon_path, "This is the file 'upsilon'\n")
2695
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', upsilon_path)
 
2673
  svntest.actions.run_and_verify_svn(None, [], 'add', upsilon_path)
2696
2674
 
2697
2675
  # Create a dir with children and schedule it for addition
2698
2676
  I_path = sbox.ospath('A/D/I')
2705
2683
  svntest.main.file_write(eta_path, "This is the file 'eta'\n")
2706
2684
  svntest.main.file_write(theta_path, "This is the file 'theta'\n")
2707
2685
  svntest.main.file_write(kappa_path, "This is the file 'kappa'\n")
2708
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', I_path)
 
2686
  svntest.actions.run_and_verify_svn(None, [], 'add', I_path)
2709
2687
 
2710
2688
  # Verify all the adds took place correctly.
2711
2689
  expected_status_after_adds = svntest.actions.get_virginal_state(wc_dir, 1)
2732
2710
 
2733
2711
  # Copy added file A/D/upsilon to URL://A/C/upsilon
2734
2712
  upsilon_copy_URL = sbox.repo_url + '/A/C/upsilon'
2735
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2713
  svntest.actions.run_and_verify_svn(None, [],
2736
2714
                                     'cp', '-m', '',
2737
2715
                                     upsilon_path, upsilon_copy_URL)
2738
2716
 
2739
 
  # Validate the merge info of the copy destination (we expect none).
2740
 
  svntest.actions.run_and_verify_svn(None, [], [],
 
2717
  # Validate the mergeinfo of the copy destination (we expect none).
 
2718
  svntest.actions.run_and_verify_svn([], '.*W200017: Property.*not found',
2741
2719
                                     'propget',
2742
2720
                                     SVN_PROP_MERGEINFO, upsilon_copy_URL)
2743
2721
 
2744
2722
  # Copy added dir A/D/I to URL://A/D/G/I
2745
2723
  I_copy_URL = sbox.repo_url + '/A/D/G/I'
2746
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2724
  svntest.actions.run_and_verify_svn(None, [],
2747
2725
                                     'cp', '-m', '',
2748
2726
                                     I_path, I_copy_URL)
2749
2727
 
2770
2748
 
2771
2749
  svntest.actions.run_and_verify_commit(wc_dir,
2772
2750
                                        expected_output,
2773
 
                                        expected_status,
2774
 
                                        None,
2775
 
                                        wc_dir)
 
2751
                                        expected_status)
2776
2752
 
2777
2753
  # Created expected output for update
2778
2754
  expected_output = svntest.wc.State(wc_dir, {
2931
2907
  C_path = sbox.ospath('A/C')
2932
2908
 
2933
2909
  # Move chi, psi, omega and E to A/C
2934
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv', chi_path, psi_path,
 
2910
  svntest.actions.run_and_verify_svn(None, [], 'mv', chi_path, psi_path,
2935
2911
                                     omega_path, E_path, C_path)
2936
2912
 
2937
2913
  # Create expected output
2965
2941
 
2966
2942
  svntest.actions.run_and_verify_commit(wc_dir,
2967
2943
                                        expected_output,
2968
 
                                        expected_status,
2969
 
                                        None,
2970
 
                                        wc_dir)
 
2944
                                        expected_status)
2971
2945
 
2972
2946
#----------------------------------------------------------------------
2973
2947
 
2986
2960
  C_path = sbox.ospath('A/C')
2987
2961
 
2988
2962
  # Copy chi, psi, omega and E to A/C
2989
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp', chi_path, psi_path,
 
2963
  svntest.actions.run_and_verify_svn(None, [], 'cp', chi_path, psi_path,
2990
2964
                                     omega_path, E_path, C_path)
2991
2965
 
2992
2966
  # Create expected output
3012
2986
 
3013
2987
  svntest.actions.run_and_verify_commit(wc_dir,
3014
2988
                                        expected_output,
3015
 
                                        expected_status,
3016
 
                                        None,
3017
 
                                        wc_dir)
 
2989
                                        expected_status)
3018
2990
 
3019
2991
#----------------------------------------------------------------------
3020
2992
 
3034
3006
 
3035
3007
  # Move three files and a directory in the repo to a different location
3036
3008
  # in the repo
3037
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
3009
  svntest.actions.run_and_verify_svn(None, [], 'mv',
3038
3010
                                     chi_url, psi_url, omega_url, E_url, C_url,
3039
3011
                                     '-m', 'logmsg')
3040
3012
 
3100
3072
 
3101
3073
  # Copy three files and a directory in the repo to a different location
3102
3074
  # in the repo
3103
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
3075
  svntest.actions.run_and_verify_svn(None, [], 'cp',
3104
3076
                                     chi_url, psi_url, omega_url, E_url, C_url,
3105
3077
                                     '-m', 'logmsg')
3106
3078
 
3158
3130
 
3159
3131
  # We need this in order to check that we don't end up with URI-encoded
3160
3132
  # paths in the WC (issue #2955)
3161
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv', '-m', 'log_msg',
 
3133
  svntest.actions.run_and_verify_svn(None, [], 'mv', '-m', 'log_msg',
3162
3134
                                     sbox.repo_url + '/A/D/H/omega',
3163
3135
                                     omega_with_space_url)
3164
3136
 
3165
3137
  # Perform the copy and check the output
3166
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
3138
  svntest.actions.run_and_verify_svn(None, [], 'cp',
3167
3139
                                     chi_url, psi_url, omega_with_space_url,
3168
3140
                                     E_url, C_path)
3169
3141
 
3187
3159
 
3188
3160
  svntest.actions.run_and_verify_commit(wc_dir,
3189
3161
                                        expected_output,
3190
 
                                        expected_status,
3191
 
                                        None, wc_dir)
 
3162
                                        expected_status)
3192
3163
 
3193
3164
#----------------------------------------------------------------------
3194
3165
 
3207
3178
  C_url = sbox.repo_url + '/A/C'
3208
3179
 
3209
3180
  # Perform the copy and check the output
3210
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
3181
  svntest.actions.run_and_verify_svn(None, [], 'cp',
3211
3182
                                     chi_path, psi_path, omega_path, E_path,
3212
3183
                                     C_url, '-m', 'logmsg')
3213
3184
 
3268
3239
 
3269
3240
  # Play a shell game with some WC files, then commit the changes back
3270
3241
  # to the repository (making r2).
3271
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
3242
  svntest.actions.run_and_verify_svn(None, [], 'mv',
3272
3243
                                     psi_path, new_iota_path)
3273
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
3244
  svntest.actions.run_and_verify_svn(None, [], 'mv',
3274
3245
                                     iota_path, psi_path)
3275
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
3246
  svntest.actions.run_and_verify_svn(None, [], 'mv',
3276
3247
                                     new_iota_path, iota_path)
3277
3248
 
3278
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3249
  svntest.actions.run_and_verify_svn(None, [],
3279
3250
                                     'ci',
3280
3251
                                     '-m', 'rev 2',
3281
3252
                                     wc_dir)
3282
3253
 
3283
3254
  # Copy using a peg rev (remember, the object at iota_path at HEAD
3284
3255
  # was at psi_path back at r1).
3285
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3256
  svntest.actions.run_and_verify_svn(None, [],
3286
3257
                                     'cp',
3287
3258
                                     iota_path + '@HEAD', '-r', '1',
3288
3259
                                     sigma_path)
3289
3260
 
3290
3261
  # Commit and verify disk contents
3291
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3262
  svntest.actions.run_and_verify_svn(None, [],
3292
3263
                                     'ci', wc_dir,
3293
3264
                                     '-m', 'rev 3')
3294
3265
 
3321
3292
  alpha_path = os.path.join(E_path, 'alpha')
3322
3293
 
3323
3294
  # Make some changes to the repository
3324
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm',
 
3295
  svntest.actions.run_and_verify_svn(None, [], 'rm',
3325
3296
                                     alpha_path)
3326
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3297
  svntest.actions.run_and_verify_svn(None, [],
3327
3298
                                     'ci',
3328
3299
                                     '-m', 'rev 2',
3329
3300
                                     wc_dir)
3330
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
3301
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
3331
3302
 
3332
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3303
  svntest.actions.run_and_verify_svn(None, [],
3333
3304
                                     'mv',
3334
3305
                                     E_path, I_path)
3335
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3306
  svntest.actions.run_and_verify_svn(None, [],
3336
3307
                                     'ci',
3337
3308
                                     '-m', 'rev 3',
3338
3309
                                     wc_dir)
3339
3310
 
3340
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3311
  svntest.actions.run_and_verify_svn(None, [],
3341
3312
                                     'mv',
3342
3313
                                     G_path, E_path)
3343
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3314
  svntest.actions.run_and_verify_svn(None, [],
3344
3315
                                     'ci',
3345
3316
                                     '-m', 'rev 4',
3346
3317
                                     wc_dir)
3347
3318
 
3348
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3319
  svntest.actions.run_and_verify_svn(None, [],
3349
3320
                                     'mv',
3350
3321
                                     I_path, G_path)
3351
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3322
  svntest.actions.run_and_verify_svn(None, [],
3352
3323
                                     'ci',
3353
3324
                                     '-m', 'rev 5',
3354
3325
                                     wc_dir)
3355
3326
 
3356
3327
  # Copy using a peg rev
3357
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3328
  svntest.actions.run_and_verify_svn(None, [],
3358
3329
                                     'cp',
3359
3330
                                     G_path + '@HEAD', '-r', '1',
3360
3331
                                     J_path)
3361
3332
 
3362
3333
  # Commit and verify disk contents
3363
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3334
  svntest.actions.run_and_verify_svn(None, [],
3364
3335
                                     'ci', wc_dir,
3365
3336
                                     '-m', 'rev 6')
3366
3337
 
3406
3377
  iota_text = "This is the file 'iota'.\n"
3407
3378
 
3408
3379
  # Make some changes to the repository
3409
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
3380
  svntest.actions.run_and_verify_svn(None, [], 'mv',
3410
3381
                                     psi_path, new_iota_path)
3411
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
3382
  svntest.actions.run_and_verify_svn(None, [], 'mv',
3412
3383
                                     iota_path, psi_path)
3413
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
3384
  svntest.actions.run_and_verify_svn(None, [], 'mv',
3414
3385
                                     new_iota_path, iota_path)
3415
3386
 
3416
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3387
  svntest.actions.run_and_verify_svn(None, [],
3417
3388
                                     'ci',
3418
3389
                                     '-m', 'rev 2',
3419
3390
                                     wc_dir)
3421
3392
  # Copy using a peg rev
3422
3393
  # Add an empty peg specifier ('@') to sigma_url when copying, to test for
3423
3394
  # issue #3651 "svn copy does not eat peg revision within copy target path".
3424
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3395
  svntest.actions.run_and_verify_svn(None, [],
3425
3396
                                     'cp',
3426
3397
                                     iota_url + '@HEAD', '-r', '1',
3427
3398
                                     sigma_url + '@', '-m', 'rev 3')
3428
3399
 
3429
3400
  # Validate the copy destination's mergeinfo (we expect none).
3430
 
  svntest.actions.run_and_verify_svn(None, [], [],
 
3401
  svntest.actions.run_and_verify_svn([], '.*W200017: Property.*not found',
3431
3402
                                     'propget', SVN_PROP_MERGEINFO, sigma_url)
3432
3403
 
3433
3404
  # Update to HEAD and verify disk contents
3465
3436
  alpha_url = E_url + '/alpha'
3466
3437
 
3467
3438
  # delete E/alpha in r2
3468
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3439
  svntest.actions.run_and_verify_svn(None, [],
3469
3440
                                     'rm', '-m', '', alpha_url)
3470
3441
 
3471
3442
  # delete E in r3
3472
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3443
  svntest.actions.run_and_verify_svn(None, [],
3473
3444
                                     'rm', '-m', '', E_url)
3474
3445
 
3475
3446
  # Copy an old revision of E into a new path in the WC
3476
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3447
  svntest.actions.run_and_verify_svn(None, [],
3477
3448
                                     'cp', '-r1', E, E2)
3478
3449
 
3479
3450
  # Create expected output tree.
3491
3462
  # Commit the one file.
3492
3463
  svntest.actions.run_and_verify_commit(wc_dir,
3493
3464
                                        expected_output,
3494
 
                                        expected_status,
3495
 
                                        None,
3496
 
                                        wc_dir)
 
3465
                                        expected_status)
3497
3466
 
3498
3467
 
3499
3468
#----------------------------------------------------------------------
3509
3478
  new_iota_path = sbox.ospath('X/Y/Z/iota')
3510
3479
 
3511
3480
  # Copy iota
3512
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp', '--parents',
 
3481
  svntest.actions.run_and_verify_svn(None, [], 'cp', '--parents',
3513
3482
                                     iota_path, new_iota_path)
3514
3483
 
3515
3484
  # Create expected output
3533
3502
 
3534
3503
  svntest.actions.run_and_verify_commit(wc_dir,
3535
3504
                                        expected_output,
3536
 
                                        expected_status,
3537
 
                                        None,
3538
 
                                        wc_dir)
 
3505
                                        expected_status)
3539
3506
 
3540
3507
#----------------------------------------------------------------------
3541
3508
# Test copying and creating parents from the repo to the wc
3550
3517
  new_iota_path = sbox.ospath('X/Y/Z/iota')
3551
3518
 
3552
3519
  # Copy iota
3553
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3520
  svntest.actions.run_and_verify_svn(None, [],
3554
3521
                                     'cp', '--parents',
3555
3522
                                     iota_url, new_iota_path)
3556
3523
 
3575
3542
 
3576
3543
  svntest.actions.run_and_verify_commit(wc_dir,
3577
3544
                                        expected_output,
3578
 
                                        expected_status,
3579
 
                                        None,
3580
 
                                        wc_dir)
 
3545
                                        expected_status)
3581
3546
 
3582
3547
 
3583
3548
#----------------------------------------------------------------------
3593
3558
  new_iota_url = sbox.repo_url + '/X/Y/Z/iota'
3594
3559
 
3595
3560
  # Copy iota
3596
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3561
  svntest.actions.run_and_verify_svn(None, [],
3597
3562
                                     'cp', '--parents',
3598
3563
                                     '-m', 'log msg',
3599
3564
                                     iota_path, new_iota_url)
3641
3606
  new_iota_url = sbox.repo_url + '/X/Y/Z/iota'
3642
3607
 
3643
3608
  # Copy iota
3644
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3609
  svntest.actions.run_and_verify_svn(None, [],
3645
3610
                                     'cp', '--parents',
3646
3611
                                     '-m', 'log msg',
3647
3612
                                     iota_url, new_iota_url)
3752
3717
      })
3753
3718
 
3754
3719
    # Make a copy
3755
 
    svntest.actions.run_and_verify_svn(None, expected, [],
 
3720
    svntest.actions.run_and_verify_svn(expected, [],
3756
3721
                                       'copy',
3757
3722
                                       sbox.repo_url + '/' + URL_rel_path,
3758
3723
                                       os.path.join(wc_dir,
3762
3727
                                       {dest_name : Item(verb='Adding')})
3763
3728
    svntest.actions.run_and_verify_commit(wc_dir,
3764
3729
                                          expected_output,
3765
 
                                          expected_status,
3766
 
                                          None, wc_dir)
 
3730
                                          expected_status)
3767
3731
 
3768
3732
  copy_URL_to_WC('A', 'A COPY', 2)
3769
3733
  copy_URL_to_WC('A COPY', 'A_COPY_2', 3)
3784
3748
 
3785
3749
  # Copy the wc-in-unversioned-parent working copy to our original wc.
3786
3750
  svntest.actions.run_and_verify_svn(None,
3787
 
                                     None,
3788
3751
                                     [],
3789
3752
                                     'cp',
3790
3753
                                     wc2_dir,
3830
3793
  A_url = sbox.repo_url + '/A'
3831
3794
 
3832
3795
  # The --parents is unnecessary, but should still work (not segfault).
3833
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp', '--parents',
 
3796
  svntest.actions.run_and_verify_svn(None, [], 'cp', '--parents',
3834
3797
                                     '-m', 'log msg', iota_url, A_url)
3835
3798
 
3836
3799
  # Verify that it worked.
3859
3822
  Z_url = sbox.repo_url + '/A/B/Z'
3860
3823
 
3861
3824
  # --parents shouldn't result in a double commit of the same directory.
3862
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp', '--parents',
 
3825
  svntest.actions.run_and_verify_svn(None, [], 'cp', '--parents',
3863
3826
                                     '-m', 'log msg', E_url, Z_url)
3864
3827
 
3865
3828
  # Verify that it worked.
3901
3864
  #     svn: Error processing command 'modify-entry' in '.'
3902
3865
  #     svn: Error modifying entry for 'A'
3903
3866
  #     svn: Entry 'A' is already under version control
3904
 
  svntest.actions.run_and_verify_svn(None,
3905
 
                                     None, ".*: Path '.*' is not a directory",
 
3867
  svntest.actions.run_and_verify_svn(None, ".*: Path '.*' is not a directory",
3906
3868
                                     'cp', iota_path, A_path)
3907
3869
 
3908
3870
  # 'cleanup' should not error.
3909
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3871
  svntest.actions.run_and_verify_svn(None, [],
3910
3872
                                     'cleanup', wc_dir)
3911
3873
 
3912
3874
 
3946
3908
  A2_path = sbox.ospath('A2')
3947
3909
  B2_path = os.path.join(A2_path, 'B')
3948
3910
 
3949
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp', A_path, A2_path)
 
3911
  svntest.actions.run_and_verify_svn(None, [], 'cp', A_path, A2_path)
3950
3912
  saved_cwd = os.getcwd()
3951
3913
  try:
3952
3914
    os.chdir(B2_path)
3953
 
    svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', 'blah')
3954
 
    svntest.actions.run_and_verify_svn(None, None, [], 'mv', 'lambda', 'blah')
 
3915
    svntest.actions.run_and_verify_svn(None, [], 'mkdir', 'blah')
 
3916
    svntest.actions.run_and_verify_svn(None, [], 'mv', 'lambda', 'blah')
3955
3917
  finally:
3956
3918
    os.chdir(saved_cwd)
3957
3919
 
3989
3951
 
3990
3952
  # Do a checkout, and verify the resulting output and disk contents.
3991
3953
  svntest.actions.run_and_verify_checkout(repo_url2,
3992
 
                          wc2_dir,
3993
 
                          expected_output,
3994
 
                          expected_wc)
 
3954
                                          wc2_dir,
 
3955
                                          expected_output,
 
3956
                                          expected_wc)
3995
3957
 
3996
3958
  # Copy a file from wc to wc2
3997
3959
  mu_path = sbox.ospath('A/mu')
4071
4033
  a = sbox.ospath('A')
4072
4034
  new_a = sbox.ospath('new_A')
4073
4035
 
4074
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
4036
  svntest.actions.run_and_verify_svn(None, [],
4075
4037
                                     'cp', a, new_a)
4076
4038
 
4077
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci',
 
4039
  svntest.actions.run_and_verify_svn(None, [], 'ci',
4078
4040
                                     new_a, '--depth', 'empty',
4079
4041
                                     '-m', 'Copied directory')
4080
4042
 
4089
4051
  new_A_mu = os.path.join(new_A, 'mu')
4090
4052
  new_A_new_mu = os.path.join(new_A, 'new_mu')
4091
4053
 
4092
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
4054
  svntest.actions.run_and_verify_svn(None, [],
4093
4055
                                     'cp', A, new_A)
4094
4056
 
4095
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
4057
  svntest.actions.run_and_verify_svn(None, [],
4096
4058
                                     'cp', new_A_D, new_A_new_D)
4097
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
4059
  svntest.actions.run_and_verify_svn(None, [],
4098
4060
                                     'cp', new_A_mu, new_A_new_mu)
4099
4061
 
4100
4062
  expected_output = svntest.wc.State(sbox.wc_dir, {
4139
4101
 
4140
4102
  svntest.actions.run_and_verify_commit(sbox.wc_dir,
4141
4103
                                        expected_output,
4142
 
                                        expected_status,
4143
 
                                        None, sbox.wc_dir)
 
4104
                                        expected_status)
4144
4105
 
4145
4106
def move_below_move(sbox):
4146
4107
  "move a dir below a moved dir"
4153
4114
  new_A_mu = os.path.join(new_A, 'mu')
4154
4115
  new_A_new_mu = os.path.join(new_A, 'new_mu')
4155
4116
 
4156
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
4117
  svntest.actions.run_and_verify_svn(None, [],
4157
4118
                                     'mv', A, new_A)
4158
4119
 
4159
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
4120
  svntest.actions.run_and_verify_svn(None, [],
4160
4121
                                     'mv', new_A_D, new_A_new_D)
4161
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
4122
  svntest.actions.run_and_verify_svn(None, [],
4162
4123
                                     'mv', new_A_mu, new_A_new_mu)
4163
4124
 
4164
4125
  expected_output = svntest.wc.State(sbox.wc_dir, {
4201
4162
 
4202
4163
  svntest.actions.run_and_verify_commit(sbox.wc_dir,
4203
4164
                                        expected_output,
4204
 
                                        expected_status,
4205
 
                                        None, sbox.wc_dir)
 
4165
                                        expected_status)
4206
4166
 
4207
4167
 
4208
4168
def reverse_merge_move(sbox):
4218
4178
 
4219
4179
  # Create another working copy path and checkout.
4220
4180
  wc2_dir = sbox.add_wc_path('2')
4221
 
  rav_svn(None, None, [], 'co', sbox.repo_url, wc2_dir)
 
4181
  rav_svn(None, [], 'co', sbox.repo_url, wc2_dir)
4222
4182
 
4223
4183
  # Update working directory and ensure that we are at revision 1.
4224
 
  rav_svn(None, exp_noop_up_out(1), [], 'up', wc_dir)
 
4184
  rav_svn(exp_noop_up_out(1), [], 'up', wc_dir)
4225
4185
 
4226
4186
  # Add new folder and file, later commit
4227
4187
  new_path = os.path.join(a_dir, 'New')
4229
4189
  first_path = os.path.join(new_path, 'first')
4230
4190
  svntest.main.file_append(first_path, 'appended first text')
4231
4191
  svntest.main.run_svn(None, "add", new_path)
4232
 
  rav_svn(None, None, [], 'ci', wc_dir, '-m', 'Add new folder %s' % new_path)
4233
 
  rav_svn(None, exp_noop_up_out(2), [], 'up', wc_dir)
 
4192
  rav_svn(None, [], 'ci', wc_dir, '-m', 'Add new folder %s' % new_path)
 
4193
  rav_svn(exp_noop_up_out(2), [], 'up', wc_dir)
4234
4194
 
4235
4195
  # Reverse merge to revert previous changes and commit
4236
 
  rav_svn(None, None, [], 'merge', '-c', '-2', a_repo_url, a_dir)
4237
 
  rav_svn(None, None, [], 'ci', '-m', 'Reverting svn merge -c -2.', a_dir)
4238
 
  rav_svn(None, exp_noop_up_out(3), [], 'up', wc_dir)
 
4196
  rav_svn(None, [], 'merge', '-c', '-2', a_repo_url, a_dir)
 
4197
  rav_svn(None, [], 'ci', '-m', 'Reverting svn merge -c -2.', a_dir)
 
4198
  rav_svn(exp_noop_up_out(3), [], 'up', wc_dir)
4239
4199
 
4240
4200
  # Reverse merge again to undo last revert.
4241
 
  rav_svn(None, None, [], 'merge', '-c', '-3', a_repo_url, a_dir)
 
4201
  rav_svn(None, [], 'merge', '-c', '-3', a_repo_url, a_dir)
4242
4202
 
4243
4203
  # Move new added file to another one and commit.
4244
4204
  second_path = os.path.join(new_path, 'second')
4245
 
  rav_svn(None, None, [], 'move', first_path, second_path)
4246
 
  rav_svn(None, "Adding.*New|Adding.*first||Committed revision 4.", [],
 
4205
  rav_svn(None, [], 'move', first_path, second_path)
 
4206
  rav_svn("Adding.*New|Adding.*first||Committed revision 4.", [],
4247
4207
          'ci', '-m',
4248
4208
          'Revert svn merge. svn mv %s %s.' % (first_path, second_path), a_dir)
4249
4209
 
4323
4283
  svntest.actions.run_and_verify_commit(wc_dir,
4324
4284
                                        expected_output,
4325
4285
                                        expected_status,
4326
 
                                        None,
 
4286
                                        [],
4327
4287
                                        wc_dir, '--depth', 'immediates')
4328
4288
 
4329
4289
# Regression test for issue #3474 - making a new subdir, moving files into it
4342
4302
  # Alias for svntest.actions.run_and_verify_svn
4343
4303
  rav_svn = svntest.actions.run_and_verify_svn
4344
4304
 
4345
 
  rav_svn(None, None, [], 'mkdir', new_dir)
4346
 
  rav_svn(None, None, [], 'cp', sbox.ospath('A/mu'), new_dir)
4347
 
  rav_svn(None, None, [], 'cp', new_dir, new_dir2)
 
4305
  rav_svn(None, [], 'mkdir', new_dir)
 
4306
  rav_svn(None, [], 'cp', sbox.ospath('A/mu'), new_dir)
 
4307
  rav_svn(None, [], 'cp', new_dir, new_dir2)
4348
4308
 
4349
4309
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
4350
4310
 
4359
4319
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
4360
4320
 
4361
4321
  # move of added dir also retains copy history of children
4362
 
  rav_svn(None, None, [], 'mv', new_dir, new_dir3)
 
4322
  rav_svn(None, [], 'mv', new_dir, new_dir3)
4363
4323
  expected_status.remove('NewDir', 'NewDir/mu')
4364
4324
  expected_status.add(
4365
4325
    {
4386
4346
 
4387
4347
  sbox.simple_add_symlink('linktarget', 'new_symlink')
4388
4348
 
4389
 
  rav_svn(None, None, [], 'cp', new_symlink, copied_symlink)
 
4349
  rav_svn(None, [], 'cp', new_symlink, copied_symlink)
4390
4350
 
4391
4351
  # Check whether both new_symlink and copied_symlink are added to the
4392
4352
  # working copy
4405
4365
  """move a directory containing moved node"""
4406
4366
 
4407
4367
  sbox.build()
4408
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
4368
  svntest.actions.run_and_verify_svn(None, [], 'mv',
4409
4369
                                     sbox.ospath('A/B/E/alpha'),
4410
4370
                                     sbox.ospath('A/B/E/alpha_moved'))
4411
4371
 
4412
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
4372
  svntest.actions.run_and_verify_svn(None, [], 'mv',
4413
4373
                                     sbox.ospath('A/B/F'),
4414
4374
                                     sbox.ospath('A/B/F_moved'))
4415
4375
 
4416
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
4376
  svntest.actions.run_and_verify_svn(None, [], 'mv',
4417
4377
                                     sbox.ospath('A/B'),
4418
4378
                                     sbox.ospath('A/B_tmp'))
4419
4379
 
4444
4404
 
4445
4405
  svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
4446
4406
 
4447
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
4407
  svntest.actions.run_and_verify_svn(None, [], 'mv',
4448
4408
                                     sbox.ospath('A/B_tmp'),
4449
4409
                                     sbox.ospath('A/B_moved'))
4450
4410
  expected_status.tweak('A/B', moved_to='A/B_moved')
4502
4462
                        'A/B_moved/F_moved', moved_from=None)
4503
4463
  svntest.actions.run_and_verify_commit(sbox.wc_dir,
4504
4464
                                        expected_output,
4505
 
                                        expected_status,
4506
 
                                        None, sbox.wc_dir)
 
4465
                                        expected_status)
4507
4466
 
4508
4467
def copy_dir_with_space(sbox):
4509
4468
  """copy a directory with whitespace to one without"""
4511
4470
  sbox.build()
4512
4471
  wc_dir = sbox.wc_dir
4513
4472
 
4514
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
4473
  svntest.actions.run_and_verify_svn(None, [], 'cp',
4515
4474
                                     sbox.ospath('A/B/E'),
4516
4475
                                     sbox.ospath('E with spaces'))
4517
4476
 
4518
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
4477
  svntest.actions.run_and_verify_svn(None, [], 'cp',
4519
4478
                                     sbox.ospath('A/B/E/alpha'),
4520
4479
                                     sbox.ospath('E with spaces/al pha'))
4521
4480
 
4532
4491
    })
4533
4492
  svntest.actions.run_and_verify_commit(wc_dir,
4534
4493
                                        expected_output,
4535
 
                                        expected_status,
4536
 
                                        None, wc_dir)
 
4494
                                        expected_status)
4537
4495
 
4538
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
4496
  svntest.actions.run_and_verify_svn(None, [], 'cp',
4539
4497
                                     sbox.ospath('E with spaces'),
4540
4498
                                     sbox.ospath('E also spaces')
4541
4499
                                     )
4542
4500
 
4543
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
4501
  svntest.actions.run_and_verify_svn(None, [], 'cp',
4544
4502
                                     sbox.ospath('E with spaces/al pha'),
4545
4503
                                     sbox.ospath('E also spaces/al b')
4546
4504
                                     )
4558
4516
    })
4559
4517
  svntest.actions.run_and_verify_commit(wc_dir,
4560
4518
                                        expected_output,
4561
 
                                        expected_status,
4562
 
                                        None, wc_dir)
 
4519
                                        expected_status)
4563
4520
 
4564
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
4521
  svntest.actions.run_and_verify_svn(None, [], 'mv',
4565
4522
                                     sbox.ospath('E with spaces'),
4566
4523
                                     sbox.ospath('E new spaces')
4567
4524
                                     )
4568
4525
 
4569
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
4526
  svntest.actions.run_and_verify_svn(None, [], 'mv',
4570
4527
                                     sbox.ospath('E new spaces/al pha'),
4571
4528
                                     sbox.ospath('E also spaces/al c')
4572
4529
                                     )
4591
4548
  })
4592
4549
  svntest.actions.run_and_verify_commit(wc_dir,
4593
4550
                                        expected_output,
4594
 
                                        expected_status,
4595
 
                                        None, wc_dir)
 
4551
                                        expected_status)
4596
4552
 
4597
4553
# Regression test for issue #3676
4598
4554
@Issue(3676)
4606
4562
 
4607
4563
  verify_dir = sbox.add_wc_path('verify')
4608
4564
 
4609
 
  svntest.actions.run_and_verify_svn(None, None, [], 'copy', A_B_E, E_new)
 
4565
  svntest.actions.run_and_verify_svn(None, [], 'copy', A_B_E, E_new)
4610
4566
 
4611
4567
  sbox.simple_commit()
4612
4568
 
4613
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
4569
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
4614
4570
 
4615
 
  svntest.actions.run_and_verify_svn(None, None, [], 'co', sbox.repo_url, verify_dir)
 
4571
  svntest.actions.run_and_verify_svn(None, [], 'co', sbox.repo_url, verify_dir)
4616
4572
 
4617
4573
  was_cwd = os.getcwd()
4618
4574
  os.chdir(verify_dir)
4622
4578
  os.chdir(was_cwd)
4623
4579
  os.chdir(wc_dir)
4624
4580
  verify_out = svntest.verify.UnorderedOutput(verify_out)
4625
 
  svntest.actions.run_and_verify_svn(None, verify_out, [], 'status', '-v')
 
4581
  svntest.actions.run_and_verify_svn(verify_out, [], 'status', '-v')
4626
4582
  os.chdir(was_cwd)
4627
4583
 
4628
4584
# Regression test for issue #3676 for copies including directories
4637
4593
 
4638
4594
  verify_dir = sbox.add_wc_path('verify')
4639
4595
 
4640
 
  svntest.actions.run_and_verify_svn(None, None, [], 'copy', A_B, B_new)
 
4596
  svntest.actions.run_and_verify_svn(None, [], 'copy', A_B, B_new)
4641
4597
 
4642
4598
  sbox.simple_commit()
4643
4599
 
4644
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
4600
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
4645
4601
 
4646
 
  svntest.actions.run_and_verify_svn(None, None, [], 'co', sbox.repo_url, verify_dir)
 
4602
  svntest.actions.run_and_verify_svn(None, [], 'co', sbox.repo_url, verify_dir)
4647
4603
 
4648
4604
  was_cwd = os.getcwd()
4649
4605
  os.chdir(verify_dir)
4666
4622
 
4667
4623
  sbox.build(read_only=True)
4668
4624
 
4669
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mkdir',
 
4625
  svntest.actions.run_and_verify_svn(None, [], 'mkdir',
4670
4626
                                     sbox.ospath('X'),
4671
4627
                                     sbox.ospath('X/Y'))
4672
4628
 
4677
4633
      })
4678
4634
  svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
4679
4635
 
4680
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
4636
  svntest.actions.run_and_verify_svn(None, [], 'mv',
4681
4637
                                     sbox.ospath('X/Y'),
4682
4638
                                     sbox.ospath('X/Z'))
4683
4639
  expected_status.remove('X/Y')
4684
4640
  expected_status.add({'X/Z' : Item(status='A ', wc_rev='0')})
4685
4641
  svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
4686
4642
 
4687
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
4643
  svntest.actions.run_and_verify_svn(None, [], 'mv',
4688
4644
                                     sbox.ospath('X/Z'),
4689
4645
                                     sbox.ospath('Z'))
4690
4646
  expected_status.remove('X/Z')
4691
4647
  expected_status.add({'Z' : Item(status='A ', wc_rev='0')})
4692
4648
  svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
4693
4649
 
4694
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
4650
  svntest.actions.run_and_verify_svn(None, [], 'mv',
4695
4651
                                     sbox.ospath('Z'),
4696
4652
                                     sbox.ospath('X/Z'))
4697
4653
  expected_status.remove('Z')
4724
4680
  expected_status.remove('A/B/E/alpha')
4725
4681
  svntest.actions.run_and_verify_commit(wc_dir,
4726
4682
                                        expected_output,
4727
 
                                        expected_status,
4728
 
                                        None,
4729
 
                                        wc_dir)
 
4683
                                        expected_status)
4730
4684
 
4731
4685
  # Update to r2, then update A/B/E/alpha and A/B/E/beta to r1
4732
4686
  svntest.main.run_svn(None, 'up', wc_dir)
4743
4697
  expected_status.tweak('A/B/E/beta', wc_rev=1)
4744
4698
  svntest.actions.run_and_verify_update(wc_dir,
4745
4699
                                        expected_output, None,
4746
 
                                        expected_status, [],
4747
 
                                        None, None, None, None, None,
 
4700
                                        expected_status, [], False,
4748
4701
                                        '-r1',
4749
4702
                                        sbox.ospath('A/B/E/alpha'),
4750
4703
                                        sbox.ospath('A/B/E/beta'))
4752
4705
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
4753
4706
 
4754
4707
  # Copy A/B/E to A/B/E_copy
4755
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
4708
  svntest.actions.run_and_verify_svn(None, [], 'cp',
4756
4709
                                     sbox.ospath('A/B/E'),
4757
4710
                                     sbox.ospath('A/B/E_copy'))
4758
4711
  expected_status.add({
4781
4734
  expected_status.remove('A/B/E_copy/alpha', 'A/B/E_copy/beta')
4782
4735
  svntest.actions.run_and_verify_commit(wc_dir,
4783
4736
                                        expected_output,
4784
 
                                        expected_status,
4785
 
                                        None,
4786
 
                                        wc_dir)
 
4737
                                        expected_status)
4787
4738
 
4788
4739
def copy_delete_undo(sbox, use_revert):
4789
4740
  "copy, delete child, undo"
4963
4914
  repo_url = sbox.repo_url + '/A'
4964
4915
 
4965
4916
  # try to move wc dir to itself
4966
 
  svntest.actions.run_and_verify_svn(None, [],
 
4917
  svntest.actions.run_and_verify_svn([],
4967
4918
                                     '.*Cannot move path.* into itself.*',
4968
4919
                                     'move', wc_dir, wc_dir)
4969
4920
 
4970
4921
  # try to move repo dir to itself
4971
 
  svntest.actions.run_and_verify_svn(None, [],
 
4922
  svntest.actions.run_and_verify_svn([],
4972
4923
                                     '.*Cannot move URL.* into itself.*',
4973
4924
                                     'move', repo_url, repo_url)
4974
4925
 
5058
5009
                                        expected_output,
5059
5010
                                        None,
5060
5011
                                        None,
5061
 
                                        None, None, None, None, None, False,
 
5012
                                        [], False,
5062
5013
                                        wc_dir, '--set-depth', 'infinity')
5063
5014
 
5064
5015
  # Except for A/no, the 3 directories should now have the same children
5102
5053
  wc_dir = sbox.wc_dir
5103
5054
 
5104
5055
  # Can't use ^/A/D/G shortcut here because wc/X is unversioned.
5105
 
  svntest.actions.run_and_verify_svn(None, None, [], 'copy',
 
5056
  svntest.actions.run_and_verify_svn(None, [], 'copy',
5106
5057
                                     sbox.ospath('A/D/G'), sbox.ospath('X'))
5107
5058
 
5108
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm',
 
5059
  svntest.actions.run_and_verify_svn(None, [], 'rm',
5109
5060
                                     sbox.ospath('X/pi'))
5110
5061
 
5111
5062
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
5118
5069
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
5119
5070
 
5120
5071
  # Can use ^/A/D/G even though X/pi is a delete within a copy.
5121
 
  svntest.actions.run_and_verify_svn(None, None, [], 'copy',
 
5072
  svntest.actions.run_and_verify_svn(None, [], 'copy',
5122
5073
                                     '^/A/D/G/pi', sbox.ospath('X/pi'))
5123
5074
 
5124
5075
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
5181
5132
  sbox.build(read_only = True)
5182
5133
  wc_dir = sbox.wc_dir
5183
5134
 
5184
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', sbox.ospath('A/mu'))
 
5135
  svntest.actions.run_and_verify_svn(None, [], 'rm', sbox.ospath('A/mu'))
5185
5136
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
5186
5137
  expected_status.tweak('A/mu', status='D ')
5187
5138
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
5188
5139
 
5189
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp', '-rBASE',
 
5140
  svntest.actions.run_and_verify_svn(None, [], 'cp', '-rBASE',
5190
5141
                                     sbox.ospath('A/mu'), sbox.ospath('A/mu2'))
5191
5142
  expected_status.add({
5192
5143
    'A/mu2' : Item(status='A ', copied='+', wc_rev='-'),
5433
5384
                         'D/G/pi',
5434
5385
                         'D/G/rho',
5435
5386
                         'D/G/tau')
 
5387
  expected_status.tweak('B', moved_from='../A/B')
 
5388
  expected_status.tweak('D', moved_from='../A/D')
 
5389
  expected_status.tweak('H', moved_from='D/H')
 
5390
  expected_status.tweak('Q', moved_from='../A/Q')
 
5391
  expected_status.tweak('D/H', moved_to='H')
 
5392
  expected_status.tweak('alpha', moved_from='B/E/alpha')
 
5393
  expected_status.tweak('B/E/alpha', moved_to='alpha')
5436
5394
  svntest.actions.run_and_verify_status(wc('move-dest'), expected_status)
5437
5395
 
5438
5396
  expected_disk = svntest.wc.State('', {
5467
5425
  # E155035 - SVN_ERR_WC_PATH_UNEXPECTED_STATUS
5468
5426
  # E155010 - SVN_ERR_WC_PATH_NOT_FOUND
5469
5427
 
5470
 
  svntest.actions.run_and_verify_svn(None, None,
 
5428
  svntest.actions.run_and_verify_svn(None,
5471
5429
                                     'svn: (E145000|E155035|E155010): ' +
5472
5430
                                     '(Path \'.*iota\' does not exist)|' +
5473
5431
                                     '(Deleted node .*iota\' copied)',
5474
5432
                                     'cp', sbox.ospath('iota'),
5475
5433
                                     sbox.ospath('new_iota'))
5476
5434
 
5477
 
  svntest.actions.run_and_verify_svn(None, None,
 
5435
  svntest.actions.run_and_verify_svn(None,
5478
5436
                                     'svn: (E145000|E155035|E155010): ' +
5479
5437
                                     '(Path \'.*D\' does not exist)|' +
5480
5438
                                     '(Deleted node .*D\' copied)',
5486
5444
  os.mkdir(sbox.ospath('A/D'))
5487
5445
 
5488
5446
  # At one time these two invocations raised an assertion.
5489
 
  svntest.actions.run_and_verify_svn(None, None,
 
5447
  svntest.actions.run_and_verify_svn(None,
5490
5448
                                     'svn: (E155035|E155010): ' +
5491
5449
                                     '(Path \'.*iota\' does not exist)|' +
5492
5450
                                     '(Deleted node.* .*iota\' can\'t be.*)',
5493
5451
                                     'cp', sbox.ospath('iota'),
5494
5452
                                     sbox.ospath('new_iota'))
5495
 
  svntest.actions.run_and_verify_svn(None, None,
 
5453
  svntest.actions.run_and_verify_svn(None,
5496
5454
                                     'svn: (E155035|E155010): ' +
5497
5455
                                     '(Path \'.*D\' does not exist)|' +
5498
5456
                                     '(Deleted node.* .*D\' can\'t be.*)',
5509
5467
  D_path = sbox.ospath('A/D')
5510
5468
 
5511
5469
  # iota -> A/D/iota; verify we cannot commit just A/D/iota
5512
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv', iota_path, D_path)
 
5470
  svntest.actions.run_and_verify_svn(None, [], 'mv', iota_path, D_path)
5513
5471
  expected_error = "svn: E200009: Cannot commit '.*%s' because it was " \
5514
5472
                    "moved from '.*%s'" % (re.escape(sbox.ospath('A/D/iota')),
5515
5473
                                           re.escape(iota_path))
5516
 
  svntest.actions.run_and_verify_svn(None, None, expected_error,
 
5474
  svntest.actions.run_and_verify_svn(None, expected_error,
5517
5475
                                     'commit', '-m', 'foo',
5518
5476
                                     os.path.join(D_path, 'iota'))
5519
5477
 
5521
5479
  expected_error = "svn: E200009: Cannot commit '.*%s' because it was " \
5522
5480
                    "moved from '.*%s'" % (re.escape(sbox.ospath('A/D/iota')),
5523
5481
                                           re.escape(iota_path))
5524
 
  svntest.actions.run_and_verify_svn(None, None, expected_error,
 
5482
  svntest.actions.run_and_verify_svn(None, expected_error,
5525
5483
                                     'commit', '-m', 'foo', D_path)
5526
5484
 
5527
5485
  # A/D -> A/C/D; verify we cannot commit just A/C
5528
5486
  C_path = sbox.ospath('A/C')
5529
5487
 
5530
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv', D_path, C_path)
 
5488
  svntest.actions.run_and_verify_svn(None, [], 'mv', D_path, C_path)
5531
5489
  expected_error = "svn: E200009: Cannot commit '.*%s' because it was moved " \
5532
5490
                    "from '.*%s'" % (re.escape(os.path.join(C_path, "D")),
5533
5491
                                     re.escape(D_path))
5534
 
  svntest.actions.run_and_verify_svn(None, None, expected_error,
 
5492
  svntest.actions.run_and_verify_svn(None, expected_error,
5535
5493
                                     'commit', '-m', 'foo', C_path)
5536
5494
 
5537
5495
  # A/C/D/iota -> A/iota; verify that iota's moved-from hasn't changed
5538
5496
  D_iota_path = sbox.ospath('A/C/D/iota')
5539
5497
  A_iota_path = sbox.ospath('A/iota')
5540
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv', D_iota_path,
 
5498
  svntest.actions.run_and_verify_svn(None, [], 'mv', D_iota_path,
5541
5499
                                     A_iota_path)
5542
5500
  expected_error = "svn: E200009: Cannot commit '.*%s' because it was " \
5543
5501
                    "moved from '.*%s'" % (re.escape(A_iota_path),
5544
5502
                                           re.escape(iota_path))
5545
 
  svntest.actions.run_and_verify_svn(None, None, expected_error,
 
5503
  svntest.actions.run_and_verify_svn(None, expected_error,
5546
5504
                                     'commit', '-m', 'foo', A_iota_path)
5547
5505
 
5548
5506
 
5557
5515
  D_path = sbox.ospath('A/D')
5558
5516
 
5559
5517
  # iota -> A/D/iota; verify we cannot commit just iota
5560
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv', iota_path, D_path)
 
5518
  svntest.actions.run_and_verify_svn(None, [], 'mv', iota_path, D_path)
5561
5519
 
5562
5520
  expected_error = "svn: E200009: Cannot commit '.*%s' because it was moved " \
5563
5521
                    "to '.*%s'" % (re.escape(iota_path),
5564
5522
                                   re.escape(os.path.join(D_path, "iota")))
5565
 
  svntest.actions.run_and_verify_svn(None, None, expected_error,
 
5523
  svntest.actions.run_and_verify_svn(None, expected_error,
5566
5524
                                     'commit', '-m', 'foo', iota_path)
5567
5525
 
5568
5526
  # A/D -> C; verify we cannot commit just A
5569
5527
  C_path = sbox.ospath('C')
5570
5528
 
5571
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv', D_path, C_path)
 
5529
  svntest.actions.run_and_verify_svn(None, [], 'mv', D_path, C_path)
5572
5530
  expected_error = "svn: E200009: Cannot commit '.*%s' because it was moved " \
5573
5531
                    "to '.*%s'" % (re.escape(D_path), re.escape(C_path))
5574
 
  svntest.actions.run_and_verify_svn(None, None, expected_error,
 
5532
  svntest.actions.run_and_verify_svn(None, expected_error,
5575
5533
                                     'commit', '-m', 'foo', A_path)
5576
5534
 
5577
5535
@Issue(4026)
5594
5552
  svntest.actions.set_incomplete(sbox.ospath('A/B/F'), 2)
5595
5553
 
5596
5554
  # Copy fails with no changes to wc
5597
 
  svntest.actions.run_and_verify_svn(None, None,
 
5555
  svntest.actions.run_and_verify_svn(None,
5598
5556
                                     'svn: E155035: Cannot handle status',
5599
5557
                                     'copy',
5600
5558
                                     sbox.ospath('A/B/E'),
5605
5563
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
5606
5564
 
5607
5565
  # Copy fails part way through
5608
 
  svntest.actions.run_and_verify_svn(None, None,
 
5566
  svntest.actions.run_and_verify_svn(None,
5609
5567
                                     'svn: E155035: Cannot handle status',
5610
5568
                                     'copy',
5611
5569
                                     sbox.ospath('A/B'),
5632
5590
  expected_status.remove('A/B2/E', 'A/B2/F')
5633
5591
  svntest.actions.run_and_verify_commit(wc_dir,
5634
5592
                                        expected_output,
5635
 
                                        expected_status,
5636
 
                                        None, wc_dir)
 
5593
                                        expected_status)
5637
5594
  expected_status.add({
5638
5595
      'A/B2/E'       : Item(status='! ', wc_rev=3),
5639
5596
      'A/B2/F'       : Item(status='! ', wc_rev=3),
5662
5619
  sbox.build()
5663
5620
  wc_dir = sbox.wc_dir
5664
5621
 
5665
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
5622
  svntest.actions.run_and_verify_svn(None, [], 'mv',
5666
5623
                                     sbox.ospath('A/B'),
5667
5624
                                     sbox.ospath('A/B2'))
5668
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
5625
  svntest.actions.run_and_verify_svn(None, [], 'mv',
5669
5626
                                     sbox.ospath('A/B2/E'),
5670
5627
                                     sbox.ospath('A/B2/E2'))
5671
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
 
5628
  svntest.actions.run_and_verify_svn(None, [], 'mv',
5672
5629
                                     sbox.ospath('A/B2/E2/alpha'),
5673
5630
                                     sbox.ospath('A/B2/E2/alpha2'))
5674
5631
 
5694
5651
 
5695
5652
  svntest.actions.run_and_verify_commit(wc_dir,
5696
5653
                                        expected_output,
5697
 
                                        expected_status,
5698
 
                                        None, wc_dir)
 
5654
                                        expected_status)
5699
5655
 
5700
5656
def copy_to_unversioned_parent(sbox):
5701
5657
  "copy to unversioned parent"
5703
5659
  sbox.build()
5704
5660
 
5705
5661
  # This succeeds
5706
 
  #svntest.actions.run_and_verify_svn(None, None, [], 'cp', '--parents',
 
5662
  #svntest.actions.run_and_verify_svn(None, [], 'cp', '--parents',
5707
5663
  #                                   sbox.ospath('A/B'),
5708
5664
  #                                   sbox.ospath('New/B2'))
5709
5665
 
5710
5666
  # And this currently fails with The node '.*Unversioned' was not found,
5711
5667
  # while it should succeed or returns some error that a GUI client can use.
5712
5668
  os.mkdir(sbox.ospath('Unversioned'))
5713
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp', '--parents',
 
5669
  svntest.actions.run_and_verify_svn(None, [], 'cp', '--parents',
5714
5670
                                     sbox.ospath('A/B'),
5715
5671
                                     sbox.ospath('Unversioned/B2'))
5716
5672
 
5728
5684
 
5729
5685
  sbox.simple_update(revision='1')
5730
5686
 
5731
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
5687
  svntest.actions.run_and_verify_svn(None, [], 'cp',
5732
5688
                                     sbox.ospath('A'),
5733
5689
                                     sbox.ospath('A_copied'))
5734
5690
 
5769
5725
  sbox.build(read_only = True)
5770
5726
  wc_dir = sbox.wc_dir
5771
5727
 
5772
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
5728
  svntest.actions.run_and_verify_svn(None, [],
5773
5729
                                     'update', '--set-depth', 'exclude',
5774
5730
                                     sbox.ospath('A/D'))
5775
5731
 
5776
5732
  expected_error = "svn: E155000: Path '.*D' exists.*excluded.*"
5777
5733
 
5778
 
  svntest.actions.run_and_verify_svn(None, None, expected_error,
 
5734
  svntest.actions.run_and_verify_svn(None, expected_error,
5779
5735
                                     'cp',
5780
5736
                                       sbox.repo_url + '/A/C',
5781
5737
                                       sbox.ospath('A/D'))
5782
5738
 
5783
5739
  expected_error = "svn: E155000: Path '.*D' exists.*excluded.*"
5784
 
  svntest.actions.run_and_verify_svn(None, None, expected_error,
 
5740
  svntest.actions.run_and_verify_svn(None, expected_error,
5785
5741
                                     'cp',
5786
5742
                                       sbox.ospath('A/C'),
5787
5743
                                       sbox.ospath('A/D'))
5792
5748
  sbox.build()
5793
5749
  wc_dir = sbox.wc_dir
5794
5750
 
5795
 
  tmp_dir = sbox.add_wc_path('relocated')
 
5751
  tmp_dir, url = sbox.add_repo_path('relocated')
5796
5752
 
5797
5753
  shutil.copytree(sbox.repo_dir, tmp_dir)
5798
5754
 
5799
 
  url = 'file://'
5800
 
 
5801
 
  if sys.platform == 'win32':
5802
 
    url += '/'
5803
 
 
5804
 
  url += os.path.abspath(tmp_dir).replace(os.path.sep, '/')
5805
 
 
5806
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
5755
  svntest.actions.run_and_verify_svn(None, [],
5807
5756
                                     'relocate', url, wc_dir)
5808
5757
 
5809
5758
  copiedpath = sbox.ospath('AA')
5810
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
5759
  svntest.actions.run_and_verify_svn(None, [],
5811
5760
                                     'cp', url + '/A', copiedpath)
5812
5761
 
5813
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
5762
  svntest.actions.run_and_verify_svn(None, [],
5814
5763
                                     'info', copiedpath)
5815
5764
 
5816
5765
def ext_wc_copy_deleted(sbox):
5824
5773
  sbox.simple_rm('A/B')
5825
5774
  sbox.simple_commit()
5826
5775
 
5827
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
5776
  svntest.actions.run_and_verify_svn(None, [],
5828
5777
                                     'up', '--set-depth', 'exclude',
5829
5778
                                     sbox.ospath('A/D'))
5830
5779
 
5831
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
5780
  svntest.actions.run_and_verify_svn(None, [],
5832
5781
                                     'co', sbox.repo_url, wc2_dir, '-r', 1)
5833
5782
 
5834
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
5783
  svntest.actions.run_and_verify_svn(None, [],
5835
5784
                                     'cp', sbox.path('A'), os.path.join(wc2_dir,'AA'))
5836
5785
 
5837
5786
  expected_output = expected_output = svntest.wc.State(wc2_dir, {
5840
5789
  })
5841
5790
 
5842
5791
  svntest.actions.run_and_verify_commit(wc2_dir,
5843
 
                                        expected_output, None, None,
5844
 
                                        wc2_dir)
 
5792
                                        expected_output, None)
5845
5793
 
5846
5794
def copy_subtree_deleted(sbox):
5847
5795
  "copy to-be-deleted subtree"
5860
5808
    'AA/B'  : Item(verb='Deleting'),
5861
5809
  })
5862
5810
  svntest.actions.run_and_verify_commit(wc_dir,
5863
 
                                        expected_output, None, None,
 
5811
                                        expected_output, None, [],
5864
5812
                                        sbox.ospath('AA'))
5865
5813
 
5866
5814
  # Commit copy between working copies
5867
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
5815
  svntest.actions.run_and_verify_svn(None, [],
5868
5816
                                     'cp', sbox.path('A'),
5869
5817
                                     os.path.join(wc2_dir,'AA2'))
5870
5818
  expected_output = expected_output = svntest.wc.State(wc2_dir, {
5872
5820
    'AA2/B'  : Item(verb='Deleting'),
5873
5821
  })
5874
5822
  svntest.actions.run_and_verify_commit(wc2_dir,
5875
 
                                        expected_output, None, None,
5876
 
                                        wc2_dir)
5877
 
 
 
5823
                                        expected_output, None)
 
5824
 
 
5825
def resurrect_at_root(sbox):
 
5826
   "resurrect directory at root"
 
5827
 
 
5828
   sbox.build(create_wc=False)
 
5829
 
 
5830
   svntest.actions.run_and_verify_svn(None, [], 'rm', sbox.repo_url + '/A',
 
5831
                                      '-m', '')
 
5832
 
 
5833
   svntest.actions.run_and_verify_svn(None, [], 'cp',
 
5834
                                      sbox.repo_url + '/A/D/H@1',
 
5835
                                      sbox.repo_url + '/A', '-m', '')
5878
5836
 
5879
5837
########################################################################
5880
5838
# Run the tests
5996
5954
              copy_relocate,
5997
5955
              ext_wc_copy_deleted,
5998
5956
              copy_subtree_deleted,
 
5957
              resurrect_at_root,
5999
5958
             ]
6000
5959
 
6001
5960
if __name__ == '__main__':