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

« back to all changes in this revision

Viewing changes to subversion/tests/cmdline/depth_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:
73
73
    wc_empty = sbox.wc_dir + '-depth-empty'
74
74
    sbox.add_test_path(wc_empty, True)
75
75
    svntest.actions.run_and_verify_svn(
76
 
      "Unexpected error from co --depth=empty",
77
76
      svntest.verify.AnyOutput, [],
78
77
      "co", "--depth", "empty", sbox.repo_url, wc_empty)
79
78
 
82
81
    wc_files = sbox.wc_dir + '-depth-files'
83
82
    sbox.add_test_path(wc_files, True)
84
83
    svntest.actions.run_and_verify_svn(
85
 
      "Unexpected error from co --depth=files",
86
84
      svntest.verify.AnyOutput, [],
87
85
      "co", "--depth", "files", sbox.repo_url, wc_files)
88
86
 
91
89
    wc_immediates = sbox.wc_dir + '-depth-immediates'
92
90
    sbox.add_test_path(wc_immediates, True)
93
91
    svntest.actions.run_and_verify_svn(
94
 
      "Unexpected error from co --depth=immediates",
95
92
      svntest.verify.AnyOutput, [],
96
93
      "co", "--depth", "immediates",
97
94
      sbox.repo_url, wc_immediates)
102
99
  """Verifies that PATH has depth DEPTH.  MSG is the failure message."""
103
100
  if depth == "infinity":
104
101
    # Check for absence of depth line.
105
 
    exit_code, out, err = svntest.actions.run_and_verify_svn(None, None,
 
102
    exit_code, out, err = svntest.actions.run_and_verify_svn(None,
106
103
                                                             [], "info", path)
107
104
    for line in out:
108
105
      if line.startswith("Depth:"):
111
108
    expected_stdout = svntest.verify.ExpectedOutput("Depth: %s\n" % depth,
112
109
                                                    match_all=False)
113
110
    svntest.actions.run_and_verify_svn(
114
 
      msg, expected_stdout, [], "info", path)
 
111
      expected_stdout, [], "info", path)
115
112
 
116
113
#----------------------------------------------------------------------
117
114
# Ensure that 'checkout --depth=empty' results in a depth-empty working copy.
144
141
  if os.path.exists(sbox.wc_dir):
145
142
    svntest.main.safe_rmtree(sbox.wc_dir)
146
143
 
147
 
  svntest.actions.run_and_verify_svn("Unexpected error during co %s" % opt,
148
 
                                     svntest.verify.AnyOutput, [],
 
144
  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
149
145
                                     "co", opt, sbox.repo_url, sbox.wc_dir)
150
146
 
151
147
  # Should create a depth-files top directory, so both iota and A
187
183
  expected_status.tweak('iota', wc_rev=2, status='  ')
188
184
  svntest.actions.run_and_verify_commit(wc,
189
185
                                        expected_output,
190
 
                                        expected_status,
191
 
                                        None, wc)
 
186
                                        expected_status)
192
187
 
193
188
  # Update the depth-empty wc, expecting not to receive the change to iota.
194
189
  expected_output = svntest.wc.State(wc_empty, { })
198
193
  svntest.actions.run_and_verify_update(wc_empty,
199
194
                                        expected_output,
200
195
                                        expected_disk,
201
 
                                        expected_status,
202
 
                                        None, None, None, None, None)
 
196
                                        expected_status)
203
197
 
204
198
  # And the wc should still be depth-empty.
205
199
  verify_depth(None, "empty", wc_empty)
210
204
                                        expected_output,
211
205
                                        expected_disk,
212
206
                                        expected_status,
213
 
                                        None, None, None, None, None, False,
 
207
                                        [], False,
214
208
                                        "--depth=infinity", wc_empty)
215
209
 
216
210
  # And the wc should still be depth-empty.
239
233
  expected_status.tweak('A/mu', wc_rev=2, status='  ')
240
234
  svntest.actions.run_and_verify_commit(wc,
241
235
                                        expected_output,
242
 
                                        expected_status,
243
 
                                        None, wc)
 
236
                                        expected_status)
244
237
 
245
238
  # Update the depth-immediates wc, expecting to receive only the
246
239
  # change to iota.
259
252
  svntest.actions.run_and_verify_update(wc_immediates,
260
253
                                        expected_output,
261
254
                                        expected_disk,
262
 
                                        expected_status,
263
 
                                        None, None, None, None, None)
 
255
                                        expected_status)
264
256
  verify_depth(None, "immediates", wc_immediates)
265
257
 
266
258
 
275
267
  wc_empty_iota = os.path.join(wc_empty, 'iota')
276
268
 
277
269
  # Update 'iota' in the depth-empty working copy and modify it
278
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
270
  svntest.actions.run_and_verify_svn(None, [],
279
271
                                     'up', wc_empty_iota)
280
272
  svntest.main.file_write(wc_empty_iota, "iota modified")
281
273
 
290
282
    })
291
283
  svntest.actions.run_and_verify_commit(wc_empty,
292
284
                                        expected_output,
293
 
                                        expected_status,
294
 
                                        None,
295
 
                                        wc_empty)
 
285
                                        expected_status)
296
286
 
297
287
#----------------------------------------------------------------------
298
288
def depth_empty_with_file(sbox):
310
300
  ### minutes of trying to figure out how, I decided to compromise.
311
301
 
312
302
  # Update iota by name, expecting to receive it.
313
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', iota_path)
 
303
  svntest.actions.run_and_verify_svn(None, [], 'up', iota_path)
314
304
 
315
305
  # Test that we did receive it.
316
306
  if not os.path.exists(iota_path):
324
314
  expected_status.tweak('iota', wc_rev=2, status='  ')
325
315
  svntest.actions.run_and_verify_commit(wc,
326
316
                                        expected_output,
327
 
                                        expected_status,
328
 
                                        None, wc)
 
317
                                        expected_status)
329
318
 
330
319
  # Delete iota in the "other" wc.
331
320
  other_iota_path = os.path.join(wc, 'iota')
332
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', other_iota_path)
 
321
  svntest.actions.run_and_verify_svn(None, [], 'rm', other_iota_path)
333
322
  expected_output = svntest.wc.State(wc, { 'iota' : Item(verb='Deleting'), })
334
323
  expected_status = svntest.actions.get_virginal_state(wc, 1)
335
324
  expected_status.remove('iota')
336
325
  svntest.actions.run_and_verify_commit(wc,
337
326
                                        expected_output,
338
 
                                        expected_status,
339
 
                                        None, wc)
 
327
                                        expected_status)
340
328
 
341
329
  # Update the depth-empty wc just a little, expecting to receive
342
330
  # the change in iota.
351
339
                                        expected_output,
352
340
                                        expected_disk,
353
341
                                        expected_status,
354
 
                                        None, None, None, None, None, False,
 
342
                                        [], False,
355
343
                                        '-r2', wc_empty)
356
344
 
357
345
  # Update the depth-empty wc all the way, expecting to receive the deletion
364
352
  svntest.actions.run_and_verify_update(wc_empty,
365
353
                                        expected_output,
366
354
                                        expected_disk,
367
 
                                        expected_status,
368
 
                                        None, None, None, None, None)
 
355
                                        expected_status)
369
356
 
370
357
 
371
358
#----------------------------------------------------------------------
409
396
                                        expected_output,
410
397
                                        expected_disk,
411
398
                                        expected_status,
412
 
                                        None, None,
413
 
                                        None, None, None, None,
 
399
                                        [], False,
414
400
                                        A_path)
415
401
 
416
402
  # Commit a change to A/mu in the "other" wc.
421
407
  expected_status.tweak('A/mu', wc_rev=2, status='  ')
422
408
  svntest.actions.run_and_verify_commit(wc,
423
409
                                        expected_output,
424
 
                                        expected_status,
425
 
                                        None, wc)
 
410
                                        expected_status)
426
411
 
427
412
  # Update "A" by name in wc_empty, expect to receive the change to A/mu.
428
413
  expected_output = svntest.wc.State(wc_empty, { 'A/mu' : Item(status='U ') })
436
421
                                        expected_output,
437
422
                                        expected_disk,
438
423
                                        expected_status,
439
 
                                        None, None,
440
 
                                        None, None, None, None,
 
424
                                        [], False,
441
425
                                        A_path)
442
426
 
443
427
  # Commit the deletion of A/mu from the "other" wc.
444
428
  svntest.main.file_write(other_mu_path, "new text\n")
445
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', other_mu_path)
 
