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

« back to all changes in this revision

Viewing changes to subversion/tests/cmdline/merge_reintegrate_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:
44
44
 
45
45
from svntest.main import SVN_PROP_MERGEINFO
46
46
from svntest.main import server_has_mergeinfo
47
 
from merge_tests import set_up_branch
48
 
from merge_tests import expected_merge_output
 
47
from svntest.mergetrees import set_up_branch
 
48
from svntest.mergetrees import expected_merge_output
49
49
 
50
50
#----------------------------------------------------------------------
51
51
def run_reintegrate(src_url, tgt_path):
53
53
     there is nothing on stdout, anything on stderr, or a non-zero exit
54
54
     code.
55
55
  """
56
 
  svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
 
56
  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
57
57
                                     'merge', '--reintegrate',
58
58
                                     src_url, tgt_path)
59
59
 
71
71
  # ourselves, but as the 'actual_stdout' argument, that way each line of
72
72
  # error must match the regex.
73
73
  exit_code, out, err = svntest.actions.run_and_verify_svn(
74
 
                          None, expected_stdout, svntest.verify.AnyOutput,
 
74
                          expected_stdout, svntest.verify.AnyOutput,
75
75
                          'merge', '--reintegrate',
76
76
                          src_url, tgt_path)
77
77
  assert exit_code
86
86
                               mergeinfo_output_tree,
87
87
                               elision_output_tree,
88
88
                               disk_tree, status_tree, skip_tree,
89
 
                               error_re_string = None,
 
89
                               expected_stderr = [],
90
90
                               check_props = True,
91
91
                               dry_run = True):
92
92
  """Run 'svn merge --reintegrate SRC_URL TGT_DIR'. Raise an error if
98
98
                    tgt_dir, None, None, src_url, None,
99
99
                    output_tree, mergeinfo_output_tree, elision_output_tree,
100
100
                    disk_tree, status_tree, skip_tree,
101
 
                    error_re_string,
102
 
                    None, None, None, None, check_props, dry_run,
 
101
                    expected_stderr, check_props, dry_run,
103
102
                    '--reintegrate', tgt_dir)
104
103
 
105
104
 
122
121
  expected_output = wc.State(wc_dir, {'A_COPY/mu' : Item(verb='Sending')})
123
122
  expected_status.tweak('A_COPY/mu', wc_rev=7)
124
123
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
125
 
                                        expected_status, None, wc_dir)
 
124
                                        expected_status)
126
125
  expected_disk.tweak('A_COPY/mu', contents='Changed on the branch.')
127
126
 
128
127
  # Update the wcs.
130
129
  expected_status.tweak(wc_rev='7')
131
130
  svntest.actions.run_and_verify_update(wc_dir, expected_output,
132
131
                                        expected_disk, expected_status,
133
 
                                        None, None, None, None, None, True)
 
132
                                        check_props=True)
134
133
 
135
134
  # Merge from trunk to branch (ie, r3-6), using normal cherry-harvest.
136
135
  A_COPY_path = sbox.ospath('A_COPY')
196
195
                                       k_expected_disk,
197
196
                                       k_expected_status,
198
197
                                       expected_skip,
199
 
                                       None, None, None, None,
200
 
                                       None, True)
 
198
                                       [], True)
201
199
  expected_disk.tweak('A_COPY', props={SVN_PROP_MERGEINFO: '/A:2-7'})
202
200
  expected_disk.tweak('A_COPY/B/E/beta', contents="New content")
203
201
  expected_disk.tweak('A_COPY/D/G/rho', contents="New content")
215
213
  expected_status.tweak('A_COPY', 'A_COPY/D/H/psi', 'A_COPY/D/G/rho',
216
214
                        'A_COPY/B/E/beta', 'A_COPY/D/H/omega', wc_rev=8)
217
215
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
218
 
                                        expected_status, None, wc_dir)
 
216
                                        expected_status)
219
217
 
220
218
  # Update the wcs again.
221
219
  expected_output = wc.State(wc_dir, {})
222
220
  expected_status.tweak(wc_rev='8')
223
221
  svntest.actions.run_and_verify_update(wc_dir, expected_output,
224
222
                                        expected_disk, expected_status,
225
 
                                        None, None, None, None, None, True)
 
223
                                        check_props=True)
226
224
 
227
225
 
228
226
  # *finally*, actually run merge --reintegrate in trunk with the
268
266
                                       k_expected_disk,
269
267
                                       k_expected_status,
270
268
                                       expected_skip,
271
 
                                       None, True, True)
 
269
                                       [], True, True)
272
270
 
273
271
  # Test issue #3640:
274
272
  #
276
274
  # targeting A_MOVED this time.  This should work with almost the same
277
275
  # results.  The only differences being the inclusion of r9 in the
278
276
  # mergeinfo and the A-->A_MOVED path difference.
279
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
280
 
  svntest.actions.run_and_verify_svn(None,
281
 
                                     ['\n', 'Committed revision 9.\n'],
 
277
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
 
278
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
279
                                      'Committed revision 9.\n'],
282
280
                                     [], 'move',
283
281
                                     sbox.repo_url + '/A',
284
282
                                     sbox.repo_url + '/A_MOVED',
285
283
                                     '-m', 'Copy A to A_MOVED')
286
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
284
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
287
285
  A_MOVED_path = sbox.ospath('A_MOVED')
288
286
  expected_output = wc.State(A_MOVED_path, {
289
287
    'mu'           : Item(status='U '),
325
323
                                       k_expected_disk,
326
324
                                       expected_status,
327
325
                                       expected_skip,
328
 
                                       None, True, True)
 
326
                                       [], True, True)
329
327
 
330
328
#----------------------------------------------------------------------
 
329
@SkipUnless(server_has_mergeinfo)
331
330
def reintegrate_with_rename(sbox):
332
331
  "merge --reintegrate with renamed file on branch"
333
332
 
342
341
  expected_output = wc.State(wc_dir, {'A_COPY/mu' : Item(verb='Sending')})
343
342
  expected_status.tweak('A_COPY/mu', wc_rev=7)
344
343
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
345
 
                                        expected_status, None, wc_dir)
 
344
                                        expected_status)
346
345
  expected_disk.tweak('A_COPY/mu', contents='Changed on the branch.')
347
346
 
348
347
  # Update the wcs.
350
349
  expected_status.tweak(wc_rev='7')
351
350
  svntest.actions.run_and_verify_update(wc_dir, expected_output,
352
351
                                        expected_disk, expected_status,
353
 
                                        None, None, None, None, None, True)
 
352
                                        check_props=True)
354
353
 
355
354
  # Merge from trunk to branch (ie, r3-6), using normal cherry-harvest.
356
355
  A_COPY_path = sbox.ospath('A_COPY')
416
415
                                       k_expected_disk,
417
416
                                       k_expected_status,
418
417
                                       expected_skip,
419
 
                                       None, None, None, None,
420
 
                                       None, True)
 
418
                                       [], True)
421
419
  expected_disk.tweak('A_COPY', props={SVN_PROP_MERGEINFO: '/A:2-7'})
422
420
  expected_disk.tweak('A_COPY/B/E/beta', contents="New content")
