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

« back to all changes in this revision

Viewing changes to subversion/tests/cmdline/merge_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:
51
51
from svntest.actions import inject_conflict_into_expected_state
52
52
from svntest.verify import RegexListOutput
53
53
 
54
 
def expected_merge_output(rev_ranges, additional_lines=[], foreign=False,
55
 
                          elides=False, two_url=False, target=None,
56
 
                          text_conflicts=0, prop_conflicts=0, tree_conflicts=0,
57
 
                          text_resolved=0, prop_resolved=0, tree_resolved=0,
58
 
                          skipped_paths=0):
59
 
  """Generate an (inefficient) regex representing the expected merge
60
 
  output and mergeinfo notifications from REV_RANGES and ADDITIONAL_LINES.
61
 
 
62
 
  REV_RANGES is a list of revision ranges for which mergeinfo is being
63
 
  recorded.  Each range is of the form [start, end] (where both START and
64
 
  END are inclusive, unlike in '-rX:Y') or the form [single_rev] (which is
65
 
  like '-c SINGLE_REV').  If REV_RANGES is None then only the standard
66
 
  notification for a 3-way merge is expected.
67
 
 
68
 
  ADDITIONAL_LINES is a list of strings to match the other lines of output;
69
 
  these are basically regular expressions except that backslashes will be
70
 
  escaped herein.  If ADDITIONAL_LINES is a single string, it is interpreted
71
 
  the same as a list containing that string.
72
 
 
73
 
  If ELIDES is true, add to the regex an expression representing elision
74
 
  notification.  If TWO_URL is true, tweak the regex to expect the
75
 
  appropriate mergeinfo notification for a 3-way merge.
76
 
 
77
 
  TARGET is the local path to the target, as it should appear in
78
 
  notifications; if None, it is not checked.
79
 
 
80
 
  TEXT_CONFLICTS, PROP_CONFLICTS, TREE_CONFLICTS and SKIPPED_PATHS specify
81
 
  the number of each kind of conflict to expect.
82
 
  """
83
 
 
84
 
  if rev_ranges is None:
85
 
    lines = [svntest.main.merge_notify_line(None, None, False, foreign)]
86
 
  else:
87
 
    lines = []
88
 
    for rng in rev_ranges:
89
 
      start_rev = rng[0]
90
 
      if len(rng) > 1:
91
 
        end_rev = rng[1]
92
 
      else:
93
 
        end_rev = None
94
 
      lines += [svntest.main.merge_notify_line(start_rev, end_rev,
95
 
                                               True, foreign, target)]
96
 
      lines += [svntest.main.mergeinfo_notify_line(start_rev, end_rev, target)]
97
 
 
98
 
  if (elides):
99
 
    lines += ["--- Eliding mergeinfo from .*\n"]
100
 
 
101
 
  if (two_url):
102
 
    lines += ["--- Recording mergeinfo for merge between repository URLs .*\n"]
103
 
 
104
 
  # Address "The Backslash Plague"
105
 
  #
106
 
  # If ADDITIONAL_LINES are present there are possibly paths in it with
107
 
  # multiple components and on Windows these components are separated with
108
 
  # '\'.  These need to be escaped properly in the regexp for the match to
109
 
  # work correctly.  See http://aspn.activestate.com/ASPN/docs/ActivePython
110
 
  # /2.2/howto/regex/regex.html#SECTION000420000000000000000.
111
 
  if isinstance(additional_lines, str):
112
 
    additional_lines = [additional_lines]
113
 
  if sys.platform == 'win32':
114
 
    additional_lines = [line.replace("\\", "\\\\") for line in additional_lines]
115
 
  lines += additional_lines
116
 
 
117
 
  lines += svntest.main.summary_of_conflicts(
118
 
             text_conflicts, prop_conflicts, tree_conflicts,
119
 
             text_resolved, prop_resolved, tree_resolved,
120
 
             skipped_paths,
121
 
             as_regex=True)
122
 
 
123
 
  return "|".join(lines)
124
 
 
125
 
def check_mergeinfo_recursively(root_path, subpaths_mergeinfo):
126
 
  """Check that the mergeinfo properties on and under ROOT_PATH are those in
127
 
     SUBPATHS_MERGEINFO, a {path: mergeinfo-prop-val} dictionary."""
128
 
  expected = svntest.verify.UnorderedOutput(
129
 
    [path + ' - ' + subpaths_mergeinfo[path] + '\n'
130
 
     for path in subpaths_mergeinfo])
131
 
  svntest.actions.run_and_verify_svn(None, expected, [],
132
 
                                     'propget', '-R', SVN_PROP_MERGEINFO,
133
 
                                     root_path)
 
54
from svntest.mergetrees import expected_merge_output, \
 
55
                               check_mergeinfo_recursively, \
 
56
                               set_up_dir_replace, \
 
57
                               set_up_branch, \
 
58
                               local_path, \
 
59
                               svn_mkfile, \
 
60
                               svn_modfile, \
 
61
                               svn_copy, \
 
62
                               svn_merge, \
 
63
                               noninheritable_mergeinfo_test_set_up
134
64
 
135
65
######################################################################
136
66
# Tests
224
154
  # Initial commit.
225
155
  svntest.actions.run_and_verify_commit(wc_dir,
226
156
                                        expected_output,
227
 
                                        expected_status,
228
 
                                        None,
229
 
                                        wc_dir)
 
157
                                        expected_status)
230
158
 
231
159
  # Make the "other" working copy
232
160
  other_wc = sbox.add_wc_path('other')
260
188
  # Commit revision 3.
261
189
  svntest.actions.run_and_verify_commit(wc_dir,
262
190
                                        expected_output,
263
 
                                        expected_status,
264
 
                                        None,
265
 
                                        wc_dir)
 
191
                                        expected_status)
266
192
 
267
193
  # Make local mods in wc.other
268
194
  other_pi_path = os.path.join(other_wc, 'A', 'D', 'G', 'pi')
278
204
  # We skip A/D/G/rho in this merge; it will be tested with a separate
279
205
  # merge command.  Temporarily put it back to revision 1, so this
280
206
  # merge succeeds cleanly.
281
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
207
  svntest.actions.run_and_verify_svn(None, [],
282
208
                                     'up', '-r', '1', other_rho_path)
283
209
 
284
210
  # For A/D/G/tau, we append few different lines, to conflict with the
317
243
 
318
244
  inject_conflict_into_expected_state('A/D/G/tau', expected_disk,
319
245
                                      expected_status, other_tau_text, tau_text,
320
 
                                      3)
 
246
                                      1, 3)
321
247
 
322
248
  expected_skip = wc.State('', { })
323
249
 
333
259
                                       expected_disk,
334
260
                                       expected_status,
335
261
                                       expected_skip,
336
 
                                       None,
337
 
                                       svntest.tree.detect_conflict_files,
338
 
                                       (list(tau_conflict_support_files)),
339
 
                                       None, None, False, True,
340
 
                                       '--allow-mixed-revisions',
341
 
                                       other_wc)
 
262
                                       [], False, True,
 
263
                                       '--allow-mixed-revisions', other_wc,
 
264
                                       extra_files=list(tau_conflict_support_files))
342
265
 
343
266
  # Now reverse merge r3 into A/D/G/rho, give it non-conflicting local
344
267
  # mods, then merge in the 2:3 change.  ### Not bothering to do the
350
273
  # so use run_and_verify_svn.
351
274
  ### TODO: We can use run_and_verify_merge() here now.
352
275
  svntest.actions.run_and_verify_svn(
353
 
    None,
354
276
    expected_merge_output([[-3]],
355
277
                          ['G    ' + other_rho_path + '\n',
356
278
                           ' G   ' + other_rho_path + '\n',]),
406
328
                               })
407
329
 
408
330
  inject_conflict_into_expected_state('tau', expected_disk, expected_status,
409
 
                                      other_tau_text, tau_text, 3)
 
331
                                      other_tau_text, tau_text, 1, 3)
410
332
 
411
333
  # Do the merge, but check svn:mergeinfo props separately since
412
334
  # run_and_verify_merge would attempt to proplist tau's conflict
421
343
    expected_disk,
422
344
    expected_status,
423
345
    expected_skip,
424
 
    None,
425
 
    svntest.tree.detect_conflict_files, list(tau_conflict_support_files))
426
 
 
427
 
 
428
 
  svntest.actions.run_and_verify_svn(None, [], [],
 
346
    extra_files=list(tau_conflict_support_files))
 
347
 
 
348
 
 
349
  svntest.actions.run_and_verify_svn([], '.*W200017: Property.*not found',
429
350
                                     'propget', SVN_PROP_MERGEINFO,
430
351
                                     os.path.join(other_wc,
431
352
                                                  "A", "D", "G", "rho"))
481
402
    })
482
403
  svntest.actions.run_and_verify_commit(wc_dir,
483
404
                                        expected_output,
484
 
                                        expected_status,
485
 
                                        None,
486
 
                                        wc_dir)
 
405
                                        expected_status)
487
406
 
488
407
  expected_output = wc.State(C_path, {
489
408
    'Q'      : Item(status='A '),
533
452
                                       expected_disk,
534
453
                                       expected_status,
535
454
                                       expected_skip,
536
 
                                       None, None, None, None, None,
537
 
                                       1) # check props
 
455
                                       check_props=True)
538
456
 
539
457
  expected_output = svntest.wc.State(wc_dir, {
540
458
    'A/C'       : Item(verb='Sending'),
561
479
    })
562
480
  svntest.actions.run_and_verify_commit(wc_dir,
563
481
                                        expected_output,
564
 
                                        expected_status,
565
 
                                        None,
566
 
                                        wc_dir)
 
482
                                        expected_status)
567
483
 
568
484
#----------------------------------------------------------------------
569
485
# Issue 953
580
496
  beta_path = sbox.ospath('A/B/E/beta')
581
497
  E_path = sbox.ospath('A/B/E')
582
498
 
583
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
499
  svntest.actions.run_and_verify_svn(None, [],
584
500
                                     'propset', 'foo', 'foo_val',
585
501
                                     alpha_path)
586
502
  # A binary, non-UTF8 property value
587
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
503
  svntest.actions.run_and_verify_svn(None, [],
588
504
                                     'propset', 'foo', 'foo\201val',
589
505
                                     beta_path)
590
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
506
  svntest.actions.run_and_verify_svn(None, [],
591
507
                                     'propset', 'foo', 'foo_val',
592
508
                                     E_path)
593
509
 
601
517
  expected_status.tweak('A/B/E', 'A/B/E/alpha', 'A/B/E/beta',
602
518
                        wc_rev=2, status='  ')
603
519
  svntest.actions.run_and_verify_commit(wc_dir,
604
 
                                        expected_output, expected_status,
605
 
                                        None, wc_dir)
606
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
520
                                        expected_output, expected_status)
 
521
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
607
522
 
608
523
  # Copy B to B2 as rev 3
609
524
  B_url = sbox.repo_url + '/A/B'
610
525
  B2_url = sbox.repo_url + '/A/B2'
611
526
 
612
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
527
  svntest.actions.run_and_verify_svn(None, [],
613
528
                                     'copy', '-m', 'copy B to B2',
614
529
                                     B_url, B2_url)
615
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
530
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
616
531
 
617
532
  # Modify a property and add a property for the file and directory
618
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
533
  svntest.actions.run_and_verify_svn(None, [],
619
534
                                     'propset', 'foo', 'mod_foo', alpha_path)
620
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
535
  svntest.actions.run_and_verify_svn(None, [],
621
536
                                     'propset', 'bar', 'bar_val', alpha_path)
622
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
537
  svntest.actions.run_and_verify_svn(None, [],
623
538
                                     'propset', 'foo', 'mod\201foo', beta_path)
624
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
539
  svntest.actions.run_and_verify_svn(None, [],
625
540
                                     'propset', 'bar', 'bar\201val', beta_path)
626
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
541
  svntest.actions.run_and_verify_svn(None, [],
627
542
                                     'propset', 'foo', 'mod_foo', E_path)
628
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
543
  svntest.actions.run_and_verify_svn(None, [],
629
544
                                     'propset', 'bar', 'bar_val', E_path)
630
545
 
631
546
  # Commit change as rev 4
641
556
    'A/B2/lambda'  : Item(status='  ', wc_rev=3),
642
557
    })
643
558
  svntest.actions.run_and_verify_commit(wc_dir,
644
 
                                        expected_output, expected_status,
645
 
                                        None, wc_dir)
646
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
559
                                        expected_output, expected_status)
 
560
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
647
561
 
648
562
  pristine_status = expected_status
649
563
  pristine_status.tweak(wc_rev=4)
689
603
                                       expected_disk,
690
604
                                       expected_status,
691
605
                                       expected_skip,
692
 
                                       None, None, None, None, None, 1)
 
606
                                       check_props=True)
693
607
 
694
608
  # Revert merge
695
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
609
  svntest.actions.run_and_verify_svn(None, [],
696
610
                                     'revert', '--recursive', wc_dir)
697
611
  svntest.actions.run_and_verify_status(wc_dir, pristine_status)
698
612
 
710
624
                                       expected_disk,
711
625
                                       expected_status,
712
626
                                       expected_skip,
713
 
                                       None, None, None, None, None, 1)
 
627
                                       check_props=True)
714
628
 
715
629
  def error_message(property, old_value, new_value):
716
630
    return "Trying to change property '%s'\n" \
717
631
           "but the property has been locally deleted.\n" \
718
 
           "<<<<<<< (local property value)\n=======\n" \
719
 
           "%s>>>>>>> (incoming property value)\n" % (property, new_value)
 
632
           "<<<<<<< (local property value)\n" \
 
633
           "||||||| (incoming 'changed from' value)\n" \
 
634
           "%s=======\n" \
 
635
           "%s>>>>>>> (incoming 'changed to' value)\n" % (property, old_value, new_value)
720
636
 
721
637
  # Merge B 3:4 into B2 now causes a conflict
722
638
  expected_disk.add({
726
642
    'E/alpha.prej'
727
643
    : Item(error_message('foo', 'foo_val', 'mod_foo')),
728
644
    'E/beta.prej'
729
 
    : Item(error_message('foo', 'foo?\\129val', 'mod?\\129foo')),
 
645
    : Item(error_message('foo', 'foo?\\81val', 'mod?\\81foo')),
730
646
    })
731
647
  expected_disk.tweak('E', 'E/alpha', props={'bar' : 'bar_val'})
732
648
  expected_disk.tweak('E/beta', props={'bar' : 'bar\201val'})
742
658
                                       expected_disk,
743
659
                                       expected_status,
744
660
                                       expected_skip,
745
 
                                       None, None, None, None, None, 1)
 
661
                                       check_props=True)
746
662
 
747
663
  # issue 1109 : single file property merge.  This test performs a merge
748
664
  # that should be a no-op (adding properties that are already present).
749
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
665
  svntest.actions.run_and_verify_svn(None, [],
750
666
                                     'revert', '--recursive', wc_dir)
751
667
  svntest.actions.run_and_verify_status(wc_dir, pristine_status)
752
668
 
753
669
  # Copy A at rev 4 to A2 to make revision 5.
754
670
  A_url = sbox.repo_url + '/A'
755
671
  A2_url = sbox.repo_url + '/A2'
756
 
  svntest.actions.run_and_verify_svn(None,
757
 
                                     ['\n', 'Committed revision 5.\n'], [],
 
672
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
673
                                      'Committed revision 5.\n'], [],
758
674
                                     'copy', '-m', 'copy A to A2',
759
675
                                     A_url, A2_url)
760
676
 
761
677
  # Re-root the WC at A2.
762
678
  svntest.main.safe_rmtree(wc_dir)
763
 
  svntest.actions.run_and_verify_svn(None, None, [], 'checkout',
 
679
  svntest.actions.run_and_verify_svn(None, [], 'checkout',
764
680
                                     A2_url, wc_dir)
765
681
 
766
682
  # Attempt to re-merge rev 4 of the original A's alpha.  Mergeinfo
770
686
  alpha_path = sbox.ospath('B/E/alpha')
771
687
 
772
688
  # Cannot use run_and_verify_merge with a file target
773
 
  svntest.actions.run_and_verify_svn(None, [], [], 'merge', '-r', '3:4',
 
689
  svntest.actions.run_and_verify_svn([], [], 'merge', '-r', '3:4',
774
690
                                     alpha_url, alpha_path)
775
691
 
776
 
  exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
 
692
  exit_code, output, err = svntest.actions.run_and_verify_svn(None, [],
777
693
                                                              'pl', alpha_path)
778
694
 
779
695
  saw_foo = 0
832
748
  os.rename(os.path.join(base2_path, 'A', 'B', 'beta'),
833
749
            os.path.join(base2_path, 'A', 'B', 'zeta'))
834
750
 
835
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
751
  svntest.actions.run_and_verify_svn(None, [],
836
752
                                  'add', base1_path, base2_path, apply_path)
837
753
 
838
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
754
  svntest.actions.run_and_verify_svn(None, [],
839
755
                                     'ci', '-m', 'rev 2', wc_dir)
840
756
 
841
757
  expected_output = wc.State(apply_path, {
846
762
 
847
763
  # run_and_verify_merge doesn't support 'svn merge URL URL path'
848
764
  ### TODO: We can use run_and_verify_merge() here now.
849
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
765
  svntest.actions.run_and_verify_svn(None, [],
850
766
                                     'merge',
851
767
                                     '--ignore-ancestry',
852
768
                                     base1_url, base2_url,
890
806
  expected_status.tweak('A/D/G/rho', wc_rev=2)
891
807
  svntest.actions.run_and_verify_commit(wc_dir,
892
808
                                        expected_output,
893
 
                                        expected_status,
894
 
                                        None,
895
 
                                        wc_dir)
 
809
                                        expected_status)
896
810
 
897
811
  # Backdate rho to revision 1, so we can merge in the rev 2 changes.
898
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
812
  svntest.actions.run_and_verify_svn(None, [],
899
813
                                     'up', '-r', '1', rho_path)
900
814
 
901
815
  # Try one merge with an explicit target; it should succeed.
904
818
  # right.  I think something is still assuming a directory target.
905
819
  if arg_flav == 'r':
906
820
    svntest.actions.run_and_verify_svn(
907
 
      None,
908
821
      expected_merge_output([[2]],
909
822
                            ['U    ' + rho_path + '\n',
910
823
                             ' U   ' + rho_path + '\n']),
911
824
      [], 'merge', '-r', '1:2', rho_url, rho_path)
912
825
  elif arg_flav == 'c':
913
826
    svntest.actions.run_and_verify_svn(
914
 
      None,
915
827
      expected_merge_output([[2]],
916
828
                            ['U    ' + rho_path + '\n',
917
829
                             ' U   ' + rho_path + '\n']),
918
830
      [], 'merge', '-c', '2', rho_url, rho_path)
919
831
  elif arg_flav == '*':
920
832
    svntest.actions.run_and_verify_svn(
921
 
      None,
922
833
      expected_merge_output([[2]],
923
834
                            ['U    ' + rho_path + '\n',
924
835
                             ' U   ' + rho_path + '\n']),
934
845
    raise svntest.Failure("Unexpected text in merged '" + rho_path + "'")
935
846
 
936
847
  # Restore rho to pristine revision 1, for another merge.
937
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', rho_path)
 
848
  svntest.actions.run_and_verify_svn(None, [], 'revert', rho_path)
938
849
  expected_status.tweak('A/D/G/rho', status='  ')
939
850
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
940
851
 
962
873
    rho_expected_status = 'MM'
963
874
  merge_cmd.append(rho_url)
964
875
 
965
 
  svntest.actions.run_and_verify_svn(None, expected_output, [], *merge_cmd)
 
876
  svntest.actions.run_and_verify_svn(expected_output, [], *merge_cmd)
966
877
 
967
878
  # Inspect rho, make sure it's right.
968
879
  rho_text = svntest.tree.get_text('rho')
1041
952
  # Initial commit.
1042
953
  svntest.actions.run_and_verify_commit(wc_dir,
1043
954
                                        expected_output,
1044
 
                                        expected_status,
1045
 
                                        None,
1046
 
                                        wc_dir)
 
955
                                        expected_status)
1047
956
 
1048
957
  # Make the "other" working copy, at r1
1049
958
  other_wc = sbox.add_wc_path('other')
1059
968
  # merge using filename for sourcepath
1060
969
  # Cannot use run_and_verify_merge with a file target
1061
970
  if arg_flav == 'r':
1062
 
    svntest.actions.run_and_verify_svn(None,
1063
 
                                       expected_merge_output([[2]],
 
971
    svntest.actions.run_and_verify_svn(expected_merge_output([[2]],
1064
972
                                                             ['U    mu\n',
1065
973
                                                              ' U   mu\n']),
1066
974
                                       [],
1067
975
                                       'merge', '-r', '1:2', 'mu')
1068
976
  elif arg_flav == 'c':
1069
 
    svntest.actions.run_and_verify_svn(None,
1070
 
                                       expected_merge_output([[2]],
 
977
    svntest.actions.run_and_verify_svn(expected_merge_output([[2]],
1071
978
                                                             ['U    mu\n',
1072
979
                                                              ' U   mu\n']),
1073
980
                                       [],
1077
984
    # Without a peg revision, the default merge range of BASE:1 (which
1078
985
    # is a no-op) will be chosen.  Let's do it both ways (no-op first,
1079
986
    # of course).
1080
 
    svntest.actions.run_and_verify_svn(None, None, [], 'merge', 'mu')
1081
 
    svntest.actions.run_and_verify_svn(None,
1082
 
                                       expected_merge_output([[2]],
 
987
    svntest.actions.run_and_verify_svn(None, [], 'merge', 'mu')
 
988
    svntest.actions.run_and_verify_svn(expected_merge_output([[2]],
1083
989
                                                             ['U    mu\n',
1084
990
                                                              ' U   mu\n']),
1085
991
                                       [],
1091
997
 
1092
998
  # merge using URL for sourcepath
1093
999
  if arg_flav == 'r':
1094
 
    svntest.actions.run_and_verify_svn(None,
1095
 
                                       expected_merge_output([[-2]],
 
1000
    svntest.actions.run_and_verify_svn(expected_merge_output([[-2]],
1096
1001
                                                             ['G    mu\n',
1097
1002
                                                              ' U   mu\n',
1098
1003
                                                              ' G   mu\n',],
1100
1005
                                       [],
1101
1006
                                       'merge', '-r', '2:1', mu_url)
1102
1007
  elif arg_flav == 'c':
1103
 
    svntest.actions.run_and_verify_svn(None,
1104
 
                                       expected_merge_output([[-2]],
 
1008
    svntest.actions.run_and_verify_svn(expected_merge_output([[-2]],
1105
1009
                                                             ['G    mu\n',
1106
1010
                                                              ' U   mu\n',
1107
1011
                                                              ' G   mu\n'],
1112
1016
    # Implicit merge source URL and revision range detection is for
1113
1017
    # forward merges only (e.g. non-reverts).  Undo application of
1114
1018
    # r2 to enable continuation of the test case.
1115
 
    svntest.actions.run_and_verify_svn(None,
1116
 
                                       expected_merge_output([[-2]],
 
1019
    svntest.actions.run_and_verify_svn(expected_merge_output([[-2]],
1117
1020
                                                             ['G    mu\n',
1118
1021
                                                              ' U   mu\n',
1119
1022
                                                              ' G   mu\n'],
1127
1030
                          (svntest.tree.get_text('mu'), orig_mu_text))
1128
1031
 
1129
1032
#----------------------------------------------------------------------
 
1033
@SkipUnless(server_has_mergeinfo)
1130
1034
@Issue(785)
1131
1035
def merge_with_implicit_target_using_r(sbox):
1132
1036
  "merging a file w/no explicit target path using -r"
1180
1084
  # Initial commit.
1181
1085
  svntest.actions.run_and_verify_commit(wc_dir,
1182
1086
                                        expected_output,
1183
 
                                        expected_status,
1184
 
                                        None,
1185
 
                                        wc_dir)
 
1087
                                        expected_status)
1186
1088
 
1187
1089
  # Make some other working copies
1188
1090
  other_wc = sbox.add_wc_path('other')
1197
1099
 
1198
1100
  # Try to revert the last change to mu via svn merge
1199
1101
  # Cannot use run_and_verify_merge with a file target
1200
 
  svntest.actions.run_and_verify_svn(None,
1201
 
                                     expected_merge_output([[-2]],
 
1102
  svntest.actions.run_and_verify_svn(expected_merge_output([[-2]],
1202
1103
                                                           ['U    mu\n',
1203
1104
                                                            ' U   mu\n'],
1204
1105
                                                           elides=True),
1220
1121
  os.chdir(another_wc)
1221
1122
 
1222
1123
  # ensure 'A' will be at revision 2
1223
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up')
 
1124
  svntest.actions.run_and_verify_svn(None, [], 'up')
1224
1125
 
1225
1126
  # now try a revert on a directory, and verify that it removed the zot
1226
1127
  # file we had added previously
1227
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1128
  svntest.actions.run_and_verify_svn(None, [],
1228
1129
                                     'merge', '-r', 'COMMITTED:PREV',
1229
1130
                                     'A', 'A')
1230
1131
 
1269
1170
    'A/theta' : Item(status='  ', wc_rev=2),
1270
1171
    })
1271
1172
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1272
 
                                        expected_status, None,
1273
 
                                        wc_dir)
 
1173
                                        expected_status)
1274
1174
 
1275
1175
  # Make the "other" working copy
1276
1176
  other_wc = sbox.add_wc_path('other')
1286
1186
    'A/theta' : Item(status='  ', wc_rev=3),
1287
1187
    })
1288
1188
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1289
 
                                        expected_status, None,
1290
 
                                        wc_dir)
 
1189
                                        expected_status)
1291
1190
 
1292
1191
  # In second working copy, attempt to 'svn merge -r 2:3'.
1293
1192
  # We should *not* see a conflict during the update, but a 'U'.
1321
1220
                                       expected_disk,
1322
1221
                                       expected_status,
1323
1222
                                       expected_skip,
1324
 
                                       None, None, None, None, None,
 
1223
                                       [],
1325
1224
                                       True, True, '--allow-mixed-revisions',
1326
1225
                                       other_wc)
1327
1226
 
1340
1239
  trunk_url = sbox.repo_url + '/A/B/E'
1341
1240
 
1342
1241
  # Create a branch
1343
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
1242
  svntest.actions.run_and_verify_svn(None, [], 'cp',
1344
1243
                                     trunk_url,
1345
1244
                                     sbox.repo_url + '/branch',
1346
1245
                                     '-m', "Creating the Branch")
1347
1246
 
1348
1247
  # Update to revision 2.
1349
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1248
  svntest.actions.run_and_verify_svn(None, [],
1350
1249
                                     'update', wc_dir)
1351
1250
 
1352
1251
  new_file_path = sbox.ospath('A/B/E/newfile')
1353
1252
  svntest.main.file_write(new_file_path, "newfile\n")
1354
1253
 
1355
1254
  # Add the new file, and commit revision 3.
1356
 
  svntest.actions.run_and_verify_svn(None, None, [], "add", new_file_path)
1357
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1255
  svntest.actions.run_and_verify_svn(None, [], "add", new_file_path)
 
1256
  svntest.actions.run_and_verify_svn(None, [],
1358
1257
                                     'ci', '-m',
1359
1258
                                     "Changing the trunk.", wc_dir)
1360
1259
 
1396
1295
  expected_output = [
1397
1296
    "Index: " + url_branch_path + "/newfile\n",
1398
1297
    "===================================================================\n",
1399
 
    "--- "+ url_branch_path + "/newfile (revision 0)\n",
 
1298
    "--- "+ url_branch_path + "/newfile (nonexistent)\n",
1400
1299
    "+++ "+ url_branch_path + "/newfile (working copy)\n",
1401
1300
    "@@ -0,0 +1 @@\n",
1402
1301
    "+newfile\n",
1409
1308
    "Property changes on: " + url_branch_path + "\n",
1410
1309
    "___________________________________________________________________\n",
1411
1310
    "Added: " + SVN_PROP_MERGEINFO + "\n",
 
1311
    "## -0,0 +0,1 ##\n",
1412
1312
    "   Merged /A/B/E:r2-3\n",
1413
1313
  ]
1414
 
  svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
 
1314
  svntest.actions.run_and_verify_svn(expected_output, [], 'diff',
1415
1315
                                     '--show-copies-as-adds', branch_path)
1416
1316
 
1417
1317
 
1453
1353
    })
1454
1354
  svntest.actions.run_and_verify_commit(wc_dir,
1455
1355
                                        expected_output,
1456
 
                                        expected_status,
1457
 
                                        None,
1458
 
                                        wc_dir)
 
1356
                                        expected_status)
1459
1357
 
1460
1358
  pre_merge_status = expected_status
1461
1359
 
1497
1395
                                       expected_disk,
1498
1396
                                       expected_status,
1499
1397
                                       expected_skip,
1500
 
                                       None, None, None, None, None,
1501
 
                                       1, 0)
 
1398
                                       [], True)
1502
1399
 
1503
1400
  # Revert the local mods, and this time make "Q" obstructed.  An
1504
1401
  # unversioned file called "Q" will obstruct the adding of the
1505
1402
  # directory of the same name.
1506
1403
 
1507
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1404
  svntest.actions.run_and_verify_svn(None, [],
1508
1405
                                     'revert', '-R', wc_dir)
1509
1406
  os.unlink(os.path.join(C_path, "foo"))
1510
1407
  svntest.main.safe_rmtree(os.path.join(C_path, "Q"))
1540
1437
                                       expected_disk,
1541
1438
                                       expected_status,
1542
1439
                                       expected_skip,
1543
 
                                       None, None, None, None, None,
1544
 
                                       1, 0)
 
1440
                                       [], True)
1545
1441
 
1546
1442
  # Revert the local mods, and commit the deletion of iota and A/D/G. (r3)
1547
1443
  os.unlink(os.path.join(C_path, "foo"))
1548
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
1444
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
1549
1445
  svntest.actions.run_and_verify_status(wc_dir, pre_merge_status)
1550
1446
 
1551
1447
  iota_path = sbox.ospath('iota')
1552
1448
  G_path = sbox.ospath('A/D/G')
1553
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', iota_path, G_path)
 
1449
  svntest.actions.run_and_verify_svn(None, [], 'rm', iota_path, G_path)
1554
1450
 
1555
1451
  expected_output = wc.State(wc_dir, {
1556
1452
    'A/D/G'  : Item(verb='Deleting'),
1560
1456
  expected_status.remove('iota', 'A/D/G', 'A/D/G/pi', 'A/D/G/rho', 'A/D/G/tau')
1561
1457
  svntest.actions.run_and_verify_commit(wc_dir,
1562
1458
                                        expected_output,
1563
 
                                        expected_status,
1564
 
                                        None, wc_dir)
 
1459
                                        expected_status)
1565
1460
 
1566
1461
  # Now create unversioned iota and A/D/G, try running a merge -r2:3.
1567
1462
  # The merge process should skip over these targets, since they're
1601
1496
                                       expected_disk,
1602
1497
                                       expected_status.copy(wc_dir),
1603
1498
                                       expected_skip,
1604
 
                                       None, None, None, None, None,
 
1499
                                       [],
1605
1500
                                       True, False, '--allow-mixed-revisions',
1606
1501
                                       wc_dir)
1607
1502
 
1608
1503
  # Revert the local mods, and commit a change to A/B/lambda (r4), and then
1609
1504
  # commit the deletion of the same file. (r5)
1610
1505
  svntest.main.safe_rmtree(G_path)
1611
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
1506
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
1612
1507
  expected_status.tweak('', status='  ')
1613
1508
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
1614
1509
 
1620
1515
  expected_status.tweak('A/B/lambda', wc_rev=4)
1621
1516
  svntest.actions.run_and_verify_commit(wc_dir,
1622
1517
                                        expected_output,
1623
 
                                        expected_status,
1624
 
                                        None, wc_dir)
 
1518
                                        expected_status)
1625
1519
 
1626
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', lambda_path)
 
1520
  svntest.actions.run_and_verify_svn(None, [], 'rm', lambda_path)
1627
1521
 
1628
1522
  expected_output = wc.State(wc_dir, {
1629
1523
    'A/B/lambda'  : Item(verb='Deleting'),
1631
1525
  expected_status.remove('A/B/lambda')
1632
1526
  svntest.actions.run_and_verify_commit(wc_dir,
1633
1527
                                        expected_output,
1634
 
                                        expected_status,
1635
 
                                        None, wc_dir)
 
1528
                                        expected_status)
1636
1529
 
1637
1530
  # lambda is gone, so create an unversioned lambda in its place.
1638
1531
  # Then attempt to merge -r3:4, which is a change to lambda.  The merge
1666
1559
                                       expected_disk,
1667
1560
                                       expected_status_short,
1668
1561
                                       expected_skip,
1669
 
                                       None, None, None, None, None,
 
1562
                                       [],
1670
1563
                                       True, False, '--allow-mixed-revisions',
1671
1564
                                       wc_dir)
1672
1565
 
1674
1567
  # working file.  Then re-run the -r3:4 merge, and see how svn deals
1675
1568
  # with a file being under version control, but missing.
1676
1569
 
1677
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', lambda_path)
 
1570
  svntest.actions.run_and_verify_svn(None, [], 'add', lambda_path)
1678
1571
 
1679
1572
  # Mergeinfo prop changed so update to avoid out of date error.
1680
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
1573
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
1681
1574
 
1682
1575
  expected_output = wc.State(wc_dir, {
1683
1576
    ''            : Item(verb='Sending'),
1692
1585
  expected_status.tweak('', status='  ', wc_rev=6)
1693
1586
  svntest.actions.run_and_verify_commit(wc_dir,
1694
1587
                                        expected_output,
1695
 
                                        expected_status,
1696
 
                                        None, wc_dir)
 
1588
                                        expected_status)
1697
1589
  os.unlink(lambda_path)
1698
1590
 
1699
1591
  expected_output = wc.State(wc_dir, { })
1716
1608
                                       expected_disk,
1717
1609
                                       expected_status.copy(wc_dir),
1718
1610
                                       expected_skip,
1719
 
                                       None, None, None, None, None,
 
1611
                                       [],
1720
1612
                                       1, 0, '--ignore-ancestry',
1721
1613
                                       '--allow-mixed-revisions', wc_dir)
1722
1614
 
1738
1630
  Q_path = os.path.join(F_path, 'Q')
1739
1631
  foo_path = os.path.join(F_path, 'foo')
1740
1632
 
1741
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', Q_path)
 
1633
  svntest.actions.run_and_verify_svn(None, [], 'mkdir', Q_path)
1742
1634
  svntest.main.file_append(foo_path, "foo")
1743
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', foo_path)
 
1635
  svntest.actions.run_and_verify_svn(None, [], 'add', foo_path)
1744
1636
 
1745
1637
  expected_output = wc.State(wc_dir, {
1746
1638
    'A/B/F/Q'       : Item(verb='Adding'),
1753
1645
    })
1754
1646
  svntest.actions.run_and_verify_commit(wc_dir,
1755
1647
                                        expected_output,
1756
 
                                        expected_status,
1757
 
                                        None, wc_dir)
 
1648
                                        expected_status)
1758
1649
 
1759
1650
  R_path = os.path.join(Q_path, 'R')
1760
1651
  bar_path = os.path.join(R_path, 'bar')
1761
1652
  baz_path = os.path.join(Q_path, 'baz')
1762
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', R_path)
 
1653
  svntest.actions.run_and_verify_svn(None, [], 'mkdir', R_path)
1763
1654
  svntest.main.file_append(bar_path, "bar")
1764
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', bar_path)
 
1655
  svntest.actions.run_and_verify_svn(None, [], 'add', bar_path)
1765
1656
  svntest.main.file_append(baz_path, "baz")
1766
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', baz_path)
 
1657
  svntest.actions.run_and_verify_svn(None, [], 'add', baz_path)
1767
1658
 
1768
1659
  expected_output = wc.State(wc_dir, {
1769
1660
    'A/B/F/Q/R'     : Item(verb='Adding'),
1777
1668
    })
1778
1669
  svntest.actions.run_and_verify_commit(wc_dir,
1779
1670
                                        expected_output,
1780
 
                                        expected_status,
1781
 
                                        None, wc_dir)
 
1671
                                        expected_status)
1782
1672
 
1783
1673
  os.unlink(foo_path)
1784
1674
  svntest.main.safe_rmtree(Q_path)
1817
1707
                                       expected_disk,
1818
1708
                                       expected_status,
1819
1709
                                       expected_skip,
1820
 
                                       None, None, None, None, None,
1821
 
                                       0, 0, '--dry-run',
 
1710
                                       [], False, False,
 
1711
                                       '--dry-run',
1822
1712
                                       '--ignore-ancestry',
1823
1713
                                       '--allow-mixed-revisions',
1824
1714
                                       F_path)
1842
1732
                                       expected_disk,
1843
1733
                                       expected_status,
1844
1734
                                       expected_skip,
1845
 
                                       None, None, None, None, None,
1846
 
                                       0, 0,
 
1735
                                       [], False, False,
1847
1736
                                       '--ignore-ancestry',
1848
1737
                                       '--allow-mixed-revisions',
1849
1738
                                       F_path)
1884
1773
  # Commit a new file which has a property.
1885
1774
  zig_path = sbox.ospath('A/B/E/zig')
1886
1775
  svntest.main.file_append(zig_path, "zig contents")
1887
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', zig_path)
1888
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1776
  svntest.actions.run_and_verify_svn(None, [], 'add', zig_path)
 
1777
  svntest.actions.run_and_verify_svn(None, [],
1889
1778
                                     'propset', 'foo', 'foo_val',
1890
1779
                                     zig_path)
1891
1780
 
1898
1787
    })
1899
1788
  svntest.actions.run_and_verify_commit(wc_dir,
1900
1789
                                        expected_output,
1901
 
                                        expected_status,
1902
 
                                        None, wc_dir)
 
1790
                                        expected_status)
1903
1791
 
1904
1792
  # Do a regular merge of that change into a different dir.
1905
1793
  F_path = sbox.ospath('A/B/F')
1927
1815
                                       expected_disk,
1928
1816
                                       expected_status,
1929
1817
                                       expected_skip,
1930
 
                                       None, None, None, None, None,
1931
 
                                       1, # please check props
1932
 
                                       1) # and do a dry-run also)
 
1818
                                       [], True, True)
1933
1819
 
1934
1820
#----------------------------------------------------------------------
1935
1821
# Regression test for issue #1673
1966
1852
    })
1967
1853
 
1968
1854
  svntest.actions.run_and_verify_commit(wc_dir,
1969
 
                                        expected_output, expected_status,
1970
 
                                        None,
1971
 
                                        wc_dir)
 
1855
                                        expected_output, expected_status)
1972
1856
 
1973
1857
  # Create the first branch
1974
1858
  J_path = sbox.ospath('J')
1985
1869
    })
1986
1870
 
1987
1871
  svntest.actions.run_and_verify_commit(wc_dir,
1988
 
                                        expected_output, expected_status,
1989
 
                                        None,
1990
 
                                        wc_dir)
 
1872
                                        expected_output, expected_status)
1991
1873
 
1992
1874
  # Create the path where the files will be merged
1993
1875
  K_path = sbox.ospath('K')
2003
1885
    })
2004
1886
 
2005
1887
  svntest.actions.run_and_verify_commit(wc_dir,
2006
 
                                        expected_output, expected_status,
2007
 
                                        None,
2008
 
                                        wc_dir)
 
1888
                                        expected_output, expected_status)
2009
1889
 
2010
1890
  # Copy 'I/theta' to 'K/'. This file will be merged later.
2011
1891
  theta_K_path = os.path.join(K_path, 'theta')
2021
1901
    })
2022
1902
 
2023
1903
  svntest.actions.run_and_verify_commit(wc_dir,
2024
 
                                        expected_output, expected_status,
2025
 
                                        None,
2026
 
                                        wc_dir)
 
1904
                                        expected_output, expected_status)
2027
1905
 
2028
1906
  # Modify the original ancestry 'I/theta'
2029
1907
  svntest.main.file_append(theta_I_path, "some extra junk")
2036
1914
  expected_status.tweak('I/theta', wc_rev=6)
2037
1915
 
2038
1916
  svntest.actions.run_and_verify_commit(wc_dir,
2039
 
                                        expected_output, expected_status,
2040
 
                                        None,
2041
 
                                        wc_dir)
 
1917
                                        expected_output, expected_status)
2042
1918
 
2043
1919
  # Create the second branch from the modified ancestry
2044
1920
  L_path = sbox.ospath('L')
2056
1932
    })
2057
1933
 
2058
1934
  svntest.actions.run_and_verify_commit(wc_dir,
2059
 
                                        expected_output, expected_status,
2060
 
                                        None,
2061
 
                                        wc_dir)
 
1935
                                        expected_output, expected_status)
2062
1936
 
2063
1937
  # Now merge first ('J/') and second ('L/') branches into 'K/'
2064
1938
  saved_cwd = os.getcwd()
2066
1940
  os.chdir(K_path)
2067
1941
  theta_J_url = sbox.repo_url + '/J/theta'
2068
1942
  theta_L_url = sbox.repo_url + '/L/theta'
2069
 
  svntest.actions.run_and_verify_svn(None,
2070
 
                                     expected_merge_output(None,
 
1943
  svntest.actions.run_and_verify_svn(expected_merge_output(None,
2071
1944
                                                           ['U    theta\n',
2072
1945
                                                            ' U   theta\n',
2073
1946
                                                            ' G   theta\n',],
2115
1988
        target_path = os.path.join(wc_dir, 'A', 'B', 'E', '%s' % target[1],
2116
1989
                                   target[2])
2117
1990
        svntest.main.file_append(target_path, "%s/%s" % (target[1], target[2]))
2118
 
      svntest.actions.run_and_verify_svn(None, None, [], 'add', target_dir)
 
1991
      svntest.actions.run_and_verify_svn(None, [], 'add', target_dir)
2119
1992
    elif target[0] == 'f':
2120
1993
        target_path = os.path.join(wc_dir, 'A', 'B', 'E', '%s' % target[1])
2121
1994
        svntest.main.file_append(target_path, "%s" % target[1])
2122
 
        svntest.actions.run_and_verify_svn(None, None, [], 'add', target_path)
 
1995
        svntest.actions.run_and_verify_svn(None, [], 'add', target_path)
2123
1996
    else:
2124
1997
      raise svntest.Failure
2125
1998
 
2127
2000
  for target in add_by_mkdir:
2128
2001
    if target[0] == 'd':
2129
2002
      target_dir = os.path.join(wc_dir, 'A', 'B', 'E', target[1])
2130
 
      svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', target_dir)
 
2003
      svntest.actions.run_and_verify_svn(None, [], 'mkdir', target_dir)
2131
2004
      if target[2]:
2132
2005
        target_path = os.path.join(wc_dir, 'A', 'B', 'E', '%s' % target[1],
2133
2006
                                   target[2])
2134
2007
        svntest.main.file_append(target_path, "%s/%s" % (target[1], target[2]))
2135
 
        svntest.actions.run_and_verify_svn(None, None, [], 'add', target_path)
 
2008
        svntest.actions.run_and_verify_svn(None, [], 'add', target_path)
2136
2009
 
2137
2010
  expected_output_dic = {}
2138
2011
  expected_status_dic = {}
2156
2029
 
2157
2030
  svntest.actions.run_and_verify_commit(wc_dir,
2158
2031
                                        expected_output,
2159
 
                                        expected_status,
2160
 
                                        None, wc_dir)
 
2032
                                        expected_status)
2161
2033
 
2162
2034
  # Do a regular merge of that change into a different dir.
2163
2035
  F_path = sbox.ospath('A/B/F')
2198
2070
                                       expected_disk,
2199
2071
                                       expected_status,
2200
2072
                                       expected_skip,
2201
 
                                       None, None, None, None, None,
2202
 
                                       0, # don't check props
2203
 
                                       1) # but do a dry-run
 
2073
                                       [],
 
2074
                                       False, # don't check props
 
2075
                                       True) # but do a dry-run
2204
2076
 
2205
2077
  expected_output_dic = {}
2206
2078
 
2216
2088
 
2217
2089
  svntest.actions.run_and_verify_commit(F_path,
2218
2090
                                        expected_output,
2219
 
                                        None,
2220
 
                                        None, wc_dir)
 
2091
                                        None)
2221
2092
 
2222
2093
#-----------------------------------------------------------------------
2223
2094
# Regression test for issue #2064
2236
2107
  os.mkdir(tpath)
2237
2108
  svntest.main.run_svn(None, "add", tpath)
2238
2109
  # Commit r2.
2239
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2110
  svntest.actions.run_and_verify_svn(None, [],
2240
2111
                                     "ci", "-m", "r2", wcpath)
2241
2112
 
2242
2113
  # Copy t to b.
2243
2114
  svntest.main.run_svn(None, "cp", tpath, bpath)
2244
2115
  # Commit r3
2245
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2116
  svntest.actions.run_and_verify_svn(None, [],
2246
2117
                                     "ci", "-m", "r3", wcpath)
2247
2118
 
2248
2119
  # Add a file to t.
2249
2120
  svntest.main.file_append(t_fpath, "$Revision$")
2250
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2121
  svntest.actions.run_and_verify_svn(None, [],
2251
2122
                                     'add', t_fpath)
2252
2123
  # Ask for keyword expansion in the file.
2253
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2124
  svntest.actions.run_and_verify_svn(None, [],
2254
2125
                                     'propset', 'svn:keywords', 'Revision',
2255
2126
                                     t_fpath)
2256
2127
  # Commit r4
2257
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2128
  svntest.actions.run_and_verify_svn(None, [],
2258
2129
                                     'ci', '-m', 'r4', wcpath)
2259
2130
 
2260
2131
  # Update the wc before the merge.
2261
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2132
  svntest.actions.run_and_verify_svn(None, [],
2262
2133
                                     'update', wcpath)
2263
2134
 
2264
2135
  expected_status = svntest.actions.get_virginal_state(wcpath, 4)
2307
2178
 
2308
2179
  # Add a property to alpha.
2309
2180
  alpha_path = sbox.ospath('A/B/E/alpha')
2310
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2181
  svntest.actions.run_and_verify_svn(None, [],
2311
2182
                                     'propset', 'foo', 'foo_val',
2312
2183
                                     alpha_path)
2313
2184
 
2318
2189
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
2319
2190
  expected_status.tweak('A/B/E/alpha', wc_rev=2, status='  ')
2320
2191
  svntest.actions.run_and_verify_commit(wc_dir,
2321
 
                                        expected_output, expected_status,
2322
 
                                        None, wc_dir)
2323
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2192
                                        expected_output, expected_status)
 
2193
  svntest.actions.run_and_verify_svn(None, [],
2324
2194
                                     'up', wc_dir)
2325
2195
 
2326
2196
  # Remove alpha entirely.
2327
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', alpha_path)
 
2197
  svntest.actions.run_and_verify_svn(None, [], 'rm', alpha_path)
2328
2198
  expected_output = wc.State(wc_dir, {
2329
2199
    'A/B/E/alpha'  : Item(verb='Deleting'),
2330
2200
    })
2333
2203
  svntest.actions.run_and_verify_commit(wc_dir,
2334
2204
                                        expected_output,
2335
2205
                                        expected_status,
2336
 
                                        None, alpha_path)
 
2206
                                        [], alpha_path)
2337
2207
 
2338
2208
  # Try merging the original propset, which applies to a target that
2339
2209
  # no longer exists.  The bug would only reproduce when run from
2341
2211
  # --ignore-ancestry here because our merge logic will otherwise
2342
2212
  # prevent a merge of changes we already have.
2343
2213
  os.chdir(wc_dir)
2344
 
  svntest.actions.run_and_verify_svn("Merge errored unexpectedly",
2345
 
                                     svntest.verify.AnyOutput, [], 'merge',
 
2214
  svntest.actions.run_and_verify_svn(svntest.verify.AnyOutput, [], 'merge',
2346
2215
                                     '-r1:2', '--ignore-ancestry', '.')
2347
2216
 
2348
2217
#----------------------------------------------------------------------
2349
 
def set_up_dir_replace(sbox):
2350
 
  """Set up the working copy for directory replace tests, creating
2351
 
  directory 'A/B/F/foo' with files 'new file' and 'new file2' within
2352
 
  it (r2), and merging 'foo' onto 'C' (r3), then deleting 'A/B/F/foo'
2353
 
  (r4)."""
2354
 
 
2355
 
  sbox.build()
2356
 
  wc_dir = sbox.wc_dir
2357
 
 
2358
 
  C_path = sbox.ospath('A/C')
2359
 
  F_path = sbox.ospath('A/B/F')
2360
 
  F_url = sbox.repo_url + '/A/B/F'
2361
 
 
2362
 
  foo_path = os.path.join(F_path, 'foo')
2363
 
  new_file = os.path.join(foo_path, "new file")
2364
 
  new_file2 = os.path.join(foo_path, "new file 2")
2365
 
 
2366
 
  # Make directory foo in F, and add some files within it.
2367
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', foo_path)
2368
 
  svntest.main.file_append(new_file, "Initial text in new file.\n")
2369
 
  svntest.main.file_append(new_file2, "Initial text in new file 2.\n")
2370
 
  svntest.main.run_svn(None, "add", new_file)
2371
 
  svntest.main.run_svn(None, "add", new_file2)
2372
 
 
2373
 
  # Commit all the new content, creating r2.
2374
 
  expected_output = wc.State(wc_dir, {
2375
 
    'A/B/F/foo'            : Item(verb='Adding'),
2376
 
    'A/B/F/foo/new file'   : Item(verb='Adding'),
2377
 
    'A/B/F/foo/new file 2' : Item(verb='Adding'),
2378
 
    })
2379
 
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
2380
 
  expected_status.add({
2381
 
    'A/B/F/foo'             : Item(status='  ', wc_rev=2),
2382
 
    'A/B/F/foo/new file'    : Item(status='  ', wc_rev=2),
2383
 
    'A/B/F/foo/new file 2'  : Item(status='  ', wc_rev=2),
2384
 
    })
2385
 
  svntest.actions.run_and_verify_commit(wc_dir,
2386
 
                                        expected_output,
2387
 
                                        expected_status,
2388
 
                                        None, wc_dir)
2389
 
 
2390
 
  # Merge foo onto C
2391
 
  expected_output = wc.State(C_path, {
2392
 
    'foo' : Item(status='A '),
2393
 
    'foo/new file'   : Item(status='A '),
2394
 
    'foo/new file 2' : Item(status='A '),
2395
 
    })
2396
 
  expected_mergeinfo_output = wc.State(C_path, {
2397
 
    '' : Item(status=' U'),
2398
 
    })
2399
 
  expected_elision_output = wc.State(C_path, {
2400
 
    })
2401
 
  expected_disk = wc.State('', {
2402
 
    ''               : Item(props={SVN_PROP_MERGEINFO : '/A/B/F:2'}),
2403
 
    'foo' : Item(),
2404
 
    'foo/new file'   : Item("Initial text in new file.\n"),
2405
 
    'foo/new file 2' : Item("Initial text in new file 2.\n"),
2406
 
    })
2407
 
  expected_status = wc.State(C_path, {
2408
 
    ''    : Item(status=' M', wc_rev=1),
2409
 
    'foo' : Item(status='A ', wc_rev='-', copied='+'),
2410
 
    'foo/new file'   : Item(status='  ', wc_rev='-', copied='+'),
2411
 
    'foo/new file 2' : Item(status='  ', wc_rev='-', copied='+'),
2412
 
    })
2413
 
  expected_skip = wc.State(C_path, { })
2414
 
  svntest.actions.run_and_verify_merge(C_path, '1', '2', F_url, None,
2415
 
                                       expected_output,
2416
 
                                       expected_mergeinfo_output,
2417
 
                                       expected_elision_output,
2418
 
                                       expected_disk,
2419
 
                                       expected_status,
2420
 
                                       expected_skip,
2421
 
                                       None, None, None, None, None, 1)
2422
 
  # Commit merge of foo onto C, creating r3.
2423
 
  expected_output = svntest.wc.State(wc_dir, {
2424
 
    'A/C'        : Item(verb='Sending'),
2425
 
    'A/C/foo'    : Item(verb='Adding'),
2426
 
    })
2427
 
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
2428
 
  expected_status.add({
2429
 
    'A/B/F/foo'  : Item(status='  ', wc_rev=2),
2430
 
    'A/C'        : Item(status='  ', wc_rev=3),
2431
 
    'A/B/F/foo/new file'      : Item(status='  ', wc_rev=2),
2432
 
    'A/B/F/foo/new file 2'    : Item(status='  ', wc_rev=2),
2433
 
    'A/C/foo'    : Item(status='  ', wc_rev=3),
2434
 
    'A/C/foo/new file'      : Item(status='  ', wc_rev=3),
2435
 
    'A/C/foo/new file 2'    : Item(status='  ', wc_rev=3),
2436
 
 
2437
 
    })
2438
 
  svntest.actions.run_and_verify_commit(wc_dir,
2439
 
                                        expected_output,
2440
 
                                        expected_status,
2441
 
                                        None, wc_dir)
2442
 
 
2443
 
  # Delete foo on F, creating r4.
2444
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', foo_path)
2445
 
  expected_output = svntest.wc.State(wc_dir, {
2446
 
    'A/B/F/foo'   : Item(verb='Deleting'),
2447
 
    })
2448
 
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
2449
 
  expected_status.add({
2450
 
    'A/C'         : Item(status='  ', wc_rev=3),
2451
 
    'A/C/foo'     : Item(status='  ', wc_rev=3),
2452
 
    'A/C/foo/new file'      : Item(status='  ', wc_rev=3),
2453
 
    'A/C/foo/new file 2'    : Item(status='  ', wc_rev=3),
2454
 
    })
2455
 
  svntest.actions.run_and_verify_commit(wc_dir,
2456
 
                                        expected_output,
2457
 
                                        expected_status,
2458
 
                                        None, wc_dir)
2459
 
 
2460
 
#----------------------------------------------------------------------
2461
2218
# A merge that replaces a directory
2462
2219
# Tests for Issue #2144 and Issue #2607
2463
2220
@SkipUnless(server_has_mergeinfo)
2480
2237
  new_file3 = os.path.join(bar_path, "new file 3")
2481
2238
 
2482
2239
  # Make a couple of directories, and add some files within them.
2483
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', foo_path)
2484
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', bar_path)
 
2240
  svntest.actions.run_and_verify_svn(None, [], 'mkdir', foo_path)
 
2241
  svntest.actions.run_and_verify_svn(None, [], 'mkdir', bar_path)
2485
2242
  svntest.main.file_append(new_file3, "Initial text in new file 3.\n")
2486
2243
  svntest.main.run_svn(None, "add", new_file3)
2487
2244
  svntest.main.file_append(foo_file, "Initial text in file foo.\n")
2507
2264
    })
2508
2265
  svntest.actions.run_and_verify_commit(wc_dir,
2509
2266
                                        expected_output,
2510
 
                                        expected_status,
2511
 
                                        None, wc_dir)
 
2267
                                        expected_status)
2512
2268
  # Merge replacement of foo onto C
2513
2269
  expected_output = wc.State(C_path, {
2514
2270
    'foo' : Item(status='R '),
2545
2301
                                       expected_disk,
2546
2302
                                       expected_status,
2547
2303
                                       expected_skip,
2548
 
                                       None, None, None, None, None,
2549
 
                                       1,
2550
 
                                       0) # don't do a dry-run
2551
 
                                          # the output differs
 
2304
                                       [], True,
 
2305
                                       False) # don't do a dry-run
 
2306
                                              # the output differs
2552
2307
 
2553
2308
  # Commit merge of foo onto C
2554
2309
  expected_output = svntest.wc.State(wc_dir, {
2569
2324
    })
2570
2325
  svntest.actions.run_and_verify_commit(wc_dir,
2571
2326
                                        expected_output,
2572
 
                                        expected_status,
2573
 
                                        None, wc_dir)
 
2327
                                        expected_status)
2574
2328
 
2575
2329
#----------------------------------------------------------------------
2576
2330
# A merge that replaces a directory and one of its children
2591
2345
  # Recreate foo and 'new file 2' in F and add a new folder with a file
2592
2346
  bar_path = os.path.join(foo_path, 'bar')
2593
2347
  new_file3 = os.path.join(bar_path, "new file 3")
2594
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', foo_path)
2595
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', bar_path)
 
2348
  svntest.actions.run_and_verify_svn(None, [], 'mkdir', foo_path)
 
2349
  svntest.actions.run_and_verify_svn(None, [], 'mkdir', bar_path)
2596
2350
  svntest.main.file_append(new_file3, "Initial text in new file 3.\n")
2597
2351
  svntest.main.run_svn(None, "add", new_file3)
2598
2352
  svntest.main.file_append(new_file2, "New text in new file 2.\n")
2617
2371
  expected_status.tweak('A/C', wc_rev=3) # From mergeinfo
2618
2372
  svntest.actions.run_and_verify_commit(wc_dir,
2619
2373
                                        expected_output,
2620
 
                                        expected_status,
2621
 
                                        None, wc_dir)
 
2374
                                        expected_status)
2622
2375
  # Merge replacement of foo onto C
2623
2376
  expected_output = wc.State(C_path, {
2624
2377
    'foo'                : Item(status='R '),
2654
2407
                                       expected_disk,
2655
2408
                                       expected_status,
2656
2409
                                       expected_skip,
2657
 
                                       None, None, None, None, None,
2658
 
                                       1,
2659
 
                                       0) # don't do a dry-run
2660
 
                                          # the output differs
 
2410
                                       [],
 
2411
                                       True,
 
2412
                                       False) # don't do a dry-run
 
2413
                                              # the output differs
2661
2414
 
2662
2415
  # Commit merge of foo onto C
2663
2416
  expected_output = svntest.wc.State(wc_dir, {
2679
2432
    })
2680
2433
  svntest.actions.run_and_verify_commit(wc_dir,
2681
2434
                                        expected_output,
2682
 
                                        expected_status,
2683
 
                                        None, wc_dir)
 
2435
                                        expected_status)
2684
2436
 
2685
2437
  # Confirm the files are present in the repository.
2686
2438
  new_file_2_url = sbox.repo_url + '/A/C/foo/new file 2'
2687
 
  svntest.actions.run_and_verify_svn(None, ["New text in new file 2.\n"],
 
2439
  svntest.actions.run_and_verify_svn(["New text in new file 2.\n"],
2688
2440
                                     [], 'cat',
2689
2441
                                     new_file_2_url)
2690
2442
  new_file_3_url = sbox.repo_url + '/A/C/foo/bar/new file 3'
2691
 
  svntest.actions.run_and_verify_svn(None, ["Initial text in new file 3.\n"],
 
2443
  svntest.actions.run_and_verify_svn(["Initial text in new file 3.\n"],
2692
2444
                                     [], 'cat',
2693
2445
                                     new_file_3_url)
2694
2446
 
2704
2456
  # Make r2.
2705
2457
  svntest.main.file_append(new_file, "Initial text in the file.\n")
2706
2458
  svntest.main.run_svn(None, "add", new_file)
2707
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2459
  svntest.actions.run_and_verify_svn(None, [],
2708
2460
                                     "ci", "-m", "r2", wc_dir)
2709
2461
 
2710
2462
  # Make r3.
2711
2463
  svntest.main.file_append(new_file, "Next line of text in the file.\n")
2712
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2464
  svntest.actions.run_and_verify_svn(None, [],
2713
2465
                                     "ci", "-m", "r3", wc_dir)
2714
2466
 
2715
2467
  # Try to reverse merge.
2719
2471
  # file (i.e., the URL basename) lives.
2720
2472
  os.chdir(wc_dir)
2721
2473
  target_url = sbox.repo_url + '/new%20file'
2722
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2474
  svntest.actions.run_and_verify_svn(None, [],
2723
2475
                                     "merge", "-r3:2", target_url)
2724
2476
 
2725
2477
#----------------------------------------------------------------------
2740
2492
 
2741
2493
  # Create foo in F
2742
2494
  foo_path = os.path.join(F_path, 'foo')
2743
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', foo_path)
 
2495
  svntest.actions.run_and_verify_svn(None, [], 'mkdir', foo_path)
2744
2496
 
2745
2497
  expected_output = wc.State(wc_dir, {
2746
2498
    'A/B/F/foo' : Item(verb='Adding'),
2751
2503
    })
2752
2504
  svntest.actions.run_and_verify_commit(wc_dir,
2753
2505
                                        expected_output,
2754
 
                                        expected_status,
2755
 
                                        None, wc_dir)
 
2506
                                        expected_status)
2756
2507
 
2757
2508
  # Create an unversioned foo
2758
2509
  foo_path = sbox.ospath('foo')
2763
2514
  # syntax of the merge command.
2764
2515
  ### TODO: We can use run_and_verify_merge() here now.
2765
2516
  expected_output = expected_merge_output(None, "A    " + foo_path + "\n")
2766
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
2517
  svntest.actions.run_and_verify_svn(expected_output, [],
2767
2518
                                     'merge', '--allow-mixed-revisions',
2768
2519
                                     C_url, F_url, wc_dir)
2769
2520
 
2793
2544
  beta_path = sbox.ospath('A/B/E/beta')
2794
2545
  E_path = sbox.ospath('A/B/E')
2795
2546
 
2796
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2547
  svntest.actions.run_and_verify_svn(None, [],
2797
2548
                                     'propset', 'foo', 'foo_val',
2798
2549
                                     alpha_path, beta_path)
2799
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2550
  svntest.actions.run_and_verify_svn(None, [],
2800
2551
                                     'propset', 'foo', 'foo_val',
2801
2552
                                     E_path)
2802
2553
 
2809
2560
  expected_status.tweak('A/B/E', 'A/B/E/alpha', 'A/B/E/beta',
2810
2561
                        wc_rev=2, status='  ')
2811
2562
  svntest.actions.run_and_verify_commit(wc_dir,
2812
 
                                        expected_output, expected_status,
2813
 
                                        None, wc_dir)
2814
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
2563
                                        expected_output, expected_status)
 
2564
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2815
2565
 
2816
2566
  # Copy B to B2 as rev 3  (making a branch)
2817
2567
  B_url = sbox.repo_url + '/A/B'
2818
2568
  B2_url = sbox.repo_url + '/A/B2'
2819
2569
 
2820
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2570
  svntest.actions.run_and_verify_svn(None, [],
2821
2571
                                     'copy', '-m', 'copy B to B2',
2822
2572
                                     B_url, B2_url)
2823
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
2573
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2824
2574
 
2825
2575
  # Change the properties underneath B again, and commit as r4
2826
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2576
  svntest.actions.run_and_verify_svn(None, [],
2827
2577
                                     'propset', 'foo', 'foo_val2',
2828
2578
                                     alpha_path)
2829
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2579
  svntest.actions.run_and_verify_svn(None, [],
2830
2580
                                     'propdel', 'foo',
2831
2581
                                     beta_path)
2832
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2582
  svntest.actions.run_and_verify_svn(None, [],
2833
2583
                                     'propset', 'foo', 'foo_val2',
2834
2584
                                     E_path)
2835
2585
  expected_output = svntest.wc.State(wc_dir, {
2838
2588
    'A/B/E/beta'  : Item(verb='Sending'),
2839
2589
    })
2840
2590
  svntest.actions.run_and_verify_commit(wc_dir,
2841
 
                                        expected_output, None,
2842
 
                                        None, wc_dir)
2843
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
2591
                                        expected_output, None)
 
2592
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2844
2593
 
2845
2594
  # Make local propchanges to E, alpha and beta in the branch.
2846
2595
  alpha_path2 = sbox.ospath('A/B2/E/alpha')
2847
2596
  beta_path2 = sbox.ospath('A/B2/E/beta')
2848
2597
  E_path2 = sbox.ospath('A/B2/E')
2849
2598
 
2850
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2599
  svntest.actions.run_and_verify_svn(None, [],
2851
2600
                                     'propset', 'foo', 'branchval',
2852
2601
                                     alpha_path2, beta_path2)
2853
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2602
  svntest.actions.run_and_verify_svn(None, [],
2854
2603
                                     'propset', 'foo', 'branchval',
2855
2604
                                     E_path2)
2856
2605
 
2901
2650
                                       expected_disk,
2902
2651
                                       expected_status,
2903
2652
                                       expected_skip,
2904
 
                                       None, # expected error string
2905
 
                                       svntest.tree.detect_conflict_files,
2906
 
                                       extra_files,
2907
 
                                       None, None, # no B singleton handler
2908
 
                                       1, # check props
2909
 
                                       0) # dry_run
 
2653
                                       [], True, False,
 
2654
                                       extra_files=extra_files)
2910
2655
 
2911
2656
#----------------------------------------------------------------------
2912
2657
# Test for issue 2035, whereby 'svn merge' wouldn't always mark
2923
2668
  alpha_path = sbox.ospath('A/B/E/alpha')
2924
2669
  E_path = sbox.ospath('A/B/E')
2925
2670
 
2926
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2671
  svntest.actions.run_and_verify_svn(None, [],
2927
2672
                                     'propset', 'foo', 'foo_val',
2928
2673
                                     alpha_path)
2929
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2674
  svntest.actions.run_and_verify_svn(None, [],
2930
2675
                                     'propset', 'foo', 'foo_val',
2931
2676
                                     E_path)
2932
2677
 
2937
2682
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
2938
2683
  expected_status.tweak('A/B/E', 'A/B/E/alpha', wc_rev=2, status='  ')
2939
2684
  svntest.actions.run_and_verify_commit(wc_dir,
2940
 
                                        expected_output, expected_status,
2941
 
                                        None, wc_dir)
2942
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
2685
                                        expected_output, expected_status)
 
2686
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2943
2687
 
2944
2688
  # Copy B to B2 as rev 3  (making a branch)
2945
2689
  B_url = sbox.repo_url + '/A/B'
2946
2690
  B2_url = sbox.repo_url + '/A/B2'
2947
2691
 
2948
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2692
  svntest.actions.run_and_verify_svn(None, [],
2949
2693
                                     'copy', '-m', 'copy B to B2',
2950
2694
                                     B_url, B2_url)
2951
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
2695
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2952
2696
 
2953
2697
  # Change the properties underneath B again, and commit as r4
2954
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2698
  svntest.actions.run_and_verify_svn(None, [],
2955
2699
                                     'propset', 'foo', 'foo_val2',
2956
2700
                                     alpha_path)
2957
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2701
  svntest.actions.run_and_verify_svn(None, [],
2958
2702
                                     'propset', 'foo', 'foo_val2',
2959
2703
                                     E_path)
2960
2704
  expected_output = svntest.wc.State(wc_dir, {
2962
2706
    'A/B/E/alpha' : Item(verb='Sending'),
2963
2707
    })
2964
2708
  svntest.actions.run_and_verify_commit(wc_dir,
2965
 
                                        expected_output, None,
2966
 
                                        None, wc_dir)
2967
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
2709
                                        expected_output, None)
 
2710
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2968
2711
 
2969
2712
  # Make different propchanges changes to the B2 branch and commit as r5.
2970
2713
  alpha_path2 = sbox.ospath('A/B2/E/alpha')
2971
2714
  E_path2 = sbox.ospath('A/B2/E')
2972
2715
 
2973
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2716
  svntest.actions.run_and_verify_svn(None, [],
2974
2717
                                     'propset', 'foo', 'branchval',
2975
2718
                                     alpha_path2)
2976
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2719
  svntest.actions.run_and_verify_svn(None, [],
2977
2720
                                     'propset', 'foo', 'branchval',
2978
2721
                                     E_path2)
2979
2722
  expected_output = svntest.wc.State(wc_dir, {
2981
2724
    'A/B2/E/alpha' : Item(verb='Sending'),
2982
2725
    })
2983
2726
  svntest.actions.run_and_verify_commit(wc_dir,
2984
 
                                        expected_output, None,
2985
 
                                        None, wc_dir)
2986
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
2727
                                        expected_output, None)
 
2728
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
2987
2729
 
2988
2730
  # Now merge the recent B change to the branch.  There are no local
2989
2731
  # mods anywhere, but we should still get property conflicts anyway!
3031
2773
                                       expected_disk,
3032
2774
                                       expected_status,
3033
2775
                                       expected_skip,
3034
 
                                       None, # expected error string
3035
 
                                       svntest.tree.detect_conflict_files,
3036
 
                                       extra_files,
3037
 
                                       None, None, # no B singleton handler
3038
 
                                       1, # check props
3039
 
                                       0) # dry_run
 
2776
                                       [], True, False,
 
2777
                                       extra_files=extra_files)
3040
2778
 
3041
2779
#----------------------------------------------------------------------
3042
2780
# Another test for issue 2035, whereby sometimes 'svn merge' marked
3050
2788
 
3051
2789
  # Add a property to a file, commit as r2.
3052
2790
  alpha_path = sbox.ospath('A/B/E/alpha')
3053
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2791
  svntest.actions.run_and_verify_svn(None, [],
3054
2792
                                     'propset', 'foo', 'foo_val',
3055
2793
                                     alpha_path)
3056
2794
 
3061
2799
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
3062
2800
  expected_status.tweak('A/B/E/alpha', wc_rev=2, status='  ')
3063
2801
  svntest.actions.run_and_verify_commit(wc_dir,
3064
 
                                        expected_output, expected_status,
3065
 
                                        None, wc_dir)
3066
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
2802
                                        expected_output, expected_status)
 
2803
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
3067
2804
 
3068
2805
  # Use 'svn merge' to undo the commit.  ('svn merge -r2:1')
3069
2806
  # Result should be a single local-prop-mod.
3089
2826
                                       expected_disk,
3090
2827
                                       expected_status,
3091
2828
                                       expected_skip,
3092
 
                                       None, # expected error string
3093
 
                                       None, None, # no A singleton handler
3094
 
                                       None, None, # no B singleton handler
3095
 
                                       1, # check props
3096
 
                                       0) # dry_run
 
2829
                                       [], True, False)
3097
2830
 
3098
2831
  # Change mind, re-apply the change ('svn merge -r1:2').
3099
2832
  # This should merge cleanly into existing prop-mod, status shows nothing.
3123
2856
                                       expected_disk,
3124
2857
                                       expected_status,
3125
2858
                                       expected_skip,
3126
 
                                       None, # expected error string
3127
 
                                       None, None, # no A singleton handler
3128
 
                                       None, None, # no B singleton handler
3129
 
                                       1, # check props
3130
 
                                       0, # dry_run
 
2859
                                       [], True, False,
3131
2860
                                       '--ignore-ancestry', wc_dir)
3132
2861
 
3133
2862
 
3147
2876
  branch_mu_path = sbox.ospath('copy-of-A/mu')
3148
2877
 
3149
2878
  # Create a branch of A.
3150
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
2879
  svntest.actions.run_and_verify_svn(None, [], 'cp',
3151
2880
                                     A_url, branch_A_url,
3152
2881
                                     '-m', "Creating copy-of-A")
3153
2882
 
3154
2883
  # Update to get the branch.
3155
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
2884
  svntest.actions.run_and_verify_svn(None, [],
3156
2885
                                     'update', wc_dir)
3157
2886
 
3158
2887
  # Change mu's text on the branch, producing r3 through r6.
3159
2888
  for rev in range(3, 7):
3160
2889
    svntest.main.file_append(branch_mu_path, ("r%d\n" % rev) * 3)
3161
 
    svntest.actions.run_and_verify_svn(None, None, [],
 
2890
    svntest.actions.run_and_verify_svn(None, [],
3162
2891
                                       'ci', '-m',
3163
2892
                                       'Add lines to mu in r%d.' % rev, wc_dir)
3164
2893
 
3165
2894
  # Mark r5 as merged into trunk, to create disparate revision ranges
3166
2895
  # which need to be merged.
3167
2896
  svntest.actions.run_and_verify_svn(
3168
 
    None,
3169
2897
    expected_merge_output([[5]],
3170
2898
                          [' U   ' + A_path + '\n']),
3171
2899
    [], 'merge', '-c5', '--record-only',
3176
2904
  expected_output = wc.State(A_path, {
3177
2905
    'mu'       : Item(status='C '),
3178
2906
    })
3179
 
  expected_mergeinfo_output = wc.State(A_path, {})
 
2907
  expected_mergeinfo_output = wc.State(A_path, {
 
2908
    ''          : Item(status=' G')
 
2909
    })
3180
2910
  expected_elision_output = wc.State(A_path, {
3181
2911
    })
3182
2912
  expected_disk = wc.State('', {
3183
2913
    'mu'        : Item("This is the file 'mu'.\n"
3184
 
                       + make_conflict_marker_text("r3\n" * 3, "r4\n" * 3, 4)),
 
2914
                       + make_conflict_marker_text('', "r3\n" * 3 + "r4\n" * 3, 3, 4,
 
2915
                                                   old_text='r3\n' * 3)),
3185
2916
    'B'         : Item(),
3186
2917
    'B/lambda'  : Item("This is the file 'lambda'.\n"),
3187
2918
    'B/E'       : Item(),
3223
2954
    })
3224
2955
  expected_status.tweak(wc_rev=2)
3225
2956
  expected_skip = wc.State('', { })
3226
 
  expected_error = "conflicts were produced while merging r3:4"
 
2957
  expected_error = ".*conflicts were produced while merging r3:4.*"
3227
2958
  svntest.actions.run_and_verify_merge(A_path, '3', '6', branch_A_url, None,
3228
2959
                                       expected_output,
3229
2960
                                       expected_mergeinfo_output,
3232
2963
                                       expected_status,
3233
2964
                                       expected_skip,
3234
2965
                                       expected_error,
3235
 
                                       svntest.tree.detect_conflict_files,
 
2966
                                       extra_files=
3236
2967
                                       ["mu\.working",
3237
2968
                                        "mu\.merge-right\.r4",
3238
 
                                        "mu\.merge-left\.r3"],
3239
 
                                       None, None, # no singleton handler
3240
 
                                       0, # don't check props
3241
 
                                       0) # not a dry_run
 
2969
                                        "mu\.merge-left\.r3"])
3242
2970
 
3243
2971
#----------------------------------------------------------------------
3244
2972
# Test for issue 2135
3251
2979
 
3252
2980
  # File scheduled for deletion
3253
2981
  rho_path = sbox.ospath('A/D/G/rho')
3254
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', rho_path)
 
2982
  svntest.actions.run_and_verify_svn(None, [], 'rm', rho_path)
3255
2983
 
3256
2984
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
3257
2985
  expected_status.tweak('A/D/G/rho', status='D ')
3266
2994
  # Commit rev 2
3267
2995
  svntest.actions.run_and_verify_commit(wc_dir,
3268
2996
                                        expected_output,
3269
 
                                        expected_status,
3270
 
                                        None, wc_dir)
 
2997
                                        expected_status)
3271
2998
  # Create and add a new file.
3272
2999
  svntest.main.file_write(rho_path, "new rho\n")
3273
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', rho_path)
 
3000
  svntest.actions.run_and_verify_svn(None, [], 'add', rho_path)
3274
3001
 
3275
3002
  # Commit revsion 3
3276
3003
  expected_status.add({
3283
3010
 
3284
3011
  svntest.actions.run_and_verify_commit(wc_dir,
3285
3012
                                        expected_output,
3286
 
                                        None,
3287
 
                                        None, wc_dir)
 
3013
                                        None)
3288
3014
 
3289
3015
  # Update working copy
3290
3016
  expected_output = svntest.wc.State(wc_dir, {})
3327
3053
  expected_status.tweak('A/D/G/rho', status='  ', copied=None, wc_rev='4')
3328
3054
  svntest.actions.run_and_verify_commit(wc_dir,
3329
3055
                                        expected_output,
3330
 
                                        expected_status,
3331
 
                                        None,
3332
 
                                        wc_dir)
 
3056
                                        expected_status)
3333
3057
 
3334
3058
#----------------------------------------------------------------------
3335
3059
# Test for issue 2522
3343
3067
 
3344
3068
  # File scheduled for deletion
3345
3069
  rho_path = sbox.ospath('A/D/G/rho')
3346
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', rho_path)
 
3070
  svntest.actions.run_and_verify_svn(None, [], 'rm', rho_path)
3347
3071
 
3348
3072
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
3349
3073
  expected_status.tweak('A/D/G/rho', status='D ')
3358
3082
  # Commit rev 2
3359
3083
  svntest.actions.run_and_verify_commit(wc_dir,
3360
3084
                                        expected_output,
3361
 
                                        expected_status,
3362
 
                                        None, wc_dir)
 
3085
                                        expected_status)
3363
3086
 
3364
3087
  # Update working copy
3365
3088
  expected_disk   = svntest.main.greek_state.copy()
3374
3097
 
3375
3098
  # Create and add a new file.
3376
3099
  svntest.main.file_write(rho_path, "new rho\n")
3377
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', rho_path)
 
3100
  svntest.actions.run_and_verify_svn(None, [], 'add', rho_path)
3378
3101
 
3379
3102
  # Commit revsion 3
3380
3103
  expected_status.add({
3391
3114
 
3392
3115
  svntest.actions.run_and_verify_commit(wc_dir,
3393
3116
                                        expected_output,
3394
 
                                        expected_status,
3395
 
                                        None, wc_dir)
 
3117
                                        expected_status)
3396
3118
 
3397
3119
  # merge changes from r3:1...
3398
3120
  #
3404
3126
  # Normally we'd simply update the whole working copy, but since that would
3405
3127
  # defeat the purpose of this test (see the comment below), instead we'll
3406
3128
  # update only "." using --depth empty.  This preserves the intent of the
3407
 
  # orginal mixed-rev test for this issue, but allows the merge tracking
 
3129
  # original mixed-rev test for this issue, but allows the merge tracking
3408
3130
  # logic to consider r3 as valid for reverse merging.
3409
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3131
  svntest.actions.run_and_verify_svn(None, [],
3410
3132
                                     'up', '--depth', 'empty', wc_dir)
3411
3133
  expected_status.tweak('', wc_rev=3)
3412
3134
  expected_output = svntest.wc.State(wc_dir, {
3429
3151
                                       expected_disk,
3430
3152
                                       expected_status,
3431
3153
                                       expected_skip,
3432
 
                                       None, None, None, None, None,
 
3154
                                       [],
3433
3155
                                       True, False, '--allow-mixed-revisions',
3434
3156
                                       wc_dir)
3435
3157
 
3444
3166
  expected_status.tweak('A/D/G/rho', status='  ', copied=None, wc_rev='4')
3445
3167
  svntest.actions.run_and_verify_commit(wc_dir,
3446
3168
                                        expected_output,
3447
 
                                        expected_status,
3448
 
                                        None,
3449
 
                                        wc_dir)
 
3169
                                        expected_status)
3450
3170
 
3451
3171
#----------------------------------------------------------------------
3452
3172
# use -x -w option for ignoring whitespace during merge
3469
3189
  expected_output = svntest.wc.State(wc_dir, {
3470
3190
      'iota' : Item(verb='Sending'),
3471
3191
      })
3472
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3473
 
                                        None, None, wc_dir)
 
3192
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, None)
3474
3193
 
3475
3194
  # change the file, mostly whitespace changes + an extra line
3476
3195
  svntest.main.file_write(file_path, "A  a\nBb \n Cc\nNew line in iota\n")
3479
3198
  expected_status.tweak(file_name, wc_rev=3)
3480
3199
  svntest.actions.run_and_verify_commit(wc_dir,
3481
3200
                                        expected_output,
3482
 
                                        expected_status,
3483
 
                                        None,
3484
 
                                        wc_dir)
 
3201
                                        expected_status)
3485
3202
 
3486
3203
  # Backdate iota to revision 2, so we can merge in the rev 3 changes.
3487
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3204
  svntest.actions.run_and_verify_svn(None, [],
3488
3205
                                     'up', '-r', '2', file_path)
3489
3206
  # Make some local whitespace changes, these should not conflict
3490
3207
  # with the remote whitespace changes as both will be ignored.
3517
3234
                                       expected_disk,
3518
3235
                                       expected_status,
3519
3236
                                       expected_skip,
3520
 
                                       None, None, None, None, None,
3521
 
                                       0, 0, '--allow-mixed-revisions',
 
3237
                                       [], False, False,
 
3238
                                       '--allow-mixed-revisions',
3522
3239
                                       '-x', '-w', wc_dir)
3523
3240
 
3524
3241
#----------------------------------------------------------------------
3543
3260
  expected_output = svntest.wc.State(wc_dir, {
3544
3261
      'iota' : Item(verb='Sending'),
3545
3262
      })
3546
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3547
 
                                        None, None, wc_dir)
 
3263
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, None)
3548
3264
 
3549
3265
  # change the file, mostly eol changes + an extra line
3550
3266
  svntest.main.file_write(file_path,
3558
3274
  expected_status.tweak(file_name, wc_rev=3)
3559
3275
  svntest.actions.run_and_verify_commit(wc_dir,
3560
3276
                                        expected_output,
3561
 
                                        expected_status,
3562
 
                                        None,
3563
 
                                        wc_dir)
 
3277
                                        expected_status)
3564
3278
 
3565
3279
  # Backdate iota to revision 2, so we can merge in the rev 3 changes.
3566
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3280
  svntest.actions.run_and_verify_svn(None, [],
3567
3281
                                     'up', '-r', '2', file_path)
3568
3282
  # Make some local eol changes, these should not conflict
3569
3283
  # with the remote eol changes as both will be ignored.
3600
3314
                                       expected_disk,
3601
3315
                                       expected_status,
3602
3316
                                       expected_skip,
3603
 
                                       None, None, None, None, None,
3604
 
                                       0, 0, '--allow-mixed-revisions',
 
3317
                                       [], False, False,
 
3318
                                       '--allow-mixed-revisions',
3605
3319
                                       '-x', '--ignore-eol-style', wc_dir)
3606
3320
 
3607
3321
#----------------------------------------------------------------------
3630
3344
 
3631
3345
  # Checkout a second working copy
3632
3346
  wc_backup = sbox.add_wc_path('backup')
3633
 
  svntest.actions.run_and_verify_svn(None, None, [], 'checkout',
 
3347
  svntest.actions.run_and_verify_svn(None, [], 'checkout',
3634
3348
                                     sbox.repo_url, wc_backup)
3635
3349
 
3636
3350
  # set starting revision
3663
3377
 
3664
3378
    # Commit the original change and note the 'base' revision number
3665
3379
    svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3666
 
                                          expected_status, None,
3667
 
                                          wc_dir)
 
3380
                                          expected_status)
3668
3381
    cur_rev = cur_rev + 1
3669
3382
    base_rev = cur_rev
3670
3383
 
3696
3409
    'A/mu' : Item(contents= "This is the file 'mu'." + eolchar +
3697
3410
      "<<<<<<< .working" + eolchar +
3698
3411
      "Conflicting appended text for mu" + eolchar +
 
3412
      "||||||| .merge-left.r" + str(cur_rev - 1) + eolchar +
3699
3413
      "=======" + eolchar +
3700
3414
      "Original appended text for mu" + eolchar +
3701
3415
      ">>>>>>> .merge-right.r" + str(cur_rev) + eolchar),
3771
3485
 
3772
3486
  # Checkout a second working copy
3773
3487
  wc_backup = sbox.add_wc_path('backup')
3774
 
  svntest.actions.run_and_verify_svn(None, None, [], 'checkout',
 
3488
  svntest.actions.run_and_verify_svn(None, [], 'checkout',
3775
3489
                                     sbox.repo_url, wc_backup)
3776
3490
  path_backup = os.path.join(wc_backup, 'A', 'mu')
3777
3491
 
3895
3609
    'A/B/F/E/beta'  : Item(status='  ', wc_rev=2),
3896
3610
    })
3897
3611
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3898
 
                                        expected_status, None,
3899
 
                                        wc_dir)
 
3612
                                        expected_status)
3900
3613
 
3901
3614
  svntest.main.run_svn(None, 'cp', A_B_F_E_path, A_B_F_E1_path)
3902
3615
 
3910
3623
    'A/B/F/E1/beta'  : Item(status='  ', wc_rev=3),
3911
3624
    })
3912
3625
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3913
 
                                        expected_status, None,
3914
 
                                        wc_dir)
 
3626
                                        expected_status)
3915
3627
 
3916
3628
  # Bring the entire WC up to date with rev 3.
3917
 
  svntest.actions.run_and_verify_svn(None, None, [], 'update', wc_dir)
 
3629
  svntest.actions.run_and_verify_svn(None, [], 'update', wc_dir)
3918
3630
  expected_status.tweak(wc_rev=3)
3919
3631
 
3920
3632
  # Copy B and commit, creating revision 4.
3935
3647
    'A/copy-of-B/lambda'     : Item(status='  ', wc_rev=4),
3936
3648
    })
3937
3649
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3938
 
                                        expected_status, None,
3939
 
                                        wc_dir)
 
3650
                                        expected_status)
3940
3651
 
3941
3652
  expected_disk = svntest.main.greek_state.copy()
3942
3653
  expected_disk.remove('A/B/E', 'A/B/E/alpha', 'A/B/E/beta')
3960
3671
  svntest.actions.verify_disk(wc_dir, expected_disk, True)
3961
3672
 
3962
3673
  # Bring the entire WC up to date with rev 4.
3963
 
  svntest.actions.run_and_verify_svn(None, None, [], 'update', wc_dir)
 
3674
  svntest.actions.run_and_verify_svn(None, [], 'update', wc_dir)
3964
3675
 
3965
3676
  svntest.actions.verify_disk(wc_dir, expected_disk, True)
3966
3677
 
3994
3705
    })
3995
3706
  expected_status.tweak('A/B/F/E/alpha', wc_rev=5)
3996
3707
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3997
 
                                        expected_status, None,
3998
 
                                        wc_dir)
 
3708
                                        expected_status)
3999
3709
 
4000
3710
  # Bring the entire WC up to date with rev 5.
4001
 
  svntest.actions.run_and_verify_svn(None, None, [], 'update', wc_dir)
 
3711
  svntest.actions.run_and_verify_svn(None, [], 'update', wc_dir)
4002
3712
 
4003
3713
  # Merge changes from rev 5 of B (to alpha) into copy_of_B.
4004
3714
  expected_output = wc.State(copy_of_B_path, {
4041
3751
                                       expected_disk,
4042
3752
                                       expected_status,
4043
3753
                                       expected_skip,
4044
 
                                       None,
4045
 
                                       None,
4046
 
                                       None,
4047
 
                                       None,
4048
 
                                       None, 1)
 
3754
                                       check_props=True)
4049
3755
 
4050
3756
  # Commit the result of the merge, creating revision 6.
4051
3757
  expected_output = svntest.wc.State(copy_of_B_path, {
4053
3759
    'F/E/alpha' : Item(verb='Sending'),
4054
3760
    })
4055
3761
  svntest.actions.run_and_verify_commit(copy_of_B_path, expected_output,
4056
 
                                        None, None, wc_dir)
 
3762
                                        None)
4057
3763
 
4058
3764
  # Update the WC to bring /A/copy_of_B/F from rev 4 to rev 6.
4059
3765
  # Without this update, a subsequent merge will not find any merge
4060
3766
  # info for /A/copy_of_B/F -- nor its parent dir in the repos -- at
4061
3767
  # rev 4.  Mergeinfo wasn't introduced until rev 6.
4062
3768
  copy_of_B_F_E_path = os.path.join(copy_of_B_path, 'F', 'E')
4063
 
  svntest.actions.run_and_verify_svn(None, None, [], 'update', wc_dir)
 
3769
  svntest.actions.run_and_verify_svn(None, [], 'update', wc_dir)
4064
3770
 
4065
3771
  # Attempt to re-merge changes to alpha from rev 4.  Use the merge
4066
3772
  # info inherited from the grandparent (copy-of-B) of our merge
4071
3777
    'beta'  : Item(status='  ', wc_rev=6),
4072
3778
    })
4073
3779
  svntest.actions.run_and_verify_svn(
4074
 
    None,
4075
3780
    expected_merge_output([[5]],
4076
3781
                          [' U   ' + copy_of_B_F_E_path + '\n',
4077
3782
                           ' G   ' + copy_of_B_F_E_path + '\n'],
4118
3823
    })
4119
3824
  expected_status.tweak('A/B/F/E/alpha', wc_rev=5)
4120
3825
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
4121
 
                                        expected_status, None, wc_dir)
 
3826
                                        expected_status)
4122
3827
 
4123
3828
  for path_and_mergeinfo in (('E', '/A/B/F/E:5'),
4124
3829
                             ('E1', '/A/B/F/E:5')):
4152
3857
                                         expected_disk,
4153
3858
                                         expected_status,
4154
3859
                                         expected_skip,
4155
 
                                         None,
4156
 
                                         None,
4157
 
                                         None,
4158
 
                                         None,
4159
 
                                         None, 1)
 
3860
                                         check_props=True)
4160
3861
 
4161
3862
    # Commit the result of the merge, creating new revision.
4162
3863
    expected_output = svntest.wc.State(path_name, {
4164
3865
      'alpha' : Item(verb='Sending'),
4165
3866
      })
4166
3867
    svntest.actions.run_and_verify_commit(path_name,
4167
 
                                          expected_output, None, None, wc_dir)
 
3868
                                          expected_output, None, [], wc_dir)
4168
3869
 
4169
3870
  # Edit A/B/F/E/alpha and commit it, creating revision 8.
4170
3871
  new_content_for_alpha = 'new content to alpha\none more line\n'
4179
3880
    'beta'  : Item(status='  ', wc_rev=4),
4180
3881
    })
4181
3882
  svntest.actions.run_and_verify_commit(A_B_F_E_path, expected_output,
4182
 
                                        expected_status, None, wc_dir)
 
3883
                                        expected_status, [], wc_dir)
4183
3884
 
4184
3885
  # Update the WC to bring /A/copy_of_B to rev 8.
4185
3886
  # Without this update expected_status tree would be cumbersome to
4186
3887
  # understand.
4187
 
  svntest.actions.run_and_verify_svn(None, None, [], 'update', wc_dir)
 
3888
  svntest.actions.run_and_verify_svn(None, [], 'update', wc_dir)
4188
3889
 
4189
3890
  # Merge changes from rev 4:8 of A/B into A/copy_of_B.  A/copy_of_B/F/E1
4190
3891
  # has explicit mergeinfo and exists at r4 in the merge source, so it
4234
3935
                                       expected_disk,
4235
3936
                                       expected_status,
4236
3937
                                       expected_skip,
4237
 
                                       None,
4238
 
                                       None,
4239
 
                                       None,
4240
 
                                       None,
4241
 
                                       None, 1)
 
3938
                                       check_props=True)
4242
3939
 
4243
3940
  # Test for part of Issue #2821, see
4244
3941
  # http://subversion.tigris.org/issues/show_bug.cgi?id=2821#desc22
4245
3942
  #
4246
3943
  # Revert all local changes.
4247
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
3944
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
4248
3945
 
4249
3946
  # Make a text mod to A/copy-of-B/F/E/alpha
4250
3947
  newer_content_for_alpha = "Conflicting content"
4292
3989
                                       expected_disk,
4293
3990
                                       expected_status,
4294
3991
                                       expected_skip,
4295
 
                                       None,
4296
 
                                       None,
4297
 
                                       None,
4298
 
                                       None,
4299
 
                                       None, 1)
 
3992
                                       check_props=True)
4300
3993
 
4301
3994
#----------------------------------------------------------------------
4302
3995
def tweak_src_then_merge_to_dest(sbox, src_path, dst_path,
4316
4009
                             { '': Item(wc_rev=new_rev, status='  ')})
4317
4010
 
4318
4011
  svntest.actions.run_and_verify_commit(src_path, expected_output,
4319
 
                                        expected_status, None, src_path)
 
4012
                                        expected_status)
4320
4013
 
4321
4014
  # Update the WC to new_rev so that it would be easier to expect everyone
4322
4015
  # to be at new_rev.
4323
 
  svntest.actions.run_and_verify_svn(None, None, [], 'update', wc_dir)
 
4016
  svntest.actions.run_and_verify_svn(None, [], 'update', wc_dir)
4324
4017
 
4325
4018
  # Merge new_rev of src_path to dst_path.
4326
4019
 
4332
4025
    merge_url = merge_url.replace('\\', '/')
4333
4026
 
4334
4027
  svntest.actions.run_and_verify_svn(
4335
 
    None,
4336
4028
    expected_merge_output([[new_rev]],
4337
4029
                          ['U    ' + dst_path + '\n',
4338
4030
                           ' U   ' + dst_path + '\n']),
4380
4072
    'A/copy-of-D/gamma'   : Item(status='  ', wc_rev=2),
4381
4073
    })
4382
4074
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
4383
 
                                        expected_status, None, wc_dir)
 
4075
                                        expected_status)
4384
4076
 
4385
4077
 
4386
4078
  cur_rev = 2
4403
4095
                                           file_contents, cur_rev)
4404
4096
 
4405
4097
  copy_of_A_D_wc_rev = cur_rev
4406
 
  svntest.actions.run_and_verify_svn(None,
4407
 
                                     ['\n',
 
4098
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
4408
4099
                                      'Committed revision ' + str(cur_rev+1) +
4409
4100
                                      '.\n'],
4410
4101
                                     [],
4472
4163
                                       expected_disk,
4473
4164
                                       expected_status,
4474
4165
                                       expected_skip,
4475
 
                                       None,
4476
 
                                       None,
4477
 
                                       None,
4478
 
                                       None,
4479
 
                                       None, 1)
4480
 
 
4481
 
#----------------------------------------------------------------------
4482
 
def set_up_branch(sbox, branch_only = False, nbr_of_branches = 1):
4483
 
  '''Starting with standard greek tree, copy 'A' NBR_OF_BRANCHES times
4484
 
  to A_COPY, A_COPY_2, A_COPY_3, and so on.  Then make four modifications
4485
 
  (setting file contents to "New content") under A:
4486
 
    r(2 + NBR_OF_BRANCHES) - A/D/H/psi
4487
 
    r(3 + NBR_OF_BRANCHES) - A/D/G/rho
4488
 
    r(4 + NBR_OF_BRANCHES) - A/B/E/beta
4489
 
    r(5 + NBR_OF_BRANCHES) - A/D/H/omega
4490
 
  Return (expected_disk, expected_status).'''
4491
 
 
4492
 
  # With the default parameters, the branching looks like this:
4493
 
  #
4494
 
  #   A         -1-----3-4-5-6--
4495
 
  #                \
4496
 
  #   A_COPY        2-----------
4497
 
 
4498
 
  wc_dir = sbox.wc_dir
4499
 
 
4500
 
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
4501
 
  expected_disk = svntest.main.greek_state.copy()
4502
 
 
4503
 
  def copy_A(dest_name, rev):
4504
 
    expected = svntest.verify.UnorderedOutput(
4505
 
      ["A    " + os.path.join(wc_dir, dest_name, "B") + "\n",
4506
 
       "A    " + os.path.join(wc_dir, dest_name, "B", "lambda") + "\n",
4507
 
       "A    " + os.path.join(wc_dir, dest_name, "B", "E") + "\n",
4508
 
       "A    " + os.path.join(wc_dir, dest_name, "B", "E", "alpha") + "\n",
4509
 
       "A    " + os.path.join(wc_dir, dest_name, "B", "E", "beta") + "\n",
4510
 
       "A    " + os.path.join(wc_dir, dest_name, "B", "F") + "\n",
4511
 
       "A    " + os.path.join(wc_dir, dest_name, "mu") + "\n",
4512
 
       "A    " + os.path.join(wc_dir, dest_name, "C") + "\n",
4513
 
       "A    " + os.path.join(wc_dir, dest_name, "D") + "\n",
4514
 
       "A    " + os.path.join(wc_dir, dest_name, "D", "gamma") + "\n",
4515
 
       "A    " + os.path.join(wc_dir, dest_name, "D", "G") + "\n",
4516
 
       "A    " + os.path.join(wc_dir, dest_name, "D", "G", "pi") + "\n",
4517
 
       "A    " + os.path.join(wc_dir, dest_name, "D", "G", "rho") + "\n",
4518
 
       "A    " + os.path.join(wc_dir, dest_name, "D", "G", "tau") + "\n",
4519
 
       "A    " + os.path.join(wc_dir, dest_name, "D", "H") + "\n",
4520
 
       "A    " + os.path.join(wc_dir, dest_name, "D", "H", "chi") + "\n",
4521
 
       "A    " + os.path.join(wc_dir, dest_name, "D", "H", "omega") + "\n",
4522
 
       "A    " + os.path.join(wc_dir, dest_name, "D", "H", "psi") + "\n",
4523
 
       "Checked out revision " + str(rev - 1) + ".\n",
4524
 
       "A         " + os.path.join(wc_dir, dest_name) + "\n"])
4525
 
    expected_status.add({
4526
 
      dest_name + "/B"         : Item(status='  ', wc_rev=rev),
4527
 
      dest_name + "/B/lambda"  : Item(status='  ', wc_rev=rev),
4528
 
      dest_name + "/B/E"       : Item(status='  ', wc_rev=rev),
4529
 
      dest_name + "/B/E/alpha" : Item(status='  ', wc_rev=rev),
4530
 
      dest_name + "/B/E/beta"  : Item(status='  ', wc_rev=rev),
4531
 
      dest_name + "/B/F"       : Item(status='  ', wc_rev=rev),
4532
 
      dest_name + "/mu"        : Item(status='  ', wc_rev=rev),
4533
 
      dest_name + "/C"         : Item(status='  ', wc_rev=rev),
4534
 
      dest_name + "/D"         : Item(status='  ', wc_rev=rev),
4535
 
      dest_name + "/D/gamma"   : Item(status='  ', wc_rev=rev),
4536
 
      dest_name + "/D/G"       : Item(status='  ', wc_rev=rev),
4537
 
      dest_name + "/D/G/pi"    : Item(status='  ', wc_rev=rev),
4538
 
      dest_name + "/D/G/rho"   : Item(status='  ', wc_rev=rev),
4539
 
      dest_name + "/D/G/tau"   : Item(status='  ', wc_rev=rev),
4540
 
      dest_name + "/D/H"       : Item(status='  ', wc_rev=rev),
4541
 
      dest_name + "/D/H/chi"   : Item(status='  ', wc_rev=rev),
4542
 
      dest_name + "/D/H/omega" : Item(status='  ', wc_rev=rev),
4543
 
      dest_name + "/D/H/psi"   : Item(status='  ', wc_rev=rev),
4544
 
      dest_name                : Item(status='  ', wc_rev=rev)})
4545
 
    expected_disk.add({
4546
 
      dest_name                : Item(),
4547
 
      dest_name + '/B'         : Item(),
4548
 
      dest_name + '/B/lambda'  : Item("This is the file 'lambda'.\n"),
4549
 
      dest_name + '/B/E'       : Item(),
4550
 
      dest_name + '/B/E/alpha' : Item("This is the file 'alpha'.\n"),
4551
 
      dest_name + '/B/E/beta'  : Item("This is the file 'beta'.\n"),
4552
 
      dest_name + '/B/F'       : Item(),
4553
 
      dest_name + '/mu'        : Item("This is the file 'mu'.\n"),
4554
 
      dest_name + '/C'         : Item(),
4555
 
      dest_name + '/D'         : Item(),
4556
 
      dest_name + '/D/gamma'   : Item("This is the file 'gamma'.\n"),
4557
 
      dest_name + '/D/G'       : Item(),
4558
 
      dest_name + '/D/G/pi'    : Item("This is the file 'pi'.\n"),
4559
 
      dest_name + '/D/G/rho'   : Item("This is the file 'rho'.\n"),
4560
 
      dest_name + '/D/G/tau'   : Item("This is the file 'tau'.\n"),
4561
 
      dest_name + '/D/H'       : Item(),
4562
 
      dest_name + '/D/H/chi'   : Item("This is the file 'chi'.\n"),
4563
 
      dest_name + '/D/H/omega' : Item("This is the file 'omega'.\n"),
4564
 
      dest_name + '/D/H/psi'   : Item("This is the file 'psi'.\n"),
4565
 
      })
4566
 
 
4567
 
    # Make a branch A_COPY to merge into.
4568
 
    svntest.actions.run_and_verify_svn(None, expected, [], 'copy',
4569
 
                                       sbox.repo_url + "/A",
4570
 
                                       os.path.join(wc_dir,
4571
 
                                                    dest_name))
4572
 
 
4573
 
    expected_output = wc.State(wc_dir, {dest_name : Item(verb='Adding')})
4574
 
    svntest.actions.run_and_verify_commit(wc_dir,
4575
 
                                          expected_output,
4576
 
                                          expected_status,
4577
 
                                          None,
4578
 
                                          wc_dir)
4579
 
  for i in range(nbr_of_branches):
4580
 
    if i == 0:
4581
 
      copy_A('A_COPY', i + 2)
4582
 
    else:
4583
 
      copy_A('A_COPY_' + str(i + 1), i + 2)
4584
 
 
4585
 
  if branch_only:
4586
 
    return expected_disk, expected_status
4587
 
 
4588
 
  # Make some changes under A which we'll later merge under A_COPY:
4589
 
 
4590
 
  # r(nbr_of_branches + 2) - modify and commit A/D/H/psi
4591
 
  svntest.main.file_write(sbox.ospath('A/D/H/psi'),
4592
 
                          "New content")
4593
 
  expected_output = wc.State(wc_dir, {'A/D/H/psi' : Item(verb='Sending')})
4594
 
  expected_status.tweak('A/D/H/psi', wc_rev=nbr_of_branches + 2)
4595
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
4596
 
                                        expected_status, None, wc_dir)
4597
 
  expected_disk.tweak('A/D/H/psi', contents="New content")
4598
 
 
4599
 
  # r(nbr_of_branches + 3) - modify and commit A/D/G/rho
4600
 
  svntest.main.file_write(sbox.ospath('A/D/G/rho'),
4601
 
                          "New content")
4602
 
  expected_output = wc.State(wc_dir, {'A/D/G/rho' : Item(verb='Sending')})
4603
 
  expected_status.tweak('A/D/G/rho', wc_rev=nbr_of_branches + 3)
4604
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
4605
 
                                        expected_status, None, wc_dir)
4606
 
  expected_disk.tweak('A/D/G/rho', contents="New content")
4607
 
 
4608
 
  # r(nbr_of_branches + 4) - modify and commit A/B/E/beta
4609
 
  svntest.main.file_write(sbox.ospath('A/B/E/beta'),
4610
 
                          "New content")
4611
 
  expected_output = wc.State(wc_dir, {'A/B/E/beta' : Item(verb='Sending')})
4612
 
  expected_status.tweak('A/B/E/beta', wc_rev=nbr_of_branches + 4)
4613
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
4614
 
                                        expected_status, None, wc_dir)
4615
 
  expected_disk.tweak('A/B/E/beta', contents="New content")
4616
 
 
4617
 
  # r(nbr_of_branches + 5) - modify and commit A/D/H/omega
4618
 
  svntest.main.file_write(sbox.ospath('A/D/H/omega'),
4619
 
                          "New content")
4620
 
  expected_output = wc.State(wc_dir, {'A/D/H/omega' : Item(verb='Sending')})
4621
 
  expected_status.tweak('A/D/H/omega', wc_rev=nbr_of_branches + 5)
4622
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
4623
 
                                        expected_status, None, wc_dir)
4624
 
  expected_disk.tweak('A/D/H/omega', contents="New content")
4625
 
 
4626
 
  return expected_disk, expected_status
 
4166
                                       check_props=True)
4627
4167
 
4628
4168
#----------------------------------------------------------------------
4629
4169
@SkipUnless(server_has_mergeinfo)
4705
4245
                                       expected_disk,
4706
4246
                                       expected_status,
4707
4247
                                       expected_skip,
4708
 
                                       None, None, None, None,
4709
 
                                       None, 1)
 
4248
                                       check_props=True)
4710
4249
 
4711
4250
  # Merge r4 again, this time into A_COPY/D/G.  An ancestor directory
4712
4251
  # (A_COPY/D) exists with identical local mergeinfo, so the merge
4740
4279
                                       expected_disk,
4741
4280
                                       expected_status,
4742
4281
                                       expected_skip,
4743
 
                                       None, None, None, None,
4744
 
                                       None, 1)
 
4282
                                       check_props=True)
4745
4283
 
4746
4284
  # Merge r5 into A_COPY/B.  Again, r1 should be inherited from
4747
4285
  # A_COPY (Issue #2733)
4779
4317
                                       expected_disk,
4780
4318
                                       expected_status,
4781
4319
                                       expected_skip,
4782
 
                                       None, None, None, None,
4783
 
                                       None, 1)
 
4320
                                       check_props=True)
4784
4321
 
4785
4322
  # Merge r5 again, this time into A_COPY/B/E/beta.  An ancestor
4786
4323
  # directory (A_COPY/B) exists with identical local mergeinfo, so
4791
4328
  # run_and_verify_merge doesn't support merging to a file WCPATH
4792
4329
  # so use run_and_verify_svn.
4793
4330
  ### TODO: We can use run_and_verify_merge() here now.
4794
 
  svntest.actions.run_and_verify_svn(None, [], [], 'merge', '-c5',
 
4331
  svntest.actions.run_and_verify_svn([], [], 'merge', '-c5',
4795
4332
                                     sbox.repo_url + '/A/B/E/beta',
4796
4333
                                     beta_COPY_path)
4797
4334
 
4866
4403
                                       expected_disk,
4867
4404
                                       expected_status,
4868
4405
                                       expected_skip,
4869
 
                                       None, None, None, None,
4870
 
                                       None, 1)
 
4406
                                       check_props=True)
4871
4407
 
4872
4408
  # Merge r6 into A_COPY/D/H/omega, it should inherit it's nearest
4873
4409
  # ancestor's (A_COPY/D) mergeinfo (Issue #2733 with a file as the
4877
4413
  # so use run_and_verify_svn.
4878
4414
  ### TODO: We can use run_and_verify_merge() here now.
4879
4415
  svntest.actions.run_and_verify_svn(
4880
 
    None,
4881
4416
    expected_merge_output([[6]],
4882
4417
                          ['U    ' + omega_COPY_path + '\n',
4883
4418
                           ' G   ' + omega_COPY_path + '\n']),
4886
4421
    omega_COPY_path)
4887
4422
 
4888
4423
  # Check that mergeinfo was properly set on A_COPY/D/H/omega
4889
 
  svntest.actions.run_and_verify_svn(None,
4890
 
                                     ["/A/D/H/omega:3-4,6\n"],
 
4424
  svntest.actions.run_and_verify_svn(["/A/D/H/omega:3-4,6\n"],
4891
4425
                                     [],
4892
4426
                                     'propget', SVN_PROP_MERGEINFO,
4893
4427
                                     omega_COPY_path)
4916
4450
                  wc_rev=7)
4917
4451
  svntest.actions.run_and_verify_commit(wc_dir,
4918
4452
                                        expected_output,
4919
 
                                        wc_status,
4920
 
                                        None,
4921
 
                                        wc_dir)
 
4453
                                        wc_status)
4922
4454
 
4923
4455
  # In single-db mode you can't create a disconnected working copy by just
4924
4456
  # copying a subdir
4930
4462
  #
4931
4463
  ## Update the disconnected WC it so it will get the most recent mergeinfo
4932
4464
  ## from the repos when merging.
4933
 
  #svntest.actions.run_and_verify_svn(None, exp_noop_up_out(7), [], 'up',
 
4465
  #svntest.actions.run_and_verify_svn(exp_noop_up_out(7), [], 'up',
4934
4466
  #                                   other_wc)
4935
4467
  #
4936
4468
  ## Merge r5:4 into the root of the disconnected WC.
4968
4500
  #                                     expected_disk,
4969
4501
  #                                     expected_status,
4970
4502
  #                                     expected_skip,
4971
 
  #                                     None, None, None, None,
4972
 
  #                                     None, 1)
 
4503
  #                                     check_props=True)
4973
4504
 
4974
4505
#----------------------------------------------------------------------
4975
4506
@SkipUnless(server_has_mergeinfo)
5000
4531
  # so use run_and_verify_svn.
5001
4532
  ### TODO: We can use run_and_verify_merge() here now.
5002
4533
  svntest.actions.run_and_verify_svn(
5003
 
    None,
5004
4534
    expected_merge_output([[5]],
5005
4535
                          ['U    ' + beta_COPY_path + '\n',
5006
4536
                           ' U   ' + beta_COPY_path + '\n']),
5014
4544
    })
5015
4545
  svntest.actions.run_and_verify_status(beta_COPY_path, expected_status)
5016
4546
 
5017
 
  svntest.actions.run_and_verify_svn(None, ["/A/B/E/beta:5\n"], [],
 
4547
  svntest.actions.run_and_verify_svn(["/A/B/E/beta:5\n"], [],
5018
4548
                                     'propget', SVN_PROP_MERGEINFO,
5019
4549
                                     beta_COPY_path)
5020
4550
 
5025
4555
  wc_status.tweak('A_COPY/B/E/beta', wc_rev=7)
5026
4556
  svntest.actions.run_and_verify_commit(wc_dir,
5027
4557
                                        expected_output,
5028
 
                                        wc_status,
5029
 
                                        None,
5030
 
                                        wc_dir)
 
4558
                                        wc_status)
5031
4559
 
5032
4560
  # Update A_COPY to get all paths to the same working revision.
5033
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(7), [],
 
4561
  svntest.actions.run_and_verify_svn(exp_noop_up_out(7), [],
5034
4562
                                     'up', wc_dir)
5035
4563
  wc_status.tweak(wc_rev=7)
5036
4564
 
5065
4593
                                       expected_disk,
5066
4594
                                       expected_status,
5067
4595
                                       expected_skip,
5068
 
                                       None, None, None, None,
5069
 
                                       None, 1)
 
4596
                                       check_props=True)
5070
4597
 
5071
4598
  # Merge r3:6 into A_COPY.  The merge doesn't touch either of A_COPY's
5072
4599
  # subtrees with explicit mergeinfo, so those are left alone.
5130
4657
                                       expected_disk,
5131
4658
                                       expected_status,
5132
4659
                                       expected_skip,
5133
 
                                       None, None, None, None,
5134
 
                                       None, 1)
 
4660
                                       check_props=True)
5135
4661
  # New repeat the above merge but with the --record-only option.
5136
4662
  # This would result in identical mergeinfo
5137
4663
  # (r4-6) on A_COPY and two of its descendants, A_COPY/D/G and
5165
4691
                                       expected_disk,
5166
4692
                                       expected_status,
5167
4693
                                       expected_skip,
5168
 
                                       None, None, None, None,
5169
 
                                       None, 1, 1, '--record-only',
 
4694
                                       [], True, True,
 
4695
                                       '--record-only',
5170
4696
                                       A_COPY_path)
5171
4697
 
5172
4698
  # Reverse merge r5 out of A_COPY/B/E/beta.  The mergeinfo on
5178
4704
  # so use run_and_verify_svn.
5179
4705
  ### TODO: We can use run_and_verify_merge() here now.
5180
4706
  svntest.actions.run_and_verify_svn(
5181
 
    None,
5182
4707
    expected_merge_output([[-5]],
5183
4708
                          ['U    ' + beta_COPY_path + '\n',
5184
4709
                           ' G   ' + beta_COPY_path + '\n']),
5192
4717
    })
5193
4718
  svntest.actions.run_and_verify_status(beta_COPY_path, expected_status)
5194
4719
 
5195
 
  svntest.actions.run_and_verify_svn(None, ["/A/B/E/beta:4,6\n"], [],
 
4720
  svntest.actions.run_and_verify_svn(["/A/B/E/beta:4,6\n"], [],
5196
4721
                                     'propget', SVN_PROP_MERGEINFO,
5197
4722
                                     beta_COPY_path)
5198
4723
 
5202
4727
  # run_and_verify_merge doesn't support merging to a file WCPATH
5203
4728
  # so use run_and_verify_svn.
5204
4729
  svntest.actions.run_and_verify_svn(
5205
 
    None,
5206
4730
    expected_merge_output([[5]],
5207
4731
                          ['G    ' + beta_COPY_path + '\n',
5208
4732
                           ' G   ' + beta_COPY_path + '\n',   # Update mergeinfo
5219
4743
  svntest.actions.run_and_verify_status(beta_COPY_path, expected_status)
5220
4744
 
5221
4745
  # Once again A_COPY/B/E/beta has no mergeinfo.
5222
 
  svntest.actions.run_and_verify_svn(None, [], [],
 
4746
  svntest.actions.run_and_verify_svn([], '.*W200017: Property.*not found',
5223
4747
                                     'propget', SVN_PROP_MERGEINFO,
5224
4748
                                     beta_COPY_path)
5225
4749
 
5252
4776
 
5253
4777
  os.chdir(A_COPY_path)
5254
4778
  svntest.actions.run_and_verify_svn(
5255
 
    None,
5256
4779
    expected_merge_output([[4]],
5257
4780
                          ['U    ' + os.path.join("D", "G", "rho") + '\n',
5258
4781
                           ' U   .\n']),
5263
4786
  expected_status.tweak("A_COPY", status=' M')
5264
4787
  expected_status.tweak("A_COPY/D/G/rho", status='M ')
5265
4788
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
5266
 
  svntest.actions.run_and_verify_svn(None, ["/A:4\n"], [],
 
4789
  svntest.actions.run_and_verify_svn(["/A:4\n"], [],
5267
4790
                                     'propget', SVN_PROP_MERGEINFO,
5268
4791
                                     A_COPY_path)
5269
4792
 
5315
4838
                                       expected_disk,
5316
4839
                                       expected_status,
5317
4840
                                       expected_skip,
5318
 
                                       None, None, None, None,
5319
 
                                       None, 1)
 
4841
                                       check_props=True)
5320
4842
 
5321
4843
  # Wipe the memory of a portion of the previous merge...
5322
4844
  ### It'd be nice to use 'merge --record-only' here, but we can't (yet)
5323
4845
  ### wipe all ranges for a file due to the bug pointed out in r864719.
5324
4846
  mu_copy_path = os.path.join(A_COPY_path, 'mu')
5325
 
  svntest.actions.run_and_verify_svn(None,
5326
 
                                     ["property '" + SVN_PROP_MERGEINFO
 
4847
  svntest.actions.run_and_verify_svn(["property '" + SVN_PROP_MERGEINFO
5327
4848
                                      + "' set on '" +
5328
4849
                                      mu_copy_path + "'\n"], [], 'propset',
5329
4850
                                     SVN_PROP_MERGEINFO, '', mu_copy_path)
5334
4855
  svntest.actions.run_and_verify_commit(wc_dir,
5335
4856
                                        expected_output,
5336
4857
                                        None,
5337
 
                                        None,
 
4858
                                        [],
5338
4859
                                        mu_copy_path)
5339
4860
  # ...and that the presence of the property is retained, even when
5340
4861
  # the value has been wiped.
5341
 
  svntest.actions.run_and_verify_svn(None, ['\n'], [], 'propget',
 
4862
  svntest.actions.run_and_verify_svn(['\n'], [], 'propget',
5342
4863
                                     SVN_PROP_MERGEINFO, mu_copy_path)
5343
4864
 
5344
4865
#----------------------------------------------------------------------
5359
4880
  rho_COPY_COPY_path = sbox.ospath('A_COPY/D/G/rho_copy')
5360
4881
 
5361
4882
  # URL to URL copy A_COPY/D/G/rho to A_COPY/D/G/rho_copy
5362
 
  svntest.actions.run_and_verify_svn(None, None, [], 'copy',
 
4883
  svntest.actions.run_and_verify_svn(None, [], 'copy',
5363
4884
                                     sbox.repo_url + '/A_COPY/D/G/rho',
5364
4885
                                     sbox.repo_url + '/A_COPY/D/G/rho_copy',
5365
4886
                                     '-m', 'copy')
5376
4897
                                        expected_output,
5377
4898
                                        expected_disk,
5378
4899
                                        expected_status,
5379
 
                                        None, None, None,
5380
 
                                        None, None, 1)
 
4900
                                        check_props=True)
5381
4901
 
5382
4902
  # Merge r4 into A_COPY/D/G/rho_copy.
5383
4903
  svntest.actions.run_and_verify_svn(
5384
 
    None,
5385
4904
    expected_merge_output([[4]],
5386
4905
                          ['U    ' + rho_COPY_COPY_path + '\n',
5387
4906
                           ' U   ' + rho_COPY_COPY_path + '\n']),
5422
4941
                                       expected_disk,
5423
4942
                                       expected_status,
5424
4943
                                       expected_skip,
5425
 
                                       None, None, None, None,
5426
 
                                       None, 1)
 
4944
                                       check_props=True)
5427
4945
 
5428
4946
#----------------------------------------------------------------------
5429
4947
@SkipUnless(server_has_mergeinfo)
5454
4972
          "A         " + G_COPY_path + "\n"])
5455
4973
 
5456
4974
  # r7 - Copy A/D/G to A/D/G_COPY and commit.
5457
 
  svntest.actions.run_and_verify_svn(None, expected, [], 'copy',
 
4975
  svntest.actions.run_and_verify_svn(expected, [], 'copy',
5458
4976
                                     sbox.repo_url + "/A/D/G",
5459
4977
                                     G_COPY_path)
5460
4978
 
5466
4984
    "A/D/G_COPY/tau" : Item(status='  ', wc_rev=7),
5467
4985
    })
5468
4986
 
5469
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
5470
 
                                        None, wc_dir)
 
4987
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
5471
4988
 
5472
4989
  # r8 - modify and commit A/D/G_COPY/rho
5473
4990
  svntest.main.file_write(sbox.ospath('A/D/G_COPY/rho'),
5474
4991
                          "New *and* improved rho content")
5475
4992
  expected_output = wc.State(wc_dir, {'A/D/G_COPY/rho' : Item(verb='Sending')})
5476
4993
  wc_status.tweak('A/D/G_COPY/rho', wc_rev=8)
5477
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
5478
 
                                        None, wc_dir)
 
4994
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
5479
4995
 
5480
4996
  # Switch A_COPY/D/G to A/D/G.
5481
4997
  wc_disk.add({
5496
5012
  svntest.actions.run_and_verify_switch(sbox.wc_dir, A_COPY_D_G_path,
5497
5013
                                        sbox.repo_url + "/A/D/G",
5498
5014
                                        expected_output, wc_disk, wc_status,
5499
 
                                        None, None, None, None, None, 1)
 
5015
                                        [], 1)
5500
5016
 
5501
5017
  # Update working copy to allow elision (if any).
5502
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(8), [],
 
5018
  svntest.actions.run_and_verify_svn(exp_noop_up_out(8), [],
5503
5019
                                     'up', wc_dir)
5504
5020
 
5505
5021
  # Set some mergeinfo on a working copy parent of our switched subtree
5506
5022
  # A_COPY/D/G.  Because the subtree is switched it should *not* inherit
5507
5023
  # this mergeinfo.
5508
 
  svntest.actions.run_and_verify_svn(None,
5509
 
                                     ["property '" + SVN_PROP_MERGEINFO +
 
5024
  svntest.actions.run_and_verify_svn(["property '" + SVN_PROP_MERGEINFO +
5510
5025
                                      "' set on '" + A_COPY_path + "'" +
5511
5026
                                      "\n"], [], 'ps', SVN_PROP_MERGEINFO,
5512
5027
                                     '/A:4', A_COPY_path)
5546
5061
                                       expected_elision_output,
5547
5062
                                       expected_disk,
5548
5063
                                       expected_status, expected_skip,
5549
 
                                       None, None, None, None, None, 1)
 
5064
                                       check_props=True)
5550
5065
 
5551
5066
  # Check that the mergeinfo set on a switched target can elide to the
5552
5067
  # repository.
5562
5077
  # but as it is switched this empty mergeinfo just elides to the
5563
5078
  # repository (empty mergeinfo on a path can elide if that path doesn't
5564
5079
  # inherit *any* mergeinfo).
5565
 
  svntest.actions.run_and_verify_svn(None,
5566
 
                                     ["Reverted '" + A_COPY_path+ "'\n",
 
5080
  svntest.actions.run_and_verify_svn(["Reverted '" + A_COPY_path+ "'\n",
5567
5081
                                      "Reverted '" + A_COPY_D_G_path+ "'\n",
5568
5082
                                      "Reverted '" + A_COPY_D_G_rho_path +
5569
5083
                                      "'\n"],
5570
5084
                                     [], 'revert', '-R', wc_dir)
5571
 
  svntest.actions.run_and_verify_svn(None,
5572
 
                                     ["property '" + SVN_PROP_MERGEINFO +
 
5085
  svntest.actions.run_and_verify_svn(["property '" + SVN_PROP_MERGEINFO +
5573
5086
                                      "' set on '" + A_COPY_D_path+ "'" +
5574
5087
                                      "\n"], [], 'ps', SVN_PROP_MERGEINFO,
5575
5088
                                     '/A/D:4', A_COPY_D_path)
5576
5089
  svntest.actions.run_and_verify_svn(
5577
 
    None,
5578
5090
    expected_merge_output([[-4]],
5579
5091
                          ['U    ' + A_COPY_D_G_rho_path + '\n',
5580
5092
                           ' U   ' + A_COPY_D_G_path + '\n'],
5646
5158
  A_COPY_gamma_path = sbox.ospath('A_COPY/D/gamma')
5647
5159
  H_COPY_2_path = sbox.ospath('A_COPY_2/D/H')
5648
5160
 
5649
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(8), [], 'up',
 
5161
  svntest.actions.run_and_verify_svn(exp_noop_up_out(8), [], 'up',
5650
5162
                                     wc_dir)
5651
5163
  wc_status.tweak(wc_rev=8)
5652
5164
 
5658
5170
  svntest.actions.run_and_verify_switch(sbox.wc_dir, A_COPY_G_path,
5659
5171
                                        sbox.repo_url + "/A_COPY_2/D/G",
5660
5172
                                        expected_output, wc_disk, wc_status,
5661
 
                                        None, None, None, None, None, 1)
 
5173
                                        [], 1)
5662
5174
 
5663
5175
  # Switch A_COPY/D/G/rho to A_COPY_3/D/G/rho.
5664
5176
  wc_status.tweak("A_COPY/D/G/rho", switched='S')
5666
5178
  svntest.actions.run_and_verify_switch(sbox.wc_dir, A_COPY_rho_path,
5667
5179
                                        sbox.repo_url + "/A_COPY_3/D/G/rho",
5668
5180
                                        expected_output, wc_disk, wc_status,
5669
 
                                        None, None, None, None, None, 1)
 
5181
                                        [], 1)
5670
5182
 
5671
5183
  # Switch A_COPY/D/H/psi to A_COPY_2/D/H/psi.
5672
5184
  wc_status.tweak("A_COPY/D/H/psi", switched='S')
5674
5186
  svntest.actions.run_and_verify_switch(sbox.wc_dir, A_COPY_psi_path,
5675
5187
                                        sbox.repo_url + "/A_COPY_2/D/H/psi",
5676
5188
                                        expected_output, wc_disk, wc_status,
5677
 
                                        None, None, None, None, None, 1)
 
5189
                                        [], 1)
5678
5190
 
5679
5191
  # Target with switched file child:
5680
5192
  #
5721
5233
                                       expected_elision_output,
5722
5234
                                       expected_disk,
5723
5235
                                       expected_status, expected_skip,
5724
 
                                       None, None, None, None, None, 1)
 
5236
                                       check_props=True)
5725
5237
 
5726
5238
  # Target with switched dir child:
5727
5239
  #
5772
5284
                                       expected_elision_output,
5773
5285
                                       expected_disk_D,
5774
5286
                                       expected_status_D, expected_skip_D,
5775
 
                                       None, None, None, None, None, 1)
 
5287
                                       check_props=True)
5776
5288
 
5777
5289
 
5778
5290
  # Merge r5 from A/D into A_COPY/D.  This updates the mergeinfo on the
5801
5313
                                       expected_elision_output,
5802
5314
                                       expected_disk_D,
5803
5315
                                       expected_status_D, expected_skip_D,
5804
 
                                       None, None, None, None, None, 1)
 
5316
                                       check_props=True)
5805
5317
 
5806
5318
  # Finally, merge r4:8 into A_COPY.  A_COPY gets mergeinfo for r5-8 added but
5807
5319
  # since none of A_COPY's subtrees with mergeinfo are affected, none of them
5866
5378
                                       expected_elision_output,
5867
5379
                                       expected_disk,
5868
5380
                                       expected_status, expected_skip,
5869
 
                                       None, None, None, None, None, 1)
 
5381
                                       check_props=True)
5870
5382
  # Commit changes thus far.
5871
5383
  expected_output = svntest.wc.State(wc_dir, {
5872
5384
    'A_COPY'           : Item(verb='Sending'),
5881
5393
  wc_status.tweak('A_COPY', 'A_COPY/B/E/beta', 'A_COPY/D', 'A_COPY/D/G',
5882
5394
                  'A_COPY/D/G/rho', 'A_COPY/D/H', 'A_COPY/D/H/omega',
5883
5395
                  'A_COPY/D/H/psi', wc_rev=9)
5884
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
5885
 
                                        None, wc_dir)
 
5396
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
5886
5397
 
5887
5398
  # Unswitch A_COPY/D/H/psi.
5888
5399
  expected_output = svntest.wc.State(wc_dir, {
5907
5418
  svntest.actions.run_and_verify_switch(sbox.wc_dir, A_COPY_psi_path,
5908
5419
                                        sbox.repo_url + "/A_COPY/D/H/psi",
5909
5420
                                        expected_output, wc_disk, wc_status,
5910
 
                                        None, None, None, None, None, 1)
 
5421
                                        [], 1)
5911
5422
 
5912
5423
  # Non-inheritable mergeinfo ranges on a target don't prevent repeat
5913
5424
  # merges of that range on the target's children.
5952
5463
                                       expected_elision_output,
5953
5464
                                       expected_disk,
5954
5465
                                       expected_status, expected_skip,
5955
 
                                       None, None, None, None, None,
 
5466
                                       [],
5956
5467
                                       True, False, '--allow-mixed-revisions',
5957
5468
                                       A_COPY_H_path)
5958
5469
 
5963
5474
  # A_COPY/D has a switched child it gets r10 added as a non-inheritable
5964
5475
  # range.  Repeat the same merge checking that no repeat merge is
5965
5476
  # attempted on A_COPY/D.
5966
 
  svntest.actions.run_and_verify_svn(None,
5967
 
                                     ["property 'prop:name' set on '" +
 
5477
  svntest.actions.run_and_verify_svn(["property 'prop:name' set on '" +
5968
5478
                                      D_path + "'\n"], [], 'ps',
5969
5479
                                     'prop:name', 'propval', D_path)
5970
5480
  expected_output = svntest.wc.State(wc_dir, {
5974
5484
    })
5975
5485
  wc_status.tweak('A_COPY/D', wc_rev=9)
5976
5486
  wc_status.tweak('A/D', 'A_COPY/D/H', 'A_COPY/D/H/psi', wc_rev=10)
5977
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
5978
 
                                        None, wc_dir)
 
5487
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
5979
5488
  expected_output = wc.State(A_COPY_D_path, {
5980
5489
    '' : Item(status=' U')
5981
5490
    })
6004
5513
                                       expected_elision_output,
6005
5514
                                       expected_disk_D,
6006
5515
                                       expected_status_D, expected_skip_D,
6007
 
                                       None, None, None, None, None,
 
5516
                                       [],
6008
5517
                                       True, False, '--allow-mixed-revisions',
6009
5518
                                       A_COPY_D_path)
6010
5519
  # Repeated merge is a no-op, though we still see the notification reporting
6021
5530
                                       expected_elision_output,
6022
5531
                                       expected_disk_D,
6023
5532
                                       expected_status_D, expected_skip_D,
6024
 
                                       None, None, None, None, None,
 
5533
                                       [],
6025
5534
                                       True, False, '--allow-mixed-revisions',
6026
5535
                                       A_COPY_D_path)
6027
5536
 
6036
5545
 
6037
5546
  # Revert all local changes.  This leaves just the mergeinfo for r5-8
6038
5547
  # on A_COPY and its various subtrees.
6039
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
5548
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
6040
5549
 
6041
5550
  # Update merge target so working revisions are uniform and all
6042
5551
  # possible elision occurs.
6043
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(10), [],
 
5552
  svntest.actions.run_and_verify_svn(exp_noop_up_out(10), [],
6044
5553
                                     'up', A_COPY_path)
6045
5554
 
6046
5555
  #  Do the reverse merge.
6113
5622
                                       expected_elision_output,
6114
5623
                                       expected_disk,
6115
5624
                                       expected_status, expected_skip,
6116
 
                                       None, None, None, None, None, 1)
 
5625
                                       check_props=True)
6117
5626
 
6118
5627
#----------------------------------------------------------------------
6119
5628
# Test for issue 2047: Merge from parent dir fails while it succeeds from
6139
5648
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
6140
5649
  expected_status.tweak('A/mu', wc_rev=2)
6141
5650
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
6142
 
                                        expected_status, None, wc_dir)
 
5651
                                        expected_status)
6143
5652
 
6144
5653
  # Update to revision 2.
6145
 
  svntest.actions.run_and_verify_svn(None, None, [], 'update', wc_dir)
 
5654
  svntest.actions.run_and_verify_svn(None, [], 'update', wc_dir)
6146
5655
 
6147
5656
  # Revert the change committed in r2
6148
5657
  os.chdir(wc_dir)
6149
5658
 
6150
5659
  # run_and_verify_merge doesn't accept file paths.
6151
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-r', '2:1',
 
5660
  svntest.actions.run_and_verify_svn(None, [], 'merge', '-r', '2:1',
6152
5661
                                     'A/mu')
6153
5662
 
6154
5663
#----------------------------------------------------------------------
6173
5682
  #   B) Empty mergeinfo elides to empty mergeinfo.
6174
5683
  #
6175
5684
  #   C) If a merge sets empty mergeinfo on its target and that target has
6176
 
  #      no ancestor in either the WC or the repository with explict
 
5685
  #      no ancestor in either the WC or the repository with explicit
6177
5686
  #      mergeinfo, then the target's mergeinfo is removed (a.k.a. elides
6178
5687
  #      to nothing).
6179
5688
  sbox.build()
6249
5758
                                       expected_disk,
6250
5759
                                       expected_status,
6251
5760
                                       expected_skip,
6252
 
                                       None, None, None, None,
6253
 
                                       None, 1)
 
5761
                                       check_props=True)
6254
5762
  # Now do the reverse merge into the subtree.
6255
5763
  expected_output = wc.State(H_COPY_path, {
6256
5764
    'psi' : Item(status='G '),
6281
5789
                                       expected_disk,
6282
5790
                                       expected_status,
6283
5791
                                       expected_skip,
6284
 
                                       None, None, None, None,
6285
 
                                       None, 1)
 
5792
                                       check_props=True)
6286
5793
 
6287
5794
  # Test areas B and C -- Reverse merge r3 into A_COPY, this would result in
6288
5795
  # empty mergeinfo on A_COPY and A_COPY/D/H, but the empty mergeinfo on the
6296
5803
              ' U   ' + H_COPY_path   + '\n',
6297
5804
              ' U   ' + A_COPY_path   + '\n',],
6298
5805
    elides=True)
6299
 
  svntest.actions.run_and_verify_svn(None, expected_output,
 
5806
  svntest.actions.run_and_verify_svn(expected_output,
6300
5807
                                     [], 'merge', '-r4:2',
6301
5808
                                     sbox.repo_url + '/A',
6302
5809
                                     A_COPY_path)
6303
5810
  svntest.actions.run_and_verify_status(wc_dir, wc_status)
6304
5811
  # Check that A_COPY's mergeinfo is gone.
6305
 
  svntest.actions.run_and_verify_svn(None, [], [], 'pg', 'svn:mergeinfo',
 
5812
  svntest.actions.run_and_verify_svn([], '.*W200017: Property.*not found',
 
5813
                                     'pg', 'svn:mergeinfo',
6306
5814
                                     A_COPY_path)
6307
5815
 
6308
5816
#----------------------------------------------------------------------
6324
5832
  B_COPY_path = sbox.ospath('A_COPY/B')
6325
5833
 
6326
5834
  # Set a non-mergeinfo prop on a file.
6327
 
  svntest.actions.run_and_verify_svn(None,
6328
 
                                     ["property 'prop:name' set on '" +
 
5835
  svntest.actions.run_and_verify_svn(["property 'prop:name' set on '" +
6329
5836
                                      beta_path + "'\n"], [], 'ps',
6330
5837
                                     'prop:name', 'propval', beta_path)
6331
5838
  expected_disk.tweak('A/B/E/beta', props={'prop:name' : 'propval'})
6334
5841
                             {'A/B/E/beta' : Item(verb='Sending')})
6335
5842
  svntest.actions.run_and_verify_commit(wc_dir,
6336
5843
                                        expected_output,
6337
 
                                        expected_status,
6338
 
                                        None,
6339
 
                                        wc_dir)
 
5844
                                        expected_status)
6340
5845
 
6341
5846
  # Merge r4:5 from A/B/E/beta into A_COPY/B/E/beta.
6342
5847
  svntest.actions.run_and_verify_svn(
6343
 
    None,
6344
5848
    expected_merge_output([[5]],
6345
5849
                          ['U    ' + beta_COPY_path +'\n',
6346
5850
                           ' U   ' + beta_COPY_path +'\n',]),
6386
5890
                                       expected_disk,
6387
5891
                                       expected_status,
6388
5892
                                       expected_skip,
6389
 
                                       None, None, None, None,
6390
 
                                       None, 1)
 
5893
                                       check_props=True)
6391
5894
 
6392
5895
#----------------------------------------------------------------------
6393
5896
@Issue(2788,3383)
6411
5914
  # Merge r3:4 (using implied peg revisions) from 'other' repos into
6412
5915
  # A_COPY/D/G.  Merge should succeed, but no mergeinfo should be set.
6413
5916
  G_COPY_path = sbox.ospath('A_COPY/D/G')
6414
 
  svntest.actions.run_and_verify_svn(None,
6415
 
                                     expected_merge_output([[4]],
 
5917
  svntest.actions.run_and_verify_svn(expected_merge_output([[4]],
6416
5918
                                      'U    ' +
6417
5919
                                      os.path.join(G_COPY_path,
6418
5920
                                                   "rho") + '\n', True),
6423
5925
  # Merge r4:5 (using explicit peg revisions) from 'other' repos into
6424
5926
  # A_COPY/B/E.  Merge should succeed, but no mergeinfo should be set.
6425
5927
  E_COPY_path = sbox.ospath('A_COPY/B/E')
6426
 
  svntest.actions.run_and_verify_svn(None,
6427
 
                                     expected_merge_output([[5]],
 
5928
  svntest.actions.run_and_verify_svn(expected_merge_output([[5]],
6428
5929
                                      'U    ' +
6429
5930
                                      os.path.join(E_COPY_path,
6430
5931
                                                   "beta") +'\n', True),
6437
5938
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
6438
5939
 
6439
5940
  # Set up for test of issue #3383.
6440
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
5941
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
6441
5942
 
6442
5943
  # Get a working copy for the foreign repos.
6443
 
  svntest.actions.run_and_verify_svn(None, None, [], 'co', other_repo_url,
 
5944
  svntest.actions.run_and_verify_svn(None, [], 'co', other_repo_url,
6444
5945
                                     other_wc_dir)
6445
5946
 
6446
5947
  # Create mergeinfo on the foreign repos on an existing directory and
6449
5950
  # simple merges to *death* elsewhere.
6450
5951
 
6451
5952
  # Create mergeinfo on an existing directory.
6452
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge',
 
5953
  svntest.actions.run_and_verify_svn(None, [], 'merge',
6453
5954
                                     other_repo_url + '/A',
6454
5955
                                     os.path.join(other_wc_dir, 'A_COPY'),
6455
5956
                                     '-c5')
6456
5957
 
6457
5958
  # Create mergeinfo on an existing file.
6458
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge',
 
5959
  svntest.actions.run_and_verify_svn(None, [], 'merge',
6459
5960
                                     other_repo_url + '/A/D/H/psi',
6460
5961
                                     os.path.join(other_wc_dir, 'A_COPY',
6461
5962
                                                  'D', 'H', 'psi'),
6463
5964
 
6464
5965
  # Add a new directory with mergeinfo in the foreign repos.
6465
5966
  new_dir = os.path.join(other_wc_dir, 'A_COPY', 'N')
6466
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', new_dir)
6467
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ps',
 
5967
  svntest.actions.run_and_verify_svn(None, [], 'mkdir', new_dir)
 
5968
  svntest.actions.run_and_verify_svn(None, [], 'ps',
6468
5969
                                     SVN_PROP_MERGEINFO, '', new_dir)
6469
5970
 
6470
5971
  # Add a new file with mergeinfo in the foreign repos.
6471
5972
  new_file = os.path.join(other_wc_dir, 'A_COPY', 'nu')
6472
5973
  svntest.main.file_write(new_file, "This is the file 'nu'.\n")
6473
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', new_file)
6474
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ps',
 
5974
  svntest.actions.run_and_verify_svn(None, [], 'add', new_file)
 
5975
  svntest.actions.run_and_verify_svn(None, [], 'ps',
6475
5976
                                     SVN_PROP_MERGEINFO, '', new_file)
6476
5977
 
6477
5978
  expected_output = wc.State(other_wc_dir,{
6482
5983
    'A_COPY/nu'       : Item(verb='Adding'),  # Has empty mergeinfo
6483
5984
    })
6484
5985
  svntest.actions.run_and_verify_commit(other_wc_dir, expected_output,
6485
 
                                        None, None, other_wc_dir,
 
5986
                                        None, [], other_wc_dir,
6486
5987
                                        '-m',
6487
5988
                                        'create mergeinfo on foreign repos')
6488
5989
  # Now merge a diff from the foreign repos that contains the mergeinfo
6489
5990
  # addition in r7 to A_COPY.  The mergeinfo diff should *not* be applied
6490
5991
  # to A_COPY since it refers to a foreign repository...
6491
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge',
 
5992
  svntest.actions.run_and_verify_svn(None, [], 'merge',
6492
5993
                                     other_repo_url + '/A@1',
6493
5994
                                     other_repo_url + '/A_COPY@7',
6494
5995
                                     sbox.ospath('A_COPY'))
6495
5996
  #...which means there should be no mergeinfo anywhere in WC_DIR, since
6496
5997
  # this test never created any.
6497
 
  svntest.actions.run_and_verify_svn(None, [], [], 'pg',
 
5998
  svntest.actions.run_and_verify_svn([], [], 'pg',
6498
5999
                                     SVN_PROP_MERGEINFO, '-vR',
6499
6000
                                     wc_dir)
6500
6001
 
6505
6006
def avoid_reflected_revs(sbox):
6506
6007
  "avoid repeated merges for cyclic merging"
6507
6008
 
6508
 
  ## See http://subversion.tigris.org/issues/show_bug.cgi?id=2897. ##
 
6009
  # See <http://subversion.tigris.org/issues/show_bug.cgi?id=2897>.
 
6010
  #
 
6011
  # This test cherry-picks some changes (all of them, in fact) from the
 
6012
  # parent branch 'A' to the child branch 'A_COPY', and then tries to
 
6013
  # reintegrate 'A_COPY' to 'A' (explicitly specifying a revision range
 
6014
  # on the source branch).  It expects the changes that are unique to the
 
6015
  # branch 'A_COPY' to be merged to 'A'.
 
6016
  #
 
6017
  #   A     --1----[3]---[5]----------?
 
6018
  #            \     \_____\___      /
 
6019
  #             \           \  \    /
 
6020
  #   A_COPY     2-[---4-----6--7--8]-
6509
6021
 
6510
6022
  # Create a WC with a single branch
6511
6023
  sbox.build()
6529
6041
  # We'll consider A as the trunk and A_COPY as the feature branch
6530
6042
  # r3 - Create a tfile1 in A
6531
6043
  svntest.main.file_write(tfile1_path, tfile1_content)
6532
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', tfile1_path)
 
6044
  svntest.actions.run_and_verify_svn(None, [], 'add', tfile1_path)
6533
6045
  expected_output = wc.State(wc_dir, {'A/tfile1' : Item(verb='Adding')})
6534
6046
  wc_status.add({'A/tfile1'     : Item(status='  ', wc_rev=3)})
6535
6047
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
6536
 
                                        wc_status, None, wc_dir)
 
6048
                                        wc_status)
6537
6049
 
6538
6050
  # r4 - Create a bfile1 in A_COPY
6539
6051
  svntest.main.file_write(bfile1_path, bfile1_content)
6540
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', bfile1_path)
 
6052
  svntest.actions.run_and_verify_svn(None, [], 'add', bfile1_path)
6541
6053
  expected_output = wc.State(wc_dir, {'A_COPY/bfile1' : Item(verb='Adding')})
6542
6054
  wc_status.add({'A_COPY/bfile1'     : Item(status='  ', wc_rev=4)})
6543
6055
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
6544
 
                                        wc_status, None, wc_dir)
 
6056
                                        wc_status)
6545
6057
 
6546
6058
  # r5 - Create one more file in A
6547
6059
  svntest.main.file_write(tfile2_path, tfile2_content)
6548
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', tfile2_path)
 
6060
  svntest.actions.run_and_verify_svn(None, [], 'add', tfile2_path)
6549
6061
  expected_output = wc.State(wc_dir, {'A/tfile2' : Item(verb='Adding')})
6550
6062
  wc_status.add({'A/tfile2'     : Item(status='  ', wc_rev=5)})
6551
6063
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
6552
 
                                        wc_status, None, wc_dir)
 
6064
                                        wc_status)
6553
6065
 
6554
6066
  # Merge r5 from /A to /A_COPY, creating r6
6555
6067
  expected_output = wc.State(A_COPY_path, {
6616
6128
                                       expected_disk,
6617
6129
                                       expected_status,
6618
6130
                                       expected_skip,
6619
 
                                       None, None, None, None, None, 1,
6620
 
                                       None, A_COPY_path,
 
6131
                                       [], True, False,
 
6132
                                       A_COPY_path,
6621
6133
                                       '--allow-mixed-revisions')
6622
6134
 
6623
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
6135
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
6624
6136
  expected_output = wc.State(wc_dir, {
6625
6137
    'A_COPY'        : Item(verb='Sending'),
6626
6138
    'A_COPY/tfile2' : Item(verb='Adding'),
6627
6139
    })
6628
6140
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
6629
 
                                        None, None, wc_dir)
 
6141
                                        None)
6630
6142
 
6631
6143
  # Merge r3 from /A to /A_COPY, creating r7
6632
6144
  expected_output = wc.State(A_COPY_path, {
6656
6168
                                       expected_disk,
6657
6169
                                       expected_status,
6658
6170
                                       expected_skip,
6659
 
                                       None, None, None, None, None, 1,
6660
 
                                       None, A_COPY_path,
 
6171
                                       [], True, False,
 
6172
                                       A_COPY_path,
6661
6173
                                       '--allow-mixed-revisions')
6662
6174
 
6663
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
6175
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
6664
6176
  expected_output = wc.State(wc_dir, {
6665
6177
    'A_COPY'        : Item(verb='Sending'),
6666
6178
    'A_COPY/tfile1' : Item(verb='Adding'),
6667
6179
    })
6668
6180
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
6669
 
                                        None, None, wc_dir)
 
6181
                                        None)
6670
6182
 
6671
6183
  # r8 - Add bfile2 to A_COPY
6672
6184
  svntest.main.file_write(bfile2_path, bfile2_content)
6673
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', bfile2_path)
 
6185
  svntest.actions.run_and_verify_svn(None, [], 'add', bfile2_path)
6674
6186
  expected_output = wc.State(wc_dir, {'A_COPY/bfile2' : Item(verb='Adding')})
6675
6187
  wc_status.tweak(wc_rev=6)
6676
6188
  wc_status.add({
6680
6192
    'A_COPY/tfile1' : Item(status='  ', wc_rev=7),
6681
6193
    })
6682
6194
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
6683
 
                                        wc_status, None, wc_dir)
 
6195
                                        wc_status)
6684
6196
 
6685
6197
  # Merge 2:8 from A_COPY(feature branch) to A(trunk).
6686
6198
  expected_output = wc.State(A_path, {
6753
6265
                                       expected_disk,
6754
6266
                                       expected_status,
6755
6267
                                       expected_skip,
6756
 
                                       None, None, None, None, None, 1)
 
6268
                                       check_props=True)
6757
6269
 
6758
6270
#----------------------------------------------------------------------
6759
6271
@SkipUnless(server_has_mergeinfo)
6772
6284
  A_B_url = sbox.repo_url + '/A/B'
6773
6285
  A_B_J_url = sbox.repo_url + '/A/B/J'
6774
6286
  A_B_K_url = sbox.repo_url + '/A/B/K'
6775
 
  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 2.\n'],
 
6287
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
6288
                                            'Committed revision 2.\n'],
6776
6289
                                     [],
6777
6290
                                     'mkdir', '-m', 'rev 2', A_B_J_url)
6778
 
  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 3.\n'],
 
6291
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
6292
                                            'Committed revision 3.\n'],
6779
6293
                                     [],
6780
6294
                                     'mkdir', '-m', 'rev 3', A_B_K_url)
6781
6295
 
6819
6333
                            )
6820
6334
  svntest.actions.run_and_verify_commit(A_C_wc_dir,
6821
6335
                                        expected_output,
6822
 
                                        expected_status,
6823
 
                                        None,
6824
 
                                        A_C_wc_dir)
 
6336
                                        expected_status)
6825
6337
 
6826
6338
  other_A_C_wc_dir = os.path.join(other_wc, 'A', 'C')
6827
6339
  expected_output = wc.State(other_A_C_wc_dir, {'K' : Item(status='A ')})
6871
6383
                                        expected_output,
6872
6384
                                        expected_disk,
6873
6385
                                        expected_status,
6874
 
                                        check_props=1)
 
6386
                                        check_props=True)
6875
6387
 
6876
6388
#----------------------------------------------------------------------
6877
6389
# Tests part of issue# 2829.
6892
6404
  A_B_url = sbox.repo_url + '/A/B'
6893
6405
  A_B_J_url = sbox.repo_url + '/A/B/J'
6894
6406
  A_B_K_url = sbox.repo_url + '/A/B/K'
6895
 
  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 2.\n'],
 
6407
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
6408
                                            'Committed revision 2.\n'],
6896
6409
                                     [],
6897
6410
                                     'mkdir', '-m', 'rev 2', A_B_J_url)
6898
 
  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 3.\n'],
 
6411
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
6412
                                            'Committed revision 3.\n'],
6899
6413
                                     [],
6900
6414
                                     'mkdir', '-m', 'rev 3', A_B_K_url)
6901
6415
 
6936
6450
                            )
6937
6451
  svntest.actions.run_and_verify_commit(A_C_wc_dir,
6938
6452
                                        expected_output,
6939
 
                                        expected_status,
6940
 
                                        None,
6941
 
                                        A_C_wc_dir)
 
6453
                                        expected_status)
6942
6454
  expected_output = wc.State(A_C_wc_dir, {'J' : Item(status='D ')})
6943
6455
  expected_elision_output = wc.State(A_C_wc_dir, {
6944
6456
    '' : Item(status=' U'),
7012
6524
    })
7013
6525
  svntest.actions.run_and_verify_commit(wc_dir,
7014
6526
                                        expected_output,
7015
 
                                        expected_status,
7016
 
                                        None, wc_dir)
 
6527
                                        expected_status)
7017
6528
 
7018
6529
  # Merge the file mu alone to rev1
7019
 
  svntest.actions.run_and_verify_svn(None,
7020
 
                                     expected_merge_output(None,
 
6530
  svntest.actions.run_and_verify_svn(expected_merge_output(None,
7021
6531
                                       ['R    ' + mu_path + '\n']),
7022
6532
                                     [],
7023
6533
                                     'merge',
7074
6584
                                       expected_elision_output,
7075
6585
                                       expected_disk,
7076
6586
                                       expected_status, expected_skip,
7077
 
                                       None, None, None, None, None, 1)
 
6587
                                       check_props=True)
7078
6588
 
7079
6589
  # Commit merge to first WC.
7080
6590
  wc_status.tweak('A_COPY/D/H/psi', 'A_COPY/D/H', wc_rev=7)
7084
6594
    })
7085
6595
  svntest.actions.run_and_verify_commit(wc_dir,
7086
6596
                                        expected_output,
7087
 
                                        wc_status,
7088
 
                                        None, wc_dir)
 
6597
                                        wc_status)
7089
6598
 
7090
6599
  # Merge -c6 into A_COPY/D/H of other WC.
7091
6600
  expected_output = wc.State(other_A_COPY_H_path, {
7116
6625
                                       expected_elision_output,
7117
6626
                                       expected_disk,
7118
6627
                                       expected_status, expected_skip,
7119
 
                                       None, None, None, None, None, 1)
 
6628
                                       check_props=1)
7120
6629
 
7121
6630
  # Update A_COPY/D/H in other WC.  Local mergeinfo for r6 on A_COPY/D/H
7122
6631
  # should be *merged* with r3 from first WC.
7140
6649
                                        expected_output,
7141
6650
                                        other_disk,
7142
6651
                                        other_status,
7143
 
                                        check_props=1)
 
6652
                                        check_props=True)
7144
6653
 
7145
6654
#----------------------------------------------------------------------
7146
6655
@SkipUnless(server_has_mergeinfo)
7159
6668
  Acopy_url = sbox.repo_url + '/A_copy'
7160
6669
 
7161
6670
  # Copy A_url to A_copy_url
7162
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
6671
  svntest.actions.run_and_verify_svn(None, [], 'cp',
7163
6672
                                     A_url, Acopy_url,
7164
6673
                                     '-m', 'create a new copy of A')
7165
6674
 
7182
6691
  # Commit the modified contents
7183
6692
  svntest.actions.run_and_verify_commit(wc_dir,
7184
6693
                                        expected_output,
7185
 
                                        expected_status,
7186
 
                                        None,
7187
 
                                        wc_dir)
 
6694
                                        expected_status)
7188
6695
 
7189
6696
  # Update working copy
7190
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
6697
  svntest.actions.run_and_verify_svn(None, [],
7191
6698
                                     'up', Acopy_path)
7192
6699
 
7193
6700
  # Merge r1:3 into A_copy with --depth files.  The merge only affects
7255
6762
                                       expected_elision_output,
7256
6763
                                       expected_disk,
7257
6764
                                       expected_status, expected_skip,
7258
 
                                       None, None, None, None, None, 1, 1,
 
6765
                                       [], True, True,
7259
6766
                                       '--depth', 'files', Acopy_path)
7260
6767
 
7261
6768
#----------------------------------------------------------------------
7292
6799
  nu_COPY_path  = sbox.ospath('A_COPY/nu')
7293
6800
 
7294
6801
  # Make a change to directory A/D/H and commit as r8.
7295
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(7), [],
 
6802
  svntest.actions.run_and_verify_svn(exp_noop_up_out(7), [],
7296
6803
                                     'update', wc_dir)
7297
6804
 
7298
6805
  svntest.actions.run_and_verify_svn(
7299
 
    None, ["property 'prop:name' set on '" + H_path + "'\n"], [],
 
6806
    ["property 'prop:name' set on '" + H_path + "'\n"], [],
7300
6807
    'ps', 'prop:name', 'propval', H_path)
7301
6808
  expected_output = svntest.wc.State(wc_dir, {
7302
6809
    'A/D/H' : Item(verb='Sending'),})
7303
6810
  wc_status.tweak(wc_rev=7)
7304
6811
  wc_status.tweak('A/D/H', wc_rev=8)
7305
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
7306
 
                                        None, wc_dir)
 
6812
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
7307
6813
 
7308
6814
  # Merge r6:8 --depth immediates to A_COPY/D.  This should merge the
7309
6815
  # prop change from r8 to A_COPY/H but not the change to A_COPY/D/H/omega
7352
6858
                                       expected_elision_output,
7353
6859
                                       expected_disk,
7354
6860
                                       expected_status, expected_skip,
7355
 
                                       None, None, None, None, None, 1, 1,
 
6861
                                       [], True, True,
7356
6862
                                       '--depth', 'immediates', D_COPY_path)
7357
6863
 
7358
6864
  # Repeat the previous merge but at default depth of infinity.  The change
7384
6890
                                       expected_elision_output,
7385
6891
                                       expected_disk,
7386
6892
                                       expected_status, expected_skip,
7387
 
                                       None, None, None, None, None, 1, 1)
 
6893
                                       [], True, True)
7388
6894
 
7389
6895
  # Now test the problem described in
7390
6896
  # http://svn.haxx.se/dev/archive-2008-12/0133.shtml.
7391
6897
  #
7392
6898
  # First revert all local mods.
7393
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
6899
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
7394
6900
 
7395
6901
  # r9: Merge all available revisions from A to A_COPY at a depth of empty
7396
6902
  # this will create non-inheritable mergeinfo on A_COPY.
7397
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
6903
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
7398
6904
  wc_status.tweak(wc_rev=8)
7399
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
6905
  svntest.actions.run_and_verify_svn(None, [],
7400
6906
                                     'merge', '--depth', 'empty',
7401
6907
                                     sbox.repo_url + '/A', A_COPY_path)
7402
6908
  wc_status.tweak('A_COPY', wc_rev=9)
7403
6909
  expected_output = wc.State(wc_dir, {'A_COPY' : Item(verb='Sending')})
7404
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
7405
 
                                        wc_status, None, wc_dir)
 
6910
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
7406
6911
 
7407
6912
  # r10: Add the file A/nu.
7408
6913
  svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
7409
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
 
6914
  svntest.actions.run_and_verify_svn(None, [], 'add', nu_path)
7410
6915
  expected_output = wc.State(wc_dir, {'A/nu' : Item(verb='Adding')})
7411
6916
  wc_status.add({'A/nu' : Item(status='  ', wc_rev=10)})
7412
6917
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
7413
 
                                        wc_status, None, wc_dir)
 
6918
                                        wc_status)
7414
6919
 
7415
6920
  # Now merge -c10 from A to A_COPY.
7416
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
6921
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
7417
6922
  expected_output = wc.State('', {
7418
6923
    'nu': Item(status='A '),
7419
6924
    })
7481
6986
                                       expected_disk,
7482
6987
                                       expected_status,
7483
6988
                                       expected_skip,
7484
 
                                       None, None, None, None,
7485
 
                                       None, 1)
 
6989
                                       check_props=True)
7486
6990
  os.chdir(saved_cwd)
7487
6991
 
7488
6992
  # If a merge target has inheritable and non-inheritable ranges and has a
7492
6996
  # *and* the mergeinfo inherited from it's parent.
7493
6997
  #
7494
6998
  # First revert all local changes and remove A_COPY/C/nu from disk.
7495
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
6999
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
7496
7000
 
7497
7001
  # Make a text change to A_COPY_2/mu in r11 and then merge that
7498
7002
  # change to A/mu in r12.  This will create mergeinfo of '/A_COPY_2/mu:11'
7499
7003
  # on A/mu.
7500
7004
  svntest.main.file_write(mu_2_path, 'new content')
7501
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m', 'log msg',
 
7005
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m', 'log msg',
7502
7006
                                     wc_dir)
7503
7007
  svntest.actions.run_and_verify_svn(
7504
 
    None,
7505
7008
    expected_merge_output([[11]],
7506
7009
                          ['U    ' + mu_path + '\n',
7507
7010
                           ' U   ' + mu_path + '\n']),
7508
7011
    [], 'merge', '-c11', sbox.repo_url + '/A_COPY_2/mu', mu_path)
7509
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m', 'log msg',
 
7012
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m', 'log msg',
7510
7013
                                     wc_dir)
7511
7014
 
7512
7015
  # Now merge r12 from A to A_COPY.  A_COPY/mu should get the mergeinfo from
7579
7082
                                       expected_disk,
7580
7083
                                       expected_status,
7581
7084
                                       expected_skip,
7582
 
                                       None, None, None, None,
7583
 
                                       None, 1,
7584
 
                                       False) # No dry-run.
 
7085
                                       [], True, False)
7585
7086
  os.chdir(saved_cwd)
7586
7087
 
7587
7088
  # Test for issue #3392
7588
7089
  #
7589
7090
  # Revert local changes and update.
7590
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
7591
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
7091
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
 
7092
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
7592
7093
 
7593
7094
  # Merge r8 from A/D/H to A_COPY_D/H at depth empty.  Since r8 affects only
7594
7095
  # A_COPY/D/H itself, the resulting mergeinfo is inheritable.  Commit this
7622
7123
                                       expected_elision_output,
7623
7124
                                       expected_disk,
7624
7125
                                       expected_status, expected_skip,
7625
 
                                       None, None, None, None, None, 1, 1,
 
7126
                                       [], True, True,
7626
7127
                                       '--depth', 'empty', H_COPY_2_path)
7627
 
  svntest.actions.run_and_verify_svn(None, None, [], 'commit', '-m',
 
7128
  svntest.actions.run_and_verify_svn(None, [], 'commit', '-m',
7628
7129
                                     'log msg', wc_dir)
7629
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
7130
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
7630
7131
  # Now reverse the prior merge.  Issue #3392 manifests itself here with
7631
7132
  # a mergeinfo parsing error:
7632
7133
  #   >svn merge %url%/A/D/H merge_tests-62\A_COPY_2\D\H -c-8
7651
7152
                                       expected_elision_output,
7652
7153
                                       expected_disk,
7653
7154
                                       expected_status, expected_skip,
7654
 
                                       None, None, None, None, None, 1)
 
7155
                                       check_props=True)
7655
7156
 
7656
7157
  # Test issue #3407 'Shallow merges incorrectly set mergeinfo on children'.
7657
7158
  #
7658
7159
  # Revert all local mods.
7659
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
7160
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
7660
7161
 
7661
7162
  # Merge all available changes from A to A_COPY at --depth empty. Only the
7662
7163
  # mergeinfo on A_COPY should be affected.
7663
7164
  svntest.actions.run_and_verify_svn(
7664
 
    None,
7665
7165
    expected_merge_output([[9,13]],
7666
7166
                          [' U   ' + A_COPY_path + '\n']),
7667
7167
    [], 'merge', '--depth', 'empty',
7668
7168
    sbox.repo_url + '/A', A_COPY_path)
7669
 
  svntest.actions.run_and_verify_svn(None,
7670
 
                                     [A_COPY_path + ' - /A:2-13*\n'],
 
7169
  svntest.actions.run_and_verify_svn([A_COPY_path + ' - /A:2-13*\n'],
7671
7170
                                     [], 'pg', SVN_PROP_MERGEINFO,
7672
7171
                                     '-R', A_COPY_path)
7673
7172
 
7674
7173
  # Merge all available changes from A to A_COPY at --depth files. Only the
7675
7174
  # mergeinfo on A_COPY and its file children should be affected.
7676
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
7175
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
7677
7176
  # Revisions 2-13 are already merged to A_COPY and now they will be merged
7678
7177
  # to A_COPY's file children.  Due to the way we drive the merge editor
7679
7178
  # r2-3, which are inoperative on A_COPY's file children, do not show up
7687
7186
                                           ' U   %s\n' % (A_COPY_path),
7688
7187
                                           ' G   %s\n' % (mu_COPY_path),
7689
7188
                                           ' U   %s\n' % (nu_COPY_path),])
7690
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
7189
  svntest.actions.run_and_verify_svn(expected_output, [],
7691
7190
                                     'merge', '--depth', 'files',
7692
7191
                                     sbox.repo_url + '/A', A_COPY_path)
7693
7192
  expected_output = svntest.verify.UnorderedOutput(
7694
7193
      [A_COPY_path  + ' - /A:2-13*\n',
7695
7194
       mu_COPY_path + ' - /A/mu:2-13\n',
7696
7195
       nu_COPY_path + ' - /A/nu:10-13\n',])
7697
 
  svntest.actions.run_and_verify_svn(None,
7698
 
                                     expected_output,
 
7196
  svntest.actions.run_and_verify_svn(expected_output,
7699
7197
                                     [], 'pg', SVN_PROP_MERGEINFO,
7700
7198
                                     '-R', A_COPY_path)
7701
7199
 
7729
7227
  expected_output = wc.State(wc_dir, {'A/mu' : Item(verb='Sending')})
7730
7228
  wc_status.tweak('A/mu', wc_rev=7)
7731
7229
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
7732
 
                                        wc_status, None, wc_dir)
 
7230
                                        wc_status)
7733
7231
  wc_disk.tweak('A/mu', contents="New content")
7734
7232
 
7735
7233
  # r8 - Add a prop to A/D and commit.
7736
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(7), [],
 
7234
  svntest.actions.run_and_verify_svn(exp_noop_up_out(7), [],
7737
7235
                                     'up', wc_dir)
7738
 
  svntest.actions.run_and_verify_svn(None,
7739
 
                                     ["property 'prop:name' set on '" +
 
7236
  svntest.actions.run_and_verify_svn(["property 'prop:name' set on '" +
7740
7237
                                      D_path + "'\n"], [], 'ps',
7741
7238
                                     'prop:name', 'propval', D_path)
7742
7239
  expected_output = svntest.wc.State(wc_dir, {
7744
7241
    })
7745
7242
  wc_status.tweak(wc_rev=7)
7746
7243
  wc_status.tweak('A/D', wc_rev=8)
7747
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
7748
 
                                        None, wc_dir)
 
7244
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
7749
7245
 
7750
7246
  # r9 - Add a prop to A and commit.
7751
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(8), [],
 
7247
  svntest.actions.run_and_verify_svn(exp_noop_up_out(8), [],
7752
7248
                                     'up', wc_dir)
7753
 
  svntest.actions.run_and_verify_svn(None,
7754
 
                                     ["property 'prop:name' set on '" +
 
7249
  svntest.actions.run_and_verify_svn(["property 'prop:name' set on '" +
7755
7250
                                      A_path + "'\n"], [], 'ps',
7756
7251
                                     'prop:name', 'propval', A_path)
7757
7252
  expected_output = svntest.wc.State(wc_dir, {
7759
7254
    })
7760
7255
  wc_status.tweak(wc_rev=8)
7761
7256
  wc_status.tweak('A', wc_rev=9)
7762
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
7763
 
                                        None, wc_dir)
 
7257
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
7764
7258
 
7765
7259
  # Do an --immediates checkout of A_COPY
7766
7260
  immediates_dir = sbox.add_wc_path('immediates')
7779
7273
  svntest.actions.run_and_verify_checkout(sbox.repo_url + "/A_COPY",
7780
7274
                                          immediates_dir,
7781
7275
                                          expected_output, expected_disk,
7782
 
                                          None, None, None, None,
 
7276
                                          [],
7783
7277
                                          "--depth", "immediates")
7784
7278
 
7785
7279
  # Merge r4:9 into the immediates WC.
7836
7330
                                       expected_disk,
7837
7331
                                       expected_status,
7838
7332
                                       expected_skip,
7839
 
                                       None, None, None, None,
7840
 
                                       None, 1)
 
7333
                                       check_props=True)
7841
7334
 
7842
7335
  # Do a --files checkout of A_COPY
7843
7336
  files_dir = sbox.add_wc_path('files')
7850
7343
  svntest.actions.run_and_verify_checkout(sbox.repo_url + "/A_COPY",
7851
7344
                                          files_dir,
7852
7345
                                          expected_output, expected_disk,
7853
 
                                          None, None, None, None,
 
7346
                                          [],
7854
7347
                                          "--depth", "files")
7855
7348
 
7856
7349
  # Merge r4:9 into the files WC.
7893
7386
                                       expected_disk,
7894
7387
                                       expected_status,
7895
7388
                                       expected_skip,
7896
 
                                       None, None, None, None,
7897
 
                                       None, 1)
 
7389
                                       check_props=True)
7898
7390
 
7899
7391
  # Do an --empty checkout of A_COPY
7900
7392
  empty_dir = sbox.add_wc_path('empty')
7903
7395
  svntest.actions.run_and_verify_checkout(sbox.repo_url + "/A_COPY",
7904
7396
                                          empty_dir,
7905
7397
                                          expected_output, expected_disk,
7906
 
                                          None, None, None, None,
 
7398
                                          [],
7907
7399
                                          "--depth", "empty")
7908
7400
 
7909
7401
  # Merge r4:9 into the empty WC.
7940
7432
                                       expected_disk,
7941
7433
                                       expected_status,
7942
7434
                                       expected_skip,
7943
 
                                       None, None, None, None,
7944
 
                                       None, 1)
 
7435
                                       check_props=True)
7945
7436
 
7946
7437
  # Check that default depth for merge is infinity.
7947
7438
  #
7948
7439
  # Revert the previous changes to the immediates WC and update one
7949
7440
  # child in that WC to depth infinity.
7950
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R',
 
7441
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R',
7951
7442
                                     immediates_dir)
7952
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', '--set-depth',
 
7443
  svntest.actions.run_and_verify_svn(None, [], 'up', '--set-depth',
7953
7444
                                     'infinity',
7954
7445
                                     os.path.join(immediates_dir, 'D'))
7955
7446
  # Now merge r6 into the immediates WC, even though the root of the
8004
7495
                                       expected_disk,
8005
7496
                                       expected_status,
8006
7497
                                       expected_skip,
8007
 
                                       None, None, None, None,
8008
 
                                       None, 1)
 
7498
                                       check_props=True)
8009
7499
 
8010
7500
#----------------------------------------------------------------------
8011
7501
@SkipUnless(server_has_mergeinfo)
8032
7522
  svntest.main.file_write(mu_path, "This is the file 'mu' modified.\n")
8033
7523
  expected_output = wc.State(wc_dir, {'A/mu' : Item(verb='Sending')})
8034
7524
  wc_status.add({'A/mu'     : Item(status='  ', wc_rev=3)})
8035
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
8036
 
                                        wc_status, None, wc_dir)
 
7525
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
8037
7526
 
8038
7527
  # Move A to A_MOVED
8039
 
  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 4.\n'],
 
7528
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
7529
                                            'Committed revision 4.\n'],
8040
7530
                                     [], 'mv', '-m', 'mv A to A_MOVED',
8041
7531
                                     A_url, A_MOVED_url)
8042
7532
 
8043
7533
  # Update the working copy to get A_MOVED
8044
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
7534
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
8045
7535
 
8046
7536
  # Make a modification to A_MOVED/mu
8047
7537
  svntest.main.file_write(A_MOVED_mu_path, "This is 'mu' in A_MOVED.\n")
8095
7585
    'A_COPY/D/H/psi'   : Item(status='  ', wc_rev=4),
8096
7586
    })
8097
7587
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
8098
 
                                        expected_status, None, wc_dir)
 
7588
                                        expected_status)
8099
7589
 
8100
7590
  # Merge /A_MOVED to /A_COPY - this happens in multiple passes
8101
7591
  # because /A_MOVED has renames in its history between the boundaries
8162
7652
                                       expected_disk,
8163
7653
                                       expected_status,
8164
7654
                                       expected_skip,
8165
 
                                       None, None, None, None, None,
8166
 
                                       True, False)
 
7655
                                       [], True, False)
8167
7656
 
8168
7657
#----------------------------------------------------------------------
8169
7658
@SkipUnless(server_has_mergeinfo)
8205
7694
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
8206
7695
  expected_status.tweak('A/mu', wc_rev=2)
8207
7696
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
8208
 
                                        expected_status, None, wc_dir)
8209
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
7697
                                        expected_status)
 
7698
  svntest.actions.run_and_verify_svn(None, [],
8210
7699
                                     'cp', A_url, A_COPY_url, '-m', 'rev 3')
8211
7700
  # Update the working copy to get A_COPY
8212
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
7701
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
8213
7702
  expected_status.add({'A_COPY'           : Item(status='  '),
8214
7703
                       'A_COPY/mu'        : Item(status='  '),
8215
7704
                       'A_COPY/C'         : Item(status='  '),
8234
7723
  svntest.main.file_write(mu_path, tweaked_7th_line)
8235
7724
  expected_status.tweak('A/mu', wc_rev=4)
8236
7725
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
8237
 
                                        expected_status, None, wc_dir)
8238
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
7726
                                        expected_status)
 
7727
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
8239
7728
  expected_status.tweak(wc_rev=4)
8240
7729
  tweaked_17th_line = tweaked_7th_line.replace('line17', 'LINE 17')
8241
7730
  svntest.main.file_write(mu_path, tweaked_17th_line)
8249
7738
  expected_status.tweak('A', wc_rev=5)
8250
7739
  expected_status.tweak('A/mu', wc_rev=5)
8251
7740
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
8252
 
                                        expected_status, None, wc_dir)
 
7741
                                        expected_status)
8253
7742
  tweaked_27th_line = tweaked_17th_line.replace('line27', 'LINE 27')
8254
7743
  svntest.main.file_write(mu_path, tweaked_27th_line)
8255
7744
  expected_status.tweak('A/mu', wc_rev=6)
8256
7745
  expected_output = wc.State(wc_dir, {'A/mu' : Item(verb='Sending')})
8257
7746
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
8258
 
                                        expected_status, None, wc_dir)
 
7747
                                        expected_status)
8259
7748
  # Merge r5 to A_COPY/mu
8260
7749
  svntest.actions.run_and_verify_svn(
8261
 
    None,
8262
7750
    expected_merge_output([[5]],
8263
7751
                          ['U    ' + A_COPY_mu_path + '\n',
8264
7752
                           ' U   ' + A_COPY_mu_path + '\n']),
8327
7815
                                       expected_disk,
8328
7816
                                       expected_status,
8329
7817
                                       expected_skip,
8330
 
                                       None, None, None, None, None, 1)
 
7818
                                       check_props=True)
8331
7819
  # Revert r5 and r6 on A_COPY/mu
8332
7820
  svntest.actions.run_and_verify_svn(
8333
 
    None,
8334
7821
    expected_merge_output([[6,5]],
8335
7822
                          ['G    ' + A_COPY_mu_path + '\n',
8336
7823
                           ' G   ' + A_COPY_mu_path + '\n']),
8361
7848
                                       expected_disk,
8362
7849
                                       expected_status,
8363
7850
                                       expected_skip,
8364
 
                                       None, None, None, None, None, 1)
 
7851
                                       check_props=True)
8365
7852
 
8366
7853
  expected_disk.add({'' : Item(props={SVN_PROP_MERGEINFO : '/A:4-6',
8367
7854
                                      'prop1' : 'val1'})})
8385
7872
                                       expected_disk,
8386
7873
                                       expected_status,
8387
7874
                                       expected_skip,
8388
 
                                       None, None, None, None, None, 1)
 
7875
                                       check_props=True)
8389
7876
  #Revert r5 on A_COPY/mu
8390
7877
  svntest.actions.run_and_verify_svn(
8391
 
    None,
8392
7878
    expected_merge_output([[-5]],
8393
7879
                          ['G    ' + A_COPY_mu_path + '\n',
8394
7880
                           ' G   ' + A_COPY_mu_path + '\n']),
8422
7908
                                       expected_disk,
8423
7909
                                       expected_status,
8424
7910
                                       expected_skip,
8425
 
                                       None, None, None, None, None, 1)
 
7911
                                       check_props=True)
8426
7912
 
8427
7913
#----------------------------------------------------------------------
8428
7914
@SkipUnless(server_has_mergeinfo)
8444
7930
  mu_MOVED_path = sbox.ospath('A/mu_MOVED')
8445
7931
 
8446
7932
  # Copy mu to mu_COPY
8447
 
  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 2.\n'],
 
7933
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
7934
                                            'Committed revision 2.\n'],
8448
7935
                                     [], 'cp', '-m', 'cp mu to mu_COPY',
8449
7936
                                     mu_url, mu_COPY_url)
8450
7937
 
8454
7941
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
8455
7942
  expected_status.tweak('A/mu', wc_rev=3)
8456
7943
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
8457
 
                                        expected_status, None, wc_dir)
 
7944
                                        expected_status)
8458
7945
 
8459
7946
  # Move mu to mu_MOVED
8460
 
  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 4.\n'],
 
7947
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
7948
                                            'Committed revision 4.\n'],
8461
7949
                                     [], 'mv', '-m', 'mv mu to mu_MOVED',
8462
7950
                                     mu_url, mu_MOVED_url)
8463
7951
 
8464
7952
  # Update the working copy to get mu_MOVED
8465
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
7953
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
8466
7954
 
8467
7955
  # Make a modification to mu_MOVED
8468
7956
  svntest.main.file_write(mu_MOVED_path, "This is 'mu' in mu_MOVED.\n")
8474
7962
    'A/mu_COPY'   : Item(status='  ', wc_rev=4),
8475
7963
    })
8476
7964
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
8477
 
                                        expected_status, None, wc_dir)
 
7965
                                        expected_status)
8478
7966
 
8479
7967
  # Merge A/mu_MOVED to A/mu_COPY - this happens in multiple passes
8480
7968
  # because A/mu_MOVED has renames in its history between the
8484
7972
                                           ' U   %s\n' % (mu_COPY_path),
8485
7973
                                           'G    %s\n' % (mu_COPY_path),
8486
7974
                                           ' G   %s\n' % (mu_COPY_path),])
8487
 
  svntest.actions.run_and_verify_svn(None, expected_output,
 
7975
  svntest.actions.run_and_verify_svn(expected_output,
8488
7976
                                     [], 'merge', '-r', '1:5',
8489
7977
                                     mu_MOVED_url,
8490
7978
                                     mu_COPY_path)
8491
 
  svntest.actions.run_and_verify_svn(None, ['/A/mu:2-3\n',
 
7979
  svntest.actions.run_and_verify_svn(['/A/mu:2-3\n',
8492
7980
                                            '/A/mu_MOVED:4-5\n'],
8493
7981
                                     [], 'propget', SVN_PROP_MERGEINFO,
8494
7982
                                     mu_COPY_path)
8512
8000
  A_COPY_path = sbox.ospath('A_COPY')
8513
8001
 
8514
8002
  # Create B1 inside A
8515
 
  svntest.actions.run_and_verify_svn(None, ["A         " + B1_path + "\n"],
 
8003
  svntest.actions.run_and_verify_svn(["A         " + B1_path + "\n"],
8516
8004
                                     [], 'mkdir',
8517
8005
                                     B1_path)
8518
8006
 
8519
8007
  # Add a file mu inside B1
8520
8008
  svntest.main.file_write(B1_mu_path, "This is the file 'mu'.\n")
8521
 
  svntest.actions.run_and_verify_svn(None, ["A         " + B1_mu_path + "\n"],
 
8009
  svntest.actions.run_and_verify_svn(["A         " + B1_mu_path + "\n"],
8522
8010
                                     [], 'add', B1_mu_path)
8523
8011
 
8524
8012
  # Commit B1 and B1/mu
8532
8020
    'A/B1/mu'   : Item(status='  ', wc_rev=2),
8533
8021
    })
8534
8022
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
8535
 
                                        expected_status, None, wc_dir)
 
8023
                                        expected_status)
8536
8024
 
8537
8025
  # Copy A to A_COPY
8538
 
  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 3.\n'],
 
8026
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
8027
                                            'Committed revision 3.\n'],
8539
8028
                                     [], 'cp', '-m', 'cp A to A_COPY',
8540
8029
                                     A_url, A_COPY_url)
8541
8030
 
8548
8037
    'A/B1/mu'   : Item(status='  ', wc_rev=4),
8549
8038
    })
8550
8039
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
8551
 
                                        expected_status, None, wc_dir)
 
8040
                                        expected_status)
8552
8041
 
8553
8042
  # Update the working copy to get A_COPY
8554
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
8043
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
8555
8044
 
8556
8045
  # Merge /A to /A_COPY
8557
8046
  expected_output = wc.State(A_COPY_path, {
8617
8106
                                       expected_disk,
8618
8107
                                       expected_status,
8619
8108
                                       expected_skip,
8620
 
                                       None, None, None, None, None,
8621
 
                                       1, 1)
 
8109
                                       [], True, True)
8622
8110
 
8623
8111
#----------------------------------------------------------------------
8624
8112
# Test for issue 2818: Provide a 'merge' API which allows for merging of
8648
8136
  wc_status.tweak(wc_rev='6')
8649
8137
  svntest.actions.run_and_verify_update(wc_dir, expected_output,
8650
8138
                                        wc_disk, wc_status,
8651
 
                                        None, None, None, None, None, True)
 
8139
                                        check_props=True)
8652
8140
 
8653
8141
  # Make some prop changes to some dirs.
8654
 
  svntest.actions.run_and_verify_svn(None,
8655
 
                                     ["property 'prop:name' set on '" +
 
8142
  svntest.actions.run_and_verify_svn(["property 'prop:name' set on '" +
8656
8143
                                      G_path + "'\n"], [], 'ps',
8657
8144
                                     'prop:name', 'propval', G_path)
8658
8145
  expected_output = svntest.wc.State(wc_dir, {'A/D/G': Item(verb='Sending'),})
8659
8146
  wc_status.tweak('A/D/G', wc_rev=7)
8660
8147
  wc_disk.tweak('A/D/G', props={'prop:name' : 'propval'})
8661
8148
 
8662
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
8663
 
                                        None, wc_dir)
8664
 
  svntest.actions.run_and_verify_svn(None,
8665
 
                                     ["property 'prop:name' set on '" +
 
8149
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
 
8150
  svntest.actions.run_and_verify_svn(["property 'prop:name' set on '" +
8666
8151
                                      H_path + "'\n"], [], 'ps',
8667
8152
                                     'prop:name', 'propval', H_path)
8668
8153
  expected_output = svntest.wc.State(wc_dir, {'A/D/H': Item(verb='Sending'),})
8669
8154
  wc_status.tweak('A/D/H', wc_rev=8)
8670
8155
  wc_disk.tweak('A/D/H', props={'prop:name' : 'propval'})
8671
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
8672
 
                                        None, wc_dir)
 
8156
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
8673
8157
 
8674
8158
  # Do multiple additive merges to a file"
8675
8159
  # Merge -r2:4 -c6 into A_COPY/D/G/rho.
8678
8162
  # so use run_and_verify_svn.
8679
8163
  ### TODO: We can use run_and_verify_merge() here now.
8680
8164
  svntest.actions.run_and_verify_svn(
8681
 
    None,
8682
8165
    expected_merge_output([[3,4],[6]],
8683
8166
                          ['U    ' + rho_COPY_path + '\n',
8684
8167
                           ' U   ' + rho_COPY_path + '\n',
8690
8173
  expected_status = wc.State(rho_COPY_path,
8691
8174
                             {'' : Item(status='MM', wc_rev=6)})
8692
8175
  svntest.actions.run_and_verify_status(rho_COPY_path, expected_status)
8693
 
  svntest.actions.run_and_verify_svn(None, ["/A/D/G/rho:3-4,6\n"], [],
 
8176
  svntest.actions.run_and_verify_svn(["/A/D/G/rho:3-4,6\n"], [],
8694
8177
                                     'propget', SVN_PROP_MERGEINFO,
8695
8178
                                     rho_COPY_path)
8696
8179
 
8701
8184
    ['U    ' + omega_COPY_path + '\n',
8702
8185
     ' U   ' + H_COPY_path + '\n',
8703
8186
     ' G   ' + H_COPY_path + '\n',])
8704
 
  svntest.actions.run_and_verify_svn(None, expected_output,
 
8187
  svntest.actions.run_and_verify_svn(expected_output,
8705
8188
                                     [], 'merge', '-c6', '-c8',
8706
8189
                                     sbox.repo_url + '/A/D/H',
8707
8190
                                     H_COPY_path)
8713
8196
                              'chi'  : Item(status='  ', wc_rev=6),
8714
8197
                              'omega': Item(status='M ', wc_rev=6),})
8715
8198
  svntest.actions.run_and_verify_status(H_COPY_path, expected_status)
8716
 
  svntest.actions.run_and_verify_svn(None,
8717
 
                                     [H_COPY_path + " - /A/D/H:6,8\n"],
 
8199
  svntest.actions.run_and_verify_svn([H_COPY_path + " - /A/D/H:6,8\n"],
8718
8200
                                     [], 'propget', '-R', SVN_PROP_MERGEINFO,
8719
8201
                                     H_COPY_path)
8720
8202
 
8728
8210
     ' G   ' + A_COPY_path + '\n',
8729
8211
     ' G   ' + H_COPY_path + '\n',],
8730
8212
    elides=True)
8731
 
  svntest.actions.run_and_verify_svn(None, expected_output,
 
8213
  svntest.actions.run_and_verify_svn(expected_output,
8732
8214
                                     [], 'merge', '-c-3', '-c-6',
8733
8215
                                     sbox.repo_url + '/A',
8734
8216
                                     A_COPY_path)
8760
8242
  # Construct proper regex for '\' infested Windows paths.
8761
8243
  if sys.platform == 'win32':
8762
8244
    expected_out = expected_out.replace("\\", "\\\\")
8763
 
  svntest.actions.run_and_verify_svn(None, expected_out, [],
 
8245
  svntest.actions.run_and_verify_svn(expected_out, [],
8764
8246
                                     'propget', '-R', SVN_PROP_MERGEINFO,
8765
8247
                                     A_COPY_path)
8766
8248
 
8779
8261
     ' U   ' + rho_COPY_path   + '\n',
8780
8262
     ' G   ' + rho_COPY_path   + '\n'],
8781
8263
    elides=True)
8782
 
  svntest.actions.run_and_verify_svn(None, expected_output, [], 'merge',
 
8264
  svntest.actions.run_and_verify_svn(expected_output, [], 'merge',
8783
8265
                                     '-r2:3', '-c-4', '-r4:7',
8784
8266
                                     sbox.repo_url + '/A/D',
8785
8267
                                     D_COPY_path)
8801
8283
  # Construct proper regex for '\' infested Windows paths.
8802
8284
  if sys.platform == 'win32':
8803
8285
    expected_out = expected_out.replace("\\", "\\\\")
8804
 
  svntest.actions.run_and_verify_svn(None, expected_out, [],
 
8286
  svntest.actions.run_and_verify_svn(expected_out, [],
8805
8287
                                     'propget', '-R', SVN_PROP_MERGEINFO,
8806
8288
                                     D_COPY_path)
8807
8289
 
8839
8321
    'A/B/E'          : Item(status='  ', wc_rev=3),
8840
8322
    })
8841
8323
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
8842
 
                                        wc_status, None, wc_dir)
 
8324
                                        wc_status)
8843
8325
 
8844
8326
  # Merge /A/B to /A_COPY/B ie., r1 to r3 with depth files
8845
8327
  expected_output = wc.State(A_COPY_B_path, {
8878
8360
                                       expected_disk,
8879
8361
                                       expected_status,
8880
8362
                                       expected_skip,
8881
 
                                       None, None, None, None, None,
8882
 
                                       1, 1, '--depth', 'files',
 
8363
                                       [], True, True,
 
8364
                                       '--depth', 'files',
8883
8365
                                       A_COPY_B_path)
8884
8366
 
8885
8367
  # Merge /A/B to /A_COPY/B ie., r1 to r3 with infinite depth
8918
8400
                                       expected_disk,
8919
8401
                                       expected_status,
8920
8402
                                       expected_skip,
8921
 
                                       None, None, None, None, None,
8922
 
                                       1, 1)
 
8403
                                       [], 1, 1)
8923
8404
 
8924
8405
#----------------------------------------------------------------------
8925
8406
# Test for issue #2971: Reverse merge of prop add segfaults if
8939
8420
  G_COPY_path = sbox.ospath('A_COPY/D/G')
8940
8421
 
8941
8422
  # Make some prop changes to some dirs.
8942
 
  svntest.actions.run_and_verify_svn(None,
8943
 
                                     ["property 'prop:name' set on '" +
 
8423
  svntest.actions.run_and_verify_svn(["property 'prop:name' set on '" +
8944
8424
                                      G_path + "'\n"], [], 'ps',
8945
8425
                                     'prop:name', 'propval', G_path)
8946
8426
  expected_output = svntest.wc.State(wc_dir, {'A/D/G': Item(verb='Sending'),})
8947
8427
  wc_status.tweak('A/D/G', wc_rev=3)
8948
8428
  wc_disk.tweak('A/D/G', props={'prop:name' : 'propval'})
8949
8429
 
8950
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
8951
 
                                        None, wc_dir)
 
8430
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
8952
8431
 
8953
8432
  # Merge -c3's prop add to A_COPY/D/G
8954
8433
  expected_output = wc.State(G_COPY_path, {
8981
8460
                                       expected_disk,
8982
8461
                                       expected_status,
8983
8462
                                       expected_skip,
8984
 
                                       None, None, None, None,
8985
 
                                       None, 1)
 
8463
                                       check_props=True)
8986
8464
 
8987
8465
  # Now merge -c-3 but target the previous target's parent instead.
8988
8466
  expected_output = wc.State(D_COPY_path, {
9028
8506
                                       expected_disk,
9029
8507
                                       expected_status,
9030
8508
                                       expected_skip,
9031
 
                                       None, None, None, None,
9032
 
                                       None, 1)
 
8509
                                       check_props=True)
9033
8510
 
9034
8511
#----------------------------------------------------------------------
9035
8512
@XFail()
9053
8530
  # Make a modifications to A/B/lambda and add A/B/E/newfile
9054
8531
  svntest.main.file_write(lambda_path, "This is the file 'lambda' modified.\n")
9055
8532
  svntest.main.file_write(newfile_path, "This is the file 'newfile'.\n")
9056
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', newfile_path)
 
8533
  svntest.actions.run_and_verify_svn(None, [], 'add', newfile_path)
9057
8534
  expected_output = wc.State(wc_dir, {
9058
8535
    'A/B/lambda'    : Item(verb='Sending'),
9059
8536
    'A/B/E/newfile' : Item(verb='Adding'),
9063
8540
    'A/B/E/newfile'  : Item(status='  ', wc_rev=3),
9064
8541
    })
9065
8542
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
9066
 
                                        wc_status, None, wc_dir)
 
8543
                                        wc_status)
9067
8544
 
9068
8545
  # Merge /A/B to /A_COPY/B ie., r1 to r3 with depth immediates
9069
8546
  expected_output = wc.State(A_COPY_B_path, {
9106
8583
                                       expected_disk,
9107
8584
                                       expected_status,
9108
8585
                                       expected_skip,
9109
 
                                       None, None, None, None, None,
9110
 
                                       1, 1, '--depth', 'immediates',
 
8586
                                       [], True, True,
 
8587
                                       '--depth', 'immediates',
9111
8588
                                       A_COPY_B_path)
9112
8589
 
9113
8590
  # Merge /A/B to /A_COPY/B ie., r1 to r3 with infinite depth
9146
8623
                                       expected_disk,
9147
8624
                                       expected_status,
9148
8625
                                       expected_skip,
9149
 
                                       None, None, None, None, None,
9150
 
                                       1, 1)
 
8626
                                       [], True, True)
9151
8627
 
9152
8628
#----------------------------------------------------------------------
9153
8629
@SkipUnless(server_has_mergeinfo)
9173
8649
 
9174
8650
  svntest.actions.run_and_verify_commit(wc_dir,
9175
8651
                                        expected_output,
9176
 
                                        expected_status,
9177
 
                                        None,
9178
 
                                        wc_dir)
 
8652
                                        expected_status)
9179
8653
 
9180
8654
  # update to HEAD so that the to-be-undone revision is found in the
9181
8655
  # implicit mergeinfo (the natural history) of the target.
9182
 
  svntest.actions.run_and_verify_svn(None, None, [], 'update', wc_dir)
 
8656
  svntest.actions.run_and_verify_svn(None, [], 'update', wc_dir)
9183
8657
 
9184
8658
  expected_output = wc.State(wc_dir, {
9185
8659
    'A/mu' : Item(status='U ')
9200
8674
                                       expected_elision_output,
9201
8675
                                       expected_disk,
9202
8676
                                       expected_status, expected_skip,
9203
 
                                       None, None, None, None, None, 1, 1)
9204
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
8677
                                       [], True, True)
 
8678
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
9205
8679
 
9206
8680
  # record dummy self mergeinfo to test the fact that self-reversal should work
9207
8681
  # irrespective of mergeinfo.
9208
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ps', SVN_PROP_MERGEINFO,
 
8682
  svntest.actions.run_and_verify_svn(None, [], 'ps', SVN_PROP_MERGEINFO,
9209
8683
                                     '/:1', wc_dir)
9210
8684
 
9211
8685
  # Bad svntest.main.greek_state does not have '', so adding it explicitly.
9224
8698
                                       expected_elision_output,
9225
8699
                                       expected_disk,
9226
8700
                                       expected_status, expected_skip,
9227
 
                                       None, None, None, None, None, 1, 1)
 
8701
                                       [], True, True)
9228
8702
 
9229
8703
#----------------------------------------------------------------------
9230
8704
@SkipUnless(server_has_mergeinfo)
9251
8725
    'A/B/lambda'     : Item(status='  ', wc_rev=3),
9252
8726
    })
9253
8727
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
9254
 
                                        wc_status, None, wc_dir)
 
8728
                                        wc_status)
9255
8729
 
9256
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
8730
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
9257
8731
 
9258
8732
  # Merge /A/B to /A_COPY/B ie., r1 to r3 with depth immediates
9259
8733
  expected_output = wc.State(A_COPY_B_path, {
9290
8764
                                       expected_disk,
9291
8765
                                       expected_status,
9292
8766
                                       expected_skip,
9293
 
                                       None, None, None, None, None, 1, 1)
 
8767
                                       [], True, True)
9294
8768
 
9295
8769
  # Now, revert lambda and repeat the merge.  Nothing should happen.
9296
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R',
 
8770
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R',
9297
8771
                                     A_COPY_lambda_path)
9298
8772
  expected_output.remove('lambda')
9299
8773
  expected_disk.tweak('lambda', contents="This is the file 'lambda'.\n")
9309
8783
                                       expected_disk,
9310
8784
                                       expected_status,
9311
8785
                                       expected_skip,
9312
 
                                       None, None, None, None, None, 1, 1)
 
8786
                                       [], True, True)
9313
8787
 
9314
8788
  # Now, try the merge again with --ignore-ancestry.  We should get
9315
8789
  # lambda re-modified. */
9330
8804
                                       expected_disk,
9331
8805
                                       expected_status,
9332
8806
                                       expected_skip,
9333
 
                                       None, None, None, None, None, 1, 1,
 
8807
                                       [], True, True,
9334
8808
                                       '--ignore-ancestry', A_COPY_B_path)
9335
8809
 
9336
8810
#----------------------------------------------------------------------
9361
8835
  svntest.main.run_svn(None, 'cp', A_C_url, A_COPY_C_url, '-m', 'copy...')
9362
8836
  svntest.main.run_svn(None, 'mv', A_COPY_C_url, A_RENAMED_C_url, '-m',
9363
8837
                       'rename...')
9364
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
8838
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
9365
8839
 
9366
8840
  svntest.main.file_write(A_RENAMED_C_file1_path, "This is the file1.\n")
9367
8841
  svntest.main.run_svn(None, 'add', A_RENAMED_C_file1_path)
9373
8847
    'file1'   : Item(status='  ', wc_rev=4),
9374
8848
    })
9375
8849
  svntest.actions.run_and_verify_commit(A_RENAMED_C_path, expected_output,
9376
 
                                        expected_status, None,
9377
 
                                        A_RENAMED_C_path)
 
8850
                                        expected_status)
9378
8851
  svntest.main.file_write(A_RENAMED_C_file1_path,
9379
8852
                          "This is the file1 modified.\n")
9380
8853
  expected_output = wc.State(A_RENAMED_C_path, {
9382
8855
    })
9383
8856
  expected_status.tweak('file1', wc_rev=5)
9384
8857
  svntest.actions.run_and_verify_commit(A_RENAMED_C_path, expected_output,
9385
 
                                        expected_status, None,
9386
 
                                        A_RENAMED_C_path)
 
8858
                                        expected_status)
9387
8859
 
9388
8860
  expected_skip = wc.State(A_C_path, {})
9389
8861
  expected_output = wc.State(A_C_path, {
9410
8882
                                       expected_disk,
9411
8883
                                       expected_status,
9412
8884
                                       expected_skip,
9413
 
                                       None, None, None, None, None, 1, 1)
 
8885
                                       [], True, True)
9414
8886
 
9415
8887
  expected_output = wc.State(A_C_path, {
9416
8888
    'file1'    : Item(status='U '),
9434
8906
                                       expected_disk,
9435
8907
                                       expected_status,
9436
8908
                                       expected_skip,
9437
 
                                       None, None, None, None, None, 1, 1)
 
8909
                                       [], True, True)
9438
8910
 
9439
8911
#----------------------------------------------------------------------
9440
8912
# Test for part of issue #2877: 'do subtree merge only if subtree has
9455
8927
  wc_disk, wc_status = set_up_branch(sbox)
9456
8928
 
9457
8929
  # r7 - Move A to A_MOVED
9458
 
  svntest.actions.run_and_verify_svn(None, ['\n', 'Committed revision 7.\n'],
 
8930
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
8931
                                            'Committed revision 7.\n'],
9459
8932
                                     [], 'mv', '-m', 'mv A to A_MOVED',
9460
8933
                                     sbox.repo_url + '/A',
9461
8934
                                     sbox.repo_url + '/A_MOVED')
9487
8960
  wc_status.tweak(status='  ', wc_rev=7)
9488
8961
 
9489
8962
  # Update the WC
9490
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
8963
  svntest.actions.run_and_verify_svn(None, [],
9491
8964
                                     'update', wc_dir)
9492
8965
 
9493
8966
  # r8 - Make a text mod to 'A_MOVED/D/G/tau'
9496
8969
  expected_output = wc.State(wc_dir,
9497
8970
                             {'A_MOVED/D/G/tau' : Item(verb='Sending')})
9498
8971
  wc_status.tweak('A_MOVED/D/G/tau', status='  ', wc_rev=8)
9499
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
9500
 
                                        wc_status, None, wc_dir)
 
8972
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
9501
8973
 
9502
8974
  # Merge -c4 URL/A_MOVED/D/G A_COPY/D/G.
9503
8975
  #
9535
9007
                                       expected_disk,
9536
9008
                                       expected_status,
9537
9009
                                       expected_skip,
9538
 
                                       None, None, None, None,
9539
 
                                       None, 1)
 
9010
                                       check_props=True)
9540
9011
 
9541
9012
  # Merge -c8 URL/A_MOVED/D A_COPY/D.
9542
9013
  #
9587
9058
                                       expected_disk,
9588
9059
                                       expected_status,
9589
9060
                                       expected_skip,
9590
 
                                       None, None, None, None,
9591
 
                                       None, 1)
 
9061
                                       check_props=True)
9592
9062
 
9593
9063
#----------------------------------------------------------------------
9594
9064
# Tests for issue #3067: 'subtrees with intersecting mergeinfo, that don't
9612
9082
 
9613
9083
  # Create 'A/D/H/nu', commit it as r7, make a text mod to it in r8.
9614
9084
  svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
9615
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
 
9085
  svntest.actions.run_and_verify_svn(None, [], 'add', nu_path)
9616
9086
  expected_output = wc.State(wc_dir, {'A/D/H/nu' : Item(verb='Adding')})
9617
9087
  wc_status.add({'A/D/H/nu' : Item(status='  ', wc_rev=7)})
9618
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
9619
 
                                        wc_status, None, wc_dir)
 
9088
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
9620
9089
  svntest.main.file_write(nu_path, "New content")
9621
9090
  expected_output = wc.State(wc_dir, {'A/D/H/nu' : Item(verb='Sending')})
9622
9091
  wc_status.tweak('A/D/H/nu', wc_rev=8)
9623
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
9624
 
                                        wc_status, None, wc_dir)
 
9092
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
9625
9093
 
9626
9094
  # Merge r7 to A_COPY/D/H, then, so it has it's own explicit mergeinfo,
9627
9095
  # then merge r8 to A_COPY/D/H/nu so it too has explicit mergeinfo.
9655
9123
                                       expected_elision_output,
9656
9124
                                       expected_disk,
9657
9125
                                       expected_status, expected_skip,
9658
 
                                       None, None, None, None, None, 1)
 
9126
                                       check_props=True)
9659
9127
  # run_and_verify_merge doesn't support merging to a file WCPATH
9660
9128
  # so use run_and_verify_svn.
9661
9129
  ### TODO: We can use run_and_verify_merge() here now.
9662
9130
  svntest.actions.run_and_verify_svn(
9663
 
    None,
9664
9131
    expected_merge_output([[8]],
9665
9132
                          ['U    ' + nu_COPY_path + '\n',
9666
9133
                           ' G   ' + nu_COPY_path + '\n']),
9732
9199
                                       expected_disk,
9733
9200
                                       expected_status,
9734
9201
                                       expected_skip,
9735
 
                                       None, None, None, None,
9736
 
                                       None, 1)
 
9202
                                       check_props=True)
9737
9203
  expected_output = wc.State(D_COPY_path, {
9738
9204
    'H/omega': Item(status='G '),
9739
9205
    })
9778
9244
                                       expected_disk,
9779
9245
                                       expected_status,
9780
9246
                                       expected_skip,
9781
 
                                       None, None, None, None,
9782
 
                                       None, 1)
 
9247
                                       check_props=True)
9783
9248
  # Now once again merge r6 to A_COPY.  A_COPY already has r6 in its mergeinfo
9784
9249
  # so we expect only subtree merges on A_COPY/D, A_COPY_D_H, and
9785
9250
  # A_COPY/D/H/nu.  The fact that A/D/H/nu doesn't exist at r6 should not cause
9850
9315
                                       expected_disk_1,
9851
9316
                                       expected_status,
9852
9317
                                       expected_skip,
9853
 
                                       None, None, None, None,
9854
 
                                       None, 1)
 
9318
                                       check_props=True)
9855
9319
 
9856
9320
  # Commit this merge as r9.
9857
9321
  #
9858
9322
  # Update the wc first to make setting the expected status a bit easier.
9859
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(8), [],
 
9323
  svntest.actions.run_and_verify_svn(exp_noop_up_out(8), [],
9860
9324
                                     'up', wc_dir)
9861
9325
  wc_status.tweak(wc_rev=8)
9862
9326
  expected_output = wc.State(wc_dir, {
9872
9336
                  'A_COPY/D/H/omega',
9873
9337
                  wc_rev=9)
9874
9338
  wc_status.add({'A_COPY/D/H/nu' : Item(status='  ', wc_rev=9)})
9875
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
9876
 
                                        wc_status, None, wc_dir)
 
9339
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
9877
9340
  # Update the WC.
9878
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(9), [],
 
9341
  svntest.actions.run_and_verify_svn(exp_noop_up_out(9), [],
9879
9342
                                     'up', wc_dir)
9880
9343
  wc_status.tweak(wc_rev=9)
9881
9344
 
9882
9345
  # Yet another test for issue #3067.  Merge -rX:Y, where X>Y (reverse merge)
9883
 
  # and the merge target has a subtree that came into existance at some rev
 
9346
  # and the merge target has a subtree that came into existence at some rev
9884
9347
  # N where X < N < Y.  This merge should simply delete the subtree.
9885
9348
  #
9886
9349
  # For this test merge -r9:2 to A_COPY.  This should revert all the merges
9950
9413
                                       expected_disk,
9951
9414
                                       expected_status,
9952
9415
                                       expected_skip,
9953
 
                                       None, None, None, None,
9954
 
                                       None, 1)
 
9416
                                       check_props=True)
9955
9417
 
9956
9418
  # Revert the previous merge, then merge r4 to A_COPY/D/G/rho.  Commit
9957
9419
  # this merge as r10.
9958
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
9420
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
9959
9421
  svntest.actions.run_and_verify_svn(
9960
 
    None,
9961
9422
    expected_merge_output([[4]],
9962
9423
                          ['U    ' + rho_COPY_path + '\n',
9963
9424
                           ' G   ' + rho_COPY_path + '\n']),
9965
9426
  expected_output = wc.State(wc_dir, {
9966
9427
    'A_COPY/D/G/rho'    : Item(verb='Sending'),})
9967
9428
  wc_status.tweak('A_COPY/D/G/rho', wc_rev=10)
9968
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
9969
 
                                        wc_status, None, wc_dir)
9970
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(10), [],
 
9429
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
 
9430
  svntest.actions.run_and_verify_svn(exp_noop_up_out(10), [],
9971
9431
                                     'up', wc_dir)
9972
9432
  wc_status.tweak(wc_rev=10)
9973
9433
 
10022
9482
                                       expected_disk_1,
10023
9483
                                       expected_status,
10024
9484
                                       expected_skip,
10025
 
                                       None, None, None, None,
10026
 
                                       None, 1)
 
9485
                                       check_props=True)
10027
9486
 
10028
9487
#----------------------------------------------------------------------
10029
9488
@SkipUnless(server_has_mergeinfo)
10106
9565
                                       expected_A_COPY_disk,
10107
9566
                                       expected_A_COPY_status,
10108
9567
                                       expected_A_COPY_skip,
10109
 
                                       None, None, None, None,
10110
 
                                       None, 1)
 
9568
                                       check_props=True)
10111
9569
 
10112
9570
  # Change 'A_COPY/mu'
10113
9571
  svntest.main.file_write(mu_COPY_path, "New content")
10121
9579
  wc_status.tweak('A_COPY', 'A_COPY/D/H/psi', 'A_COPY/mu', wc_rev=7)
10122
9580
  svntest.actions.run_and_verify_commit(wc_dir,
10123
9581
                                        expected_output,
10124
 
                                        wc_status,
10125
 
                                        None,
10126
 
                                        wc_dir)
 
9582
                                        wc_status)
10127
9583
 
10128
9584
  # Merge r7 back to the 'A'
10129
9585
  expected_output = wc.State(A_path, {
10185
9641
                                       expected_A_disk,
10186
9642
                                       expected_A_status,
10187
9643
                                       expected_A_skip,
10188
 
                                       None, None, None, None,
10189
 
                                       None, True, False,
 
9644
                                       [], True, False,
10190
9645
                                       '--allow-mixed-revisions', A_path)
10191
9646
 
10192
9647
  # Revert all local mods
10193
 
  svntest.actions.run_and_verify_svn(None,
10194
 
                                     ["Reverted '" + A_path + "'\n",
 
9648
  svntest.actions.run_and_verify_svn(["Reverted '" + A_path + "'\n",
10195
9649
                                      "Reverted '" + mu_path + "'\n"],
10196
9650
                                     [], 'revert', '-R', wc_dir)
10197
9651
 
10200
9654
  # 'A_MOVED', but 'A_MOVED@3' is 'A', so again this mergeinfo is filtered
10201
9655
  # out, leaving the only the mergeinfo created from the merge itself:
10202
9656
  # '/A_COPY:7'.
10203
 
  svntest.actions.run_and_verify_svn(None,
10204
 
                                     ['\n', 'Committed revision 8.\n'],
 
9657
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
9658
                                      'Committed revision 8.\n'],
10205
9659
                                     [], 'move',
10206
9660
                                     sbox.repo_url + '/A',
10207
9661
                                     sbox.repo_url + '/A_MOVED',
10285
9739
                                        expected_output,
10286
9740
                                        wc_disk,
10287
9741
                                        wc_status,
10288
 
                                        None, None, None, None, None,
10289
 
                                        True)
 
9742
                                        check_props=True)
10290
9743
 
10291
9744
  expected_output = wc.State(A_MOVED_path, {
10292
9745
    'mu' : Item(status='U '),
10326
9779
                                       expected_A_disk,
10327
9780
                                       expected_A_status,
10328
9781
                                       expected_A_skip,
10329
 
                                       None, None, None, None,
10330
 
                                       None, 1)
 
9782
                                       check_props=True)
10331
9783
 
10332
9784
  # Revert all local mods
10333
 
  svntest.actions.run_and_verify_svn(None,
10334
 
                                     ["Reverted '" + A_MOVED_path + "'\n",
 
9785
  svntest.actions.run_and_verify_svn(["Reverted '" + A_MOVED_path + "'\n",
10335
9786
                                      "Reverted '" + mu_MOVED_path + "'\n"],
10336
9787
                                     [], 'revert', '-R', wc_dir)
10337
9788
 
10364
9815
       "A    " + sbox.ospath('A/D/H/psi') + "\n",
10365
9816
       "Exported revision 1.\n",]
10366
9817
       )
10367
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
9818
  svntest.actions.run_and_verify_svn(expected_output, [],
10368
9819
                                     'export', sbox.repo_url + '/A@1',
10369
9820
                                     A_path)
10370
9821
  expected_output = svntest.verify.UnorderedOutput(
10388
9839
       "A         " + sbox.ospath('A/D/H/omega') + "\n",
10389
9840
       "A         " + sbox.ospath('A/D/H/psi') + "\n",]
10390
9841
      )
10391
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
9842
  svntest.actions.run_and_verify_svn(expected_output, [],
10392
9843
                                     'add', A_path)
10393
9844
  # Commit the new 'A' as r9
10394
9845
  expected_output = wc.State(wc_dir, {
10437
9888
  wc_status.tweak(status='  ')
10438
9889
  svntest.actions.run_and_verify_commit(wc_dir,
10439
9890
                                        expected_output,
10440
 
                                        wc_status,
10441
 
                                        None,
10442
 
                                        wc_dir)
 
9891
                                        wc_status)
10443
9892
 
10444
9893
  expected_output = wc.State(A_path, {
10445
9894
    'mu'      : Item(status='U '),
10502
9951
                                       expected_A_disk,
10503
9952
                                       expected_A_status,
10504
9953
                                       expected_A_skip,
10505
 
                                       None, None, None, None,
10506
 
                                       None, 1)
 
9954
                                       check_props=True)
10507
9955
 
10508
9956
#----------------------------------------------------------------------
 
9957
@SkipUnless(server_has_mergeinfo)
10509
9958
@Issue(3094)
10510
9959
def merge_range_predates_history(sbox):
10511
9960
  "merge range predates history"
10523
9972
 
10524
9973
  # Tweak a file and commit. (r2)
10525
9974
  svntest.main.file_append(iota_path, "More data.\n")
10526
 
  svntest.main.run_svn(None, 'ci', '-m', 'tweak iota', wc_dir)
 
9975
  sbox.simple_commit(message='tweak iota')
10527
9976
 
10528
9977
  # Create our trunk and branches directory, and update working copy. (r3)
10529
9978
  svntest.main.run_svn(None, 'mkdir', trunk_url, branches_url,
10533
9982
  # Add a file to the trunk and commit. (r4)
10534
9983
  svntest.main.file_append(trunk_file_path, "This is the file 'file'.\n")
10535
9984
  svntest.main.run_svn(None, 'add', trunk_file_path)
10536
 
  svntest.main.run_svn(None, 'ci', '-m', 'add trunk file', wc_dir)
 
9985
  sbox.simple_commit(message='add trunk file')
10537
9986
 
10538
9987
  # Branch trunk from r3, and update working copy. (r5)
10539
9988
  svntest.main.run_svn(None, 'cp', trunk_url, branch_url, '-r3',
10545
9994
  expected_output = expected_merge_output([[4,5]],
10546
9995
                                          ['A    ' + branch_file_path + '\n',
10547
9996
                                           ' U   ' + branch_path + '\n'])
10548
 
  svntest.actions.run_and_verify_svn(None, expected_output, [], 'merge',
 
9997
  svntest.actions.run_and_verify_svn(expected_output, [], 'merge',
10549
9998
                                     trunk_url, branch_path)
10550
9999
 
10551
10000
#----------------------------------------------------------------------
10636
10085
                      + added_contents)
10637
10086
  svntest.actions.run_and_verify_commit(wc_dir,
10638
10087
                                        expected_output,
10639
 
                                        expected_status,
10640
 
                                        None,
10641
 
                                        wc_dir)
 
10088
                                        expected_status)
10642
10089
  svntest.actions.verify_disk(wc_dir, expected_disk, True)
10643
10090
 
10644
10091
  # Now, merge our committed revision into a working copy of another
10647
10094
 
10648
10095
  ### TODO: Use run_and_verify_merge() ###
10649
10096
  svntest.main.run_svn(None, 'merge', '-c2', sbox.repo_url, wc_dir2)
10650
 
  svntest.main.run_svn(None, 'ci', '-m', 'Merge from foreign repos', wc_dir2)
 
10097
  sbox2.simple_commit(message='Merge from foreign repo')
10651
10098
  svntest.actions.verify_disk(wc_dir2, expected_disk, True)
10652
10099
 
10653
10100
  # Now, let's make a third checkout -- our second from the original
10656
10103
  # This is a regression test for issue #3623 in which wc_dir2 had the
10657
10104
  # correct state but the committed state was wrong.
10658
10105
  wc_dir3 = sbox.add_wc_path('wc3')
10659
 
  svntest.actions.run_and_verify_svn(None, None, [], 'checkout',
 
10106
  svntest.actions.run_and_verify_svn(None, [], 'checkout',
10660
10107
                                     sbox2.repo_url, wc_dir3)
10661
10108
  svntest.actions.verify_disk(wc_dir3, expected_disk, True)
10662
10109
 
10703
10150
    })
10704
10151
  svntest.actions.run_and_verify_commit(wc_dir,
10705
10152
                                        expected_output,
10706
 
                                        expected_status,
10707
 
                                        None,
10708
 
                                        wc_dir)
 
10153
                                        expected_status)
10709
10154
  svntest.actions.verify_disk(wc_dir, expected_disk, True)
10710
10155
 
10711
10156
  svntest.main.run_svn(None, 'merge', '-c2', sbox.repo_url, wc_dir2)
10712
 
  svntest.main.run_svn(None, 'ci', '-m', 'Merge from foreign repos', wc_dir2)
 
10157
  sbox2.simple_commit(message='Merge from foreign repos')
10713
10158
 
10714
10159
  # Run info to check the copied rev to make sure it's right
10715
10160
  zeta2_path = os.path.join(wc_dir2, 'A', 'D', 'G', 'zeta')
10813
10258
                      + added_contents)
10814
10259
  svntest.actions.run_and_verify_commit(wc_dir,
10815
10260
                                        expected_output,
10816
 
                                        expected_status,
10817
 
                                        None,
10818
 
                                        wc_dir)
 
10261
                                        expected_status)
10819
10262
  svntest.actions.verify_disk(wc_dir, expected_disk, True)
10820
10263
 
10821
10264
  # Now, "tag" the new state of the repository.
10831
10274
  svntest.main.run_svn(None, 'merge', sbox.repo_url + '/A-tag1',
10832
10275
                       sbox.repo_url + '/A-tag2',
10833
10276
                       os.path.join(wc_dir2, 'A'))
10834
 
  svntest.main.run_svn(None, 'ci', '-m', 'Merge from foreign repos', wc_dir2)
 
10277
  sbox2.simple_commit(message='Merge from foreign repos')
10835
10278
  svntest.actions.verify_disk(wc_dir2, expected_disk, True)
10836
10279
 
10837
10280
#----------------------------------------------------------------------
10854
10297
  A_COPY_url = url + "/A_COPY"
10855
10298
  A_path = sbox.ospath('A')
10856
10299
 
10857
 
  svntest.actions.run_and_verify_svn("",["\n", "Committed revision 2.\n"], [],
 
10300
  svntest.actions.run_and_verify_svn(["Committing transaction...\n",
 
10301
                                         "Committed revision 2.\n"], [],
10858
10302
                                     "cp", "-m", "", A_url, A_COPY_url)
10859
 
  svntest.actions.run_and_verify_svn("",["\n", "Committed revision 3.\n"], [],
 
10303
  svntest.actions.run_and_verify_svn(["Committing transaction...\n",
 
10304
                                         "Committed revision 3.\n"], [],
10860
10305
                                     "cp", "-m", "",
10861
10306
                                     A_COPY_url + '/D',
10862
10307
                                     A_COPY_url + '/D2')
10905
10350
    })
10906
10351
 
10907
10352
  # Using the above information, verify a REPO->WC copy
10908
 
  svntest.actions.run_and_verify_svn("", None, [],
 
10353
  svntest.actions.run_and_verify_svn(None, [],
10909
10354
                                     "cp", A_COPY_url + '/D2',
10910
10355
                                     os.path.join(A_path, "D2"))
10911
10356
  svntest.actions.verify_disk(A_path, expected_disk)
10912
10357
  svntest.actions.run_and_verify_status(A_path, expected_status)
10913
10358
 
10914
10359
  # Remove the copy artifacts
10915
 
  svntest.actions.run_and_verify_svn("", None, [],
 
10360
  svntest.actions.run_and_verify_svn(None, [],
10916
10361
                                     "revert", "-R", A_path)
10917
10362
  svntest.main.safe_rmtree(os.path.join(A_path, "D2"))
10918
10363
 
10943
10388
 
10944
10389
  # remove a path from the repo and commit.
10945
10390
  iota_path = sbox.ospath('iota')
10946
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', iota_path)
10947
 
  svntest.actions.run_and_verify_svn("", None, [],
 
10391
  svntest.actions.run_and_verify_svn(None, [], 'rm', iota_path)
 
10392
  svntest.actions.run_and_verify_svn(None, [],
10948
10393
                                     "ci", wc_dir, "-m", "log message")
10949
10394
 
10950
10395
 
10951
10396
  url = sbox.repo_url + "/iota"
10952
10397
  expected_err = ".*File not found.*iota.*|.*iota.*path not found.*"
10953
 
  svntest.actions.run_and_verify_svn("", None, expected_err,
 
10398
  svntest.actions.run_and_verify_svn(None, expected_err,
10954
10399
                                     "merge", url, wc_dir)
10955
10400
 
10956
10401
#----------------------------------------------------------------------
10995
10440
                                       expected_elision_output,
10996
10441
                                       expected_disk,
10997
10442
                                       expected_status, expected_skip,
10998
 
                                       None, None, None, None, None, 1)
 
10443
                                       check_props=True)
10999
10444
 
11000
10445
  # Commit the merge as r7
11001
10446
  expected_output = wc.State(wc_dir, {
11007
10452
                  wc_rev=7)
11008
10453
  svntest.actions.run_and_verify_commit(wc_dir,
11009
10454
                                        expected_output,
11010
 
                                        wc_status,
11011
 
                                        None,
11012
 
                                        wc_dir)
 
10455
                                        wc_status)
11013
10456
 
11014
10457
  # Now reverse merge r7 from itself, all mergeinfo should be removed.
11015
10458
  expected_output = wc.State(A_COPY_H_path, {
11042
10485
                                       expected_elision_output,
11043
10486
                                       expected_disk,
11044
10487
                                       expected_status, expected_skip,
11045
 
                                       None, None, None, None, None,
 
10488
                                       [],
11046
10489
                                       True, False, '--allow-mixed-revisions',
11047
10490
                                       A_COPY_H_path)
11048
10491
 
11087
10530
  expected_output = wc.State(wc_dir, {'A/D/H/psi' : Item(verb='Sending')})
11088
10531
  expected_status.tweak('A/D/H/psi', wc_rev=2)
11089
10532
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11090
 
                                        expected_status, None, wc_dir)
 
10533
                                        expected_status)
11091
10534
  expected_disk.tweak('A/D/H/psi', contents="New content")
11092
10535
 
11093
10536
  # Create 'A/D/H/nu' and commit it as r3.
11094
10537
  svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
11095
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
 
10538
  svntest.actions.run_and_verify_svn(None, [], 'add', nu_path)
11096
10539
  expected_output = wc.State(wc_dir, {'A/D/H/nu' : Item(verb='Adding')})
11097
10540
  expected_status.add({'A/D/H/nu' : Item(status='  ', wc_rev=3)})
11098
10541
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11099
 
                                        expected_status, None, wc_dir)
 
10542
                                        expected_status)
11100
10543
 
11101
10544
  # Delete 'A/D/H/nu' and commit it as r4.
11102
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', nu_path)
 
10545
  svntest.actions.run_and_verify_svn(None, [], 'rm', nu_path)
11103
10546
  expected_output = wc.State(wc_dir, {'A/D/H/nu' : Item(verb='Deleting')})
11104
10547
  expected_status.remove('A/D/H/nu')
11105
10548
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11106
 
                                        expected_status, None, wc_dir)
 
10549
                                        expected_status)
11107
10550
 
11108
10551
  # Copy 'A/D/H/nu' from r3 and commit it as r5.
11109
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
10552
  svntest.actions.run_and_verify_svn(None, [], 'cp',
11110
10553
                                     sbox.repo_url + '/A/D/H/nu@3', nu_path)
11111
10554
  expected_output = wc.State(wc_dir, {'A/D/H/nu' : Item(verb='Adding')})
11112
10555
  expected_status.add({'A/D/H/nu' : Item(status='  ', wc_rev=5)})
11113
10556
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11114
 
                                        expected_status, None, wc_dir)
 
10557
                                        expected_status)
11115
10558
 
11116
10559
  # Copy 'A/D/H' to 'H_COPY' in r6.
11117
 
  svntest.actions.run_and_verify_svn(None,
11118
 
                                     ['\n', 'Committed revision 6.\n'],
 
10560
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
10561
                                      'Committed revision 6.\n'],
11119
10562
                                     [], 'copy',
11120
10563
                                     sbox.repo_url + "/A/D/H",
11121
10564
                                     sbox.repo_url + "/H_COPY",
11136
10579
  expected_output = wc.State(wc_dir, {'A/D/H/nu' : Item(verb='Sending')})
11137
10580
  expected_status.tweak('A/D/H/nu', wc_rev=7)
11138
10581
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11139
 
                                        expected_status, None, wc_dir)
 
10582
                                        expected_status)
11140
10583
 
11141
10584
  # Remove A/D/H/nu and commit it as r8.
11142
10585
  # We do this deletion so that following cherry harvest has a *tough*
11145
10588
  expected_output = wc.State(wc_dir, {'A/D/H/nu' : Item(verb='Deleting')})
11146
10589
  expected_status.remove('A/D/H/nu')
11147
10590
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11148
 
                                        expected_status, None, wc_dir)
 
10591
                                        expected_status)
11149
10592
 
11150
10593
  # Make another text mod to 'A/D/H/psi' that can be merged to 'H_COPY'
11151
10594
  # during a cherry harvest and commit it as r9.
11153
10596
  expected_output = wc.State(wc_dir, {'A/D/H/psi' : Item(verb='Sending')})
11154
10597
  expected_status.tweak('A/D/H/psi', wc_rev=9)
11155
10598
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11156
 
                                        expected_status, None, wc_dir)
 
10599
                                        expected_status)
11157
10600
  expected_disk.tweak('A/D/H/psi', contents="Even *newer* content")
11158
10601
 
11159
10602
  # Update WC so elision occurs smoothly.
11162
10605
 
11163
10606
  # Merge r7 from 'A/D/H/nu' to 'H_COPY/nu'.
11164
10607
  svntest.actions.run_and_verify_svn(
11165
 
    None,
11166
10608
    expected_merge_output([[7]],
11167
10609
                          ['U    ' + nu_COPY_path + '\n',
11168
10610
                           ' U   ' + nu_COPY_path + '\n']),
11178
10620
 
11179
10621
  expected_skip = wc.State(H_COPY_path, { })
11180
10622
  #Cherry pick r2 prior to cherry harvest.
11181
 
  svntest.actions.run_and_verify_svn(None, [], [], 'merge', '-c2',
 
10623
  svntest.actions.run_and_verify_svn([], [], 'merge', '-c2',
11182
10624
                                     sbox.repo_url + '/A/D/H',
11183
10625
                                     H_COPY_path)
11184
10626
 
11185
10627
  # H_COPY needs r6-9 applied while H_COPY/nu needs only 6,8-9.
11186
10628
  svntest.actions.run_and_verify_svn(
11187
 
    None,
11188
10629
    expected_merge_output(
11189
10630
      [[7,9],  # Merge notification
11190
10631
       [6,9]], # Mergeinfo notification
11233
10674
  expected_output = wc.State(wc_dir, {'A/D/H/psi' : Item(verb='Sending')})
11234
10675
  expected_status.tweak('A/D/H/psi', wc_rev=2)
11235
10676
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11236
 
                                        expected_status, None, wc_dir)
 
10677
                                        expected_status)
11237
10678
  expected_disk.tweak('A/D/H/psi', contents="New content")
11238
10679
 
11239
10680
  # Make a text mod to 'A/D/H/omega' and commit it as r3
11241
10682
  expected_output = wc.State(wc_dir, {'A/D/H/omega' : Item(verb='Sending')})
11242
10683
  expected_status.tweak('A/D/H/omega', wc_rev=3)
11243
10684
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11244
 
                                        expected_status, None, wc_dir)
 
10685
                                        expected_status)
11245
10686
  expected_disk.tweak('A/D/H/omega', contents="New omega")
11246
10687
 
11247
10688
  # Move 'A/D/H/psi' to 'A/D/H/psi_moved' and commit it as r4.
11248
 
  svntest.actions.run_and_verify_svn(None, None, [], 'move',
 
10689
  svntest.actions.run_and_verify_svn(None, [], 'move',
11249
10690
                                     psi_path, psi_moved_path)
11250
10691
  expected_output = wc.State(wc_dir, {
11251
10692
    'A/D/H/psi'       : Item(verb='Deleting'),
11259
10700
  # this so we still want to test that the issue #3067 fixes tested by
11260
10701
  # merge_chokes_on_renamed_subtrees and subtrees_with_empty_mergeinfo
11261
10702
  # still work.
11262
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ps', SVN_PROP_MERGEINFO,
 
10703
  svntest.actions.run_and_verify_svn(None, [], 'ps', SVN_PROP_MERGEINFO,
11263
10704
                                     "", psi_moved_path)
11264
10705
 
11265
10706
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11266
 
                                        expected_status, None, wc_dir)
 
10707
                                        expected_status)
11267
10708
 
11268
10709
  # Copy 'A/D/H' to 'H_COPY' in r5.
11269
 
  svntest.actions.run_and_verify_svn(None,
11270
 
                                     ['\n', 'Committed revision 5.\n'],
 
10710
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
10711
                                      'Committed revision 5.\n'],
11271
10712
                                     [], 'copy',
11272
10713
                                     sbox.repo_url + "/A/D/H",
11273
10714
                                     sbox.repo_url + "/H_COPY",
11288
10729
                             {'A/D/H/psi_moved' : Item(verb='Sending')})
11289
10730
  expected_status.tweak('A/D/H/psi_moved', wc_rev=6)
11290
10731
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11291
 
                                        expected_status, None, wc_dir)
 
10732
                                        expected_status)
11292
10733
  expected_disk.remove('A/D/H/psi')
11293
10734
  expected_disk.add({
11294
10735
    'A/D/H/psi_moved' : Item("Even *Newer* content"),
11321
10762
  # Here is where issue #3174 appears, the merge fails with:
11322
10763
  # svn: svn: File not found: revision 3, path '/A/D/H/psi'
11323
10764
  svntest.actions.run_and_verify_svn(
11324
 
    None,
11325
10765
    expected_merge_output([[5,6],[3,6]],
11326
10766
                          ['U    ' + psi_COPY_moved_path + '\n',
11327
10767
                           ' U   ' + psi_COPY_moved_path + '\n',
11353
10793
  nu_copy_path = sbox.ospath('A_copy/D/H/nu')
11354
10794
 
11355
10795
  def _commit_and_update(rev, action):
11356
 
    svntest.actions.run_and_verify_svn(None, None, [],
 
10796
    svntest.actions.run_and_verify_svn(None, [],
11357
10797
                                       'ci', '-m', 'r%d - %s' % (rev, action),
11358
10798
                                       sbox.wc_dir)
11359
10799
    svntest.main.run_svn(None, 'up', wc_dir)
11381
10821
  # a propget.
11382
10822
  ### TODO: We can use run_and_verify_merge() here now.
11383
10823
  svntest.actions.run_and_verify_svn(
11384
 
    None,
11385
10824
    expected_merge_output([[5]], ['U    ' + A_copy_mu_path + '\n',
11386
10825
                                  ' U   ' + A_copy_mu_path + '\n']),
11387
10826
    [], 'merge', '-c5', sbox.repo_url + '/A_copy2/mu', A_copy_mu_path)
11450
10889
                                       expected_elision_output,
11451
10890
                                       expected_disk,
11452
10891
                                       expected_status, expected_skip,
11453
 
                                       None, None, None, None, None, 1)
 
10892
                                       check_props=True)
11454
10893
 
11455
10894
  # Revert the previous merges and try a cherry harvest merge where
11456
10895
  # the subtree's natural history is a proper subset of the merge.
11457
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
10896
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
11458
10897
 
11459
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
10898
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
11460
10899
  wc_status = svntest.actions.get_virginal_state(wc_dir, 5)
11461
10900
  wc_status.add({
11462
10901
    'A_copy'            : Item(),
11502
10941
 
11503
10942
  # r6 - Add the file 'A/D/H/nu'.
11504
10943
  svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
11505
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
 
10944
  svntest.actions.run_and_verify_svn(None, [], 'add', nu_path)
11506
10945
  expected_output = wc.State(wc_dir, {'A/D/H/nu' : Item(verb='Adding')})
11507
10946
  wc_status.add({'A/D/H/nu' : Item(status='  ', wc_rev=6)})
11508
10947
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11509
 
                                        wc_status, None, wc_dir)
 
10948
                                        wc_status)
11510
10949
 
11511
10950
  # r7 - Make a change to 'A/D/H/nu'.
11512
10951
  svntest.main.file_write(nu_path, "Nu content")
11513
10952
  expected_output = wc.State(wc_dir, {'A/D/H/nu' : Item(verb='Sending')})
11514
10953
  wc_status.tweak('A/D/H/nu', wc_rev=7)
11515
10954
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11516
 
                                        wc_status, None, wc_dir)
 
10955
                                        wc_status)
11517
10956
 
11518
10957
  # r8 - Merge r6 to 'A_copy'.
11519
10958
  expected_output = wc.State(A_copy_path, {
11577
11016
                                       expected_A_copy_disk,
11578
11017
                                       expected_A_copy_status,
11579
11018
                                       expected_A_copy_skip,
11580
 
                                       None, None, None, None,
11581
 
                                       None, 1)
 
11019
                                       check_props=True)
11582
11020
  wc_status.add({'A_copy/D/H/nu' : Item(status='  ', wc_rev=8)})
11583
11021
  wc_status.tweak('A_copy', wc_rev=8)
11584
11022
  expected_output = wc.State(wc_dir, {
11586
11024
    'A_copy'        : Item(verb='Sending'),
11587
11025
    })
11588
11026
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11589
 
                                        wc_status, None, wc_dir)
 
11027
                                        wc_status)
11590
11028
 
11591
11029
  # r9 - Merge r7 to 'A_copy/D/H/nu'.
11592
11030
  expected_skip = wc.State(nu_copy_path, { })
11594
11032
  # so use run_and_verify_svn.
11595
11033
  ### TODO: We can use run_and_verify_merge() here now.
11596
11034
  svntest.actions.run_and_verify_svn(
11597
 
    None,
11598
11035
    expected_merge_output([[7]],
11599
11036
                          ['U    ' + nu_copy_path + '\n',
11600
11037
                           ' G   ' + nu_copy_path + '\n',]),
11602
11039
  expected_output = wc.State(wc_dir, {'A_copy/D/H/nu' : Item(verb='Sending')})
11603
11040
  wc_status.tweak('A_copy/D/H/nu', wc_rev=9)
11604
11041
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11605
 
                                        wc_status, None, wc_dir)
 
11042
                                        wc_status)
11606
11043
 
11607
11044
  # Update WC
11608
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
11045
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
11609
11046
  wc_status.tweak(wc_rev=9)
11610
11047
 
11611
11048
  # r10 - Make another change to 'A/D/H/nu'.
11613
11050
  expected_output = wc.State(wc_dir, {'A/D/H/nu' : Item(verb='Sending')})
11614
11051
  wc_status.tweak('A/D/H/nu', wc_rev=10)
11615
11052
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11616
 
                                        wc_status, None, wc_dir)
 
11053
                                        wc_status)
11617
11054
 
11618
11055
  # Update WC
11619
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
11056
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
11620
11057
  wc_status.tweak(wc_rev=10)
11621
11058
 
11622
11059
  # Now do a cherry harvest merge to 'A_copy'.
11683
11120
                                       expected_A_copy_disk,
11684
11121
                                       expected_A_copy_status,
11685
11122
                                       expected_A_copy_skip,
11686
 
                                       None, None, None, None,
11687
 
                                       None, 1)
 
11123
                                       check_props=True)
11688
11124
 
11689
11125
#----------------------------------------------------------------------
11690
11126
# Test for issue where merging a change to a broken link fails
11709
11145
  os.symlink('beta', link_path)
11710
11146
  svntest.main.run_svn(None, 'commit', '-m', 'Fix a broken link', link_path)
11711
11147
  svntest.actions.run_and_verify_svn(
11712
 
    None,
11713
11148
    expected_merge_output([[4]],
11714
11149
                          ['U    ' + copy_path + '/beta_link\n',
11715
11150
                           ' U   ' + copy_path + '\n']),
11750
11185
    })
11751
11186
  wc_status.tweak('A/D/gamma', 'A/D/H/psi', wc_rev=8)
11752
11187
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
11753
 
                                        wc_status, None, wc_dir)
 
11188
                                        wc_status)
11754
11189
  wc_disk.tweak('A/D/gamma', contents="New content")
11755
11190
  wc_disk.tweak('A/D/H/psi', contents="Even newer content")
11756
11191
 
11757
11192
  # Update the WC.
11758
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(8), [],
 
11193
  svntest.actions.run_and_verify_svn(exp_noop_up_out(8), [],
11759
11194
                                     'update', wc_dir)
11760
11195
  wc_status.tweak(wc_rev=8)
11761
11196
 
11774
11209
  #         run_and_verify_merge() because these types of simple merges are
11775
11210
  #         tested to death elsewhere and this is just setup for the "real"
11776
11211
  #         test.
11777
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
11212
  svntest.actions.run_and_verify_svn(None, [],
11778
11213
                                     'merge', '-c4',
11779
11214
                                     sbox.repo_url + '/A/D/H/psi',
11780
11215
                                     psi_COPY_path)
11781
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
11216
  svntest.actions.run_and_verify_svn(None, [],
11782
11217
                                     'merge', '-c8',
11783
11218
                                     sbox.repo_url + '/A',
11784
11219
                                     A_COPY_path)
11785
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
11220
  svntest.actions.run_and_verify_svn(None, [],
11786
11221
                                     'merge', '-c-8',
11787
11222
                                     sbox.repo_url + '/A/D/H/psi',
11788
11223
                                     psi_COPY_path)
11789
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
11224
  svntest.actions.run_and_verify_svn(None, [],
11790
11225
                                     'merge',
11791
11226
                                     sbox.repo_url + '/A',
11792
11227
                                     A_COPY_2_path)
11793
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
11228
  svntest.actions.run_and_verify_svn(None, [],
11794
11229
                                     'merge', '-c-5',
11795
11230
                                     sbox.repo_url + '/A',
11796
11231
                                     A_COPY_2_path)
11797
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
11232
  svntest.actions.run_and_verify_svn(None, [],
11798
11233
                                     'merge', '-c5', '-c-8',
11799
11234
                                     sbox.repo_url + '/A/D/H',
11800
11235
                                     H_COPY_2_path)
11823
11258
                  wc_rev=9)
11824
11259
  svntest.actions.run_and_verify_commit(wc_dir,
11825
11260
                                        expected_output,
11826
 
                                        wc_status,
11827
 
                                        None,
11828
 
                                        wc_dir)
 
11261
                                        wc_status)
11829
11262
 
11830
11263
  # Update the WC.
11831
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(9), [],
 
11264
  svntest.actions.run_and_verify_svn(exp_noop_up_out(9), [],
11832
11265
                                     'update', wc_dir)
11833
11266
 
11834
11267
  # Make sure we have mergeinfo that meets the two criteria set out above.
11912
11345
                                       expected_disk,
11913
11346
                                       expected_status,
11914
11347
                                       expected_skip,
11915
 
                                       None, None, None, None,
11916
 
                                       None, 1)
 
11348
                                       check_props=True)
11917
11349
 
11918
11350
  # Merging to the criterion 1 branch.
11919
11351
  #
11986
11418
                                       expected_disk,
11987
11419
                                       expected_status,
11988
11420
                                       expected_skip,
11989
 
                                       None, None, None, None,
11990
 
                                       None, 1)
 
11421
                                       check_props=True)
11991
11422
 
11992
11423
  # Test the notification portion of issue #3199.
11993
11424
  #
12004
11435
  ###       shortcomings (and allowed merges to file targets).
12005
11436
  #
12006
11437
  # Revert the previous merges.
12007
 
  svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R', wc_dir)
 
11438
  svntest.actions.run_and_verify_svn(None, [], 'revert', '-R', wc_dir)
12008
11439
 
12009
11440
  # Repeat the forward merge
12010
11441
  expected_output = expected_merge_output(
12014
11445
     ' U   %s\n' % (H_COPY_2_path),
12015
11446
     ' U   %s\n' % (A_COPY_2_path),],
12016
11447
    elides=True)
12017
 
  svntest.actions.run_and_verify_svn(None, expected_output,
 
11448
  svntest.actions.run_and_verify_svn(expected_output,
12018
11449
                                     [], 'merge', '-r', '3:9',
12019
11450
                                     sbox.repo_url + '/A',
12020
11451
                                     A_COPY_2_path)
12026
11457
     ' U   %s\n' % (A_COPY_path),
12027
11458
     ' U   %s\n' % (psi_COPY_path)],
12028
11459
    elides=True)
12029
 
  svntest.actions.run_and_verify_svn(None, expected_output,
 
11460
  svntest.actions.run_and_verify_svn(expected_output,
12030
11461
                                     [], 'merge', '-r', '9:3',
12031
11462
                                     sbox.repo_url + '/A',
12032
11463
                                     A_COPY_path)
12053
11484
  omega_COPY_path = sbox.ospath('A_COPY/D/H/omega')
12054
11485
 
12055
11486
  # r7 Delete A/D/H/psi.
12056
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
11487
  svntest.actions.run_and_verify_svn(None, [],
12057
11488
                                     'delete', psi_path)
12058
11489
  sbox.simple_commit(message='delete psi')
12059
11490
 
12065
11496
  expected_output = expected_merge_output(
12066
11497
    [[3]], ['U    %s\n' % (psi_COPY_path),
12067
11498
            ' U   %s\n' % (psi_COPY_path),])
12068
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
11499
  svntest.actions.run_and_verify_svn(expected_output, [],
12069
11500
                                     'merge', '-c', '3',
12070
11501
                                     sbox.repo_url + '/A/D/H/psi@3',
12071
11502
                                     psi_COPY_path)
12075
11506
  expected_output = expected_merge_output(
12076
11507
    [[6]], ['U    %s\n' % (omega_COPY_path),
12077
11508
            ' U   %s\n' % (omega_COPY_path),])
12078
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
11509
  svntest.actions.run_and_verify_svn(expected_output, [],
12079
11510
                                     'merge', '-c', '6',
12080
11511
                                     sbox.repo_url + '/A/D/H/omega',
12081
11512
                                     omega_COPY_path)
12082
11513
  sbox.simple_commit(message='merge r6 to A_COPY')
12083
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(10), [], 'up',
 
11514
  svntest.actions.run_and_verify_svn(exp_noop_up_out(10), [], 'up',
12084
11515
                                     wc_dir)
12085
11516
 
12086
11517
  # r11 - Merge r8 to A_COPY.
12088
11519
    [[8]], ['U    %s\n' % (omega_COPY_path),
12089
11520
            ' U   %s\n' % (omega_COPY_path),
12090
11521
            ' U   %s\n' % (A_COPY_path)])
12091
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
11522
  svntest.actions.run_and_verify_svn(expected_output, [],
12092
11523
                                     'merge', '-c', '8',
12093
11524
                                     sbox.repo_url + '/A',
12094
11525
                                     A_COPY_path)
12102
11533
    [[8]], [' G   %s\n' % (omega_COPY_path),
12103
11534
            ' U   %s\n' % (psi_COPY_path),
12104
11535
            ' G   %s\n' % (A_COPY_path)])
12105
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
11536
  svntest.actions.run_and_verify_svn(expected_output, [],
12106
11537
                                     'merge', '-c', '8',
12107
11538
                                     sbox.repo_url + '/A',
12108
11539
                                     A_COPY_path, '--record-only')
12109
11540
  sbox.simple_commit(message='merge r8 to A_COPY/D/H/omega')
12110
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(11), [], 'up',
 
11541
  svntest.actions.run_and_verify_svn(exp_noop_up_out(11), [], 'up',
12111
11542
                                     wc_dir)
12112
11543
 
12113
11544
  # r12 - modify A/D/H/omega yet again.
12119
11550
  expected_output = expected_merge_output(
12120
11551
    [[9,12],[2,12]], ['U    %s\n' % (omega_COPY_path),
12121
11552
               ' U   %s\n' % (omega_COPY_path)])
12122
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
11553
  svntest.actions.run_and_verify_svn(expected_output, [],
12123
11554
                                     'merge',
12124
11555
                                     sbox.repo_url + '/A/D/H/omega',
12125
11556
                                     omega_COPY_path)
12126
11557
  sbox.simple_commit(message='cherry harvest to A_COPY/D/H/omega')
12127
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(13), [], 'up',
 
11558
  svntest.actions.run_and_verify_svn(exp_noop_up_out(13), [], 'up',
12128
11559
                                     wc_dir)
12129
11560
 
12130
11561
  # Check that svn:mergeinfo is as expected.
12134
11565
                                psi_COPY_path : '/A/D/H/psi:3,8' })
12135
11566
 
12136
11567
  # Now test a reverse merge where part of the requested range postdates
12137
 
  # a subtree's existance.  Merge -r12:1 to A_COPY.  This should revert
 
11568
  # a subtree's existence.  Merge -r12:1 to A_COPY.  This should revert
12138
11569
  # all of the merges done thus far.  The fact that A/D/H/psi no longer
12139
11570
  # exists after r7 shouldn't break the subtree merge into A_COPY/D/H/psi.
12140
11571
  # A_COPY/D/H/psi should simply have r3 reverse merged.  No paths under
12204
11635
                                       expected_disk,
12205
11636
                                       expected_status,
12206
11637
                                       expected_skip,
12207
 
                                       None, None, None, None,
12208
 
                                       None, True, False)
 
11638
                                       [], True, False)
12209
11639
 
12210
11640
  # Revert the previous merge.
12211
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
11641
  svntest.actions.run_and_verify_svn(None, [],
12212
11642
                                     'revert', '-R', wc_dir)
12213
11643
  # Merge r12 to A_COPY and commit as r14.
12214
11644
  expected_output = wc.State(A_COPY_path, {})
12270
11700
                                       expected_disk,
12271
11701
                                       expected_status,
12272
11702
                                       expected_skip,
12273
 
                                       None, None, None, None,
12274
 
                                       None, True, False)
 
11703
                                       [], True, False)
12275
11704
  # As we did earlier, repeat the merge with the --record-only option to
12276
11705
  # preserve the old behavior of recording mergeinfo on every subtree, thus
12277
11706
  # allowing this test to actually test the issue #3067 fixes.
12280
11709
             ' G   %s\n' % (A_COPY_path),
12281
11710
             ' U   %s\n' % (psi_COPY_path),
12282
11711
             ' U   %s\n' % (omega_COPY_path),])
12283
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
11712
  svntest.actions.run_and_verify_svn(expected_output, [],
12284
11713
                                     'merge', '-c', '12',
12285
11714
                                     sbox.repo_url + '/A',
12286
11715
                                     A_COPY_path, '--record-only')
12289
11718
  # Update A_COPY/D/H/rho back to r13 so it's mergeinfo doesn't include
12290
11719
  # r12.  Then merge a range, -r6:12 which should delete a subtree
12291
11720
  # (A_COPY/D/H/psi).
12292
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(14), [], 'up',
 
11721
  svntest.actions.run_and_verify_svn(exp_noop_up_out(14), [], 'up',
12293
11722
                                     wc_dir)
12294
11723
  expected_output = wc.State(A_COPY_path, {
12295
11724
    'D/H/psi'   : Item(status='D '),
12350
11779
                                       expected_disk,
12351
11780
                                       expected_status,
12352
11781
                                       expected_skip,
12353
 
                                       None, None, None, None,
12354
 
                                       None, True, False)
 
11782
                                       [], True, False)
12355
11783
 
12356
11784
#----------------------------------------------------------------------
12357
11785
# Another test for issue #3067: 'subtrees that don't exist at the start
12406
11834
                                       expected_elision_output,
12407
11835
                                       expected_disk,
12408
11836
                                       expected_status, expected_skip,
12409
 
                                       None, None, None, None, None, 1)
 
11837
                                       check_props=True)
12410
11838
 
12411
11839
#----------------------------------------------------------------------
12412
11840
# Test for issue #3240 'commits to subtrees added by merge
12413
11841
# corrupt working copy and repos'.
 
11842
@SkipUnless(server_has_mergeinfo)
12414
11843
@Issue(3240)
12415
11844
def commit_to_subtree_added_by_merge(sbox):
12416
11845
  "commits to subtrees added by merge wreak havoc"
12432
11861
  # subtree as r3.
12433
11862
  os.mkdir(N_path)
12434
11863
  svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
12435
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', N_path)
 
11864
  svntest.actions.run_and_verify_svn(None, [], 'add', N_path)
12436
11865
  expected_output = wc.State(wc_dir,
12437
11866
                             {'A/D/H/N'    : Item(verb='Adding'),
12438
11867
                              'A/D/H/N/nu' : Item(verb='Adding')})
12439
11868
  wc_status.add({'A/D/H/N'    : Item(status='  ', wc_rev=3),
12440
11869
                 'A/D/H/N/nu' : Item(status='  ', wc_rev=3)})
12441
11870
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
12442
 
                                        wc_status, None, wc_dir)
 
11871
                                        wc_status)
12443
11872
 
12444
11873
  # Merge r3 to 'A_COPY/D/H', creating A_COPY/D/H/N' and 'A_COPY/D/H/N/nu'.
12445
11874
  # Commit the merge as r4.
12477
11906
                                       expected_elision_output,
12478
11907
                                       expected_disk,
12479
11908
                                       expected_status, expected_skip,
12480
 
                                       None, None, None, None, None, 1)
 
11909
                                       check_props=True)
12481
11910
  expected_output = wc.State(wc_dir, {
12482
11911
    'A_COPY/D/H'      : Item(verb='Sending'),
12483
11912
    'A_COPY/D/H/N'    : Item(verb='Adding'),
12486
11915
                 'A_COPY/D/H/N/nu' : Item(status='  ', wc_rev=4)})
12487
11916
  wc_status.tweak('A_COPY/D/H', wc_rev=4)
12488
11917
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
12489
 
                                        wc_status, None, wc_dir)
 
11918
                                        wc_status)
12490
11919
 
12491
11920
  # Make a text change to 'A_COPY/D/H/N/nu' and commit it as r5.  This
12492
11921
  # is the first place issue #3240 appears over DAV layers, and the
12505
11934
                             {'A_COPY/D/H/N/nu' : Item(verb='Sending')})
12506
11935
  wc_status.tweak('A_COPY/D/H/N/nu', wc_rev=5)
12507
11936
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
12508
 
                                        wc_status, None, wc_dir)
 
11937
                                        wc_status)
12509
11938
  # The second place issue #3240 shows up is in the fact that the commit
12510
11939
  # *did* succeed, but the wrong path ('A/D/H/nu' rather than 'A_COPY/D/H/nu')
12511
11940
  # is affected.  We can see this by running an update; since we just
12512
11941
  # committed there shouldn't be any incoming changes.
12513
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(5), [], 'up',
 
11942
  svntest.actions.run_and_verify_svn(exp_noop_up_out(5), [], 'up',
12514
11943
                                     wc_dir)
12515
11944
 
12516
11945
 
12517
11946
#----------------------------------------------------------------------
12518
 
# Helper functions. These take local paths using '/' separators.
12519
 
 
12520
 
def local_path(path):
12521
 
  "Convert a path from '/' separators to the local style."
12522
 
  return os.sep.join(path.split('/'))
12523
 
 
12524
 
def svn_mkfile(path):
12525
 
  "Make and add a file with some default content, and keyword expansion."
12526
 
  path = local_path(path)
12527
 
  dirname, filename = os.path.split(path)
12528
 
  svntest.main.file_write(path, "This is the file '" + filename + "'.\n" +
12529
 
                                "Last changed in '$Revision$'.\n")
12530
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', path)
12531
 
  svntest.actions.run_and_verify_svn(None, None, [], 'propset',
12532
 
                                     'svn:keywords', 'Revision', path)
12533
 
 
12534
 
def svn_modfile(path):
12535
 
  "Make text and property mods to a WC file."
12536
 
  path = local_path(path)
12537
 
  svntest.main.file_append(path, "An extra line.\n")
12538
 
  svntest.actions.run_and_verify_svn(None, None, [], 'propset',
12539
 
                                     'newprop', 'v', path)
12540
 
 
12541
 
def svn_copy(s_rev, path1, path2):
12542
 
  "Copy a WC path locally."
12543
 
  path1 = local_path(path1)
12544
 
  path2 = local_path(path2)
12545
 
  svntest.actions.run_and_verify_svn(None, None, [], 'copy', '--parents',
12546
 
                                     '-r', s_rev, path1, path2)
12547
 
 
12548
 
def svn_merge(rev_range, source, target, lines=None, elides=[],
12549
 
              text_conflicts=0, prop_conflicts=0, tree_conflicts=0,
12550
 
              text_resolved=0, prop_resolved=0, tree_resolved=0,
12551
 
              args=[]):
12552
 
  """Merge a single change from path SOURCE to path TARGET and verify the
12553
 
  output and that there is no error.  (The changes made are not verified.)
12554
 
 
12555
 
  REV_RANGE is either a number (to cherry-pick that specific change) or a
12556
 
  two-element list [X,Y] to pick the revision range '-r(X-1):Y'.
12557
 
 
12558
 
  LINES is a list of regular expressions to match other lines of output; if
12559
 
  LINES is 'None' then match all normal (non-conflicting) merges.
12560
 
 
12561
 
  ELIDES is a list of paths on which mergeinfo elision should be reported.
12562
 
 
12563
 
  TEXT_CONFLICTS, PROP_CONFLICTS and TREE_CONFLICTS specify the number of
12564
 
  each kind of conflict to expect.
12565
 
 
12566
 
  ARGS are additional arguments passed to svn merge.
12567
 
  """
12568
 
 
12569
 
  source = local_path(source)
12570
 
  target = local_path(target)
12571
 
  elides = [local_path(p) for p in elides]
12572
 
  if isinstance(rev_range, int):
12573
 
    mi_rev_range = [rev_range]
12574
 
    rev_arg = '-c' + str(rev_range)
12575
 
  else:
12576
 
    mi_rev_range = rev_range
12577
 
    rev_arg = '-r' + str(rev_range[0] - 1) + ':' + str(rev_range[1])
12578
 
  if lines is None:
12579
 
    lines = ["(A |D |[UG] | [UG]|[UG][UG])   " + target + ".*\n"]
12580
 
  else:
12581
 
    # Expect mergeinfo on the target; caller must supply matches for any
12582
 
    # subtree mergeinfo paths.
12583
 
    lines.append(" [UG]   " + target + "\n")
12584
 
  exp_out = expected_merge_output([mi_rev_range], lines, target=target,
12585
 
                                  elides=elides,
12586
 
                                  text_conflicts=text_conflicts,
12587
 
                                  prop_conflicts=prop_conflicts,
12588
 
                                  tree_conflicts=tree_conflicts,
12589
 
                                  text_resolved=text_resolved,
12590
 
                                  prop_resolved=prop_resolved,
12591
 
                                  tree_resolved=tree_resolved)
12592
 
  svntest.actions.run_and_verify_svn(None, exp_out, [],
12593
 
                                     'merge', rev_arg, source, target, *args)
12594
 
 
12595
 
#----------------------------------------------------------------------
12596
11947
# Tests for merging the deletion of a node, where the node to be deleted
12597
11948
# is the same as or different from the node that was deleted.
12598
11949
 
12697
12048
  expected_output = wc.State(wc_dir, {'A/D/G/rho' : Item(verb='Sending')})
12698
12049
  wc_status.tweak('A/D/G/rho', wc_rev=7)
12699
12050
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
12700
 
                                        wc_status, None, wc_dir)
 
12051
                                        wc_status)
12701
12052
  wc_disk.tweak('A/D/G/rho', contents="Newer content")
12702
12053
 
12703
12054
  # r8 Make another text change to A/D/G/rho.
12704
12055
  svntest.main.file_write(rho_path, "Even *newer* content")
12705
12056
  expected_output = wc.State(wc_dir, {'A/D/G/rho' : Item(verb='Sending')})
12706
12057
  wc_status.tweak('A/D/G/rho', wc_rev=8)
12707
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
12708
 
                                        wc_status, None, wc_dir)
 
12058
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
12709
12059
  wc_disk.tweak('A/D/G/rho', contents="Even *newer* content")
12710
12060
 
12711
12061
  # Update the WC to allow full mergeinfo inheritance and elision.
12712
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(8), [], 'up',
 
12062
  svntest.actions.run_and_verify_svn(exp_noop_up_out(8), [], 'up',
12713
12063
                                     wc_dir)
12714
12064
  wc_status.tweak(wc_rev=8)
12715
12065
 
12776
12126
                                       expected_elision_output,
12777
12127
                                       expected_disk,
12778
12128
                                       expected_status, expected_skip,
12779
 
                                       None, None, None, None, None, 1)
 
12129
                                       check_props=True)
12780
12130
  # run_and_verify_merge doesn't support merging to a file WCPATH
12781
12131
  # so use run_and_verify_svn.
12782
12132
  ### TODO: We can use run_and_verify_merge() here now.
12783
 
  svntest.actions.run_and_verify_svn(None,
12784
 
                                     expected_merge_output([[-3]],
 
12133
  svntest.actions.run_and_verify_svn(expected_merge_output([[-3]],
12785
12134
                                       ['G    ' + psi_COPY_path + '\n',
12786
12135
                                        ' G   ' + psi_COPY_path + '\n']),
12787
12136
                                     [], 'merge', '-c-3',
12802
12151
                  'A_COPY/D/H/omega',
12803
12152
                  wc_rev=9)
12804
12153
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
12805
 
                                        wc_status, None, wc_dir)
 
12154
                                        wc_status)
12806
12155
 
12807
12156
  # Update the WC to allow full mergeinfo inheritance and elision.
12808
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(9), [], 'up',
 
12157
  svntest.actions.run_and_verify_svn(exp_noop_up_out(9), [], 'up',
12809
12158
                                     wc_dir)
12810
12159
  wc_status.tweak(wc_rev=9)
12811
12160
 
12892
12241
                                       expected_elision_output,
12893
12242
                                       expected_disk,
12894
12243
                                       expected_status, expected_skip,
12895
 
                                       None, None, None, None, None, 1, 0)
 
12244
                                       check_props=True)
12896
12245
 
12897
12246
#----------------------------------------------------------------------
12898
12247
# Test for yet another variant of issue #3067.
12918
12267
 
12919
12268
  # Add file A/D/G/nu in r7.
12920
12269
  svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
12921
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
 
12270
  svntest.actions.run_and_verify_svn(None, [], 'add', nu_path)
12922
12271
  expected_output = wc.State(wc_dir, {'A/D/G/nu' : Item(verb='Adding')})
12923
12272
  wc_status.add({'A/D/G/nu' : Item(status='  ', wc_rev=7)})
12924
12273
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
12925
 
                                        wc_status, None, wc_dir)
 
12274
                                        wc_status)
12926
12275
 
12927
12276
  # Make a text mod to A/D/G/nu in r8.
12928
12277
  svntest.main.file_write(nu_path, "New content")
12929
12278
  expected_output = wc.State(wc_dir, {'A/D/G/nu' : Item(verb='Sending')})
12930
12279
  wc_status.tweak('A/D/G/nu', wc_rev=8)
12931
12280
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
12932
 
                                        wc_status, None, wc_dir)
 
12281
                                        wc_status)
12933
12282
 
12934
12283
  # Do several merges to setup a situation where the merge
12935
12284
  # target and two of its subtrees need non-intersecting ranges
12945
12294
  # of merges to death we don't use run_and_verify_merge() on these
12946
12295
  # intermediate merges.
12947
12296
  svntest.actions.run_and_verify_svn(
12948
 
    None, expected_merge_output([[2,7]],
 
12297
    expected_merge_output([[2,7]],
12949
12298
                                ['U    ' + beta_COPY_path  + '\n',
12950
12299
                                 'A    ' + nu_COPY_path    + '\n',
12951
12300
                                 'U    ' + rho_COPY_path   + '\n',
12955
12304
                                ),
12956
12305
    [], 'merge', '-r0:7', sbox.repo_url + '/A', A_COPY_path)
12957
12306
  svntest.actions.run_and_verify_svn(
12958
 
    None, expected_merge_output([[8]], ['U    ' + nu_COPY_path    + '\n',
 
12307
    expected_merge_output([[8]], ['U    ' + nu_COPY_path    + '\n',
12959
12308
                                        ' G   ' + nu_COPY_path    + '\n']),
12960
12309
    [], 'merge', '-c8', sbox.repo_url + '/A/D/G/nu', nu_COPY_path)
12961
12310
 
12962
12311
  svntest.actions.run_and_verify_svn(
12963
 
    None, expected_merge_output([[-6]], ['G    ' + omega_COPY_path    + '\n',
 
12312
    expected_merge_output([[-6]], ['G    ' + omega_COPY_path    + '\n',
12964
12313
                                         ' G   ' + omega_COPY_path    + '\n']),
12965
12314
    [], 'merge', '-c-6', sbox.repo_url + '/A/D/H/omega', omega_COPY_path)
12966
12315
  wc_status.add({'A_COPY/D/G/nu' : Item(status='  ', wc_rev=9)})
12978
12327
    'A_COPY/D/H/omega' : Item(verb='Sending'),
12979
12328
    'A_COPY/D/H/psi'   : Item(verb='Sending'),
12980
12329
    })
12981
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
12982
 
                                        None, wc_dir)
 
12330
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
12983
12331
 
12984
12332
  # Update the WC to allow full mergeinfo inheritance and elision.
12985
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(9), [], 'up',
 
12333
  svntest.actions.run_and_verify_svn(exp_noop_up_out(9), [], 'up',
12986
12334
                                     wc_dir)
12987
12335
 
12988
12336
  # Merge all available revisions from A to A_COPY, the merge logic
13055
12403
                                       expected_disk,
13056
12404
                                       expected_status,
13057
12405
                                       expected_skip,
13058
 
                                       None, None, None, None,
13059
 
                                       None, 1)
 
12406
                                       check_props=True)
13060
12407
 
13061
12408
#----------------------------------------------------------------------
13062
12409
# Part of this test is a regression test for issue #3250 "Repeated merging
13118
12465
  #     the conflict, so it no longer tests the original #3250 scenario.
13119
12466
  #
13120
12467
  # Revert changes to branch wc
13121
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
12468
  svntest.actions.run_and_verify_svn(None, [],
13122
12469
                                     'revert', '--recursive', A_COPY_path)
13123
12470
 
13124
12471
  # In the branch, make two successive changes to the same property
13135
12482
      ], prop_conflicts=1, args=['--allow-mixed-revisions'])
13136
12483
 
13137
12484
  # Revert changes to trunk wc, to test next scenario of #3250
13138
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
12485
  svntest.actions.run_and_verify_svn(None, [],
13139
12486
                                     'revert', '--recursive', A_path)
13140
12487
 
13141
12488
  # Merge the first change, then the second, to trunk.
13235
12582
  D_COPY_2_path = sbox.ospath('A_COPY_2/D')
13236
12583
 
13237
12584
  # Update working copy to allow full inheritance and elision.
13238
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(7), [],
 
12585
  svntest.actions.run_and_verify_svn(exp_noop_up_out(7), [],
13239
12586
                                     'up', wc_dir)
13240
12587
  wc_status.tweak(wc_rev=7)
13241
12588
 
13300
12647
                                       expected_disk,
13301
12648
                                       expected_status,
13302
12649
                                       expected_skip,
13303
 
                                       None, None, None, None,
13304
 
                                       None, 1)
 
12650
                                       check_props=True)
13305
12651
  wc_status.tweak('A_COPY',
13306
12652
                  'A_COPY/D/G/rho',
13307
12653
                  wc_rev=8)
13309
12655
    'A_COPY'           : Item(verb='Sending'),
13310
12656
    'A_COPY/D/G/rho'   : Item(verb='Sending'),
13311
12657
    })
13312
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
13313
 
                                        None, wc_dir)
 
12658
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
13314
12659
 
13315
12660
  # Merge r7 from A/D to A_COPY_2/D and commit as r9.
13316
12661
  # This creates explicit mergeinfo on A_COPY_2/D of '/A/D:7'.
13355
12700
                                       expected_disk,
13356
12701
                                       expected_status,
13357
12702
                                       expected_skip,
13358
 
                                       None, None, None, None,
13359
 
                                       None, 1)
 
12703
                                       check_props=True)
13360
12704
  wc_status.tweak('A_COPY_2/D',
13361
12705
                  'A_COPY_2/D/H/omega',
13362
12706
                  wc_rev=9)
13364
12708
    'A_COPY_2/D'         : Item(verb='Sending'),
13365
12709
    'A_COPY_2/D/H/omega' : Item(verb='Sending'),
13366
12710
    })
13367
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
13368
 
                                        None, wc_dir)
 
12711
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
13369
12712
 
13370
12713
  # Merge r9 from A_COPY_2 to A_COPY.  A_COPY/D gets the explicit mergeinfo
13371
12714
  # '/A/D/:7' added from r9.  But it prior to the merge it inherited '/A/D:5'
13373
12716
  # the mergeinfo describing this merge '/A_COPY_2:9' should also be present
13374
12717
  # in A_COPY's explicit mergeinfo.
13375
12718
    # Update working copy to allow full inheritance and elision.
13376
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(9), [],
 
12719
  svntest.actions.run_and_verify_svn(exp_noop_up_out(9), [],
13377
12720
                                     'up', wc_dir)
13378
12721
  expected_output = wc.State(A_COPY_path, {
13379
12722
    'D'        : Item(status=' U'),
13436
12779
                                       expected_disk,
13437
12780
                                       expected_status,
13438
12781
                                       expected_skip,
13439
 
                                       None, None, None, None,
13440
 
                                       None, 1)
 
12782
                                       check_props=True)
13441
12783
 
13442
12784
  # Revert and repeat the above merge, but this time create some
13443
12785
  # uncommitted mergeinfo on A_COPY/D, this should not cause a write
13444
12786
  # lock error as was seen in http://subversion.tigris.org/
13445
12787
  # ds/viewMessage.do?dsForumId=462&dsMessageId=103945
13446
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
12788
  svntest.actions.run_and_verify_svn(None, [],
13447
12789
                                     'revert', '-R', wc_dir)
13448
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
12790
  svntest.actions.run_and_verify_svn(None, [],
13449
12791
                                     'ps', SVN_PROP_MERGEINFO, '',
13450
12792
                                     D_COPY_path)
13451
12793
  expected_output = wc.State(A_COPY_path, {
13466
12808
                                       expected_disk,
13467
12809
                                       expected_status,
13468
12810
                                       expected_skip,
13469
 
                                       None, None, None, None,
13470
 
                                       None, 1)
 
12811
                                       check_props=True)
13471
12812
 
13472
12813
#----------------------------------------------------------------------
13473
12814
@SkipUnless(server_has_mergeinfo)
13581
12922
    "A_COPY_2" + '/D/H/omega' : Item("This is the file 'omega'.\n"),
13582
12923
    "A_COPY_2" + '/D/H/psi'   : Item("New content"),
13583
12924
    })
13584
 
  svntest.actions.run_and_verify_svn(None, expected, [], 'copy',
 
12925
  svntest.actions.run_and_verify_svn(expected, [], 'copy',
13585
12926
                                     sbox.repo_url + "/A",
13586
12927
                                     A_COPY_2_path)
13587
12928
  expected_output = wc.State(wc_dir, {"A_COPY_2" : Item(verb='Adding')})
13588
12929
  svntest.actions.run_and_verify_commit(wc_dir,
13589
12930
                                        expected_output,
13590
 
                                        wc_status,
13591
 
                                        None,
13592
 
                                        wc_dir)
 
12931
                                        wc_status)
13593
12932
 
13594
12933
  # r8: Make a text change under A, to A/D/H/chi.
13595
12934
  svntest.main.file_write(chi_path, "New content")
13596
12935
  expected_output = wc.State(wc_dir, {'A/D/H/chi' : Item(verb='Sending')})
13597
12936
  wc_status.tweak('A/D/H/chi', wc_rev=8)
13598
12937
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
13599
 
                                        wc_status, None, wc_dir)
 
12938
                                        wc_status)
13600
12939
  wc_disk.tweak('A/D/H/psi', contents="New content")
13601
12940
 
13602
12941
  # r9: Merge all available revisions from A to A_COPY.  But first
13603
12942
  # update working copy to allow full inheritance and elision.
13604
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(8), [],
 
12943
  svntest.actions.run_and_verify_svn(exp_noop_up_out(8), [],
13605
12944
                                     'up', wc_dir)
13606
12945
  wc_status.tweak(wc_rev=8)
13607
12946
  expected_output = wc.State(A_COPY_path, {
13667
13006
                                       expected_disk,
13668
13007
                                       expected_status,
13669
13008
                                       expected_skip,
13670
 
                                       None, None, None, None,
13671
 
                                       None, 1)
 
13009
                                       check_props=True)
13672
13010
  wc_status.tweak('A_COPY',
13673
13011
                  'A_COPY/B/E/beta',
13674
13012
                  'A_COPY/D/G/rho',
13684
13022
    'A_COPY/D/H/psi'   : Item(verb='Sending'),
13685
13023
    'A_COPY/D/H/omega' : Item(verb='Sending'),
13686
13024
    })
13687
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
13688
 
                                        None, wc_dir)
 
13025
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
13689
13026
 
13690
13027
  # Again update the working copy to allow full inheritance and elision.
13691
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(9), [],
 
13028
  svntest.actions.run_and_verify_svn(exp_noop_up_out(9), [],
13692
13029
                                     'up', wc_dir)
13693
13030
  wc_status.tweak(wc_rev=9)
13694
13031
 
13757
13094
                                       expected_disk,
13758
13095
                                       expected_status,
13759
13096
                                       expected_skip,
13760
 
                                       None, None, None, None,
13761
 
                                       None, 1)
 
13097
                                       check_props=True)
13762
13098
 
13763
13099
#----------------------------------------------------------------------
13764
13100
@SkipUnless(server_has_mergeinfo)
13797
13133
  sbox.simple_commit(message='mod psi')
13798
13134
 
13799
13135
  # r8: Delete A/D/H/psi.
13800
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
13136
  svntest.actions.run_and_verify_svn(None, [],
13801
13137
                                     'delete', psi_path)
13802
13138
  sbox.simple_commit(message='delete psi')
13803
13139
 
13836
13172
                                       expected_elision_output,
13837
13173
                                       expected_disk,
13838
13174
                                       expected_status, expected_skip,
13839
 
                                       None, None, None, None, None, 1, 0,
 
13175
                                       [], True, False,
13840
13176
                                       '-c3,7', H_COPY_path)
13841
13177
  svntest.actions.run_and_verify_svn(
13842
 
    None,
13843
13178
    expected_merge_output([[-7]],
13844
13179
                          ['G    ' + psi_COPY_path + '\n',
13845
13180
                           ' G   ' + psi_COPY_path + '\n',]),
13886
13221
                                       expected_elision_output,
13887
13222
                                       expected_disk,
13888
13223
                                       expected_status, expected_skip,
13889
 
                                       None, None, None, None, None, 1, 0)
 
13224
                                       [], True, False)
13890
13225
 
13891
13226
#----------------------------------------------------------------------
13892
13227
@SkipUnless(server_has_mergeinfo)
13906
13241
  wc_disk, wc_status = set_up_branch(sbox, False, 2)
13907
13242
 
13908
13243
  # r8: Make a prop change on A_COPY/C.
13909
 
  svntest.actions.run_and_verify_svn(None,
13910
 
                                     ["property 'propname' set on '" +
 
13244
  svntest.actions.run_and_verify_svn(["property 'propname' set on '" +
13911
13245
                                      C_COPY_path + "'\n"], [],
13912
13246
                                     'ps', 'propname', 'propval',
13913
13247
                                     C_COPY_path)
13916
13250
  wc_status.tweak('A_COPY/C', wc_rev=8)
13917
13251
  wc_disk.tweak("A_COPY/C",
13918
13252
                props={'propname' : 'propval'})
13919
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
13920
 
                                        None, wc_dir)
 
13253
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
13921
13254
 
13922
13255
  # r9: Merge r8 from A_COPY to A.
13923
13256
  #
13924
13257
  # Update first to avoid an out of date error.
13925
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(8), [], 'up',
 
13258
  svntest.actions.run_and_verify_svn(exp_noop_up_out(8), [], 'up',
13926
13259
                                     wc_dir)
13927
13260
  wc_status.tweak(wc_rev=8)
13928
13261
  svntest.actions.run_and_verify_svn(
13929
 
    None,
13930
13262
    expected_merge_output([[8]],
13931
13263
                          [' U   ' + C_path + '\n',
13932
13264
                           ' U   ' + A_path + '\n',]),
13935
13267
                                     {'A'   : Item(verb='Sending'),
13936
13268
                                      'A/C' : Item(verb='Sending')})
13937
13269
  wc_status.tweak('A', 'A/C', wc_rev=9)
13938
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
13939
 
                                        None, wc_dir)
 
13270
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
13940
13271
 
13941
13272
  wc_disk.tweak("A/C",
13942
13273
                props={'propname' : 'propval'})
13944
13275
                props={SVN_PROP_MERGEINFO : '/A_COPY:8'})
13945
13276
 
13946
13277
  # r10: Move A/C to A/C_MOVED.
13947
 
  svntest.actions.run_and_verify_svn(None,
13948
 
                                     ['\n', 'Committed revision 10.\n'],
 
13278
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
13279
                                      'Committed revision 10.\n'],
13949
13280
                                     [], 'move',
13950
13281
                                     sbox.repo_url + '/A/C',
13951
13282
                                     sbox.repo_url + '/A/C_MOVED',
13952
13283
                                     '-m', 'Copy A/C to A/C_MOVED')
13953
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up',
 
13284
  svntest.actions.run_and_verify_svn(None, [], 'up',
13954
13285
                                     wc_dir)
13955
13286
 
13956
13287
  # Now try to merge all available revisions from A to A_COPY_2.
14038
13369
                                       expected_A_COPY_2_disk,
14039
13370
                                       expected_A_COPY_2_status,
14040
13371
                                       expected_A_COPY_2_skip,
14041
 
                                       None, None, None, None,
14042
 
                                       None, 1)
 
13372
                                       check_props=True)
14043
13373
 
14044
13374
#----------------------------------------------------------------------
14045
13375
# Test for issue #3324
14087
13417
  # r8 - Text change to A/B/E/alpha
14088
13418
  svntest.main.file_write(alpha_path, "New content")
14089
13419
  wc_status.tweak('A/B/E/alpha', wc_rev=8)
14090
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
13420
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
14091
13421
                                     'Text change', wc_dir)
14092
13422
 
14093
13423
  # r9 - Add the file A/D/H/nu and make another change to A/B/E/alpha.
14094
13424
  svntest.main.file_write(alpha_path, "Even newer content")
14095
13425
  svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
14096
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
 
13426
  svntest.actions.run_and_verify_svn(None, [], 'add', nu_path)
14097
13427
  expected_output = wc.State(wc_dir,
14098
13428
                             {'A/D/H/nu'    : Item(verb='Adding'),
14099
13429
                              'A/B/E/alpha' : Item(verb='Sending')})
14100
13430
  wc_status.add({'A/D/H/nu' : Item(status='  ', wc_rev=9)})
14101
13431
  wc_status.tweak('A/B/E/alpha', wc_rev=9)
14102
13432
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
14103
 
                                        wc_status, None, wc_dir)
 
13433
                                        wc_status)
14104
13434
 
14105
13435
  # r10 - Merge all available revisions (i.e. -r1:9) from A to A_COPY.
14106
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(9), [], 'up',
 
13436
  svntest.actions.run_and_verify_svn(exp_noop_up_out(9), [], 'up',
14107
13437
                                     wc_dir)
14108
13438
  wc_status.tweak(wc_rev=9)
14109
13439
  svntest.actions.run_and_verify_svn(
14110
 
    None,
14111
13440
    expected_merge_output([[2,9]],
14112
13441
                          ['A    ' + nu_COPY_path  + '\n',
14113
13442
                           'U    ' + alpha_COPY_path + '\n',
14134
13463
                  wc_rev=10)
14135
13464
  wc_status.add({'A_COPY/D/H/nu' : Item(status='  ', wc_rev=10)})
14136
13465
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
14137
 
                                        wc_status, None, wc_dir)
 
13466
                                        wc_status)
14138
13467
 
14139
13468
  # r11 - Reverse merge -r9:1 from A/B to A_COPY/B
14140
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(10), [], 'up',
 
13469
  svntest.actions.run_and_verify_svn(exp_noop_up_out(10), [], 'up',
14141
13470
                                     wc_dir)
14142
13471
  wc_status.tweak(wc_rev=10)
14143
13472
  svntest.actions.run_and_verify_svn(
14144
 
    None,
14145
13473
    expected_merge_output([[9,2]], ['U    ' + alpha_COPY_path + '\n',
14146
13474
                                    'U    ' + beta_COPY_path  + '\n',
14147
13475
                                    ' G   ' + B_COPY_path     + '\n',]),
14155
13483
                  'A_COPY/B/E/beta',
14156
13484
                  wc_rev=11)
14157
13485
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
14158
 
                                        wc_status, None, wc_dir)
 
13486
                                        wc_status)
14159
13487
 
14160
13488
  # r12 - Move A/D/H/nu to A/D/H/nu_moved
14161
 
  svntest.actions.run_and_verify_svn(None, ["\n",
 
13489
  svntest.actions.run_and_verify_svn(["Committing transaction...\n",
14162
13490
                                            "Committed revision 12.\n"], [],
14163
13491
                                     'move', sbox.repo_url + '/A/D/H/nu',
14164
13492
                                     sbox.repo_url + '/A/D/H/nu_moved',
14169
13497
     "A    " + nu_moved_path + "\n",
14170
13498
     "Updated to revision 12.\n"],
14171
13499
    )
14172
 
  svntest.actions.run_and_verify_svn(None, expected_output,
 
13500
  svntest.actions.run_and_verify_svn(expected_output,
14173
13501
                                     [], 'up', wc_dir)
14174
13502
 
14175
13503
  # Now merge -r7:12 from A to A_COPY.
14246
13574
                                       expected_disk,
14247
13575
                                       expected_status,
14248
13576
                                       expected_skip,
14249
 
                                       None, None, None, None,
14250
 
                                       None, 1, 0)
14251
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
13577
                                       check_props=True)
 
13578
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
14252
13579
                                     'Merge -r7:12 from A to A_COPY', wc_dir)
14253
13580
 
14254
13581
  # Now run a similar scenario as above on the second branch, but with
14264
13591
  #   Properties on 'A_COPY_2\B':
14265
13592
  #     svn:mergeinfo
14266
13593
  #       /A/B:3-13
14267
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(13), [], 'up',
 
13594
  svntest.actions.run_and_verify_svn(exp_noop_up_out(13), [], 'up',
14268
13595
                                     wc_dir)
14269
 
  svntest.actions.run_and_verify_svn(None,
14270
 
                                     None, # Don't check stdout, we test this
 
13596
  svntest.actions.run_and_verify_svn(None, # Don't check stdout, we test this
14271
13597
                                           # type of merge to death elsewhere.
14272
13598
                                     [], 'merge', sbox.repo_url + '/A/B',
14273
13599
                                     B_COPY_2_path)
14274
 
  svntest.actions.run_and_verify_svn(None, None,[], 'merge', '-r', '2:9',
 
13600
  svntest.actions.run_and_verify_svn(None,[], 'merge', '-r', '2:9',
14275
13601
                                     sbox.repo_url + '/A', A_COPY_2_path)
14276
13602
  svntest.actions.run_and_verify_svn(
14277
 
    None, None, [], 'ci', '-m',
 
13603
    None, [], 'ci', '-m',
14278
13604
    'Merge all from A/B to A_COPY_2/B\nMerge -r2:9 from A to A_COPY_2',
14279
13605
    wc_dir)
14280
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(14), [], 'up',
 
13606
  svntest.actions.run_and_verify_svn(exp_noop_up_out(14), [], 'up',
14281
13607
                                     wc_dir)
14282
13608
 
14283
13609
  # Now reverse merge -r13:7 from A to A_COPY_2.
14377
13703
                                       expected_disk,
14378
13704
                                       expected_status,
14379
13705
                                       expected_skip,
14380
 
                                       None, None, None, None,
14381
 
                                       None, 1, 1)
 
13706
                                       [], True, True)
14382
13707
 
14383
13708
#----------------------------------------------------------------------
14384
13709
def set_up_natural_history_gap(sbox):
14408
13733
 
14409
13734
  # r6: Delete 'A'
14410
13735
  exit_code, out, err = svntest.actions.run_and_verify_svn(
14411
 
    None, "(Committed revision 6.)|(\n)", [],
 
13736
    ["Committing transaction...\n",
 
13737
           "Committed revision 6.\n"], [],
14412
13738
    'delete', sbox.repo_url + '/A', '-m', 'Delete A')
14413
13739
 
14414
13740
  # r7: Resurrect 'A' by copying 'A@2' to 'A'.
14415
13741
  exit_code, out, err = svntest.actions.run_and_verify_svn(
14416
 
    None, "(Committed revision 7.)|(\n)", [],
 
13742
    ["Committing transaction...\n",
 
13743
           "Committed revision 7.\n"], [],
14417
13744
    'copy', sbox.repo_url + '/A@2', sbox.repo_url + '/A',
14418
13745
    '-m', 'Resurrect A from A@2')
14419
13746
 
14420
13747
  # r8: Branch the resurrected 'A' to 'A_COPY'.
14421
13748
  exit_code, out, err = svntest.actions.run_and_verify_svn(
14422
 
    None, "(Committed revision 8.)|(\n)", [],
 
13749
    ["Committing transaction...\n",
 
13750
           "Committed revision 8.\n"], [],
14423
13751
    'copy', sbox.repo_url + '/A', sbox.repo_url + '/A_COPY',
14424
13752
    '-m', 'Copy A to A_COPY')
14425
13753
 
14426
13754
  # Update to bring all the repos side changes down.
14427
 
  exit_code, out, err = svntest.actions.run_and_verify_svn(None, None, [],
 
13755
  exit_code, out, err = svntest.actions.run_and_verify_svn(None, [],
14428
13756
                                                           'up', wc_dir)
14429
13757
  wc_status.add({
14430
13758
      "A_COPY/B"         : Item(status='  '),
14455
13783
 
14456
13784
  # Update the WC to a uniform revision.
14457
13785
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
14458
 
                                        wc_status, None, wc_dir)
14459
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(9), [],
 
13786
                                        wc_status)
 
13787
  svntest.actions.run_and_verify_svn(exp_noop_up_out(9), [],
14460
13788
                                     'up', wc_dir)
14461
13789
  return wc_disk, wc_status
14462
13790
 
14548
13876
                                       expected_disk,
14549
13877
                                       expected_status,
14550
13878
                                       expected_skip,
14551
 
                                       None, None, None, None,
14552
 
                                       None, 1)
 
13879
                                       check_props=True)
14553
13880
 
14554
13881
#----------------------------------------------------------------------
14555
13882
# Test for issue #3432 'Merge can record mergeinfo from natural history
14643
13970
                                       expected_disk,
14644
13971
                                       expected_status,
14645
13972
                                       expected_skip,
14646
 
                                       None, None, None, None,
14647
 
                                       None, 1)
 
13973
                                       check_props=True)
14648
13974
 
14649
13975
  # Now reverse merge -r9:2 from 'A@HEAD' to 'A_COPY'.  This should be
14650
13976
  # a no-op since the only operative change made on 'A@HEAD' between r2:9
14666
13992
                                       expected_disk,
14667
13993
                                       expected_status,
14668
13994
                                       expected_skip,
14669
 
                                       None, None, None, None,
14670
 
                                       None, 1)
 
13995
                                       check_props=True)
14671
13996
 
14672
13997
  # Now merge all available revisions from 'A' to 'A_COPY'.
14673
13998
  # The mergeinfo '/A:4' on 'A_COPY' should have no impact on this merge
14687
14012
                                       expected_disk,
14688
14013
                                       expected_status,
14689
14014
                                       expected_skip,
14690
 
                                       None, None, None, None,
14691
 
                                       None, 1)
 
14015
                                       check_props=True)
14692
14016
 
14693
14017
#----------------------------------------------------------------------
14694
14018
# Test for issue #3323 'Mergeinfo deleted by a merge should disappear'
14712
14036
 
14713
14037
  # r7: Merge all available revisions from A/D to A_COPY/D, this creates
14714
14038
  #     mergeinfo on A_COPY/D.
14715
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
14716
 
  svntest.actions.run_and_verify_svn(None,
14717
 
                                     None, # Don't check stdout, we test this
 
14039
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
14040
  svntest.actions.run_and_verify_svn(None, # Don't check stdout, we test this
14718
14041
                                           # type of merge to death elsewhere.
14719
14042
                                     [], 'merge', sbox.repo_url + '/A/D',
14720
14043
                                     D_COPY_path)
14721
14044
  svntest.actions.run_and_verify_svn(
14722
 
    None, None, [], 'ci', '-m',
 
14045
    None, [], 'ci', '-m',
14723
14046
    'Merge all available revisions from A/D to A_COPY/D', wc_dir)
14724
14047
 
14725
14048
  # r8: Copy A_COPY to A_COPY_2, this carries the mergeinf on A_COPY/D
14726
14049
  #     to A_COPY_2/D.
14727
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
14728
 
  svntest.actions.run_and_verify_svn(None, None,[],
 
14050
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
14051
  svntest.actions.run_and_verify_svn(None,[],
14729
14052
                                     'copy', A_COPY_path, A_COPY_2_path)
14730
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
14053
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
14731
14054
                                     'Copy A_COPY to A_COPY_2', wc_dir)
14732
14055
 
14733
14056
  # r9: Propdel the mergeinfo on A_COPY/D.
14734
 
  svntest.actions.run_and_verify_svn(None, None,[],
 
14057
  svntest.actions.run_and_verify_svn(None,[],
14735
14058
                                     'pd', SVN_PROP_MERGEINFO, D_COPY_path)
14736
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
14059
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
14737
14060
                                     'Propdel the mergeinfo on A_COPY/D',
14738
14061
                                     wc_dir)
14739
14062
 
14740
14063
  # r10: Merge r5 from A to A_COPY_2 so the latter gets some explicit
14741
14064
  #      mergeinfo.
14742
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
14743
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c5',
 
14065
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
14066
  svntest.actions.run_and_verify_svn(None, [], 'merge', '-c5',
14744
14067
                                     sbox.repo_url + '/A', A_COPY_2_path)
14745
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
14068
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
14746
14069
                                     'Merge r5 from A to A_COPY_2', wc_dir)
14747
14070
 
14748
14071
  # Now merge r9 from A_COPY to A_COPY_2.  Since the merge itself cleanly
14749
14072
  # removes all explicit mergeinfo from A_COPY_2/D, we should not set any
14750
14073
  # mergeinfo on that subtree describing the merge.
14751
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
14074
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
14752
14075
  expected_output = wc.State(A_COPY_2_path, {
14753
14076
    'D' : Item(status=' U'),
14754
14077
    })
14809
14132
                                       expected_disk,
14810
14133
                                       expected_status,
14811
14134
                                       expected_skip,
14812
 
                                       None, None, None, None,
14813
 
                                       None, 1)
 
14135
                                       check_props=True)
14814
14136
 
14815
14137
#----------------------------------------------------------------------
14816
14138
# File merge optimization caused segfault during noop file merge
14836
14158
  # eligible ranges to be merged to A_COPY/D/H/chi into two discrete
14837
14159
  # sets: r1-4 and r5-HEAD
14838
14160
  svntest.actions.run_and_verify_svn(
14839
 
    None,
14840
14161
    expected_merge_output([[5]],
14841
14162
                          ['U    ' + beta_COPY_path + '\n',
14842
14163
                           ' U   ' + A_COPY_path    + '\n',]),
14843
14164
    [], 'merge', '-c5', sbox.repo_url + '/A', A_COPY_path)
14844
 
  svntest.actions.run_and_verify_svn(None, None, [], 'commit', '-m',
 
14165
  svntest.actions.run_and_verify_svn(None, [], 'commit', '-m',
14845
14166
                                     'Merge r5 from A to A_COPY',
14846
14167
                                     wc_dir)
14847
14168
 
14848
14169
  # Update working copy to allow full inheritance and elision.
14849
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(7), [],
 
14170
  svntest.actions.run_and_verify_svn(exp_noop_up_out(7), [],
14850
14171
                                     'up', wc_dir)
14851
14172
 
14852
14173
  # Merge all available revisions from A/D/H/chi to A_COPY/D/H/chi.
14853
14174
  # There are no operative changes in the source, so this should
14854
14175
  # not produce any output other than mergeinfo updates on
14855
14176
  # A_COPY/D/H/chi.  This is where the segfault occurred.
14856
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge',
 
14177
  svntest.actions.run_and_verify_svn(None, [], 'merge',
14857
14178
                                     sbox.repo_url + '/A/D/H/chi',
14858
14179
                                     chi_COPY_path)
14859
 
  svntest.actions.run_and_verify_svn(None,
14860
 
                                     [' M      ' + chi_COPY_path + '\n'],
 
14180
  svntest.actions.run_and_verify_svn([' M      ' + chi_COPY_path + '\n'],
14861
14181
                                     [], 'st', chi_COPY_path)
14862
 
  svntest.actions.run_and_verify_svn(None,
14863
 
                                     ['/A/D/H/chi:2-7\n'],
 
14182
  svntest.actions.run_and_verify_svn(['/A/D/H/chi:2-7\n'],
14864
14183
                                     [], 'pg', SVN_PROP_MERGEINFO,
14865
14184
                                     chi_COPY_path)
14866
14185
 
14867
14186
#----------------------------------------------------------------------
 
14187
@SkipUnless(server_has_mergeinfo)
14868
14188
@Issue(2690)
14869
14189
def copy_then_replace_via_merge(sbox):
14870
14190
  "copy then replace via merge"
14901
14221
  main.file_append(AJK_zeta, 'new text')
14902
14222
  main.file_append(AJL_zeta, 'new text')
14903
14223
  main.run_svn(None, 'add', AJ)
14904
 
  main.run_svn(None, 'ci', wc_dir, '-m', 'create tree J') # r3
 
14224
  sbox.simple_commit(message='create tree J') # r3
14905
14225
  main.run_svn(None, 'up', wc_dir)
14906
14226
 
14907
14227
  # Copy J to the branch via merge
14908
14228
  main.run_svn(None, 'merge', url_A, branch)
14909
 
  main.run_svn(None, 'ci', wc_dir, '-m', 'merge to branch') # r4
 
14229
  sbox.simple_commit(message='merge to branch') # r4
14910
14230
  main.run_svn(None, 'up', wc_dir)
14911
14231
 
14912
14232
  # In A, replace J with a slightly different tree
14913
14233
  main.run_svn(None, 'rm', AJ)
14914
 
  main.run_svn(None, 'ci', wc_dir, '-m', 'rm AJ') # r5
 
14234
  sbox.simple_commit(message='rm AJ') # r5
14915
14235
  main.run_svn(None, 'up', wc_dir)
14916
14236
 
14917
14237
  os.makedirs(AJL)
14921
14241
  main.file_append(AJL_zeta, 'really new text')
14922
14242
  main.file_append(AJM_zeta, 'really new text')
14923
14243
  main.run_svn(None, 'add', AJ)
14924
 
  main.run_svn(None, 'ci', wc_dir, '-m', 'create tree J again') # r6
 
14244
  sbox.simple_commit(message='create tree J again') # r6
14925
14245
  main.run_svn(None, 'up', wc_dir)
14926
14246
 
14927
14247
  # Run merge to replace /branch/J in one swell foop.
14961
14281
    })
14962
14282
  actions.run_and_verify_commit(branch_J,
14963
14283
                                expected_output,
14964
 
                                expected_status,
14965
 
                                None, branch_J)
 
14284
                                expected_status)
14966
14285
 
14967
14286
#----------------------------------------------------------------------
14968
14287
@SkipUnless(server_has_mergeinfo)
14985
14304
  nu_COPY_path    = sbox.ospath('A_COPY/C/nu')
14986
14305
 
14987
14306
  # r7 - Copy the branch A_COPY@2 to A2 and update the WC.
14988
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
14307
  svntest.actions.run_and_verify_svn(None, [],
14989
14308
                                     'copy', A_COPY_path, A2_path)
14990
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
14309
  svntest.actions.run_and_verify_svn(None, [],
14991
14310
                                     'commit', '-m', 'Branch the branch',
14992
14311
                                     wc_dir)
14993
14312
  # r8 - Add A/C/nu and A/B/Z.
14994
14313
  # Add a new file with mergeinfo in the foreign repos.
14995
14314
  svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
14996
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
14997
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', Z_path)
14998
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
14315
  svntest.actions.run_and_verify_svn(None, [], 'add', nu_path)
 
14316
  svntest.actions.run_and_verify_svn(None, [], 'mkdir', Z_path)
 
14317
  svntest.actions.run_and_verify_svn(None, [],
14999
14318
                                     'commit', '-m', 'Add subtrees',
15000
14319
                                     wc_dir)
15001
14320
 
15002
14321
  # r9 - Edit A/C/nu and add a random property on A/B/Z.
15003
14322
  svntest.main.file_write(nu_path, "New content.\n")
15004
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
14323
  svntest.actions.run_and_verify_svn(None, [],
15005
14324
                                     'ps', 'propname', 'propval', Z_path)
15006
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
14325
  svntest.actions.run_and_verify_svn(None, [],
15007
14326
                                     'commit', '-m', 'Subtree changes',
15008
14327
                                     wc_dir)
15009
14328
 
15010
14329
  # r10 - Merge r8 from A to A_COPY.
15011
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(9), [], 'up',
 
14330
  svntest.actions.run_and_verify_svn(exp_noop_up_out(9), [], 'up',
15012
14331
                                     wc_dir)
15013
 
  svntest.actions.run_and_verify_svn(None,
15014
 
                                     expected_merge_output(
 
14332
  svntest.actions.run_and_verify_svn(expected_merge_output(
15015
14333
                                       [[8]],
15016
14334
                                       ['A    ' + Z_COPY_path + '\n',
15017
14335
                                        'A    ' + nu_COPY_path + '\n',
15019
14337
                                     [], 'merge', '-c8',
15020
14338
                                     sbox.repo_url + '/A',
15021
14339
                                     A_COPY_path)
15022
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
14340
  svntest.actions.run_and_verify_svn(None, [],
15023
14341
                                     'commit', '-m', 'Root merge of r8',
15024
14342
                                     wc_dir)
15025
14343
 
15029
14347
  #   r6 from A/D/H to A_COPY/D/H
15030
14348
  #   r9 from A/C/nu to A_COPY/C/nu
15031
14349
  #   r9 from A/B/Z to A_COPY/B/Z
15032
 
  svntest.actions.run_and_verify_svn(None,
15033
 
                                     expected_merge_output(
 
14350
  svntest.actions.run_and_verify_svn(expected_merge_output(
15034
14351
                                       [[4]],
15035
14352
                                       ['U    ' + rho_COPY_path + '\n',
15036
14353
                                        ' U   ' + rho_COPY_path + '\n',]),
15038
14355
                                     sbox.repo_url + '/A/D/G/rho',
15039
14356
                                     rho_COPY_path)
15040
14357
  svntest.actions.run_and_verify_svn(
15041
 
    None,
15042
14358
    expected_merge_output([[6]],
15043
14359
                          ['U    ' + omega_COPY_path + '\n',
15044
14360
                           ' U   ' + H_COPY_path + '\n',]),
15045
14361
    [], 'merge', '-c6', sbox.repo_url + '/A/D/H', H_COPY_path)
15046
 
  svntest.actions.run_and_verify_svn(None,
15047
 
                                     expected_merge_output(
 
14362
  svntest.actions.run_and_verify_svn(expected_merge_output(
15048
14363
                                       [[9]],
15049
14364
                                       ['U    ' + nu_COPY_path + '\n',
15050
14365
                                        ' G   ' + nu_COPY_path + '\n',]),
15051
14366
                                     [], 'merge', '-c9',
15052
14367
                                     sbox.repo_url + '/A/C/nu',
15053
14368
                                     nu_COPY_path)
15054
 
  svntest.actions.run_and_verify_svn(None,
15055
 
                                     expected_merge_output(
 
14369
  svntest.actions.run_and_verify_svn(expected_merge_output(
15056
14370
                                       [[9]],
15057
14371
                                       [' U   ' + Z_COPY_path + '\n',
15058
14372
                                        ' G   ' + Z_COPY_path + '\n']),
15059
14373
                                     [], 'merge', '-c9',
15060
14374
                                     sbox.repo_url + '/A/B/Z',
15061
14375
                                     Z_COPY_path)
15062
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
14376
  svntest.actions.run_and_verify_svn(None, [],
15063
14377
                                     'commit', '-m', 'Several subtree merges',
15064
14378
                                     wc_dir)
15065
14379
 
15066
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(11), [], 'up',
 
14380
  svntest.actions.run_and_verify_svn(exp_noop_up_out(11), [], 'up',
15067
14381
                                     wc_dir)
15068
14382
 
15069
14383
  # Now do a --record-only merge of r10 and r11 from A_COPY to A2.
15150
14464
                                       expected_disk,
15151
14465
                                       expected_status,
15152
14466
                                       expected_skip,
15153
 
                                       None, None, None, None, None, 1, 0,
 
14467
                                       [], True, False,
15154
14468
                                       '--record-only', A2_path)
15155
14469
 
15156
14470
#----------------------------------------------------------------------
15171
14485
 
15172
14486
  # r7 - Make a change on A_COPY that will conflict with r3 on A
15173
14487
  svntest.main.file_write(psi_COPY_path, "BASE.\n")
15174
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
14488
  svntest.actions.run_and_verify_svn(None, [],
15175
14489
                                     'commit', '-m', 'log msg', wc_dir)
15176
14490
 
15177
14491
  # Set up our base expectations, we'll tweak accordingly for each option.
15228
14542
    })
15229
14543
  expected_disk.tweak('D/H/psi', contents="<<<<<<< .working\n"
15230
14544
                      "BASE.\n"
 
14545
                      "||||||| .merge-left.r2\n"
 
14546
                      "This is the file 'psi'.\n"
15231
14547
                      "=======\n"
15232
14548
                      "New content>>>>>>> .merge-right.r3\n")
15233
14549
  expected_status.tweak('D/H/psi', status='C ')
15242
14558
                                       expected_disk,
15243
14559
                                       expected_status,
15244
14560
                                       expected_skip,
15245
 
                                       None,
15246
 
                                       svntest.tree.detect_conflict_files,
15247
 
                                       list(psi_conflict_support_files),
15248
 
                                       None, None, 1, 1,
 
14561
                                       [], True, True,
15249
14562
                                       '--accept', 'postpone',
15250
14563
                                       '--allow-mixed-revisions',
15251
 
                                       A_COPY_path)
15252
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
14564
                                       A_COPY_path,
 
14565
                                       extra_files=
 
14566
                                        list(psi_conflict_support_files))
 
14567
  svntest.actions.run_and_verify_svn(None, [],
15253
14568
                                     'revert', '--recursive', wc_dir)
15254
14569
 
15255
14570
  # Test --accept mine-conflict and mine-full
15265
14580
                                       expected_disk,
15266
14581
                                       expected_status,
15267
14582
                                       expected_skip,
15268
 
                                       None, None, None,
15269
 
                                       None, None, 1, 0,
 
14583
                                       [], True, False,
15270
14584
                                       '--accept', 'mine-conflict',
15271
14585
                                       '--allow-mixed-revisions',
15272
14586
                                       A_COPY_path)
15273
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
14587
  svntest.actions.run_and_verify_svn(None, [],
15274
14588
                                     'revert', '--recursive', wc_dir)
15275
14589
  svntest.actions.run_and_verify_merge(A_COPY_path, '2', '3',
15276
14590
                                       sbox.repo_url + '/A', None,
15280
14594
                                       expected_disk,
15281
14595
                                       expected_status,
15282
14596
                                       expected_skip,
15283
 
                                       None, None, None,
15284
 
                                       None, None, 1, 0,
 
14597
                                       [], True, False,
15285
14598
                                       '--accept', 'mine-full',
15286
14599
                                       '--allow-mixed-revisions',
15287
14600
                                       A_COPY_path)
15288
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
14601
  svntest.actions.run_and_verify_svn(None, [],
15289
14602
                                     'revert', '--recursive', wc_dir)
15290
14603
 
15291
14604
  # Test --accept theirs-conflict and theirs-full
15301
14614
                                       expected_disk,
15302
14615
                                       expected_status,
15303
14616
                                       expected_skip,
15304
 
                                       None, None, None,
15305
 
                                       None, None, 1, 0,
 
14617
                                       [], True, False,
15306
14618
                                       '--accept', 'theirs-conflict',
15307
14619
                                       '--allow-mixed-revisions',
15308
14620
                                       A_COPY_path)
15309
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
14621
  svntest.actions.run_and_verify_svn(None, [],
15310
14622
                                     'revert', '--recursive', wc_dir)
15311
14623
  svntest.actions.run_and_verify_merge(A_COPY_path, '2', '3',
15312
14624
                                       sbox.repo_url + '/A', None,
15316
14628
                                       expected_disk,
15317
14629
                                       expected_status,
15318
14630
                                       expected_skip,
15319
 
                                       None, None, None,
15320
 
                                       None, None, 1, 0,
 
14631
                                       [], True, False,
15321
14632
                                       '--accept', 'theirs-full',
15322
14633
                                       '--allow-mixed-revisions',
15323
14634
                                       A_COPY_path)
15324
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
14635
  svntest.actions.run_and_verify_svn(None, [],
15325
14636
                                     'revert', '--recursive', wc_dir)
15326
14637
  # Test --accept base
15327
14638
  ### TODO: Also test that the output has a 'Resolved' line for this path.
15338
14649
                                       expected_disk,
15339
14650
                                       expected_status,
15340
14651
                                       expected_skip,
15341
 
                                       None, None, None,
15342
 
                                       None, None, 1, 0,
 
14652
                                       [], True, False,
15343
14653
                                       '--accept', 'base',
15344
14654
                                       '--allow-mixed-revisions',
15345
14655
                                       A_COPY_path)
15347
14657
#----------------------------------------------------------------------
15348
14658
# Test for issue #3440 'Skipped paths get incorrect override mergeinfo
15349
14659
# during merge'.
 
14660
@SkipUnless(server_has_mergeinfo)
15350
14661
@Issue(3440)
15351
14662
def skipped_files_get_correct_mergeinfo(sbox):
15352
14663
  "skipped files get correct mergeinfo set"
15377
14688
  # Merge r3 from A to A_COPY, this will create explicit mergeinfo of
15378
14689
  # '/A:3' on A_COPY.  Commit this merge as r8.
15379
14690
  svntest.actions.run_and_verify_svn(
15380
 
    None,
15381
14691
    expected_merge_output([[3]],
15382
14692
                          ['U    ' + psi_COPY_path + '\n',
15383
14693
                           ' U   ' + A_COPY_path + '\n',]),
15395
14705
  #
15396
14706
  # Issue #3440 occurred when empty mergeinfo was set on A_COPY/D/H, making
15397
14707
  # it appear that r3 was never merged.
15398
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(8), [],
 
14708
  svntest.actions.run_and_verify_svn(exp_noop_up_out(8), [],
15399
14709
                                     'up', wc_dir)
15400
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
14710
  svntest.actions.run_and_verify_svn(None, [],
15401
14711
                                     'up', '--set-depth=empty', H_COPY_path)
15402
14712
  expected_status = wc.State(A_COPY_path, {
15403
14713
    ''          : Item(status=' M'),
15458
14768
                                       expected_disk,
15459
14769
                                       expected_status,
15460
14770
                                       expected_skip,
15461
 
                                       None, None, None, None, None,
15462
 
                                       1, 1)
 
14771
                                       [], True, True)
15463
14772
 
15464
14773
#----------------------------------------------------------------------
15465
14774
# Test for issue #3115 'Case only renames resulting from merges don't
15476
14785
  A_COPY_path = sbox.ospath('A_COPY')
15477
14786
 
15478
14787
  # r3: A case-only file rename on the server
15479
 
  svntest.actions.run_and_verify_svn(None,
15480
 
                                     ['\n', 'Committed revision 3.\n'],
 
14788
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
14789
                                      'Committed revision 3.\n'],
15481
14790
                                     [], 'move',
15482
14791
                                     sbox.repo_url + '/A/mu',
15483
14792
                                     sbox.repo_url + '/A/MU',
15545
14854
                                       expected_disk,
15546
14855
                                       expected_status,
15547
14856
                                       expected_skip,
15548
 
                                       None, None, None, None,
15549
 
                                       None, 1, 0)
 
14857
                                       [], True, False)
15550
14858
 
15551
14859
  # Commit the merge
15552
14860
  expected_output = svntest.wc.State(wc_dir, {
15558
14866
  wc_status.remove('A_COPY/mu')
15559
14867
  wc_status.add({'A_COPY/MU': Item(status='  ', wc_rev=4)})
15560
14868
 
15561
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status,
15562
 
                                        None, wc_dir)
 
14869
  svntest.actions.run_and_verify_commit(wc_dir, expected_output, wc_status)
15563
14870
 
15564
14871
  # In issue #3115 the WC gets corrupted and any subsequent revert
15565
14872
  # attempts fail with this error:
15577
14884
  #  ..\..\..\subversion\libsvn_wc\workqueue.c:490: (apr_err=2)
15578
14885
  #  svn: Error restoring text for 'C:\SVN\src-trunk\Debug\subversion\tests
15579
14886
  #    \cmdline\svn-test-work\working_copies\merge_tests-139\A_COPY\MU'
15580
 
  svntest.actions.run_and_verify_svn(None, [], [], 'revert', '-R', wc_dir)
 
14887
  svntest.actions.run_and_verify_svn([], [], 'revert', '-R', wc_dir)
15581
14888
 
15582
14889
  # r5: A case-only directory rename on the server
15583
 
  svntest.actions.run_and_verify_svn(None,
15584
 
                                     ['\n', 'Committed revision 5.\n'],
 
14890
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
14891
                                      'Committed revision 5.\n'],
15585
14892
                                     [], 'move',
15586
14893
                                     sbox.repo_url + '/A/C',
15587
14894
                                     sbox.repo_url + '/A/c',
15614
14921
                                       expected_disk,
15615
14922
                                       expected_status,
15616
14923
                                       expected_skip,
15617
 
                                       None, None, None, None,
15618
 
                                       None, 1, 0,
 
14924
                                       [], True, False,
15619
14925
                                       '--allow-mixed-revisions', A_COPY_path)
15620
14926
 
15621
14927
#----------------------------------------------------------------------
15622
14928
# This is a test for issue #3221 'Unable to merge into working copy of
15623
14929
# deleted branch'.
 
14930
@SkipUnless(server_has_mergeinfo)
15624
14931
@Issue(3221)
15625
14932
def merge_into_wc_for_deleted_branch(sbox):
15626
14933
  "merge into WC of deleted branch should work"
15637
14944
 
15638
14945
  # r7 - Delete the branch on the repository, obviously it still
15639
14946
  # exists in our WC.
15640
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
14947
  svntest.actions.run_and_verify_svn(None, [],
15641
14948
                                     'delete', sbox.repo_url + '/A_COPY',
15642
14949
                                     '-m', 'Delete A_COPY directly in repos')
15643
14950
 
15725
15032
                                       expected_disk,
15726
15033
                                       expected_status,
15727
15034
                                       expected_skip,
15728
 
                                       None, None, None, None,
15729
 
                                       None, 1, 0)
 
15035
                                       check_props=True)
15730
15036
 
15731
15037
#----------------------------------------------------------------------
15732
15038
def foreign_repos_del_and_props(sbox):
15739
15045
  (r2_path, r2_url) = sbox.add_repo_path('fgn')
15740
15046
  svntest.main.create_repos(r2_path)
15741
15047
 
15742
 
  svntest.actions.run_and_verify_svn(None, None, [], 'checkout',
 
15048
  svntest.actions.run_and_verify_svn(None, [], 'checkout',
15743
15049
                                     r2_url, wc2_dir)
15744
15050
 
15745
 
  svntest.actions.run_and_verify_svn(None, None, [], 'propset',
 
15051
  svntest.actions.run_and_verify_svn(None, [], 'propset',
15746
15052
                                      'svn:eol-style', 'native',
15747
15053
                                      sbox.ospath('iota'))
15748
15054
 
15749
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
15055
  svntest.actions.run_and_verify_svn(None, [], 'cp',
15750
15056
                                      sbox.ospath('A/D'),
15751
15057
                                      sbox.ospath('D'))
15752
15058
 
15753
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm',
 
15059
  svntest.actions.run_and_verify_svn(None, [], 'rm',
15754
15060
                                      sbox.ospath('A/D'),
15755
15061
                                      sbox.ospath('D/G'))
15756
15062
 
15757
15063
  new_file = sbox.ospath('new-file')
15758
15064
  svntest.main.file_write(new_file, 'new-file')
15759
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', new_file)
 
15065
  svntest.actions.run_and_verify_svn(None, [], 'add', new_file)
15760
15066
 
15761
 
  svntest.actions.run_and_verify_svn(None, None, [], 'propset',
 
15067
  svntest.actions.run_and_verify_svn(None, [], 'propset',
15762
15068
                                      'svn:eol-style', 'native', new_file)
15763
15069
 
15764
 
  svntest.actions.run_and_verify_svn(None, None, [], 'commit', wc_dir,
 
15070
  svntest.actions.run_and_verify_svn(None, [], 'commit', wc_dir,
15765
15071
                                      '-m', 'changed')
15766
15072
 
15767
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge',
 
15073
  svntest.actions.run_and_verify_svn(None, [], 'merge',
15768
15074
                                      sbox.repo_url, wc2_dir,
15769
15075
                                      '-r', '0:1')
15770
15076
 
15778
15084
 
15779
15085
  expected_status = svntest.actions.get_virginal_state(wc2_dir, 1)
15780
15086
 
15781
 
  svntest.actions.run_and_verify_svn(None, None, [], 'commit', wc2_dir,
 
15087
  svntest.actions.run_and_verify_svn(None, [], 'commit', wc2_dir,
15782
15088
                                     '-m', 'Merged r1')
15783
15089
 
15784
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge',
 
15090
  svntest.actions.run_and_verify_svn(None, [], 'merge',
15785
15091
                                      sbox.repo_url, wc2_dir,
15786
15092
                                      '-r', '1:2', '--allow-mixed-revisions')
15787
15093
 
15809
15115
                     "  svn:eol-style\n",
15810
15116
                     "Properties on '%s':\n" % (os.path.join(wc2_dir, 'new-file')),
15811
15117
                     "  svn:eol-style\n" ]
15812
 
  svntest.actions.run_and_verify_svn(None, expected_output, [], 'proplist',
 
15118
  svntest.actions.run_and_verify_svn(expected_output, [], 'proplist',
15813
15119
                                     os.path.join(wc2_dir, 'iota'),
15814
15120
                                     os.path.join(wc2_dir, 'new-file'))
15815
15121
 
15828
15134
  B_COPY_path = sbox.ospath('A_COPY/B')
15829
15135
 
15830
15136
 
15831
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
15137
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
15832
15138
 
15833
15139
  # Merge -c5 from A/B to A_COPY/B at --depth immediates.
15834
15140
  # This should create only the minimum subtree mergeinfo
15875
15181
                                       expected_disk,
15876
15182
                                       expected_status,
15877
15183
                                       expected_skip,
15878
 
                                       None, None, None, None, None,
15879
 
                                       1, 1, '--depth', 'immediates',
 
15184
                                       [], True, True,
 
15185
                                       '--depth', 'immediates',
15880
15186
                                       B_COPY_path)
15881
15187
 
15882
15188
#----------------------------------------------------------------------
15883
15189
# Test for issue #3646 'cyclic --record-only merges create self-referential
15884
15190
# mergeinfo'
 
15191
@SkipUnless(server_has_mergeinfo)
15885
15192
@Issue(3646)
15886
15193
def record_only_merge_creates_self_referential_mergeinfo(sbox):
15887
15194
  "merge creates self referential mergeinfo"
15902
15209
 
15903
15210
  # Make a change to A/mu in r2.
15904
15211
  svntest.main.file_write(mu_path, "Trunk edit\n")
15905
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m', 'trunk edit',
 
15212
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m', 'trunk edit',
15906
15213
                                     wc_dir)
15907
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
15214
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
15908
15215
  # Copy A to A-branch in r3
15909
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
15216
  svntest.actions.run_and_verify_svn(None, [],
15910
15217
                                     'copy', A_path, A_branch_path)
15911
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci',
 
15218
  svntest.actions.run_and_verify_svn(None, [], 'ci',
15912
15219
                                     '-m', 'Branch A to A-branch', wc_dir)
15913
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
15220
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
15914
15221
 
15915
15222
  # Merge A-branch back to A.  This should record the mergeinfo '/A-branch:3'
15916
15223
  # on A.
15971
15278
                                       expected_A_disk,
15972
15279
                                       expected_A_status,
15973
15280
                                       expected_A_skip,
15974
 
                                       None, None, None, None, None, 1, 1,
 
15281
                                       [], True, True,
15975
15282
                                       '--record-only', A_path)
15976
15283
 
15977
15284
#----------------------------------------------------------------------
15991
15298
  A_branch_path = sbox.ospath('A-branch')
15992
15299
  C_branch_path = sbox.ospath('A-branch/C')
15993
15300
 
15994
 
  # r2 - Set some intial properties:
 
15301
  # r2 - Set some initial properties:
15995
15302
  #
15996
15303
  #  'dir-prop'='value1' on A/C.
15997
15304
  #  'svn:eol-style'='native' on A/mu.
15998
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
15305
  svntest.actions.run_and_verify_svn(None, [],
15999
15306
                                     'ps', 'dir-prop', 'initial-val',
16000
15307
                                     C_path)
16001
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
15308
  svntest.actions.run_and_verify_svn(None, [],
16002
15309
                                     'ps', 'svn:eol-style', 'native',
16003
15310
                                     mu_path)
16004
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
15311
  svntest.actions.run_and_verify_svn(None, [],
16005
15312
                                     'ci', '-m', 'Set some properties',
16006
15313
                                     wc_dir)
16007
15314
 
16008
15315
  # r3 - Branch 'A' to 'A-branch':
16009
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
16010
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
15316
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
15317
  svntest.actions.run_and_verify_svn(None, [],
16011
15318
                                     'copy', A_path, A_branch_path)
16012
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
15319
  svntest.actions.run_and_verify_svn(None, [],
16013
15320
                                     'ci', '-m', 'Create a branch of A',
16014
15321
                                     wc_dir)
16015
15322
 
16016
15323
  # r4 - Make a text mod to 'A/mu' and add new props to 'A/mu' and 'A/C':
16017
15324
  svntest.main.file_write(mu_path, "The new mu!\n")
16018
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
15325
  svntest.actions.run_and_verify_svn(None, [],
16019
15326
                                     'ps', 'prop-name', 'prop-val', mu_path)
16020
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
15327
  svntest.actions.run_and_verify_svn(None, [],
16021
15328
                                     'ps', 'another-dir-prop', 'initial-val',
16022
15329
                                     C_path)
16023
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
15330
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
16024
15331
                                     'Edit a file and make some prop changes',
16025
15332
                                     wc_dir)
16026
15333
 
16027
15334
  # r5 - Modify the sole property on 'A-branch/C':
16028
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
15335
  svntest.actions.run_and_verify_svn(None, [],
16029
15336
                                     'ps', 'dir-prop', 'branch-val',
16030
15337
                                     C_branch_path)
16031
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
15338
  svntest.actions.run_and_verify_svn(None, [],
16032
15339
                                     'ci', '-m', 'prop mod on branch', wc_dir)
16033
15340
 
16034
15341
  # Now merge r4 from 'A' to 'A-branch'.
16055
15362
  #   Summary of conflicts:
16056
15363
  #     Text conflicts: 1
16057
15364
  #     Property conflicts: 1
16058
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
15365
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
16059
15366
  expected_output = wc.State(A_branch_path, {
16060
15367
    'mu' : Item(status='UU'),
16061
15368
    'C'  : Item(status=' U'),
16121
15428
                                       expected_disk,
16122
15429
                                       expected_status,
16123
15430
                                       expected_skip,
16124
 
                                       None, None, None, None, None, 1, 1)
 
15431
                                       [], True, True)
16125
15432
 
16126
15433
 
16127
15434
#----------------------------------------------------------------------
16165
15472
                                       expected_disk,
16166
15473
                                       expected_status,
16167
15474
                                       expected_skip,
16168
 
                                       None, None, None, None, None,
16169
 
                                       True, True, new_path)
 
15475
                                       [], True, True,
 
15476
                                       new_path)
16170
15477
  sbox.simple_commit()
16171
15478
 
16172
15479
#----------------------------------------------------------------------
16226
15533
                                       expected_disk,
16227
15534
                                       expected_status,
16228
15535
                                       expected_skip,
16229
 
                                       None, None, None, None, None,
16230
 
                                       True, True, new_dir_path)
 
15536
                                       [], True, True,
 
15537
                                       new_dir_path)
16231
15538
  sbox.simple_commit()
16232
15539
 
16233
15540
#----------------------------------------------------------------------
16234
15541
# Test for issue #2915 'Handle mergeinfo for subtrees missing due to removal
16235
15542
# by non-svn command'
 
15543
@SkipUnless(server_has_mergeinfo)
16236
15544
@Issue(2915)
16237
15545
def merge_with_os_deleted_subtrees(sbox):
16238
15546
  "merge tracking fails if target missing subtrees"
16277
15585
            "|(.*A_COPY" + re_sep + "C\n)"                                 + \
16278
15586
            "|(.*A_COPY" + re_sep + "D" + re_sep + "H" + re_sep + "psi\n)"
16279
15587
  exit_code, out, err = svntest.actions.run_and_verify_svn(
16280
 
    "Missing subtrees should raise error", [], svntest.verify.AnyOutput,
 
15588
    [], svntest.verify.AnyOutput,
16281
15589
    'merge', sbox.repo_url + '/A', A_COPY_path)
16282
15590
  svntest.verify.verify_outputs("Merge failed but not in the way expected",
16283
15591
                                err, None, err_re + missing, None,
16289
15597
  missing = "|(.*A_COPY" + re_sep + "mu\n)" + \
16290
15598
            "|(.*A_COPY" + re_sep + "C\n)"
16291
15599
  exit_code, out, err = svntest.actions.run_and_verify_svn(
16292
 
    "Missing subtrees should raise error", [], svntest.verify.AnyOutput,
 
15600
    [], svntest.verify.AnyOutput,
16293
15601
    'merge', sbox.repo_url + '/A', A_COPY_path, '--depth=immediates')
16294
15602
  svntest.verify.verify_outputs("Merge failed but not in the way expected",
16295
15603
                                err, None, err_re + missing, None, True)
16299
15607
  # as missing.
16300
15608
  missing = "|(.*A_COPY" + re_sep + "mu\n)"
16301
15609
  exit_code, out, err = svntest.actions.run_and_verify_svn(
16302
 
    "Missing subtrees should raise error", [], svntest.verify.AnyOutput,
 
15610
    [], svntest.verify.AnyOutput,
16303
15611
    'merge', sbox.repo_url + '/A', A_COPY_path, '--depth=files')
16304
15612
  svntest.verify.verify_outputs("Merge failed but not in the way expected",
16305
15613
                                err, None, err_re + missing, None, True)
16308
15616
  # Only the...oh, wait, the target is present and that is as deep
16309
15617
  # as the merge goes, so this merge should succeed!
16310
15618
  svntest.actions.run_and_verify_svn(
16311
 
    "Depth empty merge should succeed as long at the target is present",
16312
15619
    svntest.verify.AnyOutput, [], 'merge', sbox.repo_url + '/A',
16313
15620
    A_COPY_path, '--depth=empty')
16314
15621
 
16338
15645
 
16339
15646
  # r7 - Add the file A/C/nu
16340
15647
  svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
16341
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
16342
 
  svntest.actions.run_and_verify_svn(None, None, [], 'commit',
 
15648
  svntest.actions.run_and_verify_svn(None, [], 'add', nu_path)
 
15649
  svntest.actions.run_and_verify_svn(None, [], 'commit',
16343
15650
                                     '-m', 'Add file', wc_dir)
16344
15651
 
16345
15652
  # r8 - Sync merge A to A_COPY
16346
15653
  svntest.actions.run_and_verify_svn(
16347
 
    "Synch merge failed unexpectedly",
16348
15654
    svntest.verify.AnyOutput, [], 'merge', sbox.repo_url + '/A',
16349
15655
    A_COPY_path)
16350
 
  svntest.actions.run_and_verify_svn(None, None, [], 'commit',
 
15656
  svntest.actions.run_and_verify_svn(None, [], 'commit',
16351
15657
                                     '-m', 'Sync A_COPY with A', wc_dir)
16352
15658
 
16353
15659
  # r9 - Add the subtree A/D/J
16354
15660
  #                      A/D/J/zeta
16355
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', J_path)
 
15661
  svntest.actions.run_and_verify_svn(None, [], 'mkdir', J_path)
16356
15662
  svntest.main.file_write(zeta_path, "This is the file 'zeta'.\n")
16357
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', zeta_path)
16358
 
  svntest.actions.run_and_verify_svn(None, None, [], 'commit',
 
15663
  svntest.actions.run_and_verify_svn(None, [], 'add', zeta_path)
 
15664
  svntest.actions.run_and_verify_svn(None, [], 'commit',
16359
15665
                                     '-m', 'Add subtree', wc_dir)
16360
15666
 
16361
15667
  # Update the WC in preparation for merges.
16362
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
15668
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
16363
15669
 
16364
15670
  # r10 - Sync merge A to A_COPY
16365
15671
  svntest.actions.run_and_verify_svn(
16366
 
    "Synch merge failed unexpectedly",
16367
15672
    svntest.verify.AnyOutput, [], 'merge', sbox.repo_url + '/A',
16368
15673
    A_COPY_path)
16369
 
  svntest.actions.run_and_verify_svn(None, None, [], 'commit',
 
15674
  svntest.actions.run_and_verify_svn(None, [], 'commit',
16370
15675
                                     '-m', 'Sync A_COPY with A', wc_dir)
16371
15676
 
16372
15677
  # r11 - Text changes to A/C/nu and A/D/J/zeta.
16373
15678
  svntest.main.file_write(nu_path, "This is the EDITED file 'nu'.\n")
16374
15679
  svntest.main.file_write(zeta_path, "This is the EDITED file 'zeta'.\n")
16375
 
  svntest.actions.run_and_verify_svn(None, None, [], 'commit',
 
15680
  svntest.actions.run_and_verify_svn(None, [], 'commit',
16376
15681
                                     '-m', 'Edit added files', wc_dir)
16377
15682
 
16378
15683
  # Update the WC in preparation for merges.
16379
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
15684
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
16380
15685
 
16381
15686
  # This test is marked as XFail because the following two merges
16382
15687
  # create mergeinfo with both non-existent path-revs and self-referential
16412
15717
                                       expected_disk,
16413
15718
                                       expected_status,
16414
15719
                                       expected_skip,
16415
 
                                       None, None, None, None,
16416
 
                                       None, 1)
 
15720
                                       check_props=True)
16417
15721
 
16418
15722
  # Merge all available revisions from A/D/J to A_COPY/D/J.  Like the
16419
15723
  # previous merge, the target should not have any non-existent ('/A/D/J:2-8')
16443
15747
                                       expected_disk,
16444
15748
                                       expected_status,
16445
15749
                                       expected_skip,
16446
 
                                       None, None, None, None,
16447
 
                                       None, 1)
 
15750
                                       check_props=True)
16448
15751
 
16449
15752
#----------------------------------------------------------------------
16450
15753
# Test for issue #3756 'subtree merge can inherit invalid working mergeinfo',
16470
15773
 
16471
15774
  # r7 - Add the file A/C/nu
16472
15775
  svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
16473
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
16474
 
  svntest.actions.run_and_verify_svn(None, None, [], 'commit',
 
15776
  svntest.actions.run_and_verify_svn(None, [], 'add', nu_path)
 
15777
  svntest.actions.run_and_verify_svn(None, [], 'commit',
16475
15778
                                     '-m', 'Add file', wc_dir)
16476
15779
 
16477
15780
  # r8 Merge c7 from A to A_COPY.
16478
15781
  svntest.actions.run_and_verify_svn(
16479
 
    "Merge failed unexpectedly",
16480
15782
    svntest.verify.AnyOutput, [], 'merge', sbox.repo_url + '/A',
16481
15783
    A_COPY_path, '-c7')
16482
 
  svntest.actions.run_and_verify_svn(None, None, [], 'commit',
 
15784
  svntest.actions.run_and_verify_svn(None, [], 'commit',
16483
15785
                                     '-m', 'Merge subtree file addition',
16484
15786
                                     wc_dir)
16485
15787
 
16486
15788
  # r9 - A text change to A/C/nu.
16487
15789
  svntest.main.file_write(nu_path, "This is the EDITED file 'nu'.\n")
16488
 
  svntest.actions.run_and_verify_svn(None, None, [], 'commit',
 
15790
  svntest.actions.run_and_verify_svn(None, [], 'commit',
16489
15791
                                     '-m', 'Edit added file', wc_dir)
16490
15792
 
16491
15793
  # Update the WC in preparation for merges.
16492
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
15794
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
16493
15795
 
16494
15796
  # Now do two merges.  The first, r3 to the root of the branch A_COPY.
16495
15797
  # This creates working mergeinfo '/A:3,7' on A_COPY.  Then do a subtree
16503
15805
  # Currently this test is marked as XFail because the resulting mergeinfo is
16504
15806
  # '/A/C/nu:3,7,9' and thus includes a non-existent path-rev.
16505
15807
  svntest.actions.run_and_verify_svn(
16506
 
    "Merge failed unexpectedly",
16507
15808
    svntest.verify.AnyOutput, [], 'merge', sbox.repo_url + '/A',
16508
15809
    A_COPY_path, '-c3')
16509
15810
  svntest.actions.run_and_verify_svn(
16510
 
    "Merge failed unexpectedly",
16511
15811
    svntest.verify.AnyOutput, [], 'merge', sbox.repo_url + '/A/C/nu',
16512
15812
    nu_COPY_path, '-c9')
16513
15813
  svntest.actions.run_and_verify_svn(
16514
 
    "Subtree merge under working merge produced the wrong mergeinfo",
16515
15814
    '/A/C/nu:9', [], 'pg', SVN_PROP_MERGEINFO, nu_COPY_path)
16516
15815
 
16517
15816
 
16519
15818
# Test for issue #3686 'executable flag not correctly set on merge'
16520
15819
# See http://subversion.tigris.org/issues/show_bug.cgi?id=3686
16521
15820
@Issue(3686)
 
15821
@SkipUnless(server_has_mergeinfo)
16522
15822
@SkipUnless(svntest.main.is_posix_os)
16523
15823
def merge_change_to_file_with_executable(sbox):
16524
15824
  "executable flag is maintained during binary merge"
16534
15834
  beta_path = sbox.ospath('A/B/E/beta')
16535
15835
 
16536
15836
  # Force one of the files to be a binary type
16537
 
  svntest.actions.run_and_verify_svn2(None, None,
 
15837
  svntest.actions.run_and_verify_svn2(None,
16538
15838
                                      binary_mime_type_on_text_file_warning, 0,
16539
15839
                                     'propset', 'svn:mime-type',
16540
15840
                                     'application/octet-stream',
16541
15841
                                     alpha_path)
16542
15842
 
16543
15843
  # Set the 'svn:executable' property on both files
16544
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
15844
  svntest.actions.run_and_verify_svn(None, [],
16545
15845
                                     'propset', 'svn:executable', 'ON',
16546
15846
                                     beta_path)
16547
15847
 
16548
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
15848
  svntest.actions.run_and_verify_svn(None, [],
16549
15849
                                     'propset', 'svn:executable', 'ON',
16550
15850
                                     alpha_path)
16551
15851
 
16565
15865
    raise svntest.Failure("beta is not marked as executable before commit")
16566
15866
 
16567
15867
  # Create the branch
16568
 
  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
 
15868
  svntest.actions.run_and_verify_svn(None, [], 'cp',
16569
15869
                                     trunk_url,
16570
15870
                                     sbox.repo_url + '/branch',
16571
15871
                                     '-m', "Creating the Branch")
16577
15877
 
16578
15878
  # Re-root the WC at the branch
16579
15879
  svntest.main.safe_rmtree(wc_dir)
16580
 
  svntest.actions.run_and_verify_svn(None, None, [], 'checkout',
 
15880
  svntest.actions.run_and_verify_svn(None, [], 'checkout',
16581
15881
                                     sbox.repo_url + '/branch', wc_dir)
16582
15882
 
16583
15883
  # Recalculate the paths
16617
15917
                                       expected_disk,
16618
15918
                                       expected_status,
16619
15919
                                       expected_skip,
16620
 
                                       None, None, None,
16621
 
                                       None, None, True, True)
 
15920
                                       [], True, True)
16622
15921
 
16623
15922
 
16624
15923
  # Verify the executable bit has been set
16662
15961
    'A/theta' : Item(status='  ', wc_rev=2),
16663
15962
    })
16664
15963
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
16665
 
                                        expected_status, None,
16666
 
                                        wc_dir)
 
15964
                                        expected_status)
16667
15965
 
16668
15966
  # Make the "other" working copy
16669
15967
  other_wc = sbox.add_wc_path('other')
16679
15977
    'A/theta' : Item(status='  ', wc_rev=3),
16680
15978
    })
16681
15979
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
16682
 
                                        expected_status, None,
16683
 
                                        wc_dir)
 
15980
                                        expected_status)
16684
15981
 
16685
15982
  # In second working copy, append different content to the binary
16686
15983
  # and attempt to 'svn merge -r 2:3'.
16728
16025
                                       expected_disk,
16729
16026
                                       expected_status,
16730
16027
                                       expected_skip,
16731
 
                                       None, None, None, None, None,
16732
 
                                       True, True, '--allow-mixed-revisions',
 
16028
                                       [], True, True,
 
16029
                                       '--allow-mixed-revisions',
16733
16030
                                       other_wc)
16734
16031
 
16735
16032
#----------------------------------------------------------------------
16746
16043
  other_repo_dir, other_repo_url = sbox.add_repo_path("other")
16747
16044
  other_wc_dir = sbox.add_wc_path("other")
16748
16045
  svntest.main.copy_repos(repo_dir, other_repo_dir, 1, 1)
16749
 
  svntest.actions.run_and_verify_svn(None, None, [], 'co', other_repo_url,
 
16046
  svntest.actions.run_and_verify_svn(None, [], 'co', other_repo_url,
16750
16047
                                     other_wc_dir)
16751
16048
 
16752
16049
  # Add properties in the first repos and commit.
16753
16050
  sbox.simple_propset('red', 'rojo', 'A/D/G')
16754
16051
  sbox.simple_propset('yellow', 'amarillo', 'A/D/G')
16755
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
16052
  svntest.actions.run_and_verify_svn(None, [],
16756
16053
                                     'ci', '-m', 'spenglish', wc_dir)
16757
16054
 
16758
16055
  # Tweak properties in the first repos and commit.
16759
16056
  sbox.simple_propset('red', 'rosso', 'A/D/G')
16760
16057
  sbox.simple_propset('yellow', 'giallo', 'A/D/G')
16761
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
16058
  svntest.actions.run_and_verify_svn(None, [],
16762
16059
                                     'ci', '-m', 'engtalian', wc_dir)
16763
16060
 
16764
16061
  # Now, merge the propchange to the *second* working copy.
16766
16063
                                                 "A", "D", "G"))]
16767
16064
  expected_output = expected_merge_output([[3]], expected_output, True,
16768
16065
                                          prop_conflicts=1)
16769
 
  svntest.actions.run_and_verify_svn(None,
16770
 
                                     expected_output,
 
16066
  svntest.actions.run_and_verify_svn(expected_output,
16771
16067
                                     [], 'merge', '-c3',
16772
16068
                                     sbox.repo_url,
16773
16069
                                     other_wc_dir)
16793
16089
 
16794
16090
  # r8 - Add the file A_COPY/C/nu.
16795
16091
  svntest.main.file_write(nu_COPY_path, "This is the file 'nu'.\n")
16796
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_COPY_path)
16797
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
16092
  svntest.actions.run_and_verify_svn(None, [], 'add', nu_COPY_path)
 
16093
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
16798
16094
                                     'Add a file on the A_COPY branch',
16799
16095
                                     wc_dir)
16800
16096
 
16801
16097
  # r9 - Cherry pick r8 from A_COPY to A.
16802
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
16803
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge',
 
16098
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
16099
  svntest.actions.run_and_verify_svn(None, [], 'merge',
16804
16100
                                     sbox.repo_url + '/A_COPY',
16805
16101
                                     A_path, '-c8')
16806
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
16102
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
16807
16103
                                     'Merge r8 from A_COPY to A', wc_dir)
16808
16104
 
16809
16105
  # r10 - Make a modification to A_COPY/C/nu
16810
16106
  svntest.main.file_append(nu_COPY_path,
16811
16107
                           "More work on the A_COPY branch.\n")
16812
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
16108
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
16813
16109
                                     'Some work on the A_COPY branch', wc_dir)
16814
16110
 
16815
16111
  # r9 - Cherry pick r10 from A_COPY/C/nu to A/C/nu.  Make some
16816
16112
  # changes to A/C/nu before committing the merge.
16817
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge',
 
16113
  svntest.actions.run_and_verify_svn(None, [], 'merge',
16818
16114
                                     sbox.repo_url + '/A_COPY/C/nu',
16819
16115
                                     nu_path, '-c10')
16820
16116
  svntest.main.file_append(nu_path, "A faux conflict resolution.\n")
16821
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
16117
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
16822
16118
                                     'Merge r8 from A_COPY to A', wc_dir)
16823
16119
 
16824
16120
  # Sync merge A to A_COPY_2
16825
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
16121
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
16826
16122
  expected_output = wc.State(A_COPY2_path, {
16827
16123
    'B/E/beta'  : Item(status='U '),
16828
16124
    'C/nu'      : Item(status='A '),
16900
16196
                                       expected_disk,
16901
16197
                                       expected_status,
16902
16198
                                       expected_skip,
16903
 
                                       None, None, None, None,
16904
 
                                       None, 1, False)
 
16199
                                       check_props=True)
16905
16200
 
16906
16201
#----------------------------------------------------------------------
16907
16202
# A test for issue #3978 'reverse merge which adds subtree fails'.
16922
16217
  H_COPY_path  = sbox.ospath('A_COPY/D/H')
16923
16218
 
16924
16219
  # r7 - Delete A\D\H\chi
16925
 
  svntest.actions.run_and_verify_svn(None, None, [], 'delete', chi_path)
16926
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
16220
  svntest.actions.run_and_verify_svn(None, [], 'delete', chi_path)
 
16221
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
16927
16222
                                     'Delete a file', wc_dir)
16928
16223
 
16929
16224
  # r8 - Merge r7 from A to A_COPY
16930
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge',
 
16225
  svntest.actions.run_and_verify_svn(None, [], 'merge',
16931
16226
                                     sbox.repo_url + '/A',
16932
16227
                                     A_COPY_path, '-c7')
16933
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
16228
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
16934
16229
                                     'Cherry-pick r7 from A to A_COPY', wc_dir)
16935
16230
 
16936
16231
  # r9 - File depth sync merge from A/D/H to A_COPY/D/H/
16937
16232
  # This shallow merge does not create non-inheritable mergeinfo because of
16938
16233
  # the issue #4057 fix; all subtrees affected by the diff are present, so
16939
16234
  # non-inheritable mergeinfo is not required.
16940
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
16941
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge',
 
16235
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
16236
  svntest.actions.run_and_verify_svn(None, [], 'merge',
16942
16237
                                     sbox.repo_url + '/A/D/H',
16943
16238
                                     H_COPY_path, '--depth', 'files')
16944
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
16239
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
16945
16240
                                     'Cherry-pick r7 from A to A_COPY', wc_dir)
16946
16241
 
16947
16242
  # Reverse merge r7 from A to A_COPY
16973
16268
  # ..\..\..\subversion\libsvn_subr\mergeinfo.c:504: (apr_err=200022)
16974
16269
  # ..\..\..\subversion\libsvn_subr\kitchensink.c:57: (apr_err=200022)
16975
16270
  # svn: E200022: Negative revision number found parsing '-7'
16976
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
16271
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
16977
16272
  expected_output = wc.State(A_COPY_path, {
16978
16273
    'D/H/chi' : Item(status='A '),
16979
16274
    })
17036
16331
                                       expected_disk,
17037
16332
                                       expected_status,
17038
16333
                                       expected_skip,
17039
 
                                       None, None, None, None,
17040
 
                                       None, 1, False)
 
16334
                                       check_props=True)
17041
16335
 
17042
16336
#----------------------------------------------------------------------
17043
16337
# A test for issue #3989 'merge which deletes file with native eol-style
17057
16351
  H_branch_path = sbox.ospath('branch/D/H')
17058
16352
 
17059
16353
  # r2 - Set svn:eol-style native on A/D/H/psi
17060
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ps', 'svn:eol-style',
 
16354
  svntest.actions.run_and_verify_svn(None, [], 'ps', 'svn:eol-style',
17061
16355
                                     'native', psi_path)
17062
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
16356
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
17063
16357
                                     'Set eol-style native on a path',
17064
16358
                                     wc_dir)
17065
16359
 
17066
16360
  # r3 - Branch ^/A to ^/branch
17067
 
  svntest.actions.run_and_verify_svn(None, None, [], 'copy',
 
16361
  svntest.actions.run_and_verify_svn(None, [], 'copy',
17068
16362
                                     sbox.repo_url + '/A',
17069
16363
                                     sbox.repo_url + '/branch',
17070
16364
                                     '-m', 'Copy ^/A to ^/branch')
17071
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
16365
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
17072
16366
 
17073
16367
  # r4 - Delete A/D/H/psi
17074
 
  svntest.actions.run_and_verify_svn(None, None, [], 'delete', psi_path)
17075
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
16368
  svntest.actions.run_and_verify_svn(None, [], 'delete', psi_path)
 
16369
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
17076
16370
                                     'Delete a a path with native eol-style',
17077
16371
                                     wc_dir)
17078
16372
 
17081
16375
  # branch/D/H/psi is, ignoring differences caused by svn:eol-style, identical
17082
16376
  # to ^/A/D/H/psi when the latter was deleted, so the deletion should merge
17083
16377
  # cleanly.
17084
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
16378
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
17085
16379
  expected_output = wc.State(H_branch_path, {
17086
16380
    'psi' : Item(status='D '),
17087
16381
    })
17110
16404
                                       expected_disk,
17111
16405
                                       expected_status,
17112
16406
                                       expected_skip,
17113
 
                                       None, None, None, None,
17114
 
                                       None, 1, False)
 
16407
                                       check_props=True)
17115
16408
 
17116
16409
#----------------------------------------------------------------------
17117
16410
# A test for issue #3976 'record-only merges which add new subtree mergeinfo
17132
16425
  H_COPY2_path  = sbox.ospath('A_COPY_2/D/H')
17133
16426
 
17134
16427
  # r7 - Copy ^/A_COPY to ^/A_COPY_2
17135
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
16428
  svntest.actions.run_and_verify_svn(None, [],
17136
16429
                                     'copy', '-m', 'copy A_COPY to A_COPY_2',
17137
16430
                                     sbox.repo_url + '/A_COPY',
17138
16431
                                     sbox.repo_url + '/A_COPY_2')
17144
16437
  svntest.main.run_svn(None, 'commit', '-m', 'set svn:eol-style', wc_dir)
17145
16438
 
17146
16439
  # r9 - Merge r3 from ^/A/D/H/psi to A_COPY/D/H/psi.
17147
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge',
 
16440
  svntest.actions.run_and_verify_svn(None, [], 'merge',
17148
16441
                                     sbox.repo_url + '/A/D/H/psi',
17149
16442
                                     psi_COPY_path, '-c3')
17150
16443
  svntest.main.run_svn(None, 'commit', '-m', 'Subtree merge', wc_dir)
17151
16444
 
17152
16445
  # r10 - Merge r8 from ^/A/D/H/psi to A_COPY/D/H/psi.
17153
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge',
 
16446
  svntest.actions.run_and_verify_svn(None, [], 'merge',
17154
16447
                                     sbox.repo_url + '/A/D/H/psi',
17155
16448
                                     psi_COPY_path, '-c8')
17156
16449
  svntest.main.run_svn(None, 'commit', '-m', 'Subtree merge', wc_dir)
17163
16456
  #   2) The mergeinfo '/A/D/H/psi:8' from r10.
17164
16457
  #
17165
16458
  #   3) The mergeinfo '/A_COPY/D/H/psi:10' describing the merge itself.
17166
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
16459
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
17167
16460
  expected_output = wc.State(H_COPY2_path, {
17168
16461
    'psi' : Item(status=' U'),
17169
16462
    })
17197
16490
                                       expected_disk,
17198
16491
                                       expected_status,
17199
16492
                                       expected_skip,
17200
 
                                       None, None, None, None,
17201
 
                                       None, 1, False)
17202
 
 
17203
 
#----------------------------------------------------------------------
17204
 
# Setup helper for issue #4056 and issue #4057 tests.
17205
 
def noninheritable_mergeinfo_test_set_up(sbox):
17206
 
  '''Starting with standard greek tree, copy 'A' to 'branch' in r2 and
17207
 
  then made a file edit to A/B/lambda in r3.
17208
 
  Return (expected_output, expected_mergeinfo_output, expected_elision_output,
17209
 
          expected_status, expected_disk, expected_skip) for a merge of
17210
 
  r3 from ^/A/B to branch/B.'''
17211
 
 
17212
 
  sbox.build()
17213
 
  wc_dir = sbox.wc_dir
17214
 
 
17215
 
  lambda_path   = sbox.ospath('A/B/lambda')
17216
 
  B_branch_path = sbox.ospath('branch/B')
17217
 
 
17218
 
  # r2 - Branch ^/A to ^/branch.
17219
 
  svntest.main.run_svn(None, 'copy', sbox.repo_url + '/A',
17220
 
                       sbox.repo_url + '/branch', '-m', 'make a branch')
17221
 
 
17222
 
  # r3 - Make an edit to A/B/lambda.
17223
 
  svntest.main.file_write(lambda_path, "trunk edit.\n")
17224
 
  svntest.main.run_svn(None, 'commit', '-m', 'file edit', wc_dir)
17225
 
  svntest.main.run_svn(None, 'up', wc_dir)
17226
 
 
17227
 
  expected_output = wc.State(B_branch_path, {
17228
 
    'lambda' : Item(status='U '),
17229
 
    })
17230
 
  expected_mergeinfo_output = wc.State(B_branch_path, {
17231
 
    ''       : Item(status=' U'),
17232
 
    'lambda' : Item(status=' U'),
17233
 
    })
17234
 
  expected_elision_output = wc.State(B_branch_path, {
17235
 
    'lambda' : Item(status=' U'),
17236
 
    })
17237
 
  expected_status = wc.State(B_branch_path, {
17238
 
    ''        : Item(status=' M'),
17239
 
    'lambda'  : Item(status='M '),
17240
 
    'E'       : Item(status='  '),
17241
 
    'E/alpha' : Item(status='  '),
17242
 
    'E/beta'  : Item(status='  '),
17243
 
    'F'       : Item(status='  '),
17244
 
    })
17245
 
  expected_status.tweak(wc_rev='3')
17246
 
  expected_disk = wc.State('', {
17247
 
    ''          : Item(props={SVN_PROP_MERGEINFO : '/A/B:3'}),
17248
 
    'lambda'  : Item("trunk edit.\n"),
17249
 
    'E'       : Item(),
17250
 
    'E/alpha' : Item("This is the file 'alpha'.\n"),
17251
 
    'E/beta'  : Item("This is the file 'beta'.\n"),
17252
 
    'F'       : Item(),
17253
 
    })
17254
 
  expected_skip = wc.State(B_branch_path, {})
17255
 
 
17256
 
  return expected_output, expected_mergeinfo_output, expected_elision_output, \
17257
 
    expected_status, expected_disk, expected_skip
 
16493
                                       check_props=True)
17258
16494
 
17259
16495
 
17260
16496
#----------------------------------------------------------------------
17298
16534
                                       expected_disk,
17299
16535
                                       expected_status,
17300
16536
                                       expected_skip,
17301
 
                                       None, None, None, None, None, 1, 1,
 
16537
                                       [], True, True,
17302
16538
                                       B_branch_path)
17303
16539
 
17304
16540
#----------------------------------------------------------------------
17341
16577
                                       expected_disk,
17342
16578
                                       expected_status,
17343
16579
                                       expected_skip,
17344
 
                                       None, None, None, None, None, 1, 1,
 
16580
                                       [], True, True,
17345
16581
                                       '--depth', 'files', B_branch_path)
17346
16582
 
17347
16583
  # Revert the merge and then make a prop change to A/B/E in r4.
17348
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
16584
  svntest.actions.run_and_verify_svn(None, [],
17349
16585
                                     'revert', '--recursive', sbox.wc_dir)
17350
 
  svntest.actions.run_and_verify_svn(None,
17351
 
                                     ["property 'prop:name' set on '" +
 
16586
  svntest.actions.run_and_verify_svn(["property 'prop:name' set on '" +
17352
16587
                                      E_path + "'\n"], [], 'ps',
17353
16588
                                     'prop:name', 'propval', E_path)
17354
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
16589
  svntest.actions.run_and_verify_svn(None, [],
17355
16590
                                     'ci', '-m', 'A new property on a dir',
17356
16591
                                     sbox.wc_dir)
17357
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
16592
  svntest.actions.run_and_verify_svn(None, [],
17358
16593
                                     'up', sbox.wc_dir)
17359
16594
 
17360
16595
  # Merge r4 from ^/A/B to branch/B at operational depth=immediates
17406
16641
                                       expected_disk,
17407
16642
                                       expected_status,
17408
16643
                                       expected_skip,
17409
 
                                       None, None, None, None, None, 1, 1,
 
16644
                                       [], True, True,
17410
16645
                                       '--depth', 'immediates', B_branch_path)
17411
16646
 
17412
16647
#----------------------------------------------------------------------
17436
16671
  sbox.simple_commit()
17437
16672
 
17438
16673
  ## r5: fail to revert it
17439
 
  svntest.actions.run_and_verify_svnmucc(None, None, [],
 
16674
  svntest.actions.run_and_verify_svnmucc(None, [],
17440
16675
                                         '-m', 'r5',
17441
16676
                                         '-U', sbox.repo_url,
17442
16677
                                         'rm', 'A',
17443
16678
                                         'cp', 'HEAD', 'A', 'A')
17444
16679
 
17445
16680
  ## r6: really revert it
17446
 
  svntest.actions.run_and_verify_svnmucc(None, None, [],
 
16681
  svntest.actions.run_and_verify_svnmucc(None, [],
17447
16682
                                         '-m', 'r6',
17448
16683
                                         '-U', sbox.repo_url,
17449
16684
                                         'rm', 'A',
17496
16731
  svntest.main.run_svn(None, 'up', wc_dir)
17497
16732
  svntest.main.run_svn(None, 'del', A_path)
17498
16733
  svntest.main.run_svn(None, 'copy', sbox.repo_url + '/A@5', A_path)
17499
 
  svntest.main.run_svn(None, 'ci', '-m',
17500
 
                       'Replace A with older version of itself', wc_dir)
 
16734
  sbox.simple_commit(message='Replace A with older version of itself')
17501
16735
 
17502
16736
  # r8: Make an edit to A/D/H/omega:
17503
16737
  svntest.main.file_write(omega_path, "New content for 'omega'.\n")
17504
 
  svntest.main.run_svn(None, 'ci', '-m', 'file edit', wc_dir)
 
16738
  sbox.simple_commit(message='file edit')
17505
16739
 
17506
16740
  # Update and sync merge ^/A to A_COPY.
17507
16741
  #
17540
16774
     'U    ' + psi_COPY_path   + '\n',
17541
16775
     ' U   ' + A_COPY_path     + '\n',
17542
16776
     ' G   ' + A_COPY_path     + '\n',])
17543
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
16777
  svntest.actions.run_and_verify_svn(expected_output, [],
17544
16778
                                     'merge', sbox.repo_url + '/A',
17545
16779
                                     A_COPY_path)
17546
16780
 
17547
16781
  # Misleading notifications are one thing, incorrect mergeinfo is quite
17548
16782
  # another.
17549
 
  svntest.actions.run_and_verify_svn(None,
17550
 
                                     [A_COPY_path + ' - /A:2-5,7-8\n'],
 
16783
  svntest.actions.run_and_verify_svn([A_COPY_path + ' - /A:2-5,7-8\n'],
17551
16784
                                     [], 'pg', SVN_PROP_MERGEINFO,
17552
16785
                                     '-R', A_COPY_path)
17553
16786
 
17564
16797
     ' U   ' + A_COPY_path     + '\n',
17565
16798
     ' G   ' + A_COPY_path     + '\n',],
17566
16799
    elides=True)
17567
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
16800
  svntest.actions.run_and_verify_svn(expected_output, [],
17568
16801
                                     'merge', sbox.repo_url + '/A',
17569
16802
                                     A_COPY_path, '-r8:1')
17570
16803
 
17594
16827
  wc_disk, wc_status = set_up_branch(sbox)
17595
16828
 
17596
16829
  # r7 - Rename ^/A to ^/trunk.
17597
 
  svntest.actions.run_and_verify_svn(None,
17598
 
                                     ['\n', 'Committed revision 7.\n'],
 
16830
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
16831
                                      'Committed revision 7.\n'],
17599
16832
                                     [], 'move',
17600
16833
                                     sbox.repo_url + '/A',
17601
16834
                                     sbox.repo_url + '/trunk',
17602
16835
                                     '-m', "Rename 'A' to 'trunk'")
17603
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
16836
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
17604
16837
 
17605
16838
  # r8 - Make and edit to trunk/D/H/omega (which was also edited in r6).
17606
16839
  svntest.main.file_write(omega_path, "Edit 'omega' on trunk.\n")
17607
 
  svntest.main.run_svn(None, 'ci', '-m', 'Another omega edit', wc_dir)
 
16840
  sbox.simple_commit(message='Another omega edit')
17608
16841
 
17609
16842
  # r9 - Sync merge ^/trunk to A_COPY.
17610
 
  svntest.actions.run_and_verify_svn(None,
17611
 
                                     None, # Don't check stdout, we test this
 
16843
  svntest.actions.run_and_verify_svn(None, # Don't check stdout, we test this
17612
16844
                                           # type of merge to death elsewhere.
17613
16845
                                     [], 'merge', sbox.repo_url + '/trunk',
17614
16846
                                     A_COPY_path)
17615
 
  svntest.main.run_svn(None, 'ci', '-m', 'Sync A_COPY with ^/trunk', wc_dir)
17616
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
16847
  sbox.simple_commit(message='Sync A_COPY with ^/trunk')
 
16848
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
17617
16849
 
17618
16850
  # Reverse merge -r9:1 from ^/trunk to A_COPY.  This should return
17619
16851
  # A_COPY to the same state it had prior to the sync merge in r2.
17649
16881
    'U    ' + psi_COPY_path   + '\n',
17650
16882
    ' U   ' + A_COPY_path     + '\n',
17651
16883
    ' G   ' + A_COPY_path     + '\n',], elides=True)
17652
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
16884
  svntest.actions.run_and_verify_svn(expected_output, [],
17653
16885
                                     'merge', sbox.repo_url + '/trunk',
17654
16886
                                     A_COPY_path, '-r9:1')
17655
16887
 
17673
16905
  nu_branch_path = sbox.ospath('branch/C/nu')
17674
16906
 
17675
16907
  # Make a branch.
17676
 
  svntest.actions.run_and_verify_svn(None, None, [], 'copy',
 
16908
  svntest.actions.run_and_verify_svn(None, [], 'copy',
17677
16909
                                     sbox.repo_url + '/A',
17678
16910
                                     sbox.repo_url + '/branch',
17679
16911
                                     '-m', 'Make a branch.')
17680
16912
 
17681
16913
  # On the branch parent: Add a file in r3 and then delete it in r4.
17682
16914
  svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
17683
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
17684
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', wc_dir,
 
16915
  svntest.actions.run_and_verify_svn(None, [], 'add', nu_path)
 
16916
  svntest.actions.run_and_verify_svn(None, [], 'ci', wc_dir,
17685
16917
                                     '-m', 'Add a file')
17686
 
  svntest.actions.run_and_verify_svn(None, None, [], 'delete', nu_path)
17687
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', wc_dir,
 
16918
  svntest.actions.run_and_verify_svn(None, [], 'delete', nu_path)
 
16919
  svntest.actions.run_and_verify_svn(None, [], 'ci', wc_dir,
17688
16920
                                     '-m', 'Delete a file')
17689
16921
 
17690
16922
  # Merge r3 and r4 from ^/A/C to branch/C as part of one merge
17715
16947
  #   svn: E155010: The node 'C:\SVN\src-trunk\Debug\subversion\tests
17716
16948
  #   \cmdline\svn-test-work\working_copies\merge_tests-128\branch\C\nu'
17717
16949
  #   was not found.
17718
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
16950
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
17719
16951
  svntest.actions.run_and_verify_svn(
17720
 
    None,
17721
16952
    expected_merge_output([[3],[4]],
17722
16953
                          ['A    ' + nu_branch_path + '\n',
17723
16954
                           'D    ' + nu_branch_path + '\n',
17752
16983
  wc_disk, wc_status = set_up_branch(sbox, nbr_of_branches=2)
17753
16984
 
17754
16985
  # r8 - Add a subtree under A.
17755
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', '--parents',
 
16986
  svntest.actions.run_and_verify_svn(None, [], 'mkdir', '--parents',
17756
16987
                                     Z_path)
17757
16988
  svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
17758
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
17759
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', wc_dir,
 
16989
  svntest.actions.run_and_verify_svn(None, [], 'add', nu_path)
 
16990
  svntest.actions.run_and_verify_svn(None, [], 'ci', wc_dir,
17760
16991
                                     '-m', 'Add a subtree on our "trunk"')
17761
16992
 
17762
16993
  # r9 - Sync ^/A to the first branch A_COPY.
17763
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
17764
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge',
 
16994
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
16995
  svntest.actions.run_and_verify_svn(None, [], 'merge',
17765
16996
                                     sbox.repo_url + '/A', A_COPY_path)
17766
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', wc_dir,
 
16997
  svntest.actions.run_and_verify_svn(None, [], 'ci', wc_dir,
17767
16998
                                     '-m', 'Sync ^/A to ^/A_COPY')
17768
16999
 
17769
17000
  # r10 - Make some edits on the first branch.
17770
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ps', 'branch-prop-foo',
 
17001
  svntest.actions.run_and_verify_svn(None, [], 'ps', 'branch-prop-foo',
17771
17002
                                     'bar', Y_COPY_path)
17772
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', W_COPY_path)
17773
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', wc_dir,
 
17003
  svntest.actions.run_and_verify_svn(None, [], 'mkdir', W_COPY_path)
 
17004
  svntest.actions.run_and_verify_svn(None, [], 'ci', wc_dir,
17774
17005
                                     '-m', 'Make some edits on "branch 1"')
17775
17006
 
17776
17007
  # r11 - Cherry-pick r10 on the first branch back to A, but
17777
17008
  # do so at depth=empty so non-inheritable mergeinfo is created.
17778
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
17779
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
17009
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
17010
  svntest.actions.run_and_verify_svn(None, [],
17780
17011
                                     'merge', '-c10', '--depth=empty',
17781
17012
                                     sbox.repo_url + '/A_COPY/C/X/Y', Y_path)
17782
17013
  svntest.actions.run_and_verify_svn(
17783
 
    None, None, [], 'ci', wc_dir,
 
17014
    None, [], 'ci', wc_dir,
17784
17015
    '-m', 'Depth empty subtree cherry pick from "branch 1" to "trunk"')
17785
17016
 
17786
17017
  # Sync ^/A to the second branch A_COPY_2.
17821
17052
  #     svn:mergeinfo
17822
17053
  #       /A/C/X/Y/Z:8-11
17823
17054
  #   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17824
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
17055
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
17825
17056
  expected_output = wc.State(A_COPY2_path, {
17826
17057
    'B/E/beta'   : Item(status='U '),
17827
17058
    'D/G/rho'    : Item(status='U '),
17899
17130
                                       expected_disk,
17900
17131
                                       expected_status,
17901
17132
                                       expected_skip,
17902
 
                                       None, None, None, None,
17903
 
                                       None, 1, 0)
 
17133
                                       check_props=True)
17904
17134
 
17905
17135
#----------------------------------------------------------------------
17906
17136
@SkipUnless(server_has_mergeinfo)
17923
17153
  wc_disk, wc_status = set_up_branch(sbox)
17924
17154
 
17925
17155
  svntest.main.file_write(mu_COPY_path, "branch edit")
17926
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
17156
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
17927
17157
                                     'file edit on the branch', wc_dir)
17928
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
 
17158
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
17929
17159
 
17930
17160
  # Create a file external under 'A' and set some bogus mergeinfo
17931
17161
  # on it (the fact that this mergeinfo is bogus has no bearing on
17932
17162
  # this test).
17933
 
  svntest.actions.run_and_verify_svn(None, None, [], 'propset',
 
17163
  svntest.actions.run_and_verify_svn(None, [], 'propset',
17934
17164
                                     'svn:externals',
17935
17165
                                     '^/iota file-external', A_path)
17936
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
17166
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
17937
17167
                                     'set file external', wc_dir)
17938
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
17939
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ps', SVN_PROP_MERGEINFO,
 
17168
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
17169
  svntest.actions.run_and_verify_svn(None, [], 'ps', SVN_PROP_MERGEINFO,
17940
17170
                                     "/bogus-mergeinfo:5", file_external_path)
17941
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
17171
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
17942
17172
                                     'set mergeinfo on file external',
17943
17173
                                     file_external_path)
17944
17174
 
17945
17175
  # Sync merge ^/A to A_COPY and then reintegrate A_COPY back to A.
17946
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge',
 
17176
  svntest.actions.run_and_verify_svn(None, [], 'merge',
17947
17177
                                     sbox.repo_url + '/A', A_COPY_path)
17948
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
17178
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
17949
17179
                                     'sync merge', wc_dir)
17950
17180
  # This was segfaulting, see
17951
17181
  # http://svn.haxx.se/dev/archive-2012-10/0364.shtml
17952
17182
  svntest.actions.run_and_verify_svn(
17953
 
    None,
17954
17183
    expected_merge_output(None,
17955
17184
                          ['U    ' + mu_path + '\n',
17956
17185
                           ' U   ' + A_path  + '\n'],
18020
17249
 
18021
17250
  # merge back
18022
17251
  svntest.actions.run_and_verify_svn(
18023
 
    None,
18024
17252
    expected_merge_output([[3,4]],
18025
17253
                          ['C    ' + sbox.ospath(file_mod_both) + '\n',
18026
17254
                           'U    ' + sbox.ospath(file_mod_src) + '\n',
18063
17291
 
18064
17292
  # sync merge
18065
17293
  svntest.actions.run_and_verify_svn(
18066
 
    None,
18067
17294
    expected_merge_output([[3,4]],
18068
17295
                          ['U    '+ sbox.ospath('A2/keyfile') + '\n',
18069
17296
                           ' U   A2\n']),
18078
17305
 
18079
17306
  # sync merge again
18080
17307
  svntest.actions.run_and_verify_svn(
18081
 
    None,
18082
17308
    expected_merge_output([[5,6]],
18083
17309
                          ['UU   ' + sbox.ospath('A2/keyfile') + '\n',
18084
17310
                           ' U   A2\n']),
18119
17345
    '--- Recording mergeinfo for merge of r4 into \'.\':\n',
18120
17346
    ' U   .\n',
18121
17347
  ]
18122
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
17348
  svntest.actions.run_and_verify_svn(expected_output, [],
18123
17349
                                     'merge', '^/dir', '-c', '4')
18124
17350
 
18125
17351
  svntest.main.run_svn(None, 'revert', '-R', '.')
18131
17357
    '--- Recording mergeinfo for merge of r4 into \'binary-file\':\n',
18132
17358
    ' U   binary-file\n',
18133
17359
  ]
18134
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
17360
  svntest.actions.run_and_verify_svn(expected_output, [],
18135
17361
                                     'merge', '^/dir/binary-file', '-c', '4')
18136
17362
 
18137
17363
  svntest.main.run_svn(None, 'revert', '-R', '.')
18143
17369
    '--- Recording mergeinfo for merge of r4 into \'.\':\n',
18144
17370
    ' U   .\n',
18145
17371
  ]
18146
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
17372
  svntest.actions.run_and_verify_svn(expected_output, [],
18147
17373
                                     'merge', '^/dir', '-c', '4', '.')
18148
17374
 
18149
17375
  svntest.main.run_svn(None, 'revert', '-R', '.')
18155
17381
    '--- Recording mergeinfo for merge of r4 into \'binary-file\':\n',
18156
17382
    ' U   binary-file\n',
18157
17383
  ]
18158
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
17384
  svntest.actions.run_and_verify_svn(expected_output, [],
18159
17385
                                     'merge', '^/dir/binary-file', '-c', '4', 'binary-file')
18160
17386
 
18161
17387
  svntest.main.run_svn(None, 'revert', '-R', '.')
18167
17393
    '--- Recording mergeinfo for merge of r4 into \'.\':\n',
18168
17394
    ' U   .\n',
18169
17395
  ] + svntest.main.summary_of_conflicts(tree_conflicts=1)
18170
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
17396
  svntest.actions.run_and_verify_svn(expected_output, [],
18171
17397
                                     'merge', '^/dir/binary-file', '-c', '4', '.')
18172
17398
 
18173
17399
  svntest.main.run_svn(None, 'revert', '-R', '.')
18179
17405
    '--- Recording mergeinfo for merge of r4 into \'binary-file\':\n',
18180
17406
    ' U   binary-file\n',
18181
17407
  ] + svntest.main.summary_of_conflicts(tree_conflicts=1)
18182
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
17408
  svntest.actions.run_and_verify_svn(expected_output, [],
18183
17409
                                     'merge', '^/dir', '-c', '4', 'binary-file')
18184
17410
 
18185
 
@Issue(3405)
 
17411
@SkipUnless(server_has_mergeinfo)
 
17412
@Issue(3405) # seems to be the wrong issue number
18186
17413
def merge_properties_on_adds(sbox):
18187
17414
  "merged directory properties are added"
18188
17415
 
18200
17427
  sbox.simple_commit()
18201
17428
  sbox.simple_update()
18202
17429
 
18203
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
17430
  svntest.actions.run_and_verify_svn(None, [],
18204
17431
                                     'merge', '^/A/D/G', sbox.ospath('G'))
18205
17432
 
18206
17433
  expected_output = svntest.verify.UnorderedOutput([
18215
17442
     'Properties on \'%s\':\n' % sbox.ospath('G/M/file'),
18216
17443
     '  key\n',
18217
17444
  ])
18218
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
17445
  svntest.actions.run_and_verify_svn(expected_output, [],
18219
17446
                                     'proplist', '-R', sbox.ospath('G'))
18220
17447
 
18221
17448
  expected_output = svntest.verify.UnorderedOutput([
18232
17459
  # I merged the tree, which should include history but only the files have
18233
17460
  # the properties stored in PRISTINE. All directories have the properties
18234
17461
  # as local changes in ACTUAL.
18235
 
  svntest.actions.run_and_verify_svn(None, expected_output, [],
 
17462
  svntest.actions.run_and_verify_svn(expected_output, [],
18236
17463
                                     'proplist', '-R', sbox.ospath('G'),
18237
17464
                                     '-r', 'BASE')
18238
17465
 
18404
17631
     EXPECTED_MERGEINFO (list of lines).
18405
17632
  """
18406
17633
  svntest.actions.run_and_verify_svn(
18407
 
    None, expected_mergeinfo, [], 'pg', SVN_PROP_MERGEINFO, tgt_ospath)
 
17634
    expected_mergeinfo, [], 'pg', SVN_PROP_MERGEINFO, tgt_ospath)
18408
17635
 
18409
17636
def simple_merge(src_path, tgt_ospath, rev_args):
18410
17637
  """Merge from ^/SRC_PATH to TGT_OSPATH using revision arguments REV_ARGS
18419
17646
                                       target=tgt_ospath)
18420
17647
  src_url = '^/' + src_path
18421
17648
  svntest.actions.run_and_verify_svn(
18422
 
    None, expected_out, [],
 
17649
    expected_out, [],
18423
17650
    'merge', src_url, tgt_ospath, '--accept', 'postpone', *rev_args)
18424
17651
 
18425
17652
@SkipUnless(server_has_mergeinfo)
18463
17690
    sbox.simple_commit()
18464
17691
 
18465
17692
  # r14: merge some changes to the branch so that later merges will be split
18466
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c5,9',
 
17693
  svntest.actions.run_and_verify_svn(None, [], 'merge', '-c5,9',
18467
17694
                                     '^/' + trunk, sbox.ospath(branch),
18468
17695
                                     '--accept', 'theirs-conflict')
18469
17696
  sbox.simple_commit()
18470
17697
  sbox.simple_update()
18471
17698
 
18472
17699
  def revert_branch():
18473
 
    svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R',
 
17700
    svntest.actions.run_and_verify_svn(None, [], 'revert', '-R',
18474
17701
                                       sbox.ospath(branch))
18475
17702
 
18476
17703
  def try_merge(relpath, conflict_rev, rev_args,
18501
17728
 
18502
17729
    src_url = '^/' + src_path
18503
17730
    svntest.actions.run_and_verify_svn(
18504
 
                      None, expected_out, expected_err,
 
17731
                      expected_out, expected_err,
18505
17732
                      'merge', src_url, tgt_ospath, '--accept', 'postpone',
18506
17733
                      *rev_args)
18507
17734
 
18645
17872
    sbox.simple_commit()
18646
17873
 
18647
17874
  # Cherry pick merge r5 and r6 to each branch and commit.
18648
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '^/iota',
 
17875
  svntest.actions.run_and_verify_svn(None, [], 'merge', '^/iota',
18649
17876
                                     '-c', '5,7', iota_branch_path)
18650
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '^/A/C',
 
17877
  svntest.actions.run_and_verify_svn(None, [], 'merge', '^/A/C',
18651
17878
                                     '-c', '5,7', C_branch_path)
18652
17879
  sbox.simple_commit()
18653
17880
 
18658
17885
  # re checking the merge notification headers -- which need to be improved
18659
17886
  # at some point.
18660
17887
  svntest.actions.run_and_verify_svn(
18661
 
    None,
18662
17888
    ["--- Merging r2 through r4 into '" + C_branch_path + "':\n",
18663
17889
     " U   " + C_branch_path + "\n",
18664
17890
     "--- Merging r6 into '" + C_branch_path + "':\n",
18693
17919
  #   --- Recording mergeinfo for merge of r2 through r9 into 'iota-copy':
18694
17920
  #    U   iota-copy
18695
17921
  svntest.actions.run_and_verify_svn(
18696
 
    None,
18697
17922
    ["--- Merging r2 through r4 into '" + iota_branch_path + "':\n",
18698
17923
     " U   " + iota_branch_path + "\n",
18699
17924
     "--- Merging r6 into '" + iota_branch_path + "':\n",
18726
17951
  set_up_branch(sbox)
18727
17952
 
18728
17953
  # r7 - Subtree merge
18729
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '^/A/D',
 
17954
  svntest.actions.run_and_verify_svn(None, [], 'merge', '^/A/D',
18730
17955
                                     '-c4', D_copy_path)
18731
17956
  sbox.simple_commit()
18732
17957
  sbox.simple_update()
18766
17991
     " U   " + D_copy_path + "\n",
18767
17992
     "--- Eliding mergeinfo from '" + D_copy_path + "':\n",
18768
17993
     " U   " + D_copy_path + "\n"])
18769
 
  svntest.actions.run_and_verify_svn(None, expected_output, [], 'merge',
 
17994
  svntest.actions.run_and_verify_svn(expected_output, [], 'merge',
18770
17995
                                     sbox.repo_url + '/A', A_copy_path)
18771
17996
 
18772
17997
  # r8 and r9 - Commit and do reverse subtree merge.
18773
17998
  sbox.simple_commit()
18774
17999
  sbox.simple_update()
18775
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '^/A/D',
 
18000
  svntest.actions.run_and_verify_svn(None, [], 'merge', '^/A/D',
18776
18001
                                     '-c-4', D_copy_path)
18777
18002
  sbox.simple_commit()
18778
18003
 
18793
18018
     " U   " + D_copy_path + "\n",
18794
18019
     "--- Eliding mergeinfo from '" + D_copy_path + "':\n",
18795
18020
     " U   " + D_copy_path + "\n"])
18796
 
  svntest.actions.run_and_verify_svn(None, expected_output, [], 'merge',
 
18021
  svntest.actions.run_and_verify_svn(expected_output, [], 'merge',
18797
18022
                                     '-r9:2', sbox.repo_url + '/A',
18798
18023
                                     A_copy_path)
18799
18024
 
18841
18066
    sbox.simple_commit()
18842
18067
 
18843
18068
  # r14: merge some changes to the branch so that later merges will be split
18844
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '-c5,9',
 
18069
  svntest.actions.run_and_verify_svn(None, [], 'merge', '-c5,9',
18845
18070
                                     '^/' + trunk, sbox.ospath(branch),
18846
18071
                                     '--accept', 'theirs-conflict')
18847
18072
  sbox.simple_commit()
18848
18073
  sbox.simple_update()
18849
18074
 
18850
18075
  def revert_branch():
18851
 
    svntest.actions.run_and_verify_svn(None, None, [], 'revert', '-R',
 
18076
    svntest.actions.run_and_verify_svn(None, [], 'revert', '-R',
18852
18077
                                       sbox.ospath(branch))
18853
18078
 
18854
18079
  def try_merge(relpath, conflict_rev, rev_args,
18879
18104
 
18880
18105
    src_url = '^/' + src_path + '@11'
18881
18106
    svntest.actions.run_and_verify_svn(
18882
 
                      None, expected_out, expected_err,
 
18107
                      expected_out, expected_err,
18883
18108
                      'merge', src_url, tgt_ospath, '--accept', 'mine-full',
18884
18109
                      *rev_args)
18885
18110
 
19021
18246
 
19022
18247
  C1_path = sbox.ospath('A/C/C1')
19023
18248
  test3_path = sbox.ospath('A/C/C1/test.txt')
19024
 
  
 
18249
 
19025
18250
  # r3 - Add some subtrees:
19026
18251
  #   A /A/B/B1
19027
18252
  #   A /A/B/B1/B1a
19048
18273
  sbox.simple_commit()
19049
18274
 
19050
18275
  # r6 - Set depth of A_COPY to empty, merge all available revs from ^/A.
19051
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up',
 
18276
  svntest.actions.run_and_verify_svn(None, [], 'up',
19052
18277
                                     '--set-depth=empty', A_COPY_path)
19053
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up',
 
18278
  svntest.actions.run_and_verify_svn(None, [], 'up',
19054
18279
                                     '--set-depth=infinity', C_COPY_path)
19055
 
  svntest.actions.run_and_verify_svn(None, None, [], 'merge', '^/A',
 
18280
  svntest.actions.run_and_verify_svn(None, [], 'merge', '^/A',
19056
18281
                                     A_COPY_path)
19057
18282
  sbox.simple_commit()
19058
18283
 
19059
18284
  # Update A_COPY back to depth infinity and retry the prior merge.
19060
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up',
 
18285
  svntest.actions.run_and_verify_svn(None, [], 'up',
19061
18286
                                     '--set-depth=infinity', A_COPY_path)
19062
18287
 
19063
18288
  expected_output = wc.State(A_COPY_path, {
19137
18362
                                       expected_disk,
19138
18363
                                       expected_status,
19139
18364
                                       expected_skip,
19140
 
                                       None, None, None, None,
19141
 
                                       None, 1, 0)
 
18365
                                       [], True, False)
19142
18366
 
19143
18367
  # Commit the merge.
19144
18368
  #sbox.simple_commit()
19145
18369
 
19146
 
def merge_dir_delete_force(sbox):
19147
 
  "merge a directory delete with --force"
19148
 
 
19149
 
  sbox.build()
19150
 
 
19151
 
  sbox.simple_rm('A/D/G')
19152
 
  sbox.simple_commit() # r2
19153
 
 
19154
 
  sbox.simple_update(revision=1)
19155
 
 
19156
 
  # Just merging r2 on r1 succeeds
19157
 
  svntest.actions.run_and_verify_svn(sbox.wc_dir, None, [],
19158
 
                                     'merge', '-c2', '^/', sbox.wc_dir,
19159
 
                                     '--ignore-ancestry')
19160
 
 
19161
 
  # Bring working copy to r1 again
19162
 
  svntest.actions.run_and_verify_svn(sbox.wc_dir, None, [],
19163
 
                                     'revert', '-R', sbox.wc_dir)
19164
 
 
19165
 
  # But when using --force this same merge caused a segfault in 1.8.0-1.8.8
19166
 
  svntest.actions.run_and_verify_svn(sbox.wc_dir, None, [],
19167
 
                                     'merge', '-c2', '^/', sbox.wc_dir,
19168
 
                                     '--ignore-ancestry', '--force')
19169
 
 
19170
18370
def conflict_naming(sbox):
19171
18371
  "verify conflict file naming"
19172
18372
 
19196
18396
    'file.txt.r2'       : Item(contents="This is the initial content\n"),
19197
18397
    'file.txt'          : Item(contents="<<<<<<< .mine\n" \
19198
18398
                               "This is conflicting content\n" \
 
18399
                               "||||||| .r3\n" \
 
18400
                               "This is the new content\n" \
19199
18401
                               "=======\n" \
19200
18402
                               "This is the initial content\n" \
19201
18403
                               ">>>>>>> .r2\n"),
19204
18406
  svntest.actions.run_and_verify_update(wc_dir,
19205
18407
                                        expected_output, expected_disk,
19206
18408
                                        expected_status,
19207
 
                                        None, None, None,
19208
 
                                        None, None, None,
 
18409
                                        [], False,
19209
18410
                                        wc_dir, '-r', '2')
19210
18411
 
19211
18412
  sbox.simple_revert('file.txt')
19227
18428
    'file.txt.r2.txt'   : Item(contents="This is the initial content\n"),
19228
18429
    'file.txt'          : Item(contents="<<<<<<< .mine.txt\n" \
19229
18430
                               "This is conflicting content\n" \
 
18431
                               "||||||| .r3.txt\n" \
 
18432
                               "This is the new content\n" \
19230
18433
                               "=======\n" \
19231
18434
                               "This is the initial content\n" \
19232
18435
                               ">>>>>>> .r2.txt\n"),
19235
18438
  svntest.actions.run_and_verify_update(
19236
18439
                      wc_dir,
19237
18440
                      expected_output, expected_disk, expected_status,
19238
 
                      None, None, None, None, None, None,
 
18441
                      [], False,
19239
18442
                      wc_dir, '-r', '2',
19240
18443
                      '--config-option',
19241
18444
                      'config:miscellany:preserved-conflict-file-exts=' +
19256
18459
    'file.txt.merge-right.r2': Item(contents="This is the initial content\n"),
19257
18460
    'file.txt'               : Item(contents="<<<<<<< .working\n" \
19258
18461
                                    "This is conflicting content\n" \
 
18462
                                    "||||||| .merge-left.r3\n" \
 
18463
                                    "This is the new content\n" \
19259
18464
                                    "=======\n" \
19260
18465
                                    "This is the initial content\n" \
19261
18466
                                    ">>>>>>> .merge-right.r2\n"),
19262
18467
    'file.txt.working'       : Item(contents="This is conflicting content\n"),
19263
18468
  })
19264
18469
 
19265
 
  svntest.actions.run_and_verify_svn(wc_dir, None, [],
 
18470
  svntest.actions.run_and_verify_svn(None, [],
19266
18471
                                     'merge', '-c-3', '^/', sbox.ospath(''))
19267
18472
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
19268
18473
  svntest.actions.verify_disk(wc_dir, expected_disk)
19281
18486
    'file.txt.merge-right.r2.txt': Item(contents="This is the initial content\n"),
19282
18487
    'file.txt'                   : Item(contents="<<<<<<< .working.txt\n" \
19283
18488
                                        "This is conflicting content\n" \
 
18489
                                        "||||||| .merge-left.r3.txt\n" \
 
18490
                                        "This is the new content\n" \
19284
18491
                                        "=======\n" \
19285
18492
                                        "This is the initial content\n" \
19286
18493
                                        ">>>>>>> .merge-right.r2.txt\n"),
19288
18495
  })
19289
18496
 
19290
18497
  svntest.actions.run_and_verify_svn(
19291
 
                           wc_dir, None, [],
 
18498
                           None, [],
19292
18499
                           'merge', '-c-3', '^/', sbox.ospath(''),
19293
18500
                           '--config-option',
19294
18501
                           'config:miscellany:preserved-conflict-file-exts=' +
19296
18503
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
19297
18504
  svntest.actions.verify_disk(wc_dir, expected_disk)
19298
18505
 
 
18506
def merge_dir_delete_force(sbox):
 
18507
  "merge a directory delete with --force"
 
18508
 
 
18509
  sbox.build()
 
18510
 
 
18511
  sbox.simple_rm('A/D/G')
 
18512
  sbox.simple_commit() # r2
 
18513
 
 
18514
  sbox.simple_update(revision=1)
 
18515
 
 
18516
  # Just merging r2 on r1 succeeds
 
18517
  svntest.actions.run_and_verify_svn(None, [],
 
18518
                                     'merge', '-c2', '^/', sbox.wc_dir,
 
18519
                                     '--ignore-ancestry')
 
18520
 
 
18521
  # Bring working copy to r1 again
 
18522
  svntest.actions.run_and_verify_svn(None, [],
 
18523
                                     'revert', '-R', sbox.wc_dir)
 
18524
 
 
18525
  # But when using --force this same merge caused a segfault in 1.8.0-1.8.8
 
18526
  svntest.actions.run_and_verify_svn(None, [],
 
18527
                                     'merge', '-c2', '^/', sbox.wc_dir,
 
18528
                                     '--ignore-ancestry', '--force')
 
18529
 
19299
18530
########################################################################
19300
18531
# Run the tests
19301
18532
 
19441
18672
              single_editor_drive_merge_notifications,
19442
18673
              conflicted_split_merge_with_resolve,
19443
18674
              merge_to_empty_target_merge_to_infinite_target,
 
18675
              conflict_naming,
19444
18676
              merge_dir_delete_force,
19445
 
              conflict_naming,
19446
18677
             ]
19447
18678
 
19448
18679
if __name__ == '__main__':