429
  svntest.actions.run_and_verify_svn(None, [], 'rm', other_mu_path)
446
430
  expected_output = svntest.wc.State(wc, { 'A/mu' : Item(verb='Deleting'), })
447
431
  expected_status = svntest.actions.get_virginal_state(wc, 1)
448
432
  expected_status.remove('A/mu')
449
433
  svntest.actions.run_and_verify_commit(wc,
450
434
                                        expected_output,
451
 
                                        expected_status,
452
 
                                        None, wc)
 
435
                                        expected_status)
453
436
 
454
437
 
455
438
  # Update "A" by name in wc_empty, expect to A/mu to disappear.
465
448
                                        expected_output,
466
449
                                        expected_disk,
467
450
                                        expected_status,
468
 
                                        None, None,
469
 
                                        None, None, None, None,
 
451
                                        [], False,
470
452
                                        A_path)
471
453
 
472
454
 
499
481
                                        expected_output,
500
482
                                        expected_disk,
501
483
                                        expected_status,
502
 
                                        None, None, None,
503
 
                                        None, None, None,
 
484
                                        [], False,
504
485
                                        A_mu_path)
505
486
 
506
487
  # Run 'svn up A/D/gamma' to test the edge case 'Skipped'.
507
 
  expected_output = svntest.wc.State(wc_imm, {
508
 
    'A/D/gamma'   : Item(verb='Skipped'),
509
 
    })
510
 
  expected_disk = svntest.main.greek_state.copy()
511
 
  expected_disk.remove('A/C', 'A/B/lambda', 'A/B/E', 'A/B/E/alpha',
512
 
                       'A/B/E/beta', 'A/B/F', 'A/B', 'A/D/gamma', 'A/D/G',
513
 
                       'A/D/G/pi', 'A/D/G/rho', 'A/D/G/tau', 'A/D/H/chi',
514
 
                       'A/D/H/psi', 'A/D/H/omega', 'A/D/H', 'A/D')
515
 
  expected_status = svntest.actions.get_virginal_state(wc_imm, 1)
516
 
  expected_status.remove('A/C', 'A/B/lambda', 'A/B/E', 'A/B/E/alpha',
517
 
                       'A/B/E/beta', 'A/B/F', 'A/B', 'A/D/gamma', 'A/D/G',
518
 
                       'A/D/G/pi', 'A/D/G/rho', 'A/D/G/tau', 'A/D/H/chi',
519
 
                       'A/D/H/psi', 'A/D/H/omega', 'A/D/H', 'A/D')
520
 
  svntest.actions.run_and_verify_update(wc_imm,
521
 
                                        expected_output,
522
 
                                        expected_disk,
523
 
                                        expected_status,
524
 
                                        None, None, None,
525
 
                                        None, None, None,
526
 
                                        gamma_path)
 
488
  svntest.actions.run_and_verify_svn(["Skipped '"+gamma_path+"'\n", ],
 
489
                       "svn: E155007: ", 'update', gamma_path)
 
490
  svntest.actions.run_and_verify_status(wc_imm, expected_status)
527
491
 
528
492
#----------------------------------------------------------------------
529
493
def depth_immediates_fill_in_dir(sbox):
560
524
                                        expected_output,
561
525
                                        expected_disk,
562
526
                                        expected_status,
563
 
                                        None, None,
564
 
                                        None, None, None, None,
 
527
                                        [], False,
565
528
                                        '--set-depth', 'infinity',
566
529
                                        A_path)
567
530
 
593
556
                                        expected_output,
594
557
                                        expected_disk,
595
558
                                        expected_status,
596
 
                                        None, None,
597
 
                                        None, None, None, None,
 
559
                                        [], False,
598
560
                                        '--set-depth', 'files',
599
561
                                        A_path)
600
562
  # Check that A was added at depth=files.
621
583
                                        expected_output,
622
584
                                        expected_disk,
623
585
                                        expected_status,
624
 
                                        None, None,
625
 
                                        None, None, None, None,
 
586
                                        [], False,
626
587
                                        '--set-depth', 'immediates',
627
588
                                        B_path)
628
589
  # Check that A/B was added at depth=immediates.
646
607
                                        expected_output,
647
608
                                        expected_disk,
648
609
                                        expected_status,
649
 
                                        None, None,
650
 
                                        None, None, None, None,
 
610
                                        [], False,
651
611
                                        '--set-depth', 'empty',
652
612
                                        C_path)
653
613
  # Check that A/C was added at depth=empty.
664
624
  iota_path = os.path.join(wc, 'iota')
665
625
 
666
626
  # Commit in the "other" wc.
667
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', iota_path)
 
627
  svntest.actions.run_and_verify_svn(None, [], 'rm', iota_path)
668
628
  expected_output = svntest.wc.State(wc, { 'iota' : Item(verb='Deleting'), })
669
629
  expected_status = svntest.actions.get_virginal_state(wc, 1)
670
630
  expected_status.remove('iota')
671
631
  svntest.actions.run_and_verify_commit(wc,
672
632
                                        expected_output,
673
 
                                        expected_status,
674
 
                                        None, wc)
 
633
                                        expected_status)
675
634
 
676
635
  # Update the depth-empty wc, expecting not to receive the deletion of iota.
677
636
  expected_output = svntest.wc.State(wc_empty, { })
681
640
  svntest.actions.run_and_verify_update(wc_empty,
682
641
                                        expected_output,
683
642
                                        expected_disk,
684
 
                                        expected_status,
685
 
                                        None, None, None, None, None)
 
643
                                        expected_status)
686
644
 
687
645
 
688
646
#----------------------------------------------------------------------
698
656
  mu_path = os.path.join(wc, 'A', 'mu')
699
657
 
700
658
  # Commit in the "other" wc.
701
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', mu_path)
 
659
  svntest.actions.run_and_verify_svn(None, [], 'rm', mu_path)
702
660
  expected_output = svntest.wc.State(wc, { 'A/mu' : Item(verb='Deleting'), })
703
661
  expected_status = svntest.actions.get_virginal_state(wc, 1)
704
662
  expected_status.remove('A/mu')
705
663
  svntest.actions.run_and_verify_commit(wc,
706
664
                                        expected_output,
707
 
                                        expected_status,
708
 
                                        None, wc)
 
665
                                        expected_status)
709
666
 
710
667
  # Update the depth-immediates wc, expecting not to receive the deletion
711
668
  # of A/mu.
722
679
  svntest.actions.run_and_verify_update(wc_immed,
723
680
                                        expected_output,
724
681
                                        expected_disk,
725
 
                                        expected_status,
726
 
                                        None, None, None, None, None)
 
682
                                        expected_status)
727
683
 
728
684
#----------------------------------------------------------------------
729
685
def depth_immediates_receive_delete(sbox):
738
694
  A_path = os.path.join(wc, 'A')
739
695
 
740
696
  # Commit in the "other" wc.
741
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', A_path)
 
697
  svntest.actions.run_and_verify_svn(None, [], 'rm', A_path)
742
698
  expected_output = svntest.wc.State(wc, { 'A' : Item(verb='Deleting'), })
743
699
  expected_status = svntest.wc.State(wc, {
744
700
    '' : Item(status='  ', wc_rev=1),
746
702
    })
747
703
  svntest.actions.run_and_verify_commit(wc,
748
704
                                        expected_output,
749
 
                                        expected_status,
750
 
                                        None, wc)
 
705
                                        expected_status)
751
706
 
752
707
  # Update the depth-immediates wc, expecting to receive the deletion of A.
753
708
  expected_output = svntest.wc.State(wc_immed, {
763
718
  svntest.actions.run_and_verify_update(wc_immed,
764
719
                                        expected_output,
765
720
                                        expected_disk,
766
 
                                        expected_status,
767
 
                                        None, None, None, None, None)
 
721
                                        expected_status)
768
722
 
769
723
#----------------------------------------------------------------------
770
724
def depth_immediates_subdir_propset_1(sbox):
775
729
  A_path = os.path.join(wc_immediates, 'A')
776
730
 
777
731
  # Set a property on an immediate subdirectory of the working copy.
778
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
732
  svntest.actions.run_and_verify_svn(None, [],
779
733
                                     'pset', 'foo', 'bar',
780
734
                                     A_path)
781
735
 
795
749
  svntest.actions.run_and_verify_commit(wc_immediates,
796
750
                                        expected_output,
797
751
                                        expected_status,
798
 
                                        None,
 
752
                                        [],
799
753
                                        A_path)
800
754
 
801
755
  # Create expected output tree for the update.
814
768
                                        expected_output,
815
769
                                        expected_disk,
816
770
                                        expected_status,
817
 
                                        None, None, None, None, None, 1)
 