423
421
  expected_disk.tweak('A_COPY/D/G/rho', contents="New content")
435
433
  expected_status.tweak('A_COPY', 'A_COPY/D/H/psi', 'A_COPY/D/G/rho',
436
434
                        'A_COPY/B/E/beta', 'A_COPY/D/H/omega', wc_rev=8)
437
435
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
438
 
                                        expected_status, None, wc_dir)
 
436
                                        expected_status)
439
437
 
440
438
 
441
439
  # Update the wcs again.
473
471
  expected_status.tweak(wc_rev='8')
474
472
  svntest.actions.run_and_verify_update(wc_dir, expected_output,
475
473
                                        expected_disk, expected_status,
476
 
                                        None, None, None, None, None, True)
 
474
                                        check_props=True)
477
475
 
478
476
  # Make another change on the branch: copy tau to tauprime.  Commit
479
477
  # in r9.
480
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
478
  svntest.actions.run_and_verify_svn(None, [], 'cp',
481
479
                                     sbox.repo_url + '/A_COPY/D/G/tau',
482
480
                                     sbox.repo_url + '/A_COPY/D/G/tauprime',
483
481
                                     '-m',
499
497
  expected_status.tweak(wc_rev='9')
500
498
  svntest.actions.run_and_verify_update(wc_dir, expected_output,
501
499
                                        expected_disk, expected_status,
502
 
                                        None, None, None, None, None, True)
 
500
                                        check_props=True)
503
501
 
504
502
  # *finally*, actually run merge --reintegrate in trunk with the
505
503
  # branch URL.  This should bring in the mu change and the tauprime
552
550
                                       k_expected_disk,
553
551
                                       k_expected_status,
554
552
                                       expected_skip,
555
 
                                       None, True, True)
 
553
                                       [], True, True)
556
554
 
557
555
  # Finally, commit the result of the merge (r10).
558
556
  expected_output = wc.State(wc_dir, {
565
563
    })
566
564
  expected_status.tweak('A', 'A/mu', wc_rev=10)
567
565
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
568
 
                                        expected_status, None, wc_dir)
 
566
                                        expected_status)
569
567
 
570
568
#----------------------------------------------------------------------
 
569
@SkipUnless(server_has_mergeinfo)
571
570
def reintegrate_branch_never_merged_to(sbox):
572
571
  "merge --reintegrate on a never-updated branch"
573
572
 
582
581
  expected_output = wc.State(wc_dir, {'A_COPY/mu' : Item(verb='Sending')})
583
582
  expected_status.tweak('A_COPY/mu', wc_rev=7)
584
583
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
585
 
                                        expected_status, None, wc_dir)
 
584
                                        expected_status)
586
585
  expected_disk.tweak('A_COPY/mu', contents='Changed on the branch.')
587
586
 
588
587
  # Update the wcs.
590
589
  expected_status.tweak(wc_rev='7')
591
590
  svntest.actions.run_and_verify_update(wc_dir, expected_output,
592
591
                                        expected_disk, expected_status,
593
 
                                        None, None, None, None, None, True)
 
592
                                        check_props=True)
594
593
 
595
594
  # Make another change on the branch: copy tau to tauprime.  Commit
596
595
  # in r8.
597
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
596
  svntest.actions.run_and_verify_svn(None, [], 'cp',
598
597
                                     os.path.join(wc_dir, 'A_COPY', 'D', 'G',
599
598
                                                  'tau'),
600
599
                                     os.path.join(wc_dir, 'A_COPY', 'D', 'G',
604
603
    })
605
604
  expected_status.add({'A_COPY/D/G/tauprime': Item(status='  ', wc_rev=8)})
606
605
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
607
 
                                        expected_status, None, wc_dir)
 
606
                                        expected_status)
608
607
  expected_disk.add({
609
608
    'A_COPY/D/G/tauprime' : Item(contents="This is the file 'tau'.\n")
610
609
    })
615
614
  expected_status.tweak(wc_rev='8')
616
615
  svntest.actions.run_and_verify_update(wc_dir, expected_output,
617
616
                                        expected_disk, expected_status,
618
 
                                        None, None, None, None, None, True)
 
617
                                        check_props=True)
619
618
 
620
619
  # *finally*, actually run merge --reintegrate in trunk with the
621
620
  # branch URL.  This should bring in the mu change and the tauprime
683
682
                                       k_expected_disk,
684
683
                                       k_expected_status,
685
684
                                       expected_skip,
686
 
                                       None, True, True)
 
685
                                       [], True, True)
687
686
 
688
687
  # Finally, commit the result of the merge (r9).
689
688
  expected_output = wc.State(wc_dir, {
696
695
    })
697
696
  expected_status.tweak('A', 'A/mu', wc_rev=9)
698
697
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
699
 
                                        expected_status, None, wc_dir)
 
698
                                        expected_status)
700
699
 
701
700
#----------------------------------------------------------------------
 
701
@SkipUnless(server_has_mergeinfo)
702
702
def reintegrate_fail_on_modified_wc(sbox):
703
703
  "merge --reintegrate should fail in modified wc"
704
704
  sbox.build()
714
714
  sbox.simple_commit()
715
715
 
716
716
  svntest.main.file_write(mu_path, "Changed on 'trunk' (the merge target).")
 
717
  expected_skip =  wc.State(wc_dir, {})
717
718
  sbox.simple_update() # avoid mixed-revision error
718
719
  run_and_verify_reintegrate(
719
720
    A_path, sbox.repo_url + '/A_COPY', None, None, None,
720
 
    None, None, None,
 
721
    None, None, expected_skip,
721
722
    ".*Cannot merge into a working copy that has local modifications.*",
722
723
    True, False)
723
724
 
724
725
#----------------------------------------------------------------------
 
726
@SkipUnless(server_has_mergeinfo)
725
727
def reintegrate_fail_on_mixed_rev_wc(sbox):
726
728
  "merge --reintegrate should fail in mixed-rev wc"
727
729
  sbox.build()
736
738
    })
737
739
  expected_status.tweak('A/mu', wc_rev=7)
738
740
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
739
 
                                        expected_status, None, wc_dir)
 
741
                                        expected_status)
 
742
  expected_skip = wc.State(wc_dir, {})
740
743
  # Try merging into that same wc, expecting failure.
741
744
  run_and_verify_reintegrate(
742
745
    A_path, sbox.repo_url + '/A_COPY', None, None, None,
743
 
    None, None, None,
 
746
    None, None, expected_skip,
744
747
    ".*Cannot merge into mixed-revision working copy.*",
745
748
    True, False)
746
749
 
747
750
#----------------------------------------------------------------------
 
751
@SkipUnless(server_has_mergeinfo)
748
752
def reintegrate_fail_on_switched_wc(sbox):
749
753
  "merge --reintegrate should fail in switched wc"
750
754
  sbox.build()
801
805
                                        expected_output,
802
806
                                        expected_disk,
803
807
                                        expected_status,
804
 
                                        None, None, None, None, None,
 
808
                                        [],
805
809
                                        False, '--ignore-ancestry')
806
810
  sbox.simple_update() # avoid mixed-revision error
 
811
  expected_skip = wc.State(wc_dir, {})
807
812
  run_and_verify_reintegrate(
808
813
    A_path, sbox.repo_url + '/A_COPY', None, None, None,
809
 
    None, None, None,
 
814
    None, None, expected_skip,
810
815
    ".*Cannot merge into a working copy with a switched subtree.*",
811
816
    True, False)
812
817
 
813
818
#----------------------------------------------------------------------
814
819
# Test for issue #3603 'allow reintegrate merges into WCs with
815
820
# missing subtrees'.
 
821
@SkipUnless(server_has_mergeinfo)
816
822
@Issue(3603)
817
823
def reintegrate_on_shallow_wc(sbox):
818
824
  "merge --reintegrate in shallow wc"
840
846
  # depth of A/D to empty.  Since the only change made on the branch
841
847
  # since the branch point is to A_COPY/mu, the reintegrate should
842
848
  # simply work and update A/mu with the branch's contents.
843
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
844
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up',
 
849
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
850
  svntest.actions.run_and_verify_svn(None, [], 'up',
845
851
                                     '--set-depth', 'empty', A_D_path)
846
852
  expected_output = wc.State(A_path, {
847
853
    'mu' : Item(status='U '),
886
892
                                       expected_A_disk,
887
893
                                       expected_A_status,
888
894
                                       expected_A_skip,
889
 
                                       None, 1, 1)
 
895
                                       [], 1, 1)
890
896
 
891
897
  # Now revert the reintegrate and make a second change on the
892
898
  # branch in r4, but this time change a subtree that corresponds
893
899
  # to the missing (shallow) portion of the source.  The reintegrate
894
900
  # should still succeed.
895
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
901
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
896
902
  svntest.main.file_write(psi_COPY_path, "more branch work")
897
903
  svntest.main.run_svn(None, 'commit', '-m',
898
904
                       'Some more work on the A_COPY branch', wc_dir)
923
929
                                       expected_A_disk,
924
930
                                       expected_A_status,
925
931
                                       expected_A_skip,
926
 
                                       None, 1, 1)
 
932
                                       [], 1, 1)
927
933
 
928
934
#----------------------------------------------------------------------
929
935
@SkipUnless(server_has_mergeinfo)
935
941
  A_path = sbox.ospath('A')
936
942
  mu_path = os.path.join(A_path, "mu")
937
943
  svntest.main.file_append(mu_path, 'some text appended to mu\n')
938
 
  svntest.actions.run_and_verify_svn(None, None, [], 'commit',
 
944
  svntest.actions.run_and_verify_svn(None, [], 'commit',
939
945
                                     '-m', 'a change to mu', mu_path)
940
946
  # Unmix the revisions in the working copy.
941
 
  svntest.actions.run_and_verify_svn(None, None, [], 'update', wc_dir)
 
947
  svntest.actions.run_and_verify_svn(None, [], 'update', wc_dir)
942
948
  # The merge --reintegrate succeeds but since there were no changes
943
949
  # on A_COPY after it was branched the only result is updated mergeinfo
944
950
  # on the reintegrate target.
1003
1009
                                       [], True, True)
1004
1010
 
1005
1011
#----------------------------------------------------------------------
 
1012
@SkipUnless(server_has_mergeinfo)
1006
1013
def merge_file_with_space_in_its_path(sbox):
1007
1014
  "merge a file with space in its path"
1008
1015
 
1016
1023
  os.mkdir(some_dir)
1017
1024
  svntest.main.file_append(file1, "Initial text in the file.\n")
1018
1025
  svntest.main.run_svn(None, "add", some_dir)
1019
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1026
  svntest.actions.run_and_verify_svn(None, [],
1020
1027
                                     "ci", "-m", "r2", wc_dir)
1021
1028
 
1022
1029
  # Make r3.
1023
1030
  svntest.main.run_svn(None, "copy", file1, file2)
1024
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1031
  svntest.actions.run_and_verify_svn(None, [],
1025
1032
                                     "ci", "-m", "r3", wc_dir)
1026
1033
 
1027
1034
  # Make r4.
1028
1035
  svntest.main.file_append(file2, "Next line of text in the file.\n")
1029
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1036
  svntest.actions.run_and_verify_svn(None, [],
1030
1037
                                     "ci", "-m", "r4", wc_dir)
1031
1038
 
1032
1039
  target_url = sbox.repo_url + '/some%20dir/file2'
1096
1103
  expected_output = wc.State(wc_dir, {'A_COPY_3/D/gamma' : Item(verb='Sending')})
1097
1104
  expected_status.tweak('A_COPY_3/D/gamma', wc_rev=9)
1098
1105
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1099
 
                                        expected_status, None, wc_dir)
 
1106
                                        expected_status)
1100
1107
 
1101
1108
  # r10 - Merge r9 from A_COPY_3/D to A/D, creating explicit subtree
1102
1109
  # mergeinfo under A.  For this and every subsequent merge we update the WC
1103
1110
  # first to allow full inheritance and elision.
1104
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(9), [], 'up',
 
1111
  svntest.actions.run_and_verify_svn(exp_noop_up_out(9), [], 'up',
1105
1112
                                     wc_dir)
1106
1113
  expected_status.tweak(wc_rev=9)
1107
1114
  svntest.actions.run_and_verify_svn(
1108
 
    None,
1109
1115
    expected_merge_output([[9]],
1110
1116
                          ['U    ' + gamma_path + '\n',
1111
1117
                           ' U   ' + D_path     + '\n',]),
1115
1121
                              'A/D/gamma' : Item(verb='Sending')})
1116
1122
  expected_status.tweak('A/D', 'A/D/gamma', wc_rev=10)
1117
1123
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1118
 
                                        expected_status, None, wc_dir)
 
1124
                                        expected_status)
1119
1125
 
1120
1126
  # r11 - Make a text change to A_COPY_2/mu
1121
1127
  svntest.main.file_write(mu_COPY_2_path, "New content")
1122
1128
  expected_output = wc.State(wc_dir, {'A_COPY_2/mu' : Item(verb='Sending')})
1123
1129
  expected_status.tweak('A_COPY_2/mu', wc_rev=11)
1124
1130
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1125
 
                                        expected_status, None, wc_dir)
 
1131
                                        expected_status)
1126
1132
 
1127
1133
  # r12 - Merge r11 from A_COPY_2/mu to A_COPY/mu
1128
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(11), [], 'up',
 
1134
  svntest.actions.run_and_verify_svn(exp_noop_up_out(11), [], 'up',
1129
1135
                                     wc_dir)
1130
1136
  expected_status.tweak(wc_rev=11)
1131
1137
  svntest.actions.run_and_verify_svn(
1132
 
    None,
1133
1138
    expected_merge_output([[11]],
1134
1139
                          ['U    ' + mu_COPY_path + '\n',
1135
1140
                           ' U   ' + mu_COPY_path + '\n',]),
1138
1143
                             {'A_COPY/mu' : Item(verb='Sending')})
1139
1144
  expected_status.tweak('A_COPY/mu', wc_rev=12)
1140
1145
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1141
 
                                        expected_status, None, wc_dir)
 
1146
                                        expected_status)
1142
1147
 
1143
1148
  # r13 - Do a 'synch' cherry harvest merge of all available revisions