771
                                        check_props=True)
818
772
 
819
773
#----------------------------------------------------------------------
820
774
def depth_immediates_subdir_propset_2(sbox):
829
783
  A_path = sbox.ospath('A')
830
784
 
831
785
  # Set a property on an immediate subdirectory of the working copy.
832
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
786
  svntest.actions.run_and_verify_svn(None, [],
833
787
                                     'pset', 'foo', 'bar',
834
788
                                     A_path)
835
789
  # Commit.
836
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
790
  svntest.actions.run_and_verify_svn(None, [],
837
791
                                     'commit', '-m', 'logmsg', A_path)
838
792
 
839
793
  # Update at depth=immediates in the other wc, expecting to see no errors.
840
 
  svntest.actions.run_and_verify_svn("Output on stderr where none expected",
841
 
                                     svntest.verify.AnyOutput, [],
 
794
  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
842
795
                                     'update', '--depth', 'immediates',
843
796
                                     other_wc)
844
797
 
865
818
                                        expected_output,
866
819
                                        expected_disk,
867
820
                                        expected_status,
868
 
                                        None, None,
869
 
                                        None, None, None, None,
 
821
                                        [], False,
870
822
                                        '--set-depth', 'files')
871
823
  verify_depth(None, "files")
872
824
 
887
839
                                        expected_output,
888
840
                                        expected_disk,
889
841
                                        expected_status,
890
 
                                        None, None,
891
 
                                        None, None, None, None,
 
842
                                        [], False,
892
843
                                        '--set-depth', 'immediates')
893
844
  verify_depth(None, "immediates")
894
845
  verify_depth(None, "empty", "A")
912
863
                                        expected_output,
913
864
                                        expected_disk,
914
865
                                        expected_status,
915
 
                                        None, None,
916
 
                                        None, None, None, None,
 
866
                                        [], False,
917
867
                                        '--set-depth', 'files', 'A')
918
868
  verify_depth(None, "immediates")
919
869
  verify_depth(None, "files", "A")
944
894
                                        expected_output,
945
895
                                        expected_disk,
946
896
                                        expected_status,
947
 
                                        None, None,
948
 
                                        None, None, None, None,
 
897
                                        [], False,
949
898
                                        '--set-depth', 'infinity')
950
899
  verify_depth("Non-infinity depth detected after an upgrade to depth-infinity",
951
900
               "infinity")
969
918
  chi_path = os.path.join(H_path, 'chi')
970
919
 
971
920
  # Set some properties, modify some files.
972
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
921
  svntest.actions.run_and_verify_svn(None, [],
973
922
                                     'propset', 'foo', 'foo-val', wc_dir)
974
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
923
  svntest.actions.run_and_verify_svn(None, [],
975
924
                                     'propset', 'bar', 'bar-val', D_path)
976
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
925
  svntest.actions.run_and_verify_svn(None, [],
977
926
                                     'propset', 'baz', 'baz-val', G_path)
978
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
927
  svntest.actions.run_and_verify_svn(None, [],
979
928
                                     'propset', 'qux', 'qux-val', H_path)
980
929
  svntest.main.file_append(iota_path, "new iota\n")
981
930
  svntest.main.file_append(gamma_path, "new gamma\n")
1003
952
  svntest.actions.run_and_verify_commit(wc_dir,
1004
953
                                        expected_output,
1005
954
                                        expected_status,
1006
 
                                        None,
 
955
                                        [],
1007
956
                                        depth_arg,
1008
957
                                        wc_dir, D_path)
1009
958
 
1032
981
  gamma_path = os.path.join(wc, 'A', 'D', 'gamma')
1033
982
 
1034
983
  # Make some changes in the depth-infinity wc, and commit them
1035
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
984
  svntest.actions.run_and_verify_svn(None, [],
1036
985
                                     'propset', 'foo', 'foo-val', wc)
1037
986
  svntest.main.file_write(iota_path, "new text\n")
1038
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
987
  svntest.actions.run_and_verify_svn(None, [],
1039
988
                                     'propset', 'bar', 'bar-val', A_path)
1040
989
  svntest.main.file_write(mu_path, "new text\n")
1041
990
  svntest.main.file_write(gamma_path, "new text\n")
1042
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
991
  svntest.actions.run_and_verify_svn(None, [],
1043
992
                                     'commit', '-m', '', wc)
1044
993
 
1045
 
  from diff_tests import make_diff_header, make_diff_prop_header
1046
 
  from diff_tests import make_diff_prop_deleted, make_diff_prop_added
 
994
  from svntest.verify import make_diff_header, make_diff_prop_header, \
 
995
                             make_diff_prop_deleted, make_diff_prop_added
1047
996
  diff_mu = make_diff_header('A/mu', 'revision 2', 'working copy') + [
1048
997
    "@@ -1 +1 @@\n",
1049
998
    "-new text\n",
1063
1012
 
1064
1013
  expected_output = svntest.verify.UnorderedOutput(diff_dot)
1065
1014
  # The diff should contain only the propchange on '.'
1066
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
1015
  svntest.actions.run_and_verify_svn(expected_output, [],
1067
1016
                                     'diff', '-rHEAD')
1068
1017
 
1069
1018
  # Upgrade to depth-files.
1070
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up',
 
1019
  svntest.actions.run_and_verify_svn(None, [], 'up',
1071
1020
                                     '--set-depth', 'files', '-r1')
1072
1021
  # The diff should contain only the propchange on '.' and the
1073
1022
  # contents change on iota.
1074
1023
  expected_output = svntest.verify.UnorderedOutput(diff_iota + diff_dot)
1075
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
1024
  svntest.actions.run_and_verify_svn(expected_output, [],
1076
1025
                                     'diff', '-rHEAD')
1077
1026
  # Do a diff at --depth empty.
1078
1027
  expected_output = svntest.verify.UnorderedOutput(diff_dot)
1079
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
1028
  svntest.actions.run_and_verify_svn(expected_output, [],
1080
1029
                                     'diff', '--depth', 'empty', '-rHEAD')
1081
1030
 
1082
1031
  # Upgrade to depth-immediates.
1083
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up',
 
1032
  svntest.actions.run_and_verify_svn(None, [], 'up',
1084
1033
                                     '--set-depth', 'immediates', '-r1')
1085
1034
  # The diff should contain the propchanges on '.' and 'A' and the
1086
1035
  # contents change on iota.
1087
1036
  expected_output = svntest.verify.UnorderedOutput(diff_A + diff_iota +
1088
1037
                                                   diff_dot)
1089
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
1038
  svntest.actions.run_and_verify_svn(expected_output, [],
1090
1039
                                    'diff', '-rHEAD')
1091
1040
  # Do a diff at --depth files.
1092
1041
  expected_output = svntest.verify.UnorderedOutput(diff_iota + diff_dot)
1093
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
1042
  svntest.actions.run_and_verify_svn(expected_output, [],
1094
1043
                                     'diff', '--depth', 'files', '-rHEAD')
1095
1044
 
1096
1045
  # Upgrade A to depth-files.
1097
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up',
 
1046
  svntest.actions.run_and_verify_svn(None, [], 'up',
1098
1047
                                     '--set-depth', 'files', '-r1', 'A')
1099
1048
  # The diff should contain everything but the contents change on
1100
1049
  # gamma (which does not exist in this working copy).
1101
1050
  expected_output = svntest.verify.UnorderedOutput(diff_mu + diff_A +
1102
1051
                                                   diff_iota + diff_dot)
1103
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
1052
  svntest.actions.run_and_verify_svn(expected_output, [],
1104
1053
                                     'diff', '-rHEAD')
1105
1054
  # Do a diff at --depth immediates.
1106
1055
  expected_output = svntest.verify.UnorderedOutput(diff_A + diff_iota +                                                                                diff_dot)
1107
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
1056
  svntest.actions.run_and_verify_svn(expected_output, [],
1108
1057
                                    'diff', '--depth', 'immediates', '-rHEAD')
1109
1058
 
1110
1059
@Issue(2882)
1151
1100
  #    Sending        A/D/G/rho
1152
1101
  #    Sending        iota
1153
1102
  #    Transmitting file data ..
 
1103
  #    Committing transaction...
1154
1104
  #    Committed revision 2.
1155
1105
 
1156
1106
  iota_path = sbox.ospath('iota')
1173
1123
  svntest.actions.run_and_verify_commit(wc_dir,
1174
1124
                                        expected_output,
1175
1125
                                        expected_status,
1176
 
                                        None,
 
1126
                                        [],
1177
1127
                                        '--depth', 'immediates',
1178
1128
                                        wc_dir, G_path)
1179
1129
 
1192
1142
  svntest.main.file_write(zeta_path, "This is the file 'zeta'.\n")
1193
1143
 
1194
1144
  # Commit in the "other" wc.
1195
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', I_path)
 
1145
  svntest.actions.run_and_verify_svn(None, [], 'add', I_path)
1196
1146
  expected_output = svntest.wc.State(wc, {
1197
1147
    'I'      : Item(verb='Adding'),
1198
1148
    'I/zeta' : Item(verb='Adding'),
1204
1154
    })
1205
1155
  svntest.actions.run_and_verify_commit(wc,
1206
1156
                                        expected_output,
1207
 
                                        expected_status,
1208
 
                                        None, wc)
 
1157
                                        expected_status)