1144
1149
  # from A to A_COPY
1145
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(12), [], 'up',
 
1150
  svntest.actions.run_and_verify_svn(exp_noop_up_out(12), [], 'up',
1146
1151
                                     wc_dir)
1147
1152
  expected_status.tweak(wc_rev=12)
1148
1153
  svntest.actions.run_and_verify_svn(
1149
 
    None,
1150
1154
    expected_merge_output([[2,12]],
1151
1155
                          ['U    ' + beta_COPY_path  + '\n',
1152
1156
                           'U    ' + gamma_COPY_path + '\n',
1176
1180
                        'A_COPY/D/gamma',
1177
1181
                        wc_rev=13)
1178
1182
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1179
 
                                        expected_status, None, wc_dir)
 
1183
                                        expected_status)
1180
1184
 
1181
1185
  # r14 - Make a text change on A_COPY/B/E/alpha
1182
1186
  svntest.main.file_write(alpha_COPY_path, "New content")
1183
1187
  expected_output = wc.State(wc_dir, {'A_COPY/B/E/alpha' : Item(verb='Sending')})
1184
1188
  expected_status.tweak('A_COPY/B/E/alpha', wc_rev=14)
1185
1189
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1186
 
                                        expected_status, None, wc_dir)
 
1190
                                        expected_status)
1187
1191
 
1188
1192
  # Now, reintegrate A_COPY to A.  This should succeed.
1189
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(14), [], 'up',
 
1193
  svntest.actions.run_and_verify_svn(exp_noop_up_out(14), [], 'up',
1190
1194
                                     wc_dir)
1191
1195
  expected_status.tweak(wc_rev=14)
1192
1196
  expected_output = wc.State(A_path, {
1256
1260
                                       expected_A_disk,
1257
1261
                                       expected_A_status,
1258
1262
                                       expected_A_skip,
1259
 
                                       None, 1, 1)
 
1263
                                       [], 1, 1)
1260
1264
 
1261
1265
  # Make some more changes to A_COPY so that the same revisions have *not*
1262
1266
  # been uniformly applied from A to A_COPY.  In this case the reintegrate
1275
1279
  #   A_COPY_2        3-------------[11]--
1276
1280
 
1277
1281
  # First revert the previous reintegrate merge
1278
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1282
  svntest.actions.run_and_verify_svn(None, [],
1279
1283
                                     'revert', '-R', wc_dir)
1280
1284
 
1281
1285
  # r15 - Reverse Merge r8 from A/D to A_COPY/D.
1282
1286
  svntest.actions.run_and_verify_svn(
1283
 
    None,
1284
1287
    expected_merge_output([[-8]],
1285
1288
                          ['U    ' + omega_COPY_path + '\n',
1286
1289
                           ' U   ' + D_COPY_path     + '\n',]),
1290
1293
                              'A_COPY/D/H/omega' : Item(verb='Sending')})
1291
1294
  expected_status.tweak('A_COPY/D', 'A_COPY/D/H/omega', wc_rev=15)
1292
1295
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1293
 
                                        expected_status, None, wc_dir)
 
1296
                                        expected_status)
1294
1297
 
1295
1298
  # Now reintegrate A_COPY back to A.  Since A_COPY/D no longer has r8 merged
1296
1299
  # to it from A, the merge should fail.  Further we expect an error message
1325
1328
  #
1326
1329
  #   D) Synch merge the changes in C) from 'trunk' to 'branch' and commit in
1327
1330
  #      rev N+3.  The renamed subtree on 'branch' now has additional explicit
1328
 
  #      mergeinfo decribing the synch merge from trunk@N+1 to trunk@N+2.
 
1331
  #      mergeinfo describing the synch merge from trunk@N+1 to trunk@N+2.
1329
1332
  #
1330
1333
  #   E) Reintegrate 'branch' to 'trunk'.
1331
1334
  #
1345
1348
  # r874258 WC-to-WC moves won't create mergeinfo on the dest if the source
1346
1349
  # doesn't have any.  So do a repos-to-repos move so explicit mergeinfo
1347
1350
  # *is* created on the destination.
1348
 
  svntest.actions.run_and_verify_svn(None, None,[], 'move',
 
1351
  svntest.actions.run_and_verify_svn(None,[], 'move',
1349
1352
                                     sbox.repo_url + '/A/D/gamma',
1350
1353
                                     sbox.repo_url + '/A/D/gamma_moved',
1351
1354
                                     '-m', 'REPOS-to-REPOS move'
1352
1355
                                     )
1353
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
1356
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
1354
1357
  expected_status.tweak(wc_rev=16)
1355
1358
  expected_status.remove('A/D/gamma')
1356
1359
  expected_status.add({'A/D/gamma_moved' : Item(status='  ', wc_rev=16)})
1365
1368
  # behavior pass.
1366
1369
  # r17 - B) Synch merge from A to A_COPY
1367
1370
  svntest.actions.run_and_verify_svn(
1368
 
    None,
1369
1371
    expected_merge_output([[8], [13,16], [2,16]],
1370
1372
                          ['U    ' + omega_COPY_path + '\n',
1371
1373
                           'A    ' + gamma_moved_COPY_path + '\n',
1391
1393
                        wc_rev=17)
1392
1394
  expected_status.add({'A_COPY/D/gamma_moved' : Item(status='  ', wc_rev=17)})
1393
1395
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1394
 
                                        expected_status, None, wc_dir)
 
1396
                                        expected_status)
1395
1397
 
1396
1398
  # r18 - C) Text mod to A/D/gamma_moved
1397
1399
  svntest.main.file_write(gamma_moved_path, "Even newer content")
1398
1400
  expected_output = wc.State(wc_dir, {'A/D/gamma_moved' : Item(verb='Sending')})
1399
1401
  expected_status.tweak('A/D/gamma_moved', wc_rev=18)
1400
1402
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1401
 
                                        expected_status, None, wc_dir)
 
1403
                                        expected_status)
1402
1404
 
1403
1405
  # r19 - D) Synch merge from A to A_COPY
1404
1406
  svntest.actions.run_and_verify_svn(
1405
 
    None,
1406
1407
    expected_merge_output([[17,18], [2,18]],
1407
1408
                          ['U    ' + gamma_moved_COPY_path + '\n',
1408
1409
                           ' U   ' + A_COPY_path + '\n',
1420
1421
                        'A_COPY/D/gamma_moved',
1421
1422
                        wc_rev=19)
1422
1423
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1423
 
                                        expected_status, None, wc_dir)
 
1424
                                        expected_status)
1424
1425
 
1425
1426
  # Reintegrate A_COPY to A, this should work since
1426
1427
  # A_COPY/D/gamma_moved's natural history,
1430
1431
  #   /A_COPY/D/gamma_moved:17-19
1431
1432
  #
1432
1433
  # shows that it is fully synched up with trunk.
1433
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(19), [], 'up',
 
1434
  svntest.actions.run_and_verify_svn(exp_noop_up_out(19), [], 'up',
1434
1435
                                     wc_dir)