1209
1158
 
1210
1159
  # Update the depth-immediates wc, expecting to receive just the
1211
1160
  # new directory, without the file.
1226
1175
  svntest.actions.run_and_verify_update(wc_immed,
1227
1176
                                        expected_output,
1228
1177
                                        expected_disk,
1229
 
                                        expected_status,
1230
 
                                        None, None, None, None, None)
 
1178
                                        expected_status)
1231
1179
  # Check that the new directory was added at depth=empty.
1232
1180
  verify_depth(None, "empty", other_I_path)
1233
1181
 
1245
1193
  os.mkdir(new3_path)
1246
1194
  os.mkdir(new4_path)
1247
1195
  # Simple case, add new1 only, set depth to files
1248
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1196
  svntest.actions.run_and_verify_svn(None, [],
1249
1197
                                     "add", "--depth", "files", new1_path)
1250
1198
  verify_depth(None, "infinity", new1_path)
1251
1199
 
1252
1200
  # Force add new1 at new1 again, should include new2 at empty, the depth of
1253
1201
  # new1 should not change
1254
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1202
  svntest.actions.run_and_verify_svn(None, [],
1255
1203
                                     "add", "--depth", "immediates",
1256
1204
                                     "--force", new1_path)
1257
1205
  verify_depth(None, "infinity", new1_path)
1258
1206
  verify_depth(None, "infinity", new2_path)
1259
1207
 
1260
1208
  # add new4 with intermediate path, the intermediate path is added at empty
1261
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1209
  svntest.actions.run_and_verify_svn(None, [],
1262
1210
                                     "add", "--depth", "immediates",
1263
1211
                                     "--parents", new4_path)
1264
1212
  verify_depth(None, "infinity", new3_path)
1302
1250
                                          expected_output,
1303
1251
                                          expected_disk,
1304
1252
                                          expected_status,
1305
 
                                          None, None, None, None, None, None,
1306
 
                                          '--set-depth=files')
 
1253
                                          [], False,
 
1254
                                          '--set-depth=files', '.')
1307
1255
    verify_depth(None, "files")
1308
1256
  finally:
1309
1257
    os.chdir(saved_cwd)
1324
1272
                                        expected_output,
1325
1273
                                        expected_disk,
1326
1274
                                        expected_status,
1327
 
                                        None, None, None, None, None, None,
 
1275
                                        [], False,
1328
1276
                                        '--set-depth=files', wc)
1329
1277
  verify_depth(None, "files", wc)
1330
1278
 
1340
1288
  gamma_path = os.path.join(wc, 'A', 'D', 'gamma')
1341
1289
 
1342
1290
  # Make some changes in the depth-infinity wc, and commit them
1343
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1291
  svntest.actions.run_and_verify_svn(None, [],
1344
1292
                                     'propset', 'foo', 'foo-val', wc)
1345
1293
  svntest.main.file_write(iota_path, "new text\n")
1346
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1294
  svntest.actions.run_and_verify_svn(None, [],
1347
1295
                                     'propset', 'bar', 'bar-val', A_path)
1348
1296
  svntest.main.file_write(mu_path, "new text\n")
1349
1297
  svntest.main.file_write(gamma_path, "new text\n")
1350
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1298
  svntest.actions.run_and_verify_svn(None, [],
1351
1299
                                     'commit', '-m', '', wc)
1352
1300
 
1353
1301
  status = [
1362
1310
 
1363
1311
  expected_output = svntest.verify.UnorderedOutput(status[:2])
1364
1312
  # The output should contain only the change on '.'.
1365
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
1313
  svntest.actions.run_and_verify_svn(expected_output, [],
1366
1314
                                     'st', '-u')
1367
1315
 
1368
1316
  # Upgrade to depth-files.
1369
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up',
 
1317
  svntest.actions.run_and_verify_svn(None, [], 'up',
1370
1318
                                     '--set-depth', 'files', '-r1')
1371
1319
  # The output should contain only the changes on '.' and 'iota'.
1372
1320
  expected_output = svntest.verify.UnorderedOutput(status[:3])
1373
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
1321
  svntest.actions.run_and_verify_svn(expected_output, [],
1374
1322
                                     'st', '-u')
1375
1323
  # Do a status -u at --depth empty.
1376
1324
  expected_output = svntest.verify.UnorderedOutput(status[:2])
1377
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
1325
  svntest.actions.run_and_verify_svn(expected_output, [],
1378
1326
                                     'st', '-u', '--depth', 'empty')
1379
1327
 
1380
1328
  # Upgrade to depth-immediates.
1381
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up',
 
1329
  svntest.actions.run_and_verify_svn(None, [], 'up',
1382
1330
                                     '--set-depth', 'immediates', '-r1')
1383
1331
  # The output should contain the changes on '.', 'A' and 'iota'.
1384
1332
  expected_output = svntest.verify.UnorderedOutput(status[:4])
1385
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
1333
  svntest.actions.run_and_verify_svn(expected_output, [],
1386
1334
                                    'st', '-u')
1387
1335
  # Do a status -u at --depth files.
1388
1336
  expected_output = svntest.verify.UnorderedOutput(status[:3])
1389
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
1337
  svntest.actions.run_and_verify_svn(expected_output, [],
1390
1338
                                     'st', '-u', '--depth', 'files')
1391
1339
 
1392
1340
  # Upgrade A to depth-files.
1393
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up',
 
1341
  svntest.actions.run_and_verify_svn(None, [], 'up',
1394
1342
                                     '--set-depth', 'files', '-r1', 'A')
1395
1343
  # The output should contain everything but the change on
1396
1344
  # gamma (which does not exist in this working copy).
1397
1345
  expected_output = svntest.verify.UnorderedOutput(status)
1398
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
1346
  svntest.actions.run_and_verify_svn(expected_output, [],
1399
1347
                                     'st', '-u')
1400
1348
  # Do a status -u at --depth immediates.
1401
1349
  expected_output = svntest.verify.UnorderedOutput(status[:4])
1402
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
1350
  svntest.actions.run_and_verify_svn(expected_output, [],
1403
1351
                                    'st', '-u', '--depth', 'immediates')
1404
1352
 
1405
1353
#----------------------------------------------------------------------
1417
1365
    }
1418
1366
 
1419
1367
  exit_code, output, err = svntest.actions.run_and_verify_svn(
1420
 
    None, None, [],
 
1368
    None, [],
1421
1369
    "delete", "-m", "Delete A.", sbox.repo_url + "/A")
1422
1370
 
1423
1371
  def empty_output(wc_dir):
1466
1414
                                          expected_output_func(wc_dir),
1467
1415
                                          expected_disk,
1468
1416
                                          expected_status_func(wc_dir),
1469
 
                                          None, None, None, None, None,
1470
 
                                          False,
 
1417
                                          [], False,
1471
1418
                                          "--depth=%s" % depth, wc_dir)
1472
1419
 
1473
1420
 
1512
1459
                                        expected_output,
1513
1460
                                        expected_disk,
1514
1461
                                        expected_status,
1515
 
                                        None, None,
1516
 
                                        None, None, None, None,
 
1462
                                        [], False,
1517
1463
                                        '--set-depth', 'immediates', E_path)
1518
1464
  verify_depth(None, "immediates", E_path)
1519
1465
 
1523
1469
                                        expected_output,
1524
1470
                                        expected_disk,
1525
1471
                                        expected_status,
1526
 
                                        None, None,
1527
 
                                        None, None, None, None,
 
1472
                                        [], False,