1435
1436
  expected_output = wc.State(A_path, {
1436
1437
    'B/E/alpha'     : Item(status='U '),
1528
1529
                                       expected_A_disk,
1529
1530
                                       expected_A_status,
1530
1531
                                       expected_A_skip,
1531
 
                                       None, 1, 1)
 
1532
                                       [], 1, 1)
1532
1533
 
1533
1534
#----------------------------------------------------------------------
1534
1535
@SkipUnless(server_has_mergeinfo)
1555
1556
  # the reintegrate target.
1556
1557
  #
1557
1558
  # r7 - Create the feature branch.
1558
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
1559
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1559
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
1560
  svntest.actions.run_and_verify_svn(None, [],
1560
1561
                                     'copy', A_path, Feature_branch_path)
1561
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1562
  svntest.actions.run_and_verify_svn(None, [],
1562
1563
                                     'ci', '-m', 'Make a feature branch',
1563
1564
                                     wc_dir)
1564
1565
 
1565
1566
  # r8 - Make a change under 'A'.
1566
1567
  svntest.main.file_write(mu_path, "New trunk content.\n")
1567
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
1568
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
1568
1569
                                     "A text change under 'A'",
1569
1570
                                     wc_dir)
1570
1571
 
1571
1572
  # r9 - Make a change on the feature branch.
1572
1573
  svntest.main.file_write(Feature_beta_path, "New branch content.\n")
1573
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
1574
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
1574
1575
                                     "A text change on the feature branch",
1575
1576
                                     wc_dir)
1576
1577
 
1577
1578
  # r10 - Sync merge all changes from 'A' to the feature branch.
1578
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
1579
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge',
 
1579
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
1580
  svntest.actions.run_and_verify_svn(None, [], 'merge',
1580
1581
                                     sbox.repo_url + '/A',
1581
1582
                                     Feature_branch_path)
1582
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
1583
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
1583
1584
                                     "Sync merge 'A' to feature branch",
1584
1585
                                     wc_dir)
1585
1586
 
1586
1587
  # r11 - Reintegrate the feature branch back to 'A'.
1587
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
1588
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
1588
1589
  run_reintegrate(sbox.repo_url + '/A_FEATURE_BRANCH', A_path)
1589
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
1590
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
1590
1591
                                     "Reintegrate feature branch back to 'A'",
1591
1592
                                     wc_dir)
1592
1593
 
1593
1594
  # r12 - Do a --record-only merge from 'A' to the feature branch so we
1594
1595
  # don't try to merge r11 from trunk during the next sync merge.
1595
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
1596
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c11',
 
1596
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
1597
  svntest.actions.run_and_verify_svn(None, [], 'merge', '-c11',
1597
1598
                                     '--record-only',
1598
1599
                                     sbox.repo_url + '/A',
1599
1600
                                     Feature_branch_path)
1600
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
1601
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
1601
1602
                                     "Sync merge 'A' to feature branch",
1602
1603
                                     wc_dir)
1603
1604
 
1604
1605
  # r13 - Make another change on the feature branch.
1605
1606
  svntest.main.file_write(Feature_beta_path, "Even newer branch content.\n")
1606
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
1607
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
1607
1608
                                     "Different text on the feature branch",
1608
1609
                                     wc_dir)
1609
1610
 
1610
1611
  # r14 - Sync merge all changes from 'A' to the feature branch in
1611
1612
  # preparation for a second reintegrate from this branch.
1612
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
1613
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge',
 
1613
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
1614
  svntest.actions.run_and_verify_svn(None, [], 'merge',
1614
1615
                                     sbox.repo_url + '/A',
1615
1616
                                     Feature_branch_path)
1616
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
1617
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
1617
1618
                                     "2nd Sync merge 'A' to feature branch",
1618
1619
                                     wc_dir)
1619
1620
 
1620
1621
  # r15 - Reintegrate the feature branch back to 'A' a second time.
1621
1622
  # No self-referential mergeinfo should be applied on 'A'.
1622
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
1623
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
1623
1624
  expected_output = wc.State(A_path, {
1624
1625
     #'' : Item(status=' U'), #<-- no self-referential mergeinfo applied!
1625
1626
    'B/E/beta' : Item(status='U '),
1685
1686
                                       expected_disk,
1686
1687
                                       expected_status,
1687
1688
                                       expected_skip,
1688
 
                                       None, 1, 1)
1689
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
1689
                                       [], 1, 1)
 
1690
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
1690
1691
                                     "2nd Reintegrate feature branch back to 'A'",
1691
1692
                                     wc_dir)
1692
1693
 
1693
1694
  # Demonstrate the danger of any self-referential mergeinfo on trunk.
1694
1695
  #
1695
1696
  # Merge all available revisions except r3 from 'A' to 'A_COPY'.
1696
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
1697
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-r3:HEAD',
 
1697
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
1698
  svntest.actions.run_and_verify_svn(None, [], 'merge', '-r3:HEAD',
1698
1699
                                     sbox.repo_url + '/A',
1699
1700
                                     A_COPY_path)
1700
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
1701
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
1701
1702
                                     "Merge -r3:HEAD from 'A' to 'A_COPY'",
1702
1703
                                     wc_dir)
1703
1704
  # No self-referential mergeinfo should have been carried on 'A_COPY' from
1704
1705
  # 'A' that would prevent the following merge from being operative.
1705
1706
  svntest.actions.run_and_verify_svn(
1706
 
    None,
1707
1707
    expected_merge_output([[2,3],[2,16]],
1708
1708
                          ['U    ' + psi_COPY_path + '\n',
1709
1709
                           ' U   ' + A_COPY_path   + '\n',]),
1716
1716
#
1717
1717
# Also tests Issue #3591 'reintegrate merges update subtree mergeinfo
1718
1718
# unconditionally'.
 
1719
@SkipUnless(server_has_mergeinfo)
1719
1720
@Issue(3591)
1720
1721
def reintegrate_with_self_referential_mergeinfo(sbox):
1721
1722
  "source has target's history as explicit mergeinfo"
1735
1736
 
1736
1737
  # r6 Copy A to A2 and then manually set some self-referential mergeinfo on
1737
1738
  # A2/B and A2.
1738
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(5), [],
 
1739
  svntest.actions.run_and_verify_svn(exp_noop_up_out(5), [],
1739
1740
                                     'up', wc_dir)
1740
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1741
  svntest.actions.run_and_verify_svn(None, [],
1741
1742
                                     'copy', A_path, A2_path)
1742
1743
  # /A:3 describes A2's natural history, a.k.a. it's implicit mergeinfo, so
1743
1744
  # it is self-referential.  Same for /A/B:4 and A2/B.  Normally this is
1744
1745
  # redundant but not harmful.
1745
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1746
  svntest.actions.run_and_verify_svn(None, [],
1746
1747
                                     'ps', 'svn:mergeinfo', '/A:3', A2_path)
1747
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1748
  svntest.actions.run_and_verify_svn(None, [],
1748
1749
                                     'ps', 'svn:mergeinfo', '/A/B:4', A2_B_path)
1749
1750
  svntest.actions.run_and_verify_svn(
1750
 
    None, None, [], 'ci', '-m',
 
1751
    None, [], 'ci', '-m',
1751
1752
    'copy A to A2 and set some self-referential mergeinfo on the latter.',
1752
1753
    wc_dir)
1753
1754
 
1754
1755
  # r7 Copy A2 to A2.1
1755
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1756
  svntest.actions.run_and_verify_svn(None, [],
1756
1757
                                     'copy', A2_path, A2_1_path)
1757
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci',
 
1758
  svntest.actions.run_and_verify_svn(None, [], 'ci',
1758
1759
                                     '-m', 'copy A2to A2.1.', wc_dir)
1759
1760
 
1760
1761
  # r8 Make a change on A2.1/mu
1761
1762
  svntest.main.file_write(A2_1_mu_path, 'New A2.1 stuff')
1762
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci',
 
1763
  svntest.actions.run_and_verify_svn(None, [], 'ci',
1763
1764
                                     '-m', 'Work done on the A2.1 branch.',
1764
1765
                                     wc_dir)
1765
1766
 
1766
1767
  # Update to uniform revision and reintegrate A2.1 back to A2.
1767
1768
  # Note that the mergeinfo on A2/B is not changed by the reintegration
1768
1769
  # and so is not expected to by updated to describe the merge.
1769
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(8), [],
 
1770
  svntest.actions.run_and_verify_svn(exp_noop_up_out(8), [],
1770
1771
                                     'up', wc_dir)
1771
1772
  expected_output = wc.State(A2_path, {
1772
1773
    'mu' : Item(status='U '),
1841
1842
                                       expected_disk,
1842
1843
                                       expected_status,
1843
1844
                                       expected_skip,
1844
 
                                       None, 1, 0)
 
1845
                                       [], 1, 0)
1845
1846
 
1846
1847
#----------------------------------------------------------------------
1847
1848
# Test for issue #3577 '1.7 subtree mergeinfo recording breaks reintegrate'
1877
1878
  # from A to A_COPY, but do it via subtree merges so the mergeinfo
1878
1879
  # record of the merges insn't neatly reflected in the root of the
1879
1880
  # branch.  Commit the merge as r8.
1880
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
1881
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c5',
 
1881
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
1882
  svntest.actions.run_and_verify_svn(None, [], 'merge', '-c5',
1882
1883
                                     sbox.repo_url + '/A/B',
1883
1884
                                     B_COPY_path)
1884
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c4',
 
1885
  svntest.actions.run_and_verify_svn(None, [], 'merge', '-c4',
1885
1886
                                     sbox.repo_url + '/A/D/G/rho',
1886
1887
                                     rho_COPY_path)
1887
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c3',
 
1888
  svntest.actions.run_and_verify_svn(None, [], 'merge', '-c3',
1888
1889
                                     sbox.repo_url + '/A/D/H',
1889
1890
                                     H_COPY_path)
1890
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c6',
 
1891
  svntest.actions.run_and_verify_svn(None, [], 'merge', '-c6',
1891
1892
                                     sbox.repo_url + '/A',
1892
1893
                                     A_COPY_path)
1893
 
  svntest.actions.run_and_verify_svn(None, None, [], 'commit', '-m',
 
1894
  svntest.actions.run_and_verify_svn(None, [], 'commit', '-m',
1894
1895
                                     'Merge everything from A to A_COPY',
1895
1896
                                     wc_dir)
1896
1897
 
1915
1916
  #        Missing ranges: /A/D/G/rho:2-3,5-6
1916
1917
  #      A_COPY/D/H
1917
1918
  #        Missing ranges: /A/D/H:2,4-5
1918
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
1919
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
1919
1920
  expected_output = wc.State(A_path, {
1920
1921
    'mu' : Item(status='U '),
1921
1922
    })
1976
1977
                             expected_A_disk,
1977
1978
                             expected_A_status,
1978
1979
                             expected_A_skip,
1979
 
                             None, 1, 1)
 
1980
                             [], 1, 1)
1980
1981
 
1981
1982
  # Test issue #4329.  Revert previous merge and commit a new edit to
1982
1983
  # A/D/H/psi. Attempt the same merge without the --reintegrate option.
1983
1984
  # It should succeed because the automatic merge code should detect that
1984
1985
  # a reintegrate-style merge is required, that merge should succeed and
1985
1986
  # there should be not conflict on A/D/H/psi.
1986
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
1987
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
1987
1988
  svntest.main.file_write(psi_path, "Non-conflicting trunk edit.\n")
1988
1989
  svntest.main.run_svn(None, 'commit', '-m',
1989
1990
                       'An edit on trunk prior to reintegrate.', wc_dir)
1997
1998
                                       expected_mergeinfo_output,
1998
1999
                                       expected_elision_output,
1999
2000
                                       expected_A_disk, expected_A_status,
2000
 
                                       expected_A_skip, None, None, None,
2001
 
                                       None, None, True, False, A_path)
 
2001
                                       expected_A_skip,
 
2002
                                       [], True, False, A_path)
2002
2003
 
2003
2004
#----------------------------------------------------------------------
2004
2005
# Test for issue #3654 'added subtrees with mergeinfo break reintegrate'.
 
2006
@SkipUnless(server_has_mergeinfo)
2005
2007
@Issue(3654)
2006
2008
def added_subtrees_with_mergeinfo_break_reintegrate(sbox):
2007
2009
  "added subtrees with mergeinfo break reintegrate"
2024
2026
 
2025
2027
  # r8 - Add a new file A_COPY_2/C/nu.
2026
2028
  svntest.main.file_write(nu_COPY_2_path, "This is the file 'nu'.\n")
2027
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_COPY_2_path)
2028
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci',
 
2029
  svntest.actions.run_and_verify_svn(None, [], 'add', nu_COPY_2_path)
 
2030
  svntest.actions.run_and_verify_svn(None, [], 'ci',
2029
2031
                                     '-m', 'Add new file in A_COPY_2 branch',
2030
2032
                                     wc_dir)
2031
2033
 
2032
2034
 
2033
2035
  # r9 - Cyclic cherry pick merge r8 from A_COPY_2 back to A.
2034
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
2035
 
  svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
 
2036
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
2037
  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
2036
2038
                                     'merge', '-c', '8',
2037
2039
                                     sbox.repo_url + '/A_COPY_2',
2038
2040
                                     A_path)
2039
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci',
 
2041
  svntest.actions.run_and_verify_svn(None, [], 'ci',
2040
2042
                                     '-m', 'Merge r8 from A_COPY_2 to A.',
2041
2043
                                     wc_dir)
2042
2044
 
2043
2045
  # r10 - Make an edit to A_COPY_2/C/nu.
2044
2046
  svntest.main.file_write(nu_COPY_2_path, "A_COPY_2 edit to file 'nu'.\n")
2045
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci',
 
2047
  svntest.actions.run_and_verify_svn(None, [], 'ci',
2046
2048
                                     '-m', 'Edit new file on A_COPY_2 branch',
2047
2049
                                     wc_dir)
2048
2050
 
2049
2051
  # r11 - Cyclic subtree cherry pick merge r10 from A_COPY_2/C/nu
2050
2052
  # back to A/C/nu.
2051
 
  svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
 
2053
  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
2052
2054
                                     'merge', '-c', '10',
2053
2055
                                     sbox.repo_url + '/A_COPY_2/C/nu',