1528
1473
                                        '--set-depth', 'files', E_path)
1529
1474
  verify_depth(None, "files", E_path)
1530
1475
 
1540
1485
                                        expected_output,
1541
1486
                                        expected_disk,
1542
1487
                                        expected_status,
1543
 
                                        None, None,
1544
 
                                        None, None, None, None,
 
1488
                                        [], False,
1545
1489
                                        '--set-depth', 'immediates', B_path)
1546
1490
  verify_depth(None, "immediates", B_path)
1547
1491
  verify_depth(None, "empty", E_path)
1560
1504
                                        expected_output,
1561
1505
                                        expected_disk,
1562
1506
                                        expected_status,
1563
 
                                        None, None,
1564
 
                                        None, None, None, None,
 
1507
                                        [], False,
1565
1508
                                        '--set-depth', 'empty', H_path)
1566
1509
  verify_depth(None, "empty", H_path)
1567
1510
 
1578
1521
                                        expected_output,
1579
1522
                                        expected_disk,
1580
1523
                                        expected_status,
1581
 
                                        None, None,
1582
 
                                        None, None, None, None,
 
1524
                                        [], False,
1583
1525
                                        '--set-depth', 'immediates', D_path)
1584
1526
  verify_depth(None, "immediates", D_path)
1585
1527
  verify_depth(None, "empty", G_path)
1597
1539
                                        expected_output,
1598
1540
                                        expected_disk,
1599
1541
                                        expected_status,
1600
 
                                        None, None,
1601
 
                                        None, None, None, None,
 
1542
                                        [], False,
1602
1543
                                        '--set-depth', 'empty', D_path)
1603
1544
  verify_depth(None, "empty", D_path)
1604
1545
 
1615
1556
                                        expected_output,
1616
1557
                                        expected_disk,
1617
1558
                                        expected_status,
1618
 
                                        None, None,
1619
 
                                        None, None, None, None,
 
1559
                                        [], False,
1620
1560
                                        '--set-depth', 'immediates', A_path)
1621
1561
  verify_depth(None, "immediates", A_path)
1622
1562
  verify_depth(None, "empty", C_path)
1635
1575
                                        expected_output,
1636
1576
                                        expected_disk,
1637
1577
                                        expected_status,
1638
 
                                        None, None,
1639
 
                                        None, None, None, None,
 
1578
                                        [], False,
1640
1579
                                        '--set-depth', 'files', A_path)
1641
1580
  verify_depth(None, "files", A_path)
1642
1581
 
1651
1590
                                        expected_output,
1652
1591
                                        expected_disk,
1653
1592
                                        expected_status,
1654
 
                                        None, None,
1655
 
                                        None, None, None, None,
 
1593
                                        [], False,
1656
1594
                                        '--set-depth', 'empty', A_path)
1657
1595
  verify_depth(None, "empty", A_path)
1658
1596
 
1667
1605
                                        expected_output,
1668
1606
                                        expected_disk,
1669
1607
                                        expected_status,
1670
 
                                        None, None,
1671
 
                                        None, None, None, None,
 
1608
                                        [], False,
1672
1609
                                        '--set-depth', 'files', wc_dir)
1673
1610
  verify_depth(None, "files", wc_dir)
1674
1611
 
1693
1630
  G_path = os.path.join(D_path, 'G')
1694
1631
 
1695
1632
  # pull in directory A at immediates
1696
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1633
  svntest.actions.run_and_verify_svn(None, [],
1697
1634
                                     'up', '--depth', 'immediates', A_path)
1698
1635
  # check to see if it's really at immediates
1699
1636
  verify_depth(None, "immediates", A_path)
1700
1637
 
1701
1638
  # pull in directory D at infinity
1702
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1639
  svntest.actions.run_and_verify_svn(None, [],
1703
1640
                                     'up', '--set-depth', 'infinity', D_path)
1704
1641
 
1705
1642
  # Run 'svn up --set-depth=immediates' to directory A/D.
1739
1676
                                        expected_output,
1740
1677
                                        expected_disk,
1741
1678
                                        expected_status,
1742
 
                                        None, None,
1743
 
                                        None, None, None, None,
 
1679
                                        [], False,
1744
1680
                                        '--set-depth', 'immediates', D_path)
1745
1681
  verify_depth(None, "immediates", D_path)
1746
1682
  verify_depth(None, "empty", G_path)
1759
1695
                                        expected_output,
1760
1696
                                        expected_disk,
1761
1697
                                        expected_status,
1762
 
                                        None, None,
1763
 
                                        None, None, None, None,
 
1698
                                        [], False,
1764
1699
                                        '--set-depth', 'immediates', A_path)
1765
1700
  verify_depth(None, "immediates", A_path)
1766
1701
  verify_depth(None, "empty", D_path)
1767
1702
 
1768
1703
  # pull in directory D at infinity
1769
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1704
  svntest.actions.run_and_verify_svn(None, [],
1770
1705
                                     'up', '--set-depth', 'infinity', D_path)
1771
1706
 
1772
1707
  # Run 'svn up --set-depth=immediates' to directory A.
1780
1715
                                        expected_output,
1781
1716
                                        expected_disk,
1782
1717
                                        expected_status,
1783
 
                                        None, None,
1784
 
                                        None, None, None, None,
 
1718
                                        [], False,
1785
1719
                                        '--set-depth', 'immediates', A_path)
1786
1720
  verify_depth(None, "immediates", A_path)
1787
1721
  verify_depth(None, "empty", D_path)
1788
1722
 
1789
1723
  # pull in directory D at files
1790
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1724
  svntest.actions.run_and_verify_svn(None, [],
1791
1725
                                     'up', '--set-depth', 'files', D_path)
1792
1726
 
1793
1727
  # Run 'svn up --set-depth=immediates' to directory A.
1799
1733
                                        expected_output,
1800
1734
                                        expected_disk,
1801
1735
                                        expected_status,
1802
 
                                        None, None,
1803
 
                                        None, None, None, None,
 
1736
                                        [], False,
1804
1737
                                        '--set-depth', 'immediates', A_path)
1805
1738
  verify_depth(None, "immediates", A_path)
1806
1739
  verify_depth(None, "empty", D_path)
1826
1759
#                                        expected_output,
1827
1760
#                                        expected_disk,
1828
1761
#                                        expected_status,
1829
 
#                                        None, None,
1830
 
#                                        None, None, None, None,
 
1762
#                                        [], False,
1831
1763
#                                        '--set-depth', 'empty', A_path)
1832
1764
 
1833
1765
def depth_fold_expand_clean_trees(sbox):
1843
1775
  D_path = os.path.join(A_path, 'D')
1844
1776
 
1845
1777
  # pull in directory A at empty
1846
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1778
  svntest.actions.run_and_verify_svn(None, [],
1847
1779
                                     'up', '--depth', 'empty', A_path)
1848
1780
  verify_depth(None, "empty", A_path)
1849
1781
 
1850
1782
  # pull in directory D at infinity
1851
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1783
  svntest.actions.run_and_verify_svn(None, [],
1852
1784
                                     'up', D_path)
1853
1785
 
1854
1786
  # Make the other working copy.
1884
1816
                                        expected_output,
1885
1817
                                        expected_disk,
1886
1818
                                        expected_status,
1887
 
                                        None, None,
1888
 
                                        None, None, None, None,
 
1819
                                        [], False,
1889
1820
                                        '--set-depth', 'immediates', A_path)
1890
1821
  verify_depth(None, "immediates", A_path)
1891
1822
  verify_depth(None, "empty", B_path)
1912
1843
                                        expected_output,
1913
1844
                                        expected_disk,
1914
1845
                                        expected_status,
1915
 
                                        None, None,
1916
 
                                        None, None, None, None,
 
1846
                                        [], False,
1917
1847
                                        '--set-depth', 'files', Other_A_path)
1918
1848
  verify_depth(None, "files", Other_A_path)
1919
1849
 
1950
1880
                                        expected_output,
1951
1881
                                        expected_disk,
1952
1882
                                        expected_status,
1953
 
                                        None, None, None, None, None, False,
 
1883
                                        [], False,
1954
1884
                                        "--depth=immediates", A_path)
1955
1885
 
1956
1886
  # Check that the A directory was pull ed in at depth=immediates.
1976
1906
  # Fold the A dir to empty, expect the modified & unversioned ones left
1977
1907
  # unversioned rather than removed, along with paths to those items.
1978
1908
 
1979
 
  # Even though the directory B and D is not deleted because of local
1980
 
  # modificatoin or unversioned items, there will be only one notification at
1981
 
  # B and D.
 
1909
  # Directories B and D won't be deleted, because that would remove their
 
1910
  # local modifications. Their unmodified descendants are deleted though.
1982
1911
  expected_output = svntest.wc.State(wc_dir, {
1983
 
    'A/B'            : Item(status='D '),
 
1912
    'A/B/E'          : Item(status='D '),
 
1913
    'A/B/F'          : Item(status='D '),
 
1914
    'A/B/lambda'     : Item(status='D '),
1984
1915
    'A/C'            : Item(status='D '),
1985
 
    'A/D'            : Item(status='D '),
1986
 
    'A/mu'           : Item(status='D '),
 
1916
    'A/D/G/rho'      : Item(status='D '),
 
1917
    'A/D/G/tau'      : Item(status='D '),
 
1918
    'A/D/H'          : Item(status='D '),
 
1919
    'A/D/gamma'      : Item(status='D '),
1987
1920
    })
1988
1921
  # unversioned items will be ignored in in the status tree, since the
1989
1922
  # run_and_verify_update() function uses a quiet version of svn status
1990
 
  # Dir A is still versioned, since the wc root is in depth-infinity
1991
1923
  expected_status = svntest.wc.State(wc_dir, {
1992
1924
    ''               : Item(status='  ', wc_rev=1),
1993
1925
    'iota'           : Item(status='  ', wc_rev=1),
1994
 
    'A'              : Item(status='  ', wc_rev=1)
 
1926
    'A'              : Item(status='  ', wc_rev=1),
 
1927
    'A/D'            : Item(status='  ', wc_rev='1'),
 
1928
    'A/D/G'          : Item(status='  ', wc_rev='1'),
 
1929
    'A/D/G/pi'       : Item(status='M ', wc_rev='1'),
 
1930
    'A/B'            : Item(status='  ', wc_rev='1'),
 
1931
    'A/mu'           : Item(status='M ', wc_rev='1'),
1995
1932
    })
1996
1933
  expected_disk = svntest.wc.State('', {
1997
1934
    'iota'           : Item(contents="This is the file 'iota'.\n"),
2007
1944
                                        expected_output,
2008
1945
                                        expected_disk,
2009
1946
                                        expected_status,
2010
 
                                        None, None,
2011
 
                                        None, None, None, None,
 
1947
                                        [], False,
2012
1948
                                        '--set-depth', 'empty', A_path)
2013
1949
  verify_depth(None, "empty", A_path)
2014
1950
 
2026
1962
  expected_status.tweak('iota', wc_rev=2, status='  ')
2027
1963
  svntest.actions.run_and_verify_commit(wc_dir,
2028
1964
                                        expected_output,
2029
 
                                        expected_status,
2030
 
                                        None, wc_dir)
 
1965
                                        expected_status)
2031
1966
 
2032
1967
  # Update iota with depth=empty.
2033
1968
  expected_output = svntest.wc.State(wc_dir,
2038
1973
                                        expected_output,
2039
1974
                                        expected_disk,
2040
1975
                                        expected_status,
2041
 
                                        None, None, None, None, None, False,
 
1976
                                        [], False,
2042
1977
                                        '--depth=empty', '-r1', iota_path)
2043
1978
 
2044
1979
  # Check the revision and created rev.
2074
2009
                                        expected_output,
2075
2010
                                        expected_disk,
2076
2011
                                        expected_status,
2077
 
                                        None, None,
2078
 
                                        None, None, None, None,
 
2012
                                        [], False,
2079
2013
                                        '--set-depth', 'exclude', E_path)
2080
2014
  # verify_depth exclude? not implemented yet
2081
2015
 
2093
2027
                                        expected_output,
2094
2028
                                        expected_disk,
2095
2029
                                        expected_status,
2096
 
                                        None, None,
2097
 
                                        None, None, None, None,
 
2030
                                        [], False,
2098
2031
                                        '--set-depth', 'immediates', B_path)
2099
2032
  verify_depth(None, "immediates", B_path)
2100
2033
 
2101
2034
  # Exclude A/B/E again
2102
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2035
  svntest.actions.run_and_verify_svn(None, [],
2103
2036
                                     'up', '--set-depth', 'exclude', E_path)
2104
2037
 
2105
2038
  # Exclude path B totally, in which contains an excluded subtree.
2112
2045
                                        expected_output,
2113
2046
                                        expected_disk,
2114
2047
                                        expected_status,
2115
 
                                        None, None,
2116
 
                                        None, None, None, None,
 
2048
                                        [], False,
2117
2049
                                        '--set-depth', 'exclude', B_path)
2118
2050
 
2119
2051
  # Explicitly pull in excluded path B.
2131
2063
                                        expected_output,
2132
2064
                                        expected_disk,
2133
2065
                                        expected_status,
2134
 
                                        None, None,
2135
 
                                        None, None, None, None,
 
2066
                                        [], False,
2136
2067
                                        B_path)
2137
2068
 
2138
2069
  # Test issue #
2146
2077
                                        expected_output,
2147
2078
                                        expected_disk,
2148
2079
                                        expected_status,
2149
 
                                        None, None,
2150
 
                                        None, None, None, None,
 
2080
                                        [], False,
2151
2081
                                        '--set-depth', 'exclude', iota_path)
2152
2082
 
2153
2083
  # Update the whole WC to depth=infinity.
2163
2093
                                        expected_output,
2164
2094
                                        expected_disk,
2165
2095
                                        expected_status,
2166
 
                                        None, None,
2167
 
                                        None, None, None, None,
 
2096
                                        [], False,
2168
2097
                                        '--set-depth', 'infinity', wc_dir)
2169
2098
 
2170
2099
def excluded_path_misc_operation(sbox):
2192
2121
                                        expected_output,
2193
2122
                                        expected_disk,
2194
2123
                                        expected_status,
2195
 
                                        None, None,
2196
 
                                        None, None, None, None,
 
2124
                                        [], False,
2197
2125
                                        '--set-depth', 'exclude', E_path)
2198
2126
 
2199
2127
  # copy A/B to A/L, excluded entry should be copied too
2200
2128
  expected_output = ['A         '+L_path+'\n']
2201
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
2129
  svntest.actions.run_and_verify_svn(expected_output, [],
2202
2130
                                     'cp', B_path, L_path)
2203
2131
  # verify_depth exclude? not implemented yet
2204
2132
  #verify_depth(None, "empty", LE_path)
2209
2137
  expected_output = svntest.verify.UnorderedOutput([
2210
2138
    "Reverted '%s'\n" % path for path in revert_paths])
2211
2139
 
2212
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
2140
  svntest.actions.run_and_verify_svn(expected_output, [],
2213
2141
                                     'revert', '--depth=infinity', L_path)
2214
2142
 
2215
2143
  # copy A/B to A/L and then cp A/L to A/M, excluded entry should be
2216
2144
  # copied both times
2217
2145
  expected_output = ['A         '+L_path+'\n']
2218
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
2146
  svntest.actions.run_and_verify_svn(expected_output, [],
2219
2147
                                     'cp', B_path, L_path)
2220
2148
  expected_output = ['A         '+M_path+'\n']
2221
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
2149
  svntest.actions.run_and_verify_svn(expected_output, [],
2222
2150
                                     'cp', L_path, M_path)
2223
2151
 
2224
2152
  # commit this copy, with an excluded item.
2236
2164
    })
2237
2165
  svntest.actions.run_and_verify_commit(wc_dir,
2238
2166
                                        expected_output,
2239
 
                                        expected_status,
2240
 
                                        None,
2241
 
                                        wc_dir)
 
2167
                                        expected_status)
2242
2168
 
2243
2169
  # Relocate wc, with excluded items in it.
2244
2170
  repo_dir = sbox.repo_dir
2246
2172
  other_repo_dir, other_repo_url = sbox.add_repo_path('other')
2247
2173
  svntest.main.copy_repos(repo_dir, other_repo_dir, 2, 0)
2248
2174
  svntest.main.safe_rmtree(repo_dir, 1)