2054
2056
                                     nu_path)
2055
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
2057
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
2056
2058
                                     'Merge r8 from A_COPY_2/C/nu to A/C/nu.',
2057
2059
                                     wc_dir)
2058
2060
 
2059
2061
  # r12 - Edit under A_COPY.
2060
2062
  svntest.main.file_write(mu_path, "mu edits on A_COPY.\n")
2061
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci',
 
2063
  svntest.actions.run_and_verify_svn(None, [], 'ci',
2062
2064
                                     '-m', 'Work on A_COPY branch.',
2063
2065
                                     wc_dir)
2064
2066
 
2065
2067
  # r13 - Sync merge A to A_COPY in preparation for reintegrate.
2066
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
2067
 
  svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
 
2068
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
2069
  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
2068
2070
                                     'merge', sbox.repo_url + '/A', A_COPY_path)
2069
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
2071
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
2070
2072
                                     'Prep for reintegrate: Sync A to A_COPY.',
2071
2073
                                     wc_dir)
2072
2074
 
2073
2075
  # r14 - Reintegrate A_COPY to A.
2074
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
2076
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2075
2077
  run_reintegrate(sbox.repo_url + '/A_COPY', A_path)
2076
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
2078
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
2077
2079
                                     'Reintegrate A_COPY to A.',
2078
2080
                                     wc_dir)
2079
2081
 
2080
2082
  # r15 - Delete A_COPY.
2081
 
  svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
 
2083
  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
2082
2084
                                     'delete', A_COPY_path)
2083
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
2085
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
2084
2086
                                     'Delete A_COPY branch', wc_dir)
2085
2087
 
2086
2088
  # r16 - Create new A_COPY from A@HEAD=15.
2087
2089
  #
2088
2090
  # Update so we copy HEAD:
2089
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
2090
 
  svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
 
2091
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
2092
  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
2091
2093
                                     'copy', A_path, A_COPY_path)
2092
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
2094
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
2093
2095
                                     'Create new A_COPY branch from A', wc_dir)
2094
2096
 
2095
2097
  # r17 - Unrelated edits under both A and A_COPY.
2096
2098
  svntest.main.file_write(nu_path, "Trunk work on nu.\n")
2097
2099
  svntest.main.file_write(lambda_COPY_path, "lambda edit on A_COPY.\n")
2098
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
2100
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
2099
2101
                                     'Unrelated edits on A and A_COPY branch.',
2100
2102
                                     wc_dir)
2101
2103
 
2102
2104
  # r18 - Sync A to A_COPY in preparation for another reintegrate.
2103
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
2104
 
  svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
 
2105
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
2106
  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
2105
2107
                                     'merge', sbox.repo_url + '/A', A_COPY_path)
2106
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
2108
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
2107
2109
                                     'Prep for reintegrate: Sync A to A_COPY.',
2108
2110
                                     wc_dir)
2109
2111
 
2110
2112
  # Reintegrate A_COPY back to A.  We just synced A_COPY with A, so this
2111
2113
  # should work.  The only text change should be the change made to
2112
2114
  # A_COPY/B/lambda in r17 after the new A_COPY was created.
2113
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
2115
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2114
2116
  expected_output = wc.State(A_path, {
2115
2117
    ''         : Item(status=' U'),
2116
2118
    'B/lambda' : Item(status='U '),
2190
2192
                                       expected_disk,
2191
2193
                                       expected_status,
2192
2194
                                       expected_skip,
2193
 
                                       None, 1, 1)
 
2195
                                       [], 1, 1)
2194
2196
 
2195
2197
#----------------------------------------------------------------------
2196
2198
# Test for issue #3648 '2-URL merges incorrectly reverse-merge mergeinfo
2197
2199
# for merge target'.
 
2200
@SkipUnless(server_has_mergeinfo)
2198
2201
@Issue(3648)
2199
2202
def two_URL_merge_removes_valid_mergeinfo_from_target(sbox):
2200
2203
  "2-URL merge removes valid mergeinfo from target"
2215
2218
 
2216
2219
  # r8 - A simple text edit on the A_COPY branch.
2217
2220
  svntest.main.file_write(lambda_COPY_path, "Edit on 'branch 1'.\n")
2218
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci',
 
2221
  svntest.actions.run_and_verify_svn(None, [], 'ci',
2219
2222
                                     '-m', "Work on 'branch 1'.",
2220
2223
                                     wc_dir)
2221
2224
 
2222
2225
  # r9 - Sync the A_COPY branch with A up the HEAD (r8).  Now A_COPY
2223
2226
  # differs from A only by the change made in r8 and by the mergeinfo
2224
2227
  # '/A:2-8' on A_COPY which was set to describe the merge.
2225
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
2226
 
  svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
 
2228
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
2229
  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
2227
2230
                                     'merge', sbox.repo_url + '/A', A_COPY_path)
2228
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci',
 
2231
  svntest.actions.run_and_verify_svn(None, [], 'ci',
2229
2232
                                     '-m', 'Sync A to A_COPY.',
2230
2233
                                     wc_dir)
2231
2234
 
2232
2235
  # r10 - A simple text edit on our "trunk" A.
2233
2236
  svntest.main.file_write(mu_path, "Edit on 'trunk'.\n")
2234
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci',
 
2237
  svntest.actions.run_and_verify_svn(None, [], 'ci',
2235
2238
                                     '-m', "Work on 'trunk'",
2236
2239
                                     wc_dir)
2237
2240
 
2238
2241
  # r11 - Sync the A_COPY_2 branch with A up to HEAD (r10).
2239
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
2240
 
  svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
 
2242
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
2243
  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [],
2241
2244
                                     'merge', sbox.repo_url + '/A',
2242
2245
                                     A_COPY_2_path)
2243
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci',
 
2246
  svntest.actions.run_and_verify_svn(None, [], 'ci',
2244
2247
                                     '-m', 'Sync A to A_COPY_2.',
2245
2248
                                     wc_dir)
2246
2249
 
2247
2250
  # Confirm that the mergeinfo on each branch is what we expect.