2249
 
  svntest.actions.run_and_verify_svn(None, None, [], 'switch', '--relocate',
 
2175
  svntest.actions.run_and_verify_svn(None, [], 'switch', '--relocate',
2250
2176
                                     repo_url, other_repo_url, wc_dir)
2251
2177
 
2252
2178
  # remove the new directory A/L, with an excluded item.
2253
2179
  # If successed, no error will be thrown
2254
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2180
  svntest.actions.run_and_verify_svn(None, [],
2255
2181
                                     'rm', L_path)
2256
2182
 
2257
2183
  # revert the delete
2258
2184
  # If successed, no error will be thrown
2259
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2185
  svntest.actions.run_and_verify_svn(None, [],
2260
2186
                                     'revert', '--depth=infinity', L_path)
2261
2187
 
2262
2188
 
2283
2209
                                        expected_output,
2284
2210
                                        expected_disk,
2285
2211
                                        expected_status,
2286
 
                                        None, None,
2287
 
                                        None, None, None, None,
 
2212
                                        [], False,
2288
2213
                                        "--set-depth", "exclude", B_path)
2289
2214
 
2290
2215
  # Remove path B in the repos.
2291
 
  svntest.actions.run_and_verify_svn(None, None, [], "delete", "-m",
 
2216
  svntest.actions.run_and_verify_svn(None, [], "delete", "-m",
2292
2217
                                     "Delete B.", sbox.repo_url + "/A/B")
2293
2218
 
2294
2219
  # Update wc, should receive the removal of excluded path B
2299
2224
  svntest.actions.run_and_verify_update(wc,
2300
2225
                                        None,
2301
2226
                                        expected_disk,
2302
 
                                        expected_status,
2303
 
                                        None, None,
2304
 
                                        None, None, None, None)
 
2227
                                        expected_status)
2305
2228
 
2306
2229
  # Introduce a new path with the same name B.
2307
2230
  # This should succeed if the exclude entry is gone with the update,
2308
2231
  # otherwise a name conflict will rise up.
2309
2232
  expected_output = ['A         '+B_path+'\n']
2310
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
2233
  svntest.actions.run_and_verify_svn(expected_output, [],
2311
2234
                                     'cp', C_path, B_path)
2312
2235
 
2313
2236
 
2327
2250
  # we could grep the 'entries' file, but...
2328
2251
  # or we could use 'info', but info_excluded() is XFail.
2329
2252
  expected_stderr = ".*svn: E150002: '.*C' is already under version control.*"
2330
 
  svntest.actions.run_and_verify_svn(None, None, expected_stderr,
 
2253
  svntest.actions.run_and_verify_svn(None, expected_stderr,
2331
2254
                                     'mkdir', 'C')
2332
2255
 
2333
2256
 
2383
2306
  g =      j(D, 'gamma')
2384
2307
 
2385
2308
  # Store node modifications as rev 2
2386
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2309
  svntest.actions.run_and_verify_svn(None, [],
2387
2310
                                     'propset', 'foo', 'foo-val', B)
2388
2311
  svntest.main.file_append(m, "Modified mu.\n")
2389
2312
  svntest.main.file_append(g, "Modified gamma.\n")
2401
2324
  svntest.actions.run_and_verify_commit(wc,
2402
2325
                                        expected_output,
2403
2326
                                        expected_status,
2404
 
                                        None,
 
2327
                                        [],
2405
2328
                                        A)
2406
2329
 
2407
2330
  # Go back to rev 1
2416
2339
                                        expected_output,
2417
2340
                                        expected_disk,
2418
2341
                                        expected_status,
2419
 
                                        None, None, None, None, None, False,
 
2342
                                        [], False,
2420
2343
                                        '-r1', A)
2421
2344
 
2422
2345
  # Perform node deletions so that items become unversioned and
2423
2346
  # will have tree-conflicts upon update.
2424
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2347
  svntest.actions.run_and_verify_svn(None, [],
2425
2348
                                     'rm', m, B, g)
2426
2349
 
2427
2350
  # Update so that conflicts appear
2458
2381
                                        expected_output,
2459
2382
                                        expected_disk,
2460
2383
                                        expected_status,
2461
 
                                        None, None, None, None, None, False,
 
2384
                                        [], False,
2462
2385
                                        wc)
2463
2386
 
2464
2387
 
2538
2461
                                        expected_output,
2539
2462
                                        expected_disk,
2540
2463
                                        expected_status,
2541
 
                                        None, None,
2542
 
                                        None, None, None, None,
 
2464
                                        [], False,
2543
2465
                                        '--set-depth', 'exclude', B_path)
2544
2466
 
2545
2467
  # Update to depth 'empty' for the excluded path A/B
2556
2478
                                        expected_output,
2557
2479
                                        expected_disk,
2558
2480
                                        expected_status,
2559
 
                                        None, None,
2560
 
                                        None, None, None, None,
 
2481
                                        [], False,
2561
2482
                                        '--set-depth', 'empty', B_path)
2562
2483
  verify_depth(None, "empty", B_path)
2563
2484
  expected_info = {
2569
2490
  svntest.actions.run_and_verify_info([expected_info], B_path)
2570
2491
 
2571
2492
  # Exclude A/B again
2572
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2493
  svntest.actions.run_and_verify_svn(None, [],
2573
2494
                                     'up', '--set-depth', 'exclude', B_path)
2574
2495
 
2575
2496
  # Update to depth 'files' for the excluded path A/B
2589
2510
                                        expected_output,
2590
2511
                                        expected_disk,
2591
2512
                                        expected_status,
2592
 
                                        None, None,
2593
 
                                        None, None, None, None,
 
2513
                                        [], False,
2594
2514
                                        '--set-depth', 'files', B_path)
2595
2515
  verify_depth(None, "files", B_path)
2596
2516
  expected_info = {
2602
2522
  svntest.actions.run_and_verify_info([expected_info], B_path)
2603
2523
 
2604
2524
  # Exclude A/B again
2605
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2525
  svntest.actions.run_and_verify_svn(None, [],
2606
2526
                                     'up', '--set-depth', 'exclude', B_path)
2607
2527
 
2608
2528
  # Update to depth 'immediates' for the excluded path A/B
2628
2548
                                        expected_output,
2629
2549
                                        expected_disk,
2630
2550
                                        expected_status,
2631
 
                                        None, None,
2632
 
                                        None, None, None, None,
 
2551
                                        [], False,
2633
2552
                                        '--set-depth', 'immediates', B_path)
2634
2553
  verify_depth(None, "immediates", B_path)
2635
2554
  expected_info = {
2641
2560
  svntest.actions.run_and_verify_info([expected_info], B_path)
2642
2561
 
2643
2562
  # Exclude A/B again
2644
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2563
  svntest.actions.run_and_verify_svn(None, [],
2645
2564
                                     'up', '--set-depth', 'exclude', B_path)
2646
2565
 
2647
2566
  # Update to depth 'infinity' for the excluded path A/B
2659
2578
                                        expected_output,
2660
2579
                                        expected_disk,
2661
2580
                                        expected_status,
2662
 
                                        None, None,
2663
 
                                        None, None, None, None,
 
2581
                                        [], False,
2664
2582
                                        '--set-depth', 'infinity', B_path)
2665
2583
  verify_depth(None, "infinity", B_path)
2666
2584
  expected_info = {
2681
2599
  A_path = os.path.join(wc_dir, 'A')
2682
2600
 
2683
2601
  # Update A to depth 'infinity'
2684
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2602
  svntest.actions.run_and_verify_svn(None, [],
2685
2603
                                     'up', '--set-depth', 'infinity', A_path)
2686
2604
 
2687
2605
  # Tweak some files in the full working copy and commit.
2689
2607
                           "Modified alpha.\n")
2690
2608
  svntest.main.file_append(os.path.join(wc_other, 'A', 'D', 'G', 'rho'),
2691
2609
                           "Modified rho.\n")
2692
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2610
  svntest.actions.run_and_verify_svn(None, [],
2693
2611
                                     'ci', '-m', '', wc_other)
2694
2612
 
2695
2613
  # Now update the original working copy and make sure we get those changes.
2706
2624
  svntest.actions.run_and_verify_update(wc_dir,
2707
2625
                                        expected_output,
2708
2626
                                        expected_disk,
2709
 
                                        expected_status,
2710
 
                                        None, None,
2711
 
                                        None, None, None, None, wc_dir)
 
2627
                                        expected_status)
2712
2628
 
2713
2629
def sparse_update_with_dash_dash_parents(sbox):
2714
2630
  """update --parents"""
2721
2637
 
2722
2638
  # Start with a depth=empty root checkout.
2723
2639
  svntest.actions.run_and_verify_svn(
2724
 
      "Unexpected error from co --depth=empty",
2725
2640
      svntest.verify.AnyOutput, [],
2726
2641
      "co", "--depth", "empty", sbox.repo_url, sbox.wc_dir)
2727
2642
 
2749
2664
                                        expected_output,
2750
2665
                                        expected_disk,
2751
2666
                                        expected_status,
2752
 
                                        None, None, None, None, None, False,
 
2667
                                        [], False,
2753
2668
                                        '--parents', alpha_path)
2754
2669
 
2755
2670
  expected_output = svntest.wc.State(sbox.wc_dir, {
2771
2686
                                        expected_output,
2772
2687
                                        expected_disk,
2773
2688
                                        expected_status,
2774
 
                                        None, None, None, None, None, False,
 
2689
                                        [], False,
2775
2690
                                        '--parents', pi_path)
2776
2691
 
2777
2692
  expected_output = svntest.wc.State(sbox.wc_dir, {
2790
2705
                                        expected_output,
2791
2706
                                        expected_disk,
2792
2707
                                        expected_status,
2793
 
                                        None, None, None, None, None, False,
 
2708
                                        [], False,
2794
2709
                                        '--parents', omega_path)
2795
2710
 
2796
2711
def update_below_depth_empty(sbox):
2807
2722
      'A/D'               : Item(status='D '),
2808
2723
    })
2809
2724
  svntest.actions.run_and_verify_update(sbox.wc_dir, expected_output, None,
2810
 
                                        None, None, None, None, None, None,
2811
 
                                        False,
 
2725
                                        None,
 
2726
                                        [], False,
2812
2727
                                        '--set-depth', 'empty', A)
2813
2728
 
2814
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2729
  svntest.actions.run_and_verify_svn(None, [],
2815
2730
                                     'cp', repo_url + '/iota',
2816
2731
                                           repo_url + '/A/B',
2817
2732
                                     '-m', 'remote copy')
2821
2736
 
2822
2737
  # This update should just update the revision of the working copy
2823
2738
  svntest.actions.run_and_verify_update(sbox.wc_dir, expected_output, None,
2824
 
                                        None, None)
 
2739
                                        None)
2825
2740
 
2826
2741
# Test for issue #4136.
2827
2742
@Issue(4136)
2842
2757
  expected_status.tweak('A/mu', wc_rev=2, status='  ')
2843
2758
  svntest.actions.run_and_verify_commit(wc_dir,
2844
2759
                                        expected_output,
2845
 
                                        expected_status,
2846
 
                                        None,
2847
 
                                        wc_dir)
 
2760
                                        expected_status)
2848
2761
 
2849
2762
  # Now, update --depth immediates in the root of the working copy.
2850
2763
  expected_output = svntest.wc.State(wc_dir, { })
2860
2773
                                        expected_output,
2861
2774
                                        expected_disk,
2862
2775
                                        expected_status,
2863
 
                                        None, None, None, None, None, False,
 
2776
                                        [], False,
2864
2777
                                        "--depth=immediates", wc_dir)
2865
2778
 
2866
2779
def revert_depth_files(sbox):
2875
2788
 
2876
2789
  sbox.simple_rm('A/mu')
2877
2790
  # Expect reversion of just 'mu'
2878
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
2791
  svntest.actions.run_and_verify_svn(expected_output, [],
2879
2792
                                     'revert', '--depth=immediates', sbox.ospath('A'))
2880
2793
 
2881
2794
  # Apply an unrelated directory delete
2883
2796
 
2884
2797
  sbox.simple_rm('A/mu')
2885
2798
  # Expect reversion of just 'mu'
2886
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
2799
  svntest.actions.run_and_verify_svn(expected_output, [],
2887
2800
                                     'revert', '--depth=files', sbox.ospath('A'))
2888
2801
 
2889
2802
@Issue(4257)
2901
2814
                                        expected_output,
2902
2815
                                        expected_disk,
2903
2816
                                        expected_status,
2904
 
                                        None, None, None, None, None, False,
 
2817
                                        [], False,
2905
2818
                                        "--depth=empty", sbox.wc_dir)
2906
2819
  val2 = svntest.wc.sqlite_stmt(sbox.wc_dir, "select count(*) from nodes")
2907
2820
  if (val1 != val2):
2908
2821
    # ra_neon added a spurious not-present row that does not show up in status
2909
2822
    raise svntest.Failure("count changed from '%s' to '%s'" % (val1, val2))
2910
2823
 
 
2824
def commit_excluded(sbox):
 
2825
  "commit an excluded node"
 
2826
 
 
2827
  sbox.build()
 
2828
  wc_dir = sbox.wc_dir
 
2829
 
 
2830
  expected_output = svntest.wc.State(wc_dir, {
 
2831
    'A/D/G' : Item(status='D '),
 
2832
  })
 
2833
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
 
2834
  expected_status.remove('A/D/G', 'A/D/G/pi', 'A/D/G/rho', 'A/D/G/tau')
 
2835
 
 
2836
  svntest.actions.run_and_verify_update(wc_dir,
 
2837
                                        expected_output,
 
2838
                                        None,
 
2839
                                        expected_status,
 
2840
                                        [], False,
 
2841
                                        "--set-depth=exclude",
 
2842
                                        sbox.ospath('A/D/G'))
 
2843
 
 
2844
  sbox.simple_copy('A/D', 'D')
 
2845
 
 
2846
  expected_output = svntest.wc.State(wc_dir, {
 
2847
    'D' : Item(verb='Adding'),
 
2848
  })
 
2849
  
 
2850
  expected_status.add({
 
2851
    'D'          : Item(status='  ', wc_rev='2'),
 
2852
    'D/H'        : Item(status='  ', wc_rev='2'),
 
2853
    'D/H/chi'    : Item(status='  ', wc_rev='2'),
 
2854
    'D/H/psi'    : Item(status='  ', wc_rev='2'),
 
2855
    'D/H/omega'  : Item(status='  ', wc_rev='2'),
 
2856
    'D/gamma'    : Item(status='  ', wc_rev='2')
 
2857
  })
 
2858
 
 
2859
  svntest.actions.run_and_verify_commit(wc_dir,
 
2860
                                        expected_output,
 
2861
                                        expected_status)
 
2862
 
 
2863
  expected_output = svntest.wc.State(wc_dir, {
 
2864
    'A/D/G'     : Item(status='A '),
 
2865
    'A/D/G/pi'  : Item(status='A '),
 
2866
    'A/D/G/tau' : Item(status='A '),
 
2867
    'A/D/G/rho' : Item(status='A '),
 
2868
    'D/G'       : Item(status='A '),
 
2869
    'D/G/pi'    : Item(status='A '),
 
2870
    'D/G/tau'   : Item(status='A '),
 
2871
    'D/G/rho'   : Item(status='A ')
 
2872
  })
 
2873
 
 
2874
  expected_status.tweak(wc_rev=2)
 
2875
 
 
2876
  expected_status.add({
 
2877
    'D'         : Item(status='  ', wc_rev='2'),
 
2878
    'D/G'       : Item(status='  ', wc_rev='2'),
 
2879
    'D/G/pi'    : Item(status='  ', wc_rev='2'),
 
2880
    'D/G/rho'   : Item(status='  ', wc_rev='2'),
 
2881
    'D/G/tau'   : Item(status='  ', wc_rev='2'),
 
2882
    'D/H'       : Item(status='  ', wc_rev='2'),
 
2883
    'D/H/chi'   : Item(status='  ', wc_rev='2'),
 
2884
    'D/H/psi'   : Item(status='  ', wc_rev='2'),
 
2885
    'D/H/omega' : Item(status='  ', wc_rev='2'),
 
2886
    'D/gamma'   : Item(status='  ', wc_rev='2'),
 
2887
    'A/D/G'     : Item(status='  ', wc_rev='2'),
 
2888
    'A/D/G/rho' : Item(status='  ', wc_rev='2'),
 
2889
    'A/D/G/tau' : Item(status='  ', wc_rev='2'),
 
2890
    'A/D/G/pi'  : Item(status='  ', wc_rev='2')
 
2891
  })
 
2892
 
 
2893
  svntest.actions.run_and_verify_update(wc_dir,
 
2894
                                        expected_output,
 
2895
                                        None,
 
2896
                                        expected_status,
 
2897
                                        [], False,
 
2898
                                        "--set-depth=infinity", wc_dir)
2911
2899
 
2912
2900
#----------------------------------------------------------------------
2913
2901
# list all tests here, starting with None:
2959
2947
              commit_then_immediates_update,
2960
2948
              revert_depth_files,
2961
2949
              spurious_nodes_row,
 
2950
              commit_excluded,
2962
2951
              ]
2963
2952
 
2964
2953
if __name__ == "__main__":