2248
 
  svntest.actions.run_and_verify_svn(None,
2249
 
                                     [A_COPY_path + ' - /A:2-8\n'],
 
2251
  svntest.actions.run_and_verify_svn([A_COPY_path + ' - /A:2-8\n'],
2250
2252
                                     [], 'pg', SVN_PROP_MERGEINFO,
2251
2253
                                     '-R', A_COPY_path)
2252
 
  svntest.actions.run_and_verify_svn(None,
2253
 
                                     [A_COPY_2_path + ' - /A:3-10\n'],
 
2254
  svntest.actions.run_and_verify_svn([A_COPY_2_path + ' - /A:3-10\n'],
2254
2255
                                     [], 'pg', SVN_PROP_MERGEINFO,
2255
2256
                                     '-R', A_COPY_2_path)
2256
2257
 
2285
2286
  #
2286
2287
  # Before issue #3648 was fixed this test failed because the valid mergeinfo
2287
2288
  # '/A:r3-8' on A_COPY_2 was removed by the merge.
2288
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
2289
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2289
2290
  expected_output = wc.State(A_COPY_2_path, {
2290
2291
    ''         : Item(status=' G'),
2291
2292
    'B/lambda' : Item(status='U '),
2349
2350
                                       expected_disk,
2350
2351
                                       expected_status,
2351
2352
                                       expected_skip,
2352
 
                                       None, None, None, None,
2353
 
                                       None, 1, 1)
 
2353
                                       [], True, True)
2354
2354
 
2355
2355
#----------------------------------------------------------------------
2356
2356
# Test for issue #3867 'reintegrate merges create mergeinfo for
2357
2357
# non-existent paths'.
 
2358
@SkipUnless(server_has_mergeinfo)
2358
2359
@Issue(3867)
2359
2360
def reintegrate_creates_bogus_mergeinfo(sbox):
2360
2361
  "reintegrate creates bogus mergeinfo"
2436
2437
                                       expected_mergeinfo_output,
2437
2438
                                       expected_elision_output,
2438
2439
                                       expected_disk, None, expected_skip,
2439
 
                                       None,
 
2440
                                       [],
2440
2441
                                       1, 1)
2441
2442
 
2442
2443
 
2445
2446
# subtree mergeinfo is reintegrated into a target with subtree
2446
2447
# mergeinfo.  Deliberately written in a style that works with the 1.6
2447
2448
# testsuite.
 
2449
@SkipUnless(server_has_mergeinfo)
2448
2450
@Issue(3957)
2449
2451
def no_source_subtree_mergeinfo(sbox):
2450
2452
  "source without subtree mergeinfo"
2516
2518
  svntest.main.run_svn(None, 'update', wc_dir)
2517
2519
 
2518
2520
  # Verify that merge results in no subtree mergeinfo
2519
 
  svntest.actions.run_and_verify_svn(None, [], [], 'propget', 'svn:mergeinfo',
 
2521
  expected_stderr = '.*W200017: Property.*not found'
 
2522
  svntest.actions.run_and_verify_svn([], expected_stderr,
 
2523
                                     'propget', 'svn:mergeinfo',
2520
2524
                                     sbox.repo_url + '/A/B2/E')
2521
2525
 
2522
2526
  # Merge trunk to branch-2
2525
2529
  svntest.main.run_svn(None, 'update', wc_dir)
2526
2530
 
2527
2531
  # Verify that there is still no subtree mergeinfo
2528
 
  svntest.actions.run_and_verify_svn(None, [], [], 'propget', 'svn:mergeinfo',
 
2532
  svntest.actions.run_and_verify_svn([], expected_stderr,
 
2533
                                     'propget', 'svn:mergeinfo',
2529
2534
                                     sbox.repo_url + '/A/B2/E')
2530
2535
 
2531
2536
  # Reintegrate branch-2 to trunk, this fails in 1.6.x from 1.6.13.
2558
2563
                                       expected_output, expected_mergeinfo,
2559
2564
                                       expected_elision, expected_disk,
2560
2565
                                       None, expected_skip,
2561
 
                                       None,
 
2566
                                       [],
2562
2567
                                       1, 1)
2563
2568
 
2564
2569
#----------------------------------------------------------------------
2584
2589
  svntest.main.run_svn(None, 'up', wc_dir)
2585
2590
  svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path,
2586
2591
                       '-c3')
2587
 
  svntest.main.run_svn(None, 'ci', '-m', 'Merge r3 from A to A_COPY', wc_dir)
 
2592
  sbox.simple_commit(message='Merge r3 from A to A_COPY')
2588
2593
 
2589
2594
  # r8 - Merge r4 from A to A_COPY
2590
2595
  svntest.main.run_svn(None, 'up', wc_dir)
2591
2596
  svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path,
2592
2597
                       '-c4')
2593
 
  svntest.main.run_svn(None, 'ci', '-m', 'Merge r4 from A to A_COPY', wc_dir)
 
2598
  sbox.simple_commit(message='Merge r4 from A to A_COPY')
2594
2599
 
2595
2600
  # r9 - Merge r5 from A to A_COPY. Make an additional edit to
2596
2601
  # A_COPY/B/E/beta.
2598
2603
  svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path,
2599
2604
                       '-c5')
2600
2605
  svntest.main.file_write(beta_COPY_path, "Branch edit mistake.\n")
2601
 
  svntest.main.run_svn(None, 'ci', '-m', 'Merge r5 from A to A_COPY', wc_dir)
 
2606
  sbox.simple_commit(message='Merge r5 from A to A_COPY')
2602
2607
 
2603
2608
  # r10 - Delete A_COPY and replace it with A_COPY@8. This removes the edit
2604
2609
  # we made above in r9 to A_COPY/B/E/beta.
2606
2611
  svntest.main.run_svn(None, 'delete', A_COPY_path)
2607
2612
  svntest.main.run_svn(None, 'copy', sbox.repo_url + '/A_COPY@8',
2608
2613
                       A_COPY_path)
2609
 
  svntest.main.run_svn(None, 'ci', '-m', 'Replace A_COPY with A_COPY@8',
2610
 
                       wc_dir)
 
2614
  sbox.simple_commit(message='Replace A_COPY with A_COPY@8')
2611
2615
 
2612
2616
  # r11 - Make an edit on A_COPY/mu.
2613
2617
  svntest.main.file_write(mu_COPY_path, "Branch edit.\n")
2614
 
  svntest.main.run_svn(None, 'ci', '-m', 'Branch edit',
2615
 
                       wc_dir)
 
2618
  sbox.simple_commit(message='Branch edit')
2616
2619
 
2617
2620
  # r12 - Do a final sync merge of A to A_COPY in preparation for
2618
2621
  # reintegration.
2619
2622
  svntest.main.run_svn(None, 'up', wc_dir)
2620
2623
  svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A', A_COPY_path)
2621
 
  svntest.main.run_svn(None, 'ci', '-m', 'Sycn A_COPY with A', wc_dir)
 
2624
  sbox.simple_commit(message='Sync A_COPY with A')
2622
2625
 
2623
2626
  # Reintegrate A_COPY to A.  The resulting mergeinfo should be
2624
2627
  # '/A_COPY:2-8,10-12' because of the replacement which removed /A_COPY:9
2688
2691
 
2689
2692
#----------------------------------------------------------------------
2690
2693
@SkipUnless(svntest.main.is_posix_os)
 
2694
@SkipUnless(server_has_mergeinfo)
2691
2695
@Issue(4052)
2692
2696
def reintegrate_symlink_deletion(sbox):
2693
2697
  "reintegrate symlink deletion"
2724
2728
  run_reintegrate(A_COPY_url, A_path)
2725
2729
 
2726
2730
#----------------------------------------------------------------------
 
2731
@SkipUnless(server_has_mergeinfo)
2727
2732
def no_op_reintegrate(sbox):
2728
2733
  """no-op reintegrate"""
2729
2734
 
2744
2749
  run_reintegrate(sbox.repo_url + '/A_COPY', A_path)
2745
2750
 
2746
2751
#----------------------------------------------------------------------
 
2752
@SkipUnless(server_has_mergeinfo)
2747
2753
def renamed_branch_reintegrate(sbox):
2748
2754
  """reintegrate a branch that has been renamed"""
2749
2755