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

« back to all changes in this revision

Viewing changes to subversion/tests/cmdline/update_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:
34
34
# Our testing module
35
35
import svntest
36
36
from svntest import wc, actions, verify, deeptrees
37
 
from merge_tests import expected_merge_output
38
 
from merge_tests import set_up_branch
 
37
from svntest.mergetrees import expected_merge_output
 
38
from svntest.mergetrees import set_up_branch
39
39
 
40
40
# (abbreviation)
41
41
Skip = svntest.testcase.Skip_deco
55
55
#   Each test must return on success or raise on failure.
56
56
 
57
57
 
58
 
#----------------------------------------------------------------------
59
 
 
60
 
# Helper for update_binary_file() test -- a custom singleton handler.
61
 
def detect_extra_files(node, extra_files):
62
 
  """NODE has been discovered as an extra file on disk.  Verify that
63
 
  it matches one of the regular expressions in the EXTRA_FILES list of
64
 
  lists, and that its contents matches the second part of the list
65
 
  item.  If it matches, remove the match from the list.  If it doesn't
66
 
  match, raise an exception."""
67
 
 
68
 
  # Baton is of the form:
69
 
  #
70
 
  #       [ [wc_dir, pattern, contents],
71
 
  #         [wc_dir, pattern, contents], ... ]
72
 
 
73
 
  for fdata in extra_files:
74
 
    wc_dir = fdata[0]
75
 
    pattern = fdata[1]
76
 
    contents = None
77
 
    if len(fdata) > 2:
78
 
      contents = fdata[2]
79
 
    match_obj = re.match(pattern, node.name)
80
 
    if match_obj:
81
 
      if contents is None:
82
 
        return
83
 
      else:
84
 
        # Strip the root_node_name from node path
85
 
        # (svntest.tree.root_node_name, currently `__SVN_ROOT_NODE'),
86
 
        # since it doesn't really exist. Also strip the trailing "slash".
87
 
        real_path = node.path
88
 
        if real_path.startswith(svntest.tree.root_node_name):
89
 
          real_path = real_path[len(svntest.tree.root_node_name) +
90
 
                                len(os.sep) :]
91
 
        real_path = os.path.join(wc_dir, real_path)
92
 
 
93
 
        real_contents = open(real_path).read()
94
 
        if real_contents == contents:
95
 
          extra_files.pop(extra_files.index(fdata)) # delete pattern from list
96
 
          return
97
 
 
98
 
  logger.warn("Found unexpected object: %s", node.name)
99
 
  raise svntest.tree.SVNTreeUnequal
100
 
 
101
 
 
102
58
 
103
59
def update_binary_file(sbox):
104
60
  "update a locally-modified binary file"
127
83
 
128
84
  # Commit the new binary file, creating revision 2.
129
85
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
130
 
                                        expected_status, None, wc_dir)
 
86
                                        expected_status)
131
87
 
132
88
  # Make a backup copy of the working copy.
133
89
  wc_backup = sbox.add_wc_path('backup')
151
107
 
152
108
  # Commit original working copy again, creating revision 3.
153
109
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
154
 
                                        expected_status, None, wc_dir)
 
110
                                        expected_status)
155
111
 
156
112
  # Now start working in the backup working copy:
157
113
 
178
134
    'A/theta' : Item(status='C ', wc_rev=3),
179
135
    })
180
136
 
181
 
  # Extra 'singleton' files we expect to exist after the update.
182
 
  # In the case, the locally-modified binary file should be backed up
183
 
  # to an .orig file.
184
 
  #  This is a list of lists, of the form [ WC_DIR,
185
 
  #                                         [pattern, contents], ...]
186
 
  extra_files = [[wc_backup, 'theta.*\.r2', theta_contents],
187
 
                 [wc_backup, 'theta.*\.r3', theta_contents_r3]]
 
137
  extra_files = ['theta.r2', 'theta.r3']
188
138
 
189
139
  # Do the update and check the results in three ways.  Pass our
190
140
  # custom singleton handler to verify the .orig file; this handler
194
144
                                        expected_output,
195
145
                                        expected_disk,
196
146
                                        expected_status,
197
 
                                        None,
198
 
                                        detect_extra_files, extra_files,
199
 
                                        None, None, 1)
200
 
 
201
 
  # verify that the extra_files list is now empty.
202
 
  if len(extra_files) != 0:
203
 
    logger.warn("Not all extra reject files have been accounted for:")
204
 
    logger.warn(extra_files)
205
 
    raise svntest.Failure
 
147
                                        [], True,
 
148
                                        extra_files=extra_files)
206
149
 
207
150
#----------------------------------------------------------------------
208
151
 
249
192
 
250
193
  # Commit the new binary filea, creating revision 2.
251
194
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
252
 
                                        expected_status, None, wc_dir)
 
195
                                        expected_status)
253
196
 
254
197
  # Make some mods to the binary files.
255
198
  svntest.main.file_append(theta_path, "foobar")
272
215
 
273
216
  # Commit original working copy again, creating revision 3.
274
217
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
275
 
                                        expected_status, None, wc_dir)
 
218
                                        expected_status)
276
219
 
277
220
  # Create expected output tree for an update to rev 2.
278
221
  expected_output = svntest.wc.State(wc_dir, {
303
246
                                        expected_output,
304
247
                                        expected_disk,
305
248
                                        expected_status,
306
 
                                        None, None, None,
307
 
                                        None, None, 1,
 
249
                                        [], True,
308
250
                                        '-r', '2', wc_dir)
309
251
 
310
252
 
340
282
 
341
283
  # Commit the new binary file, creating revision 2.
342
284
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
343
 
                                        expected_status, None, wc_dir)
 
285
                                        expected_status)
344
286
 
345
287
  # Make some mods to the binary files.
346
288
  svntest.main.file_append(theta_path, "foobar")
359
301
 
360
302
  # Commit modified working copy, creating revision 3.
361
303
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
362
 
                                        expected_status, None, wc_dir)
 
304
                                        expected_status)
363
305
 
364
306
  # Now we locally modify the file back to the old version.
365
307
  svntest.main.file_write(theta_path, theta_contents, 'wb')
389
331
                                        expected_output,
390
332
                                        expected_disk,
391
333
                                        expected_status,
392
 
                                        None, None, None,
393
 
                                        None, None, 1,
 
334
                                        [], True,
394
335
                                        '-r', '2', wc_dir)
395
336
 
396
337
#----------------------------------------------------------------------
443
384
                                        expected_output,
444
385
                                        expected_disk,
445
386
                                        expected_status,
446
 
                                        None, None, None, None, None, 0,
 
387
                                        [], False,
447
388
                                        mu_path, rho_path,
448
389
                                        E_path, H_path)
449
390
 
531
472
  svntest.actions.run_and_verify_update(wc_dir,
532
473
                                        expected_output,
533
474
                                        expected_disk,
534
 
                                        None, None,
535
 
                                        None, None, None, None, 0,
 
475
                                        None, [], False,
536
476
                                        '-r', '0', wc_dir)
537
477
 
538
478
#----------------------------------------------------------------------
581
521
 
582
522
  # Commit the change, creating revision 2.
583
523
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
584
 
                                        expected_status, None, wc_dir)
 
524
                                        expected_status)
585
525
 
586
526
  # Expected output tree for update of other_wc.
587
527
  expected_output = svntest.wc.State(other_wc, {
644
584
 
645
585
  # Commit.
646
586
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
647
 
                                        expected_status, None, wc_dir)
 
587
                                        expected_status)
648
588
 
649
589
  # Create expected output tree for an update of the wc_backup.
650
590
  expected_output = svntest.wc.State(wc_backup, {
658
598
                      contents="\n".join(["This is the file 'mu'.",
659
599
                                          "<<<<<<< .mine",
660
600
                                          "Conflicting appended text for mu",
 
601
                                          "||||||| .r1",
661
602
                                          "=======",
662
603
                                          "Original appended text for mu",
663
604
                                          ">>>>>>> .r2",
666
607
                      contents="\n".join(["This is the file 'rho'.",
667
608
                                          "<<<<<<< .mine",
668
609
                                          "Conflicting appended text for rho",
 
610
                                          "||||||| .r1",
669
611
                                          "=======",
670
612
                                          "Original appended text for rho",
671
613
                                          ">>>>>>> .r2",
687
629
                                        expected_output,
688
630
                                        expected_disk,
689
631
                                        expected_status,
690
 
                                        None,
691
 
                                        svntest.tree.detect_conflict_files,
692
 
                                        extra_files)
693
 
 
694
 
 
695
 
  # verify that the extra_files list is now empty.
696
 
  if len(extra_files) != 0:
697
 
    logger.warn("didn't get expected extra files")
698
 
    raise svntest.Failure
 
632
                                        extra_files=extra_files)
699
633
 
700
634
  # remove the conflicting files to clear text conflict but not props conflict
701
635
  os.remove(mu_path_backup)
726
660
 
727
661
  # Delete a file
728
662
  alpha_path = sbox.ospath('A/B/E/alpha')
729
 
  svntest.actions.run_and_verify_svn("Deleting alpha failed", None, [],
 
663
  svntest.actions.run_and_verify_svn(None, [],
730
664
                                     'rm', alpha_path)
731
665
 
732
666
  # Delete a directory containing files
733
667
  G_path = sbox.ospath('A/D/G')
734
 
  svntest.actions.run_and_verify_svn("Deleting G failed", None, [],
 
668
  svntest.actions.run_and_verify_svn(None, [],
735
669
                                     'rm', G_path)
736
670
 
737
671
  # Commit
738
 
  svntest.actions.run_and_verify_svn("Committing deletes failed", None, [],
 
672
  svntest.actions.run_and_verify_svn(None, [],
739
673
                                     'ci', '-m', 'log msg', wc_dir)
740
674
 
741
675
  ### Update before backdating to avoid obstructed update error for G
742
 
  svntest.actions.run_and_verify_svn("Updating after commit failed", None, [],
 
676
  svntest.actions.run_and_verify_svn(None, [],
743
677
                                     'up', wc_dir)
744
678
 
745
679
  # Backdate to restore deleted items
746
 
  svntest.actions.run_and_verify_svn("Backdating failed", None, [],
 
680
  svntest.actions.run_and_verify_svn(None, [],
747
681
                                     'up', '-r', '1', wc_dir)
748
682
 
749
683
  # Modify the file to be deleted, and a file in the directory to be deleted
807
741
  # Delete a file and directory from WC
808
742
  alpha_path = sbox.ospath('A/B/E/alpha')
809
743
  F_path = sbox.ospath('A/B/F')
810
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', alpha_path, F_path)
 
744
  svntest.actions.run_and_verify_svn(None, [], 'rm', alpha_path, F_path)
811
745
 
812
746
  # Commit deletion
813
747
  expected_output = svntest.wc.State(wc_dir, {
820
754
  expected_status.remove('A/B/F')
821
755
 
822
756
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
823
 
                                        expected_status, None, wc_dir)
 
757
                                        expected_status)
824
758
 
825
759
  # alpha and F are now in state "deleted", next we add a new ones
826
760
  svntest.main.file_append(alpha_path, "new alpha")
827
 
  svntest.actions.run_and_verify_svn(None, None, [], 'add', alpha_path)
 
761
  svntest.actions.run_and_verify_svn(None, [], 'add', alpha_path)
828
762
 
829
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', F_path)
 
763
  svntest.actions.run_and_verify_svn(None, [], 'mkdir', F_path)
830
764
 
831
765
  # New alpha and F should be in add state A
832
766
  expected_status.add({
838
772
 
839
773
  # Forced removal of new alpha and F must restore "deleted" state
840
774
 
841
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', '--force',
 
775
  svntest.actions.run_and_verify_svn(None, [], 'rm', '--force',
842
776
                                     alpha_path, F_path)
843
777
  if os.path.exists(alpha_path) or os.path.exists(F_path):
844
778
    raise svntest.Failure
850
784
 
851
785
  # Although parent dir is already at rev 1, the "deleted" state will cause
852
786
  # alpha and F to be restored in the WC when updated to rev 1
853
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', '-r', '1', wc_dir)
 
787
  svntest.actions.run_and_verify_svn(None, [], 'up', '-r', '1', wc_dir)
854
788
 
855
789
  expected_status.add({
856
790
    'A/B/E/alpha' : Item(status='  ', wc_rev=1),
874
808
 
875
809
  # Create a new dir in the repo in prep for creating an obstruction.
876
810
  #print "Adding dir to repo"
877
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
811
  svntest.actions.run_and_verify_svn(None, [],
878
812
                                     'mkdir', '-m',
879
813
                                     'prep for obstruction',
880
814
                                     sbox.repo_url + '/A/foo')
905
839
  })
906
840
 
907
841
  actions.run_and_verify_update(wc_dir, expected_output, expected_disk,
908
 
    expected_status, None, None, None, None, None, False, wc_dir)
 
842
                                expected_status)
909
843
 
910
844
 
911
845
  # Remove the file which caused the obstruction.
949
883
 
950
884
  # Delete a directory
951
885
  F_path = sbox.ospath('A/B/F')
952
 
  svntest.actions.run_and_verify_svn(None, None, [], 'rm', F_path)
 
886
  svntest.actions.run_and_verify_svn(None, [], 'rm', F_path)
953
887
 
954
888
  # Commit deletion
955
889
  expected_output = svntest.wc.State(wc_dir, {
960
894
  expected_status.remove('A/B/F')
961
895
 
962
896
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
963
 
                                        expected_status, None, wc_dir)
 
897
                                        expected_status)
964
898
 
965
899
  # Add replacement directory
966
 
  svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', F_path)
 
900
  svntest.actions.run_and_verify_svn(None, [], 'mkdir', F_path)
967
901
 
968
902
  # Commit addition
969
903
  expected_output = svntest.wc.State(wc_dir, {
974
908
  expected_status.tweak('A/B/F', wc_rev=3)
975
909
 
976
910
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
977
 
                                        expected_status, None, wc_dir)
 
911
                                        expected_status)
978
912
 
979
913
  # Update to HEAD
980
914
  expected_output = svntest.wc.State(wc_dir, {
998
932
                                        expected_output,
999
933
                                        expected_disk,
1000
934
                                        expected_status,
1001
 
                                        None, None, None, None, None, 0,
 
935
                                        [], False,
1002
936
                                        '-r', '1', wc_dir)
1003
937
 
1004
938
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
1028
962
  expected_status.tweak('A/mu', wc_rev=2)
1029
963
 
1030
964
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1031
 
                                        expected_status, None, wc_dir)
 
965
                                        expected_status)
1032
966
 
1033
967
  # At one stage 'svn up file' failed with a parent lock error
1034
968
  was_cwd = os.getcwd()
1035
969
  os.chdir(sbox.ospath('A'))
1036
970
 
1037
971
  ### Can't get run_and_verify_update to work having done the chdir.
1038
 
  svntest.actions.run_and_verify_svn("update failed", None, [],
 
972
  svntest.actions.run_and_verify_svn(None, [],
1039
973
                                     'up', '-r', '1', 'mu')
1040
974
  os.chdir(was_cwd)
1041
975
 
1071
1005
 
1072
1006
  # Commit the change, creating revision 2.
1073
1007
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1074
 
                                        expected_status, None, wc_dir)
 
1008
                                        expected_status)
1075
1009
 
1076
1010
  svntest.main.run_svn(None, 'rm', other_iota_path)
1077
1011
 
1109
1043
                 + '/A/D/G/' + svntest.main.get_admin_name())
1110
1044
  # Ha!  The client doesn't allow us to mkdir a '.svn' but it does
1111
1045
  # allow us to copy to a '.svn' so ...
1112
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1046
  svntest.actions.run_and_verify_svn(None, [],
1113
1047
                                     'mkdir', '-m', 'log msg',
1114
1048
                                     legal_url)
1115
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1049
  svntest.actions.run_and_verify_svn(None, [],
1116
1050
                                     'mv', '-m', 'log msg',
1117
1051
                                     legal_url, illegal_url)
1118
1052
 
1184
1118
                                        expected_output,
1185
1119
                                        expected_disk,
1186
1120
                                        expected_status,
1187
 
                                        None, None, None, None, None,
1188
 
                                        0, "-r", "2", E_path, H_path)
 
1121
                                        [], False,
 
1122
                                        "-r", "2", E_path, H_path)
1189
1123
 
1190
1124
  # Update back to the old revision again
1191
1125
  svntest.main.run_svn(None,
1205
1139
                                        expected_output,
1206
1140
                                        expected_disk,
1207
1141
                                        expected_status,
1208
 
                                        None, None, None, None, None,
1209
 
                                        0, "-r", "2", wc_dir)
 
1142
                                        [], False,
 
1143
                                        "-r", "2", wc_dir)
1210
1144
 
1211
1145
#----------------------------------------------------------------------
1212
1146
 
1231
1165
 
1232
1166
  svntest.actions.run_and_verify_commit(wc_dir,
1233
1167
                                        expected_output,
1234
 
                                        expected_status,
1235
 
                                        None, wc_dir)
 
1168
                                        expected_status)
1236
1169
 
1237
1170
  # Delete directory G from the repository
1238
 
  svntest.actions.run_and_verify_svn(None,
1239
 
                                     ['\n', 'Committed revision 3.\n'], [],
 
1171
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
1172
                                      'Committed revision 3.\n'], [],
1240
1173
                                     'rm', '-m', 'log msg',
1241
1174
                                     sbox.repo_url + '/A/D/G')
1242
1175
 
1259
1192
  # Sigh, I can't get run_and_verify_update to work (but not because
1260
1193
  # of issue 919 as far as I can tell)
1261
1194
  expected_output = svntest.verify.UnorderedOutput(expected_output)
1262
 
  svntest.actions.run_and_verify_svn(None,
1263
 
                                     expected_output, [],
 
1195
  svntest.actions.run_and_verify_svn(expected_output, [],
1264
1196
                                     'up', G_path)
1265
1197
 
1266
1198
  # Both G and gamma should be 'deleted', update should produce no output
1299
1231
 
1300
1232
  svntest.actions.run_and_verify_commit(wc_dir,
1301
1233
                                        expected_output,
1302
 
                                        expected_status,
1303
 
                                        None, wc_dir)
 
1234
                                        expected_status)
1304
1235
 
1305
1236
  # Explicit update must not remove the 'deleted=true' entries
1306
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(2), [],
 
1237
  svntest.actions.run_and_verify_svn(exp_noop_up_out(2), [],
1307
1238
                                     'update', gamma_path)
1308
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(2), [],
 
1239
  svntest.actions.run_and_verify_svn(exp_noop_up_out(2), [],
1309
1240
                                     'update', F_path)
1310
1241
 
1311
1242
  # Update to r1 to restore items, since the parent directory is already
1323
1254
                                        expected_output,
1324
1255
                                        expected_disk,
1325
1256
                                        expected_status,
1326
 
                                        None, None, None, None, None, 0,
 
1257
                                        [], False,
1327
1258
                                        '-r', '1', wc_dir)
1328
1259
 
1329
1260
 
1337
1268
  wc_dir = sbox.wc_dir
1338
1269
 
1339
1270
  # Create a new directory ("spacey dir") directly in repository
1340
 
  svntest.actions.run_and_verify_svn(None,
1341
 
                                     ['\n', 'Committed revision 2.\n'], [],
 
1271
  svntest.actions.run_and_verify_svn(['Committing transaction...\n',
 
1272
                                      'Committed revision 2.\n'], [],
1342
1273
                                     'mkdir', '-m', 'log msg',
1343
1274
                                     sbox.repo_url
1344
1275
                                     + '/A/spacey%20dir')
1387
1318
  expected_status.tweak('A/mu', 'A/D/G/rho', wc_rev=2)
1388
1319
 
1389
1320
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1390
 
                                        expected_status,
1391
 
                                        None, wc_dir)
 
1321
                                        expected_status)
1392
1322
 
1393
1323
  # Update back to revision 1
1394
1324
  expected_output = svntest.wc.State(wc_dir, {
1402
1332
 
1403
1333
  svntest.actions.run_and_verify_update(wc_dir, expected_output,
1404
1334
                                        expected_disk, expected_status,
1405
 
                                        None, None, None, None, None, 0,
 
1335
                                        [], False,
1406
1336
                                        '-r', '1', wc_dir)
1407
1337
 
1408
1338
  # Non-recursive update of A should change A/mu but not A/D/G/rho
1418
1348
 
1419
1349
  svntest.actions.run_and_verify_update(wc_dir, expected_output,
1420
1350
                                        expected_disk, expected_status,
1421
 
                                        None, None, None, None, None, 0,
 
1351
                                        [], False,
1422
1352
                                        '-N', A_path)
1423
1353
 
1424
1354
#----------------------------------------------------------------------
1433
1363
  C_url = sbox.repo_url + '/A/C'
1434
1364
 
1435
1365
  svntest.main.safe_rmtree(wc_dir)
1436
 
  svntest.actions.run_and_verify_svn(None, None, [], 'checkout', C_url, wc_dir)
 
1366
  svntest.actions.run_and_verify_svn(None, [], 'checkout', C_url, wc_dir)
1437
1367
 
1438
 
  svntest.actions.run_and_verify_svn(None, [], [], 'status', wc_dir)
 
1368
  svntest.actions.run_and_verify_svn([], [], 'status', wc_dir)
1439
1369
 
1440
1370
 
1441
1371
#----------------------------------------------------------------------
1463
1393
  svntest.actions.run_and_verify_update(wc_dir,
1464
1394
                                        expected_output,
1465
1395
                                        expected_disk,
1466
 
                                        None, None,
1467
 
                                        None, None, None, None, 0,
 
1396
                                        None,
 
1397
                                        [], False,
1468
1398
                                        '-r', '0', iota_path)
1469
1399
 
1470
1400
  # Update the wc root, so iota comes back.
1477
1407
  svntest.actions.run_and_verify_update(wc_dir,
1478
1408
                                        expected_output,
1479
1409
                                        expected_disk,
1480
 
                                        None, None,
1481
 
                                        None, None, None, None, 0,
1482
 
                                        wc_dir)
 
1410
                                        None)
1483
1411
 
1484
1412
 
1485
1413
#----------------------------------------------------------------------
1494
1422
  child_path = os.path.join(parent_path, 'E')  # Could be a file, doesn't matter
1495
1423
 
1496
1424
  # Delete the parent directory.
1497
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1425
  svntest.actions.run_and_verify_svn(None, [],
1498
1426
                                     'rm', parent_path)
1499
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1427
  svntest.actions.run_and_verify_svn(None, [],
1500
1428
                                     'ci', '-m', '', wc_dir)
1501
1429
 
1502
1430
  # Update back to r1.
1503
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1431
  svntest.actions.run_and_verify_svn(None, [],
1504
1432
                                     'update', '-r', '1', wc_dir)
1505
1433
 
1506
1434
  # Update just the child to r2.
1507
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1435
  svntest.actions.run_and_verify_svn(None, [],
1508
1436
                                     'update', '-r', '2', child_path)
1509
1437
 
1510
1438
  # Now try a normal update.
1535
1463
  # Delete directory A/D/G in the repository via immediate commit
1536
1464
  G_path = sbox.ospath('A/D/G')
1537
1465
  G_url = sbox.repo_url + '/A/D/G'
1538
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1466
  svntest.actions.run_and_verify_svn(None, [],
1539
1467
                                     'rm', G_url, '-m', 'rev 2')
1540
1468
 
1541
1469
  # Update the wc to HEAD (r2)
1557
1485
  # Do a URL->wc copy, creating a new schedule-add A/D/G.
1558
1486
  # (Standard procedure when trying to resurrect the directory.)
1559
1487
  D_path = sbox.ospath('A/D')
1560
 
  svntest.actions.run_and_verify_svn("Copy error:", None, [],
 
1488
  svntest.actions.run_and_verify_svn(None, [],
1561
1489
                                     'cp', G_url + '@1', D_path)
1562
1490
 
1563
1491
  # status should now show the dir scheduled for addition-with-history
1571
1499
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
1572
1500
 
1573
1501
  # Now update with the schedule-add dir as the target.
1574
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', G_path)
 
1502
  svntest.actions.run_and_verify_svn(None, [], 'up', G_path)
1575
1503
 
1576
1504
  # The update should be a no-op, and the schedule-add directory
1577
1505
  # should still exist!  'svn status' shouldn't change at all.
1602
1530
  svntest.actions.run_and_verify_update(wc_dir,
1603
1531
                                        expected_output,
1604
1532
                                        expected_disk,
1605
 
                                        None, None,
1606
 
                                        None, None, None, None, 0,
 
1533
                                        None,
 
1534
                                        [], False,
1607
1535
                                        '-r', '0', wc_dir)
1608
1536
 
1609
1537
  # Update iota to the current HEAD.
1620
1548
  svntest.actions.run_and_verify_update(wc_dir,
1621
1549
                                        expected_output,
1622
1550
                                        expected_disk,
1623
 
                                        None, None,
1624
 
                                        None, None, None, None, 0,
 
1551
                                        None,
 
1552
                                        [], False,
1625
1553
                                        iota_path)
1626
1554
 
1627
1555
  # Now try updating the directory into the future
1654
1582
  svntest.actions.run_and_verify_update(wc_dir,
1655
1583
                                        expected_output,
1656
1584
                                        expected_disk,
1657
 
                                        None, None,
1658
 
                                        None, None, None, None, 0,
 
1585
                                        None,
 
1586
                                        [], False,
1659
1587
                                        A_path)
1660
1588
 
1661
1589
#----------------------------------------------------------------------
1688
1616
 
1689
1617
  # Commit.
1690
1618
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1691
 
                                        expected_status, None, wc_dir)
 
1619
                                        expected_status)
1692
1620
 
1693
1621
  # chdir into the funky path, and update from there.
1694
1622
  os.chdir(test_path)
1731
1659
 
1732
1660
  # Checkout a second working copy
1733
1661
  wc_backup = sbox.add_wc_path('backup')
1734
 
  svntest.actions.run_and_verify_svn(None, None, [], 'checkout',
 
1662
  svntest.actions.run_and_verify_svn(None, [], 'checkout',
1735
1663
                                     sbox.repo_url, wc_backup)
1736
1664
 
1737
1665
  # set starting revision
1766
1694
 
1767
1695
    # Commit the original change and note the 'base' revision number
1768
1696
    svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1769
 
                                          expected_status, None, wc_dir)
 
1697
                                          expected_status)
1770
1698
    cur_rev = cur_rev + 1
1771
1699
    base_rev = cur_rev
1772
1700
 
1798
1726
    'A/mu' : Item(contents= "This is the file 'mu'." + eolchar +
1799
1727
      "<<<<<<< .mine" + eolchar +
1800
1728
      "Conflicting appended text for mu" + eolchar +
 
1729
      "||||||| .r" + str(cur_rev - 1) + eolchar +
1801
1730
      "=======" + eolchar +
1802
1731
      "Original appended text for mu" + eolchar +
1803
1732
      ">>>>>>> .r" + str(cur_rev) + eolchar),
1831
1760
    svntest.actions.run_and_verify_update(wc_backup,
1832
1761
                                          expected_backup_output,
1833
1762
                                          expected_backup_disk,
1834
 
                                          expected_backup_status,
1835
 
                                          None,
1836
 
                                          None,
1837
 
                                          None)
 
1763
                                          expected_backup_status)
1838
1764
 
1839
1765
    # cleanup for next run
1840
1766
    svntest.main.run_svn(None, 'revert', '-R', wc_backup)
1864
1790
 
1865
1791
  # Checkout a second working copy
1866
1792
  wc_backup = sbox.add_wc_path('backup')
1867
 
  svntest.actions.run_and_verify_svn(None, None, [], 'checkout',
 
1793
  svntest.actions.run_and_verify_svn(None, [], 'checkout',
1868
1794
                                     sbox.repo_url, wc_backup)
1869
1795
  path_backup = os.path.join(wc_backup, 'A', 'mu')
1870
1796
 
1891
1817
  svntest.actions.run_and_verify_update(wc_backup,
1892
1818
                                        expected_backup_output,
1893
1819
                                        expected_backup_disk,
1894
 
                                        expected_backup_status,
1895
 
                                        None, None, None)
 
1820
                                        expected_backup_status)
1896
1821
 
1897
1822
  # Test 2: now change the eol-style property to another value and commit,
1898
1823
  # update the still changed mu in the second working copy; there should be
1917
1842
  svntest.actions.run_and_verify_update(wc_backup,
1918
1843
                                        expected_backup_output,
1919
1844
                                        expected_backup_disk,
1920
 
                                        expected_backup_status,
1921
 
                                        None, None, None)
 
1845
                                        expected_backup_status)
1922
1846
 
1923
1847
  # Test 3: now delete the eol-style property and commit, update the still
1924
1848
  # changed mu in the second working copy; there should be no conflict!
1942
1866
  svntest.actions.run_and_verify_update(wc_backup,
1943
1867
                                        expected_backup_output,
1944
1868
                                        expected_backup_disk,
1945
 
                                        expected_backup_status,
1946
 
                                        None, None, None)
 
1869
                                        expected_backup_status)
1947
1870
 
1948
1871
# Bug in which "update" put a bogus revision number on a schedule-add file,
1949
1872
# causing the wrong version of it to be committed.
1961
1884
  url2 = sbox.repo_url + '/A2/mu'
1962
1885
 
1963
1886
  # Remember the original text of the file
1964
 
  exit_code, text_r1, err = svntest.actions.run_and_verify_svn(None, None, [],
 
1887
  exit_code, text_r1, err = svntest.actions.run_and_verify_svn(None, [],
1965
1888
                                                               'cat', '-r1',
1966
1889
                                                               url)
1967
1890
 
1968
1891
  # Commit a different version of the file
1969
1892
  svntest.main.file_write(file, "Second revision of 'mu'\n")
1970
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1893
  svntest.actions.run_and_verify_svn(None, [],
1971
1894
                                     'ci', '-m', '', wc_dir)
1972
1895
 
1973
1896
  # Copy an old revision of its directory into a new path in the WC
1974
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1897
  svntest.actions.run_and_verify_svn(None, [],
1975
1898
                                     'cp', '-r1', dir, dir2)
1976
1899
 
1977
1900
  # Update.  (Should do nothing, but added a bogus "revision" in "entries".)
1978
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
1901
  svntest.actions.run_and_verify_svn(None, [],
1979
1902
                                     'up', wc_dir)
1980
1903
 
1981
1904
  # Commit, and check that it says it's committing the right thing
1982
1905
  exp_out = ['Adding         ' + dir2 + '\n',
1983
 
             '\n',
 
1906
             'Committing transaction...\n',
1984
1907
             'Committed revision 3.\n']
1985
 
  svntest.actions.run_and_verify_svn(None, exp_out, [],
 
1908
  svntest.actions.run_and_verify_svn(exp_out, [],
1986
1909
                                     'ci', '-m', '', wc_dir)
1987
1910
 
1988
1911
  # Verify the committed file's content
1989
 
  svntest.actions.run_and_verify_svn(None, text_r1, [],
 
1912
  svntest.actions.run_and_verify_svn(text_r1, [],
1990
1913
                                     'cat', url2)
1991
1914
 
1992
1915
#----------------------------------------------------------------------
2049
1972
 
2050
1973
  # Commit.
2051
1974
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
2052
 
                                        expected_status, None, wc_dir)
 
1975
                                        expected_status)
2053
1976
 
2054
1977
  # Make a local mod to mu that will merge cleanly.
2055
1978
  backup_mu_path = os.path.join(wc_backup, 'A', 'mu')
2125
2048
                                        expected_output,
2126
2049
                                        expected_disk,
2127
2050
                                        expected_status,
2128
 
                                        None, None, None, None, None, 0,
 
2051
                                        [], False,
2129
2052
                                        wc_backup, '--force')
2130
2053
 
2131
2054
#----------------------------------------------------------------------
2164
2087
 
2165
2088
  # Commit.
2166
2089
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
2167
 
                                        expected_status, None, wc_dir)
 
2090
                                        expected_status)
2168
2091
 
2169
2092
  # Create an unversioned dir A/B/F/nu that will obstruct the file of the
2170
2093
  # same name coming from the repository.  Create an unversioned file A/C/I
2200
2123
  expected_status.tweak('A/B/F', wc_rev='2')
2201
2124
 
2202
2125
  actions.run_and_verify_update(wc_backup, expected_output,
2203
 
    expected_disk, expected_status, None, None, None, None, None, False,
2204
 
    '--force', backup_A_B_F)
 
2126
                                expected_disk, expected_status,
 
2127
                                [], False,
 
2128
                                '--force', backup_A_B_F)
2205
2129
 
2206
2130
 
2207
2131
  # A forced update that tries to add a directory when an unversioned file
2243
2167
  expected_status.tweak('A/C', 'A/B/F', wc_rev='2')
2244
2168
 
2245
2169
  actions.run_and_verify_update(wc_dir_backup, expected_output,
2246
 
    expected_disk, expected_status, None, None, None, None, None, False,
2247
 
    '--force', backup_A_C)
 
2170
                                expected_disk, expected_status,
 
2171
                                [], False,
 
2172
                                '--force', backup_A_C)
2248
2173
 
2249
2174
  # rm -rf wc_dir_backup/A/C/I wc_dir_backup/A/B/F/nu
2250
2175
  os.remove(backup_A_C_I)
2263
2188
  expected_status.tweak('A/C/I', 'A/B/F/nu', treeconflict=None)
2264
2189
 
2265
2190
  actions.run_and_verify_update(wc_dir_backup, expected_output,
2266
 
    expected_disk, expected_status, None, None, None, None, None, False,
2267
 
    wc_dir_backup)
 
2191
                                expected_disk, expected_status)
2268
2192
 
2269
2193
  # svn up -r1 wc_dir_backup/A/C
2270
2194
  expected_output = svntest.wc.State(wc_dir_backup, {
2277
2201
  expected_status.tweak('A/C', wc_rev='1')
2278
2202
 
2279
2203
  actions.run_and_verify_update(wc_dir_backup, expected_output,
2280
 
    expected_disk, expected_status, None, None, None, None, None, False,
2281
 
    '-r1', backup_A_C)
 
2204
                                expected_disk, expected_status,
 
2205
                                [], False,
 
2206
                                '-r1', backup_A_C)
2282
2207
 
2283
2208
  # svn co url/A/C/I wc_dir_backup/A/C/I
2284
2209
  expected_output = svntest.wc.State(wc_dir_backup, {})
2285
2210
 
2286
2211
  expected_disk = svntest.wc.State(wc_dir, {})
2287
2212
 
2288
 
  actions.run_and_verify_checkout2(False, url_A_C_I, backup_A_C_I,
2289
 
    expected_output, expected_disk, None, None, None, None)
 
2213
  actions.run_and_verify_checkout(url_A_C_I, backup_A_C_I,
 
2214
                                  expected_output, expected_disk)
2290
2215
 
2291
2216
  # svn up --force wc_dir_backup/A/C
2292
2217
  expected_output = svntest.wc.State(wc_dir_backup, {
2294
2219
  })
2295
2220
 
2296
2221
  actions.run_and_verify_update(wc_dir_backup, expected_output, None, None,
2297
 
    None, None, None, None, None, False, '--force', backup_A_C)
 
2222
                                [], False,
 
2223
                                '--force', backup_A_C)
2298
2224
 
2299
2225
 
2300
2226
#----------------------------------------------------------------------
2346
2272
  was_cwd = os.getcwd()
2347
2273
 
2348
2274
  try:
2349
 
    svntest.actions.run_and_verify_svn(None, None, [],
 
2275
    svntest.actions.run_and_verify_svn(None, [],
2350
2276
                                       'checkout',
2351
2277
                                       sbox.repo_url, wc_dir)
2352
2278
 
2370
2296
    })
2371
2297
 
2372
2298
    svntest.actions.run_and_verify_commit(wc_dir, expected_output,
2373
 
                                          expected_status, None,
 
2299
                                          expected_status, [],
2374
2300
                                          wc_dir, zeta_path)
2375
2301
 
2376
2302
    # Non recursive commit
2392
2318
      })
2393
2319
 
2394
2320
    svntest.actions.run_and_verify_commit(wc_dir, expected_output,
2395
 
                                          expected_status, None,
 
2321
                                          expected_status, [],
2396
2322
                                          '-N',
2397
2323
                                          wc_dir,
2398
2324
                                          dir1_path, file1_path)
2414
2340
                                          expected_output,
2415
2341
                                          expected_disk,
2416
2342
                                          expected_status,
2417
 
                                          None, None, None, None, None, 0,
 
2343
                                          [], False,
2418
2344
                                          '-r', '1', wc_dir)
2419
2345
 
2420
2346
    os.chdir(was_cwd)
2443
2369
    expected_disk.tweak('A/mu', contents = expected_disk.desc['A/mu'].contents
2444
2370
                        + '\nAppended text for mu')
2445
2371
 
2446
 
    # Use .old_tree() for status to avoid the entries validation
 
2372
    # Create expected status with 'H:iota' style paths
 
2373
    expected_status_relative = svntest.wc.State('', {})
 
2374
    expected_status_relative.add_state(wc_dir, expected_status, strict=True)
 
2375
 
2447
2376
    svntest.actions.run_and_verify_update(wc_dir,
2448
2377
                                          expected_output,
2449
2378
                                          expected_disk,
2450
 
                                          expected_status.old_tree())
 
2379
                                          expected_status_relative)
2451
2380
 
2452
2381
  finally:
2453
2382
    os.chdir(was_cwd)
2498
2427
  expected_disk = svntest.main.greek_state.copy()
2499
2428
  expected_disk.tweak('iota', contents="")
2500
2429
 
2501
 
  conflict_files = []
2502
 
 
2503
2430
  svntest.actions.run_and_verify_update(wc_dir,
2504
2431
                                        expected_output,
2505
2432
                                        expected_disk,
2506
 
                                        expected_status,
2507
 
                                        None,
2508
 
                                        svntest.tree.detect_conflict_files,
2509
 
                                        conflict_files)
 
2433
                                        expected_status)
2510
2434
 
2511
2435
  # Make us a working copy with a 'replace-with-history' file.
2512
2436
  svntest.main.run_svn(None, 'revert', iota_path)
2523
2447
                                        expected_output,
2524
2448
                                        expected_disk,
2525
2449
                                        expected_status,
2526
 
                                        None,
2527
 
                                        None, None, None, None, 0,
 
2450
                                        [], False,
2528
2451
                                        wc_dir, '-r1')
2529
2452
 
2530
2453
  svntest.main.run_svn(None, 'rm', iota_path)
2549
2472
  expected_disk = svntest.main.greek_state.copy()
2550
2473
  expected_disk.tweak('iota', contents="This is the file 'mu'.\n")
2551
2474
 
2552
 
  conflict_files = [ ]
2553
 
 
2554
2475
  svntest.actions.run_and_verify_update(wc_dir,
2555
2476
                                        expected_output,
2556
2477
                                        expected_disk,
2557
 
                                        expected_status,
2558
 
                                        None,
2559
 
                                        svntest.tree.detect_conflict_files,
2560
 
                                        conflict_files)
 
2478
                                        expected_status)
2561
2479
 
2562
2480
#----------------------------------------------------------------------
2563
2481
def update_with_obstructing_additions(sbox):
2670
2588
 
2671
2589
  # Commit.
2672
2590
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
2673
 
                                        expected_status, None, wc_dir)
 
2591
                                        expected_status)
2674
2592
 
2675
2593
  # Create various paths scheduled for addition which will obstruct
2676
2594
  # the adds coming from the repos.
2737
2655
    'A/D/H/I/J'     : Item(props={'propname1' : 'propval-WC'}),
2738
2656
    'A/D/H/I/J/eta' : Item("\n".join(["<<<<<<< .mine",
2739
2657
                                      "This is WC file 'eta'",
 
2658
                                      "||||||| .r0",
2740
2659
                                      "=======",
2741
2660
                                      "This is REPOS file 'eta'",
2742
2661
                                      ">>>>>>> .r2",
2746
2665
    'A/D/H/I/L'     : Item(),
2747
2666
    'A/D/kappa'     : Item("\n".join(["<<<<<<< .mine",
2748
2667
                                      "This is WC file 'kappa'",
 
2668
                                      "||||||| .r0",
2749
2669
                                      "=======",
2750
2670
                                      "This is REPOS file 'kappa'",
2751
2671
                                      ">>>>>>> .r2",
2753
2673
                           props={'propname1' : 'propval-WC'}),
2754
2674
    'A/D/epsilon'     : Item("\n".join(["<<<<<<< .mine",
2755
2675
                                        "This is WC file 'epsilon'",
 
2676
                                        "||||||| .r0",
2756
2677
                                        "=======",
2757
2678
                                        "This is REPOS file 'epsilon'",
2758
2679
                                        ">>>>>>> .r2",
2791
2712
                                        expected_output,
2792
2713
                                        expected_disk,
2793
2714
                                        expected_status,
2794
 
                                        None,
2795
 
                                        svntest.tree.detect_conflict_files,
2796
 
                                        extra_files, None, None, 1,
2797
 
                                        wc_backup)
 
2715
                                        [], True,
 
2716
                                        extra_files=extra_files)
2798
2717
 
2799
2718
  # Some obstructions are still not permitted:
2800
2719
  #
2804
2723
  # URL to URL copy of A/D/G to A/M.
2805
2724
  G_URL = sbox.repo_url + '/A/D/G'
2806
2725
  M_URL = sbox.repo_url + '/A/M'
2807
 
  svntest.actions.run_and_verify_svn("Copy error:", None, [],
 
2726
  svntest.actions.run_and_verify_svn(None, [],
2808
2727
                                     'cp', G_URL, M_URL, '-m', '')
2809
2728
 
2810
2729
  # WC to WC copy of A/D/H to A/M, M now scheduled for addition with
2813
2732
  A_path = sbox.ospath('A')
2814
2733
  M_path = sbox.ospath('A/M')
2815
2734
 
2816
 
  svntest.actions.run_and_verify_svn("Copy error:", None, [],
 
2735
  svntest.actions.run_and_verify_svn(None, [],
2817
2736
                                     'cp', H_path, M_path)
2818
2737
 
2819
2738
  # URL to URL copy of A/D/H/omega to omicron.
2820
2739
  omega_URL = sbox.repo_url + '/A/D/H/omega'
2821
2740
  omicron_URL = sbox.repo_url + '/omicron'
2822
 
  svntest.actions.run_and_verify_svn("Copy error:", None, [],
 
2741
  svntest.actions.run_and_verify_svn(None, [],
2823
2742
                                     'cp', omega_URL, omicron_URL,
2824
2743
                                     '-m', '')
2825
2744
 
2828
2747
  chi_path = sbox.ospath('A/D/H/chi')
2829
2748
  omicron_path = sbox.ospath('omicron')
2830
2749
 
2831
 
  svntest.actions.run_and_verify_svn("Copy error:", None, [],
 
2750
  svntest.actions.run_and_verify_svn(None, [],
2832
2751
                                     'cp', chi_path,
2833
2752
                                     omicron_path)
2834
2753
 
2903
2822
 
2904
2823
  svntest.actions.run_and_verify_update(wc_dir, expected_output,
2905
2824
                                        expected_disk, expected_status,
2906
 
                                        None, None, None, None, None, False,
 
2825
                                        [], False,
2907
2826
                                        A_path)
2908
2827
 
2909
2828
  # Resolve the tree conflict.
2922
2841
 
2923
2842
  svntest.actions.run_and_verify_update(wc_dir, expected_output,
2924
2843
                                        expected_disk, expected_status,
2925
 
                                        None, None, None, None, None, False,
 
2844
                                        [], False,
2926
2845
                                        wc_dir, '-N')
2927
2846
 
2928
2847
  # Resolve the tree conflict.
2935
2854
  # Again, --force shouldn't matter.
2936
2855
  svntest.actions.run_and_verify_update(wc_dir, expected_output,
2937
2856
                                        expected_disk, expected_status,
2938
 
                                        None, None, None, None, None, False,
 
2857
                                        [], False,
2939
2858
                                        omicron_path, '-N', '--force')
2940
2859
 
2941
2860
# Test for issue #2022: Update shouldn't touch conflicted files.
2971
2890
  expected_status.tweak('iota', 'A/mu', 'A/B/lambda', 'A/D', wc_rev=2)
2972
2891
 
2973
2892
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
2974
 
                                        expected_status, None, wc_dir)
 
2893
                                        expected_status)
2975
2894
 
2976
2895
  # Do another change to each path that we will need later.
2977
2896
  # Also, change a file below A/D in the path.
2990
2909
    'A/D/G/pi': Item(verb='Sending')})
2991
2910
 
2992
2911
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
2993
 
                                        expected_status, None, wc_dir)
 
2912
                                        expected_status)
2994
2913
 
2995
2914
  # Go back to revision 1.
2996
2915
  expected_output = svntest.wc.State(wc_dir, {
3009
2928
                                        expected_output,
3010
2929
                                        expected_disk,
3011
2930
                                        expected_status,
3012
 
                                        None,
3013
 
                                        None, None,
3014
 
                                        None, None, 1,
 
2931
                                        [], True,
3015
2932
                                        '-r1', wc_dir)
3016
2933
 
3017
2934
  # Create modifications conflicting with rev 2.
3033
2950
                      contents="\n".join(["This is the file 'iota'.",
3034
2951
                                          "<<<<<<< .mine",
3035
2952
                                          "Conflicting appended text for iota",
 
2953
                                          "||||||| .r1",
3036
2954
                                          "=======",
3037
2955
                                          "Original appended text for iota",
3038
2956
                                          ">>>>>>> .r2",
3041
2959
                      contents="\n".join(["This is the file 'mu'.",
3042
2960
                                          "<<<<<<< .mine",
3043
2961
                                          "Conflicting appended text for mu",
 
2962
                                          "||||||| .r1",
3044
2963
                                          "=======",
3045
2964
                                          "Original appended text for mu",
3046
2965
                                          ">>>>>>> .r2",
3053
2972
  expected_status.tweak('A/B/lambda', 'A/D', status=' C')
3054
2973
  expected_status.tweak('A/mu', status='CC')
3055
2974
 
3056
 
  extra_files = [ [wc_dir, 'iota.*\.(r1|r2|mine)'],
3057
 
                  [wc_dir, 'mu.*\.(r1|r2|mine|prej)'],
3058
 
                  [wc_dir, 'lambda.*\.prej'],
3059
 
                  [wc_dir, 'dir_conflicts.prej']]
 
2975
  extra_files = [ 'iota.r1', 'iota.r2', 'iota.mine',
 
2976
                  'mu.r1', 'mu.r2', 'mu.mine', 'mu.prej',
 
2977
                  'lambda.prej',
 
2978
                  'dir_conflicts.prej']
3060
2979
 
3061
2980
  svntest.actions.run_and_verify_update(wc_dir,
3062
2981
                                        expected_output,
3063
2982
                                        expected_disk,
3064
2983
                                        expected_status,
3065
 
                                        None,
3066
 
                                        detect_extra_files, extra_files,
3067
 
                                        None, None, 1,
3068
 
                                        '-r2', wc_dir)
 
2984
                                        [], True,
 
2985
                                        '-r2', wc_dir,
 
2986
                                        extra_files=extra_files+[])
3069
2987
 
3070
2988
  # Now, update to HEAD, which should skip all the conflicted files, but
3071
2989
  # still update the pi file.
3093
3011
                                        expected_output,
3094
3012
                                        expected_disk,
3095
3013
                                        expected_status,
3096
 
                                        None,
3097
 
                                        detect_extra_files, extra_files,
3098
 
                                        None, None, 1)
 
3014
                                        [], True,
 
3015
                                        extra_files=extra_files)
3099
3016
 
3100
3017
#----------------------------------------------------------------------
3101
3018
@SkipUnless(server_has_mergeinfo)
3128
3045
     "Checked out revision 1.\n",
3129
3046
     "A         " + B_COPY_path + "\n",
3130
3047
    ])
3131
 
  svntest.actions.run_and_verify_svn(None, expected_stdout, [], 'copy',
 
3048
  svntest.actions.run_and_verify_svn(expected_stdout, [], 'copy',
3132
3049
                                     sbox.repo_url + "/A/B", B_COPY_path)
3133
3050
 
3134
3051
  expected_output = wc.State(wc_dir, {'A/B_COPY' : Item(verb='Adding')})
3144
3061
 
3145
3062
  svntest.actions.run_and_verify_commit(wc_dir,
3146
3063
                                        expected_output,
3147
 
                                        expected_status,
3148
 
                                        None,
3149
 
                                        wc_dir)
 
3064
                                        expected_status)
3150
3065
 
3151
3066
  # Make some changes under A/B
3152
3067
 
3158
3073
  expected_status.tweak('A/B/E/beta', wc_rev=3)
3159
3074
 
3160
3075
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3161
 
                                        expected_status, None, wc_dir)
 
3076
                                        expected_status)
3162
3077
 
3163
3078
  # r4 - modify and commit A/B/lambda
3164
3079
  svntest.main.file_write(lambda_path, "New content")
3168
3083
  expected_status.tweak('A/B/lambda', wc_rev=4)
3169
3084
 
3170
3085
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3171
 
                                        expected_status, None, wc_dir)
 
3086
                                        expected_status)
3172
3087
 
3173
3088
  # r5 - modify and commit A/B/E/alpha
3174
3089
  svntest.main.file_write(alpha_path, "New content")
3178
3093
  expected_status.tweak('A/B/E/alpha', wc_rev=5)
3179
3094
 
3180
3095
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3181
 
                                        expected_status, None, wc_dir)
 
3096
                                        expected_status)
3182
3097
 
3183
3098
  # Merge r2:5 into A/B_COPY
3184
3099
  expected_output = wc.State(B_COPY_path, {
3222
3137
                                       expected_merge_disk,
3223
3138
                                       expected_merge_status,
3224
3139
                                       expected_skip,
3225
 
                                       None, None, None, None,
3226
 
                                       None, 1)
 
3140
                                       check_props=True)
3227
3141
 
3228
3142
  # r6 - Commit the merge
3229
3143
  expected_output = wc.State(wc_dir,
3238
3152
  expected_status.tweak('A/B_COPY/lambda',  wc_rev=6)
3239
3153
 
3240
3154
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3241
 
                                        expected_status, None, wc_dir)
 
3155
                                        expected_status)
3242
3156
 
3243
3157
  # Update WC back to r5, A/COPY_B is at it's pre-merge state again
3244
3158
  expected_output = wc.State(wc_dir,
3266
3180
                                        expected_output,
3267
3181
                                        expected_disk,
3268
3182
                                        expected_status,
3269
 
                                        None, None, None,
3270
 
                                        None, None, 1,
 
3183
                                        [], True,
3271
3184
                                        '-r', '5', wc_dir)
3272
3185
 
3273
3186
  # Merge r2:5 to A/B_COPY/E/alpha
3278
3191
 
3279
3192
  # run_and_verify_merge doesn't support merging to a file WCPATH
3280
3193
  # so use run_and_verify_svn.
3281
 
  svntest.actions.run_and_verify_svn(None,
3282
 
                                     expected_merge_output([[3,5]],
 
3194
  svntest.actions.run_and_verify_svn(expected_merge_output([[3,5]],
3283
3195
                                     ['U    ' + alpha_COPY_path + '\n',
3284
3196
                                      ' U   ' + alpha_COPY_path + '\n']),
3285
3197
                                     [], 'merge', '-r2:5',
3294
3206
  svntest.actions.run_and_verify_status(alpha_COPY_path,
3295
3207
                                        expected_alpha_status)
3296
3208
 
3297
 
  svntest.actions.run_and_verify_svn(None, ["/A/B/E/alpha:3-5\n"], [],
 
3209
  svntest.actions.run_and_verify_svn(["/A/B/E/alpha:3-5\n"], [],
3298
3210
                                     'propget', SVN_PROP_MERGEINFO,
3299
3211
                                     alpha_COPY_path)
3300
3212
 
3321
3233
                                        expected_output,
3322
3234
                                        expected_disk,
3323
3235
                                        expected_status,
3324
 
                                        None, None, None,
3325
 
                                        None, None, 1)
 
3236
                                        [], True)
3326
3237
 
3327
3238
  # Now test that an updated target's mergeinfo can itself elide.
3328
3239
  # r7 - modify and commit A/B/E/alpha
3333
3244
  expected_status.tweak('A/B/E/alpha', 'A/B_COPY/E/alpha', status='  ',
3334
3245
                        wc_rev=7)
3335
3246
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3336
 
                                        expected_status, None, wc_dir)
 
3247
                                        expected_status)
3337
3248
 
3338
3249
  # Update A to get all paths to the same working revision.
3339
 
  svntest.actions.run_and_verify_svn(None, exp_noop_up_out(7), [],
 
3250
  svntest.actions.run_and_verify_svn(exp_noop_up_out(7), [],
3340
3251
                                     'up', wc_dir)
3341
3252
 
3342
3253
  # Merge r6:7 into A/B_COPY/E
3375
3286
                                       expected_merge_disk,
3376
3287
                                       expected_merge_status,
3377
3288
                                       expected_skip,
3378
 
                                       None, None, None, None,
3379
 
                                       None, 1)
 
3289
                                       check_props=True)
3380
3290
 
3381
3291
  # r8 - Commit the merge
3382
 
  svntest.actions.run_and_verify_svn(None,
3383
 
                                     exp_noop_up_out(7),
 
3292
  svntest.actions.run_and_verify_svn(exp_noop_up_out(7),
3384
3293
                                     [], 'update', wc_dir)
3385
3294
 
3386
3295
  expected_output = wc.State(wc_dir,
3391
3300
  expected_status.tweak('A/B_COPY/E', 'A/B_COPY/E/alpha', wc_rev=8)
3392
3301
 
3393
3302
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3394
 
                                        expected_status, None, wc_dir)
 
3303
                                        expected_status)
3395
3304
 
3396
3305
  # Update A/COPY_B/E back to r7
3397
3306
  expected_output = wc.State(wc_dir, {
3410
3319
                                        expected_output,
3411
3320
                                        expected_disk,
3412
3321
                                        expected_status,
3413
 
                                        None, None, None,
3414
 
                                        None, None, 1,
 
3322
                                        [], True,
3415
3323
                                        '-r', '7', E_COPY_path)
3416
3324
 
3417
3325
  # Merge r6:7 to A/B_COPY
3456
3364
                                       expected_merge_disk,
3457
3365
                                       expected_merge_status,
3458
3366
                                       expected_skip,
3459
 
                                       None, None, None, None,
3460
 
                                       None, 1,alpha_COPY_path)
 
3367
                                       [], True, True)
3461
3368
 
3462
3369
  # Update just A/B_COPY/E.  The mergeinfo (r3-5,7) reset on
3463
3370
  # A/B_COPY/E by the udpate is identical to the local info on
3483
3390
                                        expected_output,
3484
3391
                                        expected_disk,
3485
3392
                                        expected_status,
3486
 
                                        None, None, None,
3487
 
                                        None, None, 1, E_COPY_path)
 
3393
                                        [], True,
 
3394
                                        E_COPY_path)
3488
3395
 
3489
3396
 
3490
3397
#----------------------------------------------------------------------
3518
3425
  fn3_path = sbox.ospath(fn3_relpath)
3519
3426
 
3520
3427
  # Move fn2 to fn1
3521
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3428
  svntest.actions.run_and_verify_svn(None, [],
3522
3429
                                     'mv', fn2_path, fn1_path)
3523
3430
 
3524
3431
  # Move fn3 to fn2
3525
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3432
  svntest.actions.run_and_verify_svn(None, [],
3526
3433
                                     'mv', fn3_path, fn2_path)
3527
3434
 
3528
3435
  # Commit that change, creating r2.
3540
3447
    })
3541
3448
 
3542
3449
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3543
 
                                        expected_status, None, wc_dir)
 
3450
                                        expected_status)
3544
3451
 
3545
3452
  # Modify fn2.
3546
3453
  fn2_final_contents = "I have new contents for the middle file."
3559
3466
    })
3560
3467
 
3561
3468
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3562
 
                                        expected_status, None, wc_dir)
 
3469
                                        expected_status)
3563
3470
 
3564
3471
  # Go back to r1.
3565
3472
  expected_output = svntest.wc.State(wc_dir, {
3575
3482
  svntest.actions.run_and_verify_update(wc_dir,
3576
3483
                                        expected_output,
3577
3484
                                        expected_disk,
3578
 
                                        None, None,
3579
 
                                        None, None, None, None, 0,
 
3485
                                        None,
 
3486
                                        [], False,
3580
3487
                                        '-r', '1', wc_dir)
3581
3488
 
3582
3489
  # And back up to 3 again.
3600
3507
  svntest.actions.run_and_verify_update(wc_dir,
3601
3508
                                        expected_output,
3602
3509
                                        expected_disk,
3603
 
                                        expected_status, None,
3604
 
                                        None, None, None, None, 0,
3605
 
                                        wc_dir)
 
3510
                                        expected_status)
3606
3511
 
3607
3512
#----------------------------------------------------------------------
3608
3513
# Regression test: ra_neon assumes that you never delete a property on
3616
3521
  iota2_path = sbox.ospath('iota2')
3617
3522
 
3618
3523
  # Add a property on iota
3619
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3524
  svntest.actions.run_and_verify_svn(None, [],
3620
3525
                                     'propset', 'foo', 'bar', iota_path)
3621
3526
  # Commit that change, creating r2.
3622
3527
  expected_output = svntest.wc.State(wc_dir, {
3627
3532
  expected_status_mixed.tweak('iota', wc_rev=2)
3628
3533
 
3629
3534
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3630
 
                                        expected_status_mixed, None, wc_dir)
 
3535
                                        expected_status_mixed)
3631
3536
 
3632
3537
  # Copy iota to iota2 and delete the property on it.
3633
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3538
  svntest.actions.run_and_verify_svn(None, [],
3634
3539
                                     'copy', iota_path, iota2_path)
3635
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
3540
  svntest.actions.run_and_verify_svn(None, [],
3636
3541
                                     'propdel', 'foo', iota2_path)
3637
3542
 
3638
3543
  # Commit that change, creating r3.
3645
3550
    })
3646
3551
 
3647
3552
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3648
 
                                        expected_status_mixed, None, wc_dir)
 
3553
                                        expected_status_mixed)
3649
3554
 
3650
3555
  # Update the whole wc, verifying disk as well.
3651
3556
  expected_output = svntest.wc.State(wc_dir, { })
3679
3584
                                        expected_output,
3680
3585
                                        expected_disk_r2,
3681
3586
                                        expected_status_r2,
3682
 
                                        None, None, None, None, None,
3683
 
                                        True,
 
3587
                                        [], True,
3684
3588
                                        "-r2", wc_dir)
3685
3589
 
3686
3590
  # And finally, back to r3, getting an add-with-history-and-property-deleted
3795
3699
 
3796
3700
  # Commit.
3797
3701
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3798
 
                                        expected_status, None, wc_dir)
 
3702
                                        expected_status)
3799
3703
 
3800
3704
  # Now we'll update each of our 5 files in wc_backup; each one will get
3801
3705
  # conflicts, and we'll handle each with a different --accept option.
3806
3710
  # iota: no accept option
3807
3711
  # Just leave the conflicts alone, since run_and_verify_svn already uses
3808
3712
  # the --non-interactive option.
3809
 
  svntest.actions.run_and_verify_svn(None,
3810
 
                                     update_output_with_conflicts(
 
3713
  svntest.actions.run_and_verify_svn(update_output_with_conflicts(
3811
3714
                                       2, iota_path_backup),
3812
3715
                                     [],
3813
3716
                                     'update', iota_path_backup)
3814
3717
 
3815
3718
  # lambda: --accept=postpone
3816
3719
  # Just leave the conflicts alone.
3817
 
  svntest.actions.run_and_verify_svn(None,
3818
 
                                     update_output_with_conflicts(
 
3720
  svntest.actions.run_and_verify_svn(update_output_with_conflicts(
3819
3721
                                       2, lambda_path_backup),
3820
3722
                                     [],
3821
3723
                                     'update', '--accept=postpone',
3823
3725
 
3824
3726
  # mu: --accept=base
3825
3727
  # Accept the pre-update base file.
3826
 
  svntest.actions.run_and_verify_svn(None,
3827
 
                                     update_output_with_conflicts_resolved(
 
3728
  svntest.actions.run_and_verify_svn(update_output_with_conflicts_resolved(
3828
3729
                                       2, mu_path_backup),
3829
3730
                                     [],
3830
3731
                                     'update', '--accept=base',
3832
3733
 
3833
3734
  # alpha: --accept=mine
3834
3735
  # Accept the user's working file.
3835
 
  svntest.actions.run_and_verify_svn(None,
3836
 
                                     update_output_with_conflicts_resolved(
 
3736
  svntest.actions.run_and_verify_svn(update_output_with_conflicts_resolved(
3837
3737
                                       2, alpha_path_backup),
3838
3738
                                     [],
3839
3739
                                     'update', '--accept=mine-full',
3841
3741
 
3842
3742
  # beta: --accept=theirs
3843
3743
  # Accept their file.
3844
 
  svntest.actions.run_and_verify_svn(None,
3845
 
                                     update_output_with_conflicts_resolved(
 
3744
  svntest.actions.run_and_verify_svn(update_output_with_conflicts_resolved(
3846
3745
                                       2, beta_path_backup),
3847
3746
                                     [],
3848
3747
                                     'update', '--accept=theirs-full',
3852
3751
  # Run editor and accept the edited file. The merge tool will leave
3853
3752
  # conflicts in place, so expect a message on stderr, but expect
3854
3753
  # svn to exit with an exit code of 0.
3855
 
  svntest.actions.run_and_verify_svn2(None,
3856
 
                                      update_output_with_conflicts_resolved(
 
3754
  svntest.actions.run_and_verify_svn2(update_output_with_conflicts_resolved(
3857
3755
                                        2, pi_path_backup),
3858
3756
                                      "system(.*) returned.*", 0,
3859
3757
                                      'update', '--accept=edit',
3862
3760
 
3863
3761
  # rho: --accept=launch
3864
3762
  # Run the external merge tool, it should leave conflict markers in place.
3865
 
  svntest.actions.run_and_verify_svn(None,
3866
 
                                     update_output_with_conflicts(
 
3763
  svntest.actions.run_and_verify_svn(update_output_with_conflicts(
3867
3764
                                       2, rho_path_backup),
3868
3765
                                     [],
3869
3766
                                     'update', '--accept=launch',
3876
3773
  expected_disk.tweak('iota', contents=("This is the file 'iota'.\n"
3877
3774
                                        '<<<<<<< .mine\n'
3878
3775
                                        'My appended text for iota\n'
 
3776
                                        '||||||| .r1\n'
3879
3777
                                        '=======\n'
3880
3778
                                        'Their appended text for iota\n'
3881
3779
                                        '>>>>>>> .r2\n'))
3882
3780
  expected_disk.tweak('A/B/lambda', contents=("This is the file 'lambda'.\n"
3883
3781
                                              '<<<<<<< .mine\n'
3884
3782
                                              'My appended text for lambda\n'
 
3783
                                              '||||||| .r1\n'
3885
3784
                                              '=======\n'
3886
3785
                                              'Their appended text for lambda\n'
3887
3786
                                              '>>>>>>> .r2\n'))
3893
3792
  expected_disk.tweak('A/D/G/pi', contents=("This is the file 'pi'.\n"
3894
3793
                                             '<<<<<<< .mine\n'
3895
3794
                                             'My appended text for pi\n'
 
3795
                                             '||||||| .r1\n'
3896
3796
                                             '=======\n'
3897
3797
                                             'Their appended text for pi\n'
3898
3798
                                             '>>>>>>> .r2\n'
3900
3800
  expected_disk.tweak('A/D/G/rho', contents=("This is the file 'rho'.\n"
3901
3801
                                             '<<<<<<< .mine\n'
3902
3802
                                             'My appended text for rho\n'
 
3803
                                             '||||||| .r1\n'
3903
3804
                                             '=======\n'
3904
3805
                                             'Their appended text for rho\n'
3905
3806
                                             '>>>>>>> .r2\n'
3931
3832
                                        expected_output,
3932
3833
                                        expected_disk,
3933
3834
                                        expected_status,
3934
 
                                        None,
3935
 
                                        svntest.tree.detect_conflict_files,
3936
 
                                        extra_files)
3937
 
 
3938
 
# Test for a wc corruption race condition (possibly introduced in
3939
 
# r863416) which is easy to trigger if interactive conflict resolution
3940
 
# dies in the middle of prompting.  Specifically, we run an update
3941
 
# with interactive-conflicts on but close stdin immediately, so the
3942
 
# prompt errors out; then the dir_baton pool cleanup handlers in the
3943
 
# WC update editor flush and run incomplete logs and lead to WC
3944
 
# corruption, detectable by another update command.
3945
 
 
3946
 
# FIXME: With issue #4280 fixed and this test using --force-interactive,
3947
 
#        the test driver can no longer redirect terminal input to cause
3948
 
#        an EOF. Consequently, skip this test so that it does not hang
3949
 
#        the test suite.
3950
 
@Skip()
3951
 
def eof_in_interactive_conflict_resolver(sbox):
3952
 
  "eof in interactive resolution can't break wc"
3953
 
 
3954
 
  sbox.build()
3955
 
  wc_dir = sbox.wc_dir
3956
 
 
3957
 
  # Set up a custom config directory which *doesn't* turn off
3958
 
  # interactive resolution
3959
 
  config_contents = '''\
3960
 
[auth]
3961
 
password-stores =
3962
 
 
3963
 
[miscellany]
3964
 
interactive-conflicts = true
3965
 
'''
3966
 
  tmp_dir = os.path.abspath(svntest.main.temp_dir)
3967
 
  config_dir = os.path.join(tmp_dir, 'interactive-conflicts-config')
3968
 
  svntest.main.create_config_dir(config_dir, config_contents)
3969
 
 
3970
 
  iota_path = sbox.ospath('iota')
3971
 
 
3972
 
  # Modify iota and commit for r2.
3973
 
  svntest.main.file_append(iota_path, "Appended text in r2.\n")
3974
 
  expected_output = svntest.wc.State(wc_dir, {
3975
 
    'iota': Item(verb="Sending"),
3976
 
  })
3977
 
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
3978
 
  expected_status.tweak('iota', wc_rev=2)
3979
 
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
3980
 
                                        expected_status, None, wc_dir)
3981
 
 
3982
 
  # Go back to revision 1.
3983
 
  expected_output = svntest.wc.State(wc_dir, {
3984
 
    'iota' : Item(status='U '),
3985
 
    })
3986
 
 
3987
 
  expected_disk = svntest.main.greek_state.copy()
3988
 
 
3989
 
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
3990
 
 
3991
 
  svntest.actions.run_and_verify_update(wc_dir,
3992
 
                                        expected_output,
3993
 
                                        expected_disk,
3994
 
                                        expected_status,
3995
 
                                        None,
3996
 
                                        None, None,
3997
 
                                        None, None, 1,
3998
 
                                        '-r1', wc_dir)
3999
 
 
4000
 
  # Modify iota differently and try to update *with the interactive
4001
 
  # resolver*.  ### The parser won't go so well with the output
4002
 
  svntest.main.file_append(iota_path, "Local mods to r1 text.\n")
4003
 
  svntest.actions.run_and_verify_update(
4004
 
    wc_dir, None, None, None,
4005
 
    "End of file while reading from terminal",
4006
 
    None, None, None, None, 1,
4007
 
    wc_dir, '--force-interactive', '--config-dir', config_dir)
4008
 
 
4009
 
  # Now update -r1 again.  Hopefully we don't get a checksum error!
4010
 
  expected_output = svntest.wc.State(wc_dir, {
4011
 
    'iota': Item(verb="Skipped"),
4012
 
  })
4013
 
 
4014
 
  # The interactive callback aborts, so the file remains in conflict.
4015
 
  expected_disk.tweak('iota', contents="This is the file 'iota'.\n"
4016
 
                                        "<<<<<<< .mine\n"
4017
 
                                        "Local mods to r1 text.\n"
4018
 
                                        "=======\n"
4019
 
                                        "Appended text in r2.\n"
4020
 
                                        ">>>>>>> .r2\n"),
4021
 
  expected_disk.add({
4022
 
    'iota.r1'   : Item(contents="This is the file 'iota'.\n"),
4023
 
    'iota.r2'   : Item(contents="This is the file 'iota'.\n"
4024
 
                                 "Appended text in r2.\n"),
4025
 
    'iota.mine' : Item(contents="This is the file 'iota'.\n"
4026
 
                                "Local mods to r1 text.\n"),
4027
 
  })
4028
 
 
4029
 
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
4030
 
  expected_status.tweak('iota', status='C ', wc_rev=2)
4031
 
 
4032
 
  svntest.actions.run_and_verify_update(wc_dir,
4033
 
                                        expected_output,
4034
 
                                        expected_disk,
4035
 
                                        expected_status,
4036
 
                                        None,
4037
 
                                        None, None,
4038
 
                                        None, None, 1,
4039
 
                                        '-r1', wc_dir)
 
3835
                                        extra_files=extra_files)
4040
3836
 
4041
3837
 
4042
3838
#----------------------------------------------------------------------
4055
3851
  uuid_before = svntest.actions.get_wc_uuid(wc_dir)
4056
3852
 
4057
3853
  # Change repository's uuid.
4058
 
  svntest.actions.run_and_verify_svnadmin(None, None, [],
 
3854
  svntest.actions.run_and_verify_svnadmin(None, [],
4059
3855
                                          'setuuid', repo_dir)
4060
3856
 
4061
3857
  # 'update' detected the new uuid...
4062
 
  svntest.actions.run_and_verify_svn(None, None, '.*UUID.*',
 
3858
  svntest.actions.run_and_verify_svn(None, '.*UUID.*',
4063
3859
                                     'update', wc_dir)
4064
3860
 
4065
3861
  # ...and didn't overwrite the old uuid.
4094
3890
  expected_status.tweak('A', wc_rev=2)
4095
3891
 
4096
3892
  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
4097
 
                                        expected_status, None, wc_dir)
 
3893
                                        expected_status)
4098
3894
 
4099
3895
  # Create a second working copy.
4100
3896
  ### Does this hack still work with wc-ng?
4121
3917
    })
4122
3918
 
4123
3919
  svntest.actions.run_and_verify_commit(other_wc, expected_output,
4124
 
                                        expected_status, None, other_wc)
 
3920
                                        expected_status)
4125
3921
 
4126
3922
  # Back in the first working copy, create an obstructing path and
4127
3923
  # update. The update will flag a tree conflict.
4146
3942
  })
4147
3943
 
4148
3944
  actions.run_and_verify_update(wc_dir, expected_output, expected_disk,
4149
 
    expected_status, None, None, None, None, None, False, wc_dir)
 
3945
                                expected_status)
4150
3946
 
4151
3947
  # Now, delete the obstructing path and rerun the update.
4152
3948
  os.unlink(zeta_path)
4189
3985
disk_after_leaf_del = svntest.deeptrees.deep_trees_after_leaf_del
4190
3986
disk_after_tree_del = svntest.deeptrees.deep_trees_after_tree_del
4191
3987
 
4192
 
disk_empty_dirs = svntest.deeptrees.deep_trees_empty_dirs
4193
 
 
4194
3988
deep_trees_conflict_output = svntest.deeptrees.deep_trees_conflict_output
4195
3989
deep_trees_conflict_output_skipped = \
4196
3990
    svntest.deeptrees.deep_trees_conflict_output_skipped
4223
4017
    'DF/D1/beta'        : Item(status='  ', treeconflict='U'),
4224
4018
  })
4225
4019
 
4226
 
  expected_disk = disk_empty_dirs.copy()
4227
 
  expected_disk.remove('D/D1', 'DF/D1', 'DD/D1', 'DD/D1/D2',
4228
 
                       'DDF/D1', 'DDF/D1/D2',
4229
 
                       'DDD/D1', 'DDD/D1/D2', 'DDD/D1/D2/D3')
4230
 
 
 
4020
  expected_disk = svntest.wc.State('', {
 
4021
    'F'               : Item(),
 
4022
    'D'               : Item(),
 
4023
    'DF'              : Item(),
 
4024
    'DD'              : Item(),
 
4025
    'DDF'             : Item(),
 
4026
    'DDD'             : Item(),
 
4027
  })
4231
4028
  # The files delta, epsilon, and zeta are incoming additions, but since
4232
4029
  # they are all within locally deleted trees they should also be schedule
4233
4030
  # for deletion.
4307
4104
    'DDF/D1/D2/gamma'   : Item(status='  ', treeconflict='D'),
4308
4105
  })
4309
4106
 
4310
 
  expected_disk = disk_empty_dirs.copy()
 
4107
  expected_disk = svntest.wc.State('', {
 
4108
    'F'               : Item(),
 
4109
    'D'               : Item(),
 
4110
    'DF'              : Item(),
 
4111
    'DD'              : Item(),
 
4112
    'DDF'             : Item(),
 
4113
    'DDD'             : Item(),
 
4114
  })
4311
4115
 
4312
4116
  expected_status = deep_trees_status_local_tree_del.copy()
4313
4117
 
4330
4134
                         'DDF/D1/D2/gamma',
4331
4135
                         'DF/D1/beta')
4332
4136
 
4333
 
  ### Why does the deep trees state not include files?
4334
 
  expected_disk.remove('D/D1',
4335
 
                       'DD/D1/D2',
4336
 
                       'DDD/D1/D2/D3',
4337
 
                       'DF/D1', 'DD/D1',
4338
 
                       'DDF/D1', 'DDF/D1/D2',
4339
 
                       'DDD/D1', 'DDD/D1/D2')
4340
 
 
4341
4137
  expected_info = {
4342
4138
    'F/alpha' : {
4343
4139
      'Tree conflict' :
4344
 
        '^local file delete, incoming file delete upon update'
 
4140
        '^local file delete, incoming file delete or move upon update'
4345
4141
        + ' Source  left: .file.*/F/alpha@2'
4346
4142
        + ' Source right: .none.*(/F/alpha@3)?$',
4347
4143
    },
4359
4155
    },
4360
4156
    'D/D1' : {
4361
4157
      'Tree conflict' :
4362
 
        '^local dir delete, incoming dir delete upon update'
 
4158
        '^local dir delete, incoming dir delete or move upon update'
4363
4159
        + ' Source  left: .dir.*/D/D1@2'
4364
4160
        + ' Source right: .none.*(/D/D1@3)?$',
4365
4161
    },
4424
4220
  expected_info = {
4425
4221
    'F/alpha' : {
4426
4222
      'Tree conflict' :
4427
 
        '^local file edit, incoming file delete upon update'
 
4223
        '^local file edit, incoming file delete or move upon update'
4428
4224
        + ' Source  left: .file.*/F/alpha@2'
4429
4225
        + ' Source right: .none.*(/F/alpha@3)?$',
4430
4226
    },
4431
4227
    'DF/D1' : {
4432
4228
      'Tree conflict' :
4433
 
        '^local dir edit, incoming dir delete upon update'
 
4229
        '^local dir edit, incoming dir delete or move upon update'
4434
4230
        + ' Source  left: .dir.*/DF/D1@2'
4435
4231
        + ' Source right: .none.*(/DF/D1@3)?$',
4436
4232
    },
4437
4233
    'DDF/D1' : {
4438
4234
      'Tree conflict' :
4439
 
        '^local dir edit, incoming dir delete upon update'
 
4235
        '^local dir edit, incoming dir delete or move upon update'
4440
4236
        + ' Source  left: .dir.*/DDF/D1@2'
4441
4237
        + ' Source right: .none.*(/DDF/D1@3)?$',
4442
4238
    },
4443
4239
    'D/D1' : {
4444
4240
      'Tree conflict' :
4445
 
        '^local dir edit, incoming dir delete upon update'
 
4241
        '^local dir edit, incoming dir delete or move upon update'
4446
4242
        + ' Source  left: .dir.*/D/D1@2'
4447
4243
        + ' Source right: .none.*(/D/D1@3)?$',
4448
4244
    },
4449
4245
    'DD/D1' : {
4450
4246
      'Tree conflict' :
4451
 
        '^local dir edit, incoming dir delete upon update'
 
4247
        '^local dir edit, incoming dir delete or move upon update'
4452
4248
        + ' Source  left: .dir.*/DD/D1@2'
4453
4249
        + ' Source right: .none.*(/DD/D1@3)?$',
4454
4250
    },
4455
4251
    'DDD/D1' : {
4456
4252
      'Tree conflict' :
4457
 
        '^local dir edit, incoming dir delete upon update'
 
4253
        '^local dir edit, incoming dir delete or move upon update'
4458
4254
        + ' Source  left: .dir.*/DDD/D1@2'
4459
4255
        + ' Source right: .none.*(/DDD/D1@3)?$',
4460
4256
    },
4486
4282
  ### when dirs_same_p() is implemented)
4487
4283
  expected_output = deep_trees_conflict_output
4488
4284
 
4489
 
  expected_disk = disk_empty_dirs.copy()
 
4285
  expected_disk = svntest.wc.State('', {
 
4286
    'DDF/D1/D2'       : Item(),
 
4287
    'F'               : Item(),
 
4288
    'D'               : Item(),
 
4289
    'DF/D1'           : Item(),
 
4290
    'DD/D1'           : Item(),
 
4291
    'DDD/D1/D2'       : Item(),
 
4292
  })
4490
4293
 
4491
4294
  expected_status = svntest.deeptrees.deep_trees_virginal_state.copy()
4492
4295
  expected_status.add({'' : Item()})
4504
4307
  # Expect the incoming tree deletes and the local leaf deletes to mean
4505
4308
  # that all deleted paths are *really* gone, not simply scheduled for
4506
4309
  # deletion.
4507
 
  expected_status.tweak('F/alpha',
4508
 
                        'D/D1',
4509
 
                        'DD/D1',
4510
 
                        'DF/D1',
4511
 
                        'DDD/D1',
4512
 
                        'DDF/D1',
4513
 
                        status='! ', wc_rev=None)
4514
 
  # Remove from expected status and disk everything below the deleted paths.
4515
 
  expected_status.remove('DD/D1/D2',
4516
 
                         'DF/D1/beta',
4517
 
                         'DDD/D1/D2',
4518
 
                         'DDD/D1/D2/D3',
4519
 
                         'DDF/D1/D2',
4520
 
                         'DDF/D1/D2/gamma',)
4521
 
 
4522
 
  expected_disk.remove('D/D1',
4523
 
                       'DD/D1',
4524
 
                       'DD/D1/D2',
4525
 
                       'DF/D1',
4526
 
                       'DDD/D1',
4527
 
                       'DDD/D1/D2',
4528
 
                       'DDD/D1/D2/D3',
4529
 
                       'DDF/D1',
4530
 
                       'DDF/D1/D2',)
 
4310
  expected_status.tweak('DD/D1', 'DF/D1', 'DDF/D1', 'DDD/D1',
 
4311
                        status='A ', copied='+', treeconflict='C',
 
4312
                        wc_rev='-')
 
4313
  expected_status.tweak('DDF/D1/D2', 'DDD/D1/D2',
 
4314
                        copied='+', wc_rev='-')
 
4315
  expected_status.tweak('DD/D1/D2',  'DF/D1/beta', 'DDD/D1/D2/D3',
 
4316
                        'DDF/D1/D2/gamma',
 
4317
                        status='D ', copied='+', wc_rev='-')
 
4318
  expected_status.tweak('F/alpha', 'D/D1',
 
4319
                        status='! ', treeconflict='C', wc_rev=None)
4531
4320
 
4532
4321
  expected_info = {
4533
4322
    'F/alpha' : {
4534
4323
      'Tree conflict' :
4535
 
        '^local file delete, incoming file delete upon update'
 
4324
        '^local file delete, incoming file delete or move upon update'
4536
4325
        + ' Source  left: .file.*/F/alpha@2'
4537
4326
        + ' Source right: .none.*(/F/alpha@3)?$',
4538
4327
    },
4539
4328
    'DF/D1' : {
4540
4329
      'Tree conflict' :
4541
 
        '^local dir delete, incoming dir delete upon update'
 
4330
        '^local dir edit, incoming dir delete or move upon update'
4542
4331
        + ' Source  left: .dir.*/DF/D1@2'
4543
4332
        + ' Source right: .none.*(/DF/D1@3)?$',
4544
4333
    },
4545
4334
    'DDF/D1' : {
4546
4335
      'Tree conflict' :
4547
 
        '^local dir delete, incoming dir delete upon update'
 
4336
        '^local dir edit, incoming dir delete or move upon update'
4548
4337
        + ' Source  left: .dir.*/DDF/D1@2'
4549
4338
        + ' Source right: .none.*(/DDF/D1@3)?$',
4550
4339
    },
4551
4340
    'D/D1' : {
4552
4341
      'Tree conflict' :
4553
 
        '^local dir delete, incoming dir delete upon update'
 
4342
        '^local dir delete, incoming dir delete or move upon update'
4554
4343
        + ' Source  left: .dir.*/D/D1@2'
4555
4344
        + ' Source right: .none.*(/D/D1@3)?$',
4556
4345
    },
4557
4346
    'DD/D1' : {
4558
4347
      'Tree conflict' :
4559
 
        '^local dir delete, incoming dir delete upon update'
 
4348
        '^local dir edit, incoming dir delete or move upon update'
4560
4349
        + ' Source  left: .dir.*/DD/D1@2'
4561
4350
        + ' Source right: .none.*(/DD/D1@3)?$',
4562
4351
    },
4563
4352
    'DDD/D1' : {
4564
4353
      'Tree conflict' :
4565
 
        '^local dir delete, incoming dir delete upon update'
 
4354
        '^local dir edit, incoming dir delete or move upon update'
4566
4355
        + ' Source  left: .dir.*/DDD/D1@2'
4567
4356
        + ' Source right: .none.*(/DDD/D1@3)?$',
4568
4357
    },
4659
4448
 
4660
4449
  expected_output = deep_trees_conflict_output
4661
4450
 
4662
 
  expected_disk = disk_empty_dirs.copy()
4663
 
 
 
4451
  expected_disk = svntest.wc.State('', {
 
4452
    'F'               : Item(),
 
4453
    'D'               : Item(),
 
4454
    'DF'              : Item(),
 
4455
    'DD'              : Item(),
 
4456
    'DDF'             : Item(),
 
4457
    'DDD'             : Item(),
 
4458
  })
4664
4459
  expected_status = deep_trees_status_local_tree_del.copy()
4665
4460
 
4666
4461
  # Expect the incoming tree deletes and the local tree deletes to mean
4681
4476
                         'DDF/D1/D2',
4682
4477
                         'DDF/D1/D2/gamma',)
4683
4478
 
4684
 
  expected_disk.remove('D/D1',
4685
 
                       'DD/D1',
4686
 
                       'DD/D1/D2',
4687
 
                       'DF/D1',
4688
 
                       'DDD/D1',
4689
 
                       'DDD/D1/D2',
4690
 
                       'DDD/D1/D2/D3',
4691
 
                       'DDF/D1',
4692
 
                       'DDF/D1/D2',)
4693
 
 
4694
4479
  expected_info = {
4695
4480
    'F/alpha' : {
4696
4481
      'Tree conflict' :
4697
 
        '^local file delete, incoming file delete upon update'
 
4482
        '^local file delete, incoming file delete or move upon update'
4698
4483
        + ' Source  left: .file.*/F/alpha@2'
4699
4484
        + ' Source right: .none.*(/F/alpha@3)?$',
4700
4485
    },
4701
4486
    'DF/D1' : {
4702
4487
      'Tree conflict' :
4703
 
        '^local dir delete, incoming dir delete upon update'
 
4488
        '^local dir delete, incoming dir delete or move upon update'
4704
4489
        + ' Source  left: .dir.*/DF/D1@2'
4705
4490
        + ' Source right: .none.*(/DF/D1@3)?$',
4706
4491
    },
4707
4492
    'DDF/D1' : {
4708
4493
      'Tree conflict' :
4709
 
        '^local dir delete, incoming dir delete upon update'
 
4494
        '^local dir delete, incoming dir delete or move upon update'
4710
4495
        + ' Source  left: .dir.*/DDF/D1@2'
4711
4496
        + ' Source right: .none.*(/DDF/D1@3)?$',
4712
4497
    },
4713
4498
    'D/D1' : {
4714
4499
      'Tree conflict' :
4715
 
        '^local dir delete, incoming dir delete upon update'
 
4500
        '^local dir delete, incoming dir delete or move upon update'
4716
4501
        + ' Source  left: .dir.*/D/D1@2'
4717
4502
        + ' Source right: .none.*(/D/D1@3)?$',
4718
4503
    },
4719
4504
    'DD/D1' : {
4720
4505
      'Tree conflict' :
4721
 
        '^local dir delete, incoming dir delete upon update'
 
4506
        '^local dir delete, incoming dir delete or move upon update'
4722
4507
        + ' Source  left: .dir.*/DD/D1@2'
4723
4508
        + ' Source right: .none.*(/DD/D1@3)?$',
4724
4509
    },
4725
4510
    'DDD/D1' : {
4726
4511
      'Tree conflict' :
4727
 
        '^local dir delete, incoming dir delete upon update'
 
4512
        '^local dir delete, incoming dir delete or move upon update'
4728
4513
        + ' Source  left: .dir.*/DDD/D1@2'
4729
4514
        + ' Source right: .none.*(/DDD/D1@3)?$',
4730
4515
    },
4773
4558
  def modify_dir(dir):
4774
4559
    """Make some set of local modifications to an existing tree:
4775
4560
    A prop change, add a child, delete a child, change a child."""
4776
 
    run_and_verify_svn(None, AnyOutput, [], 'propset', 'p', 'v', dir)
 
4561
    run_and_verify_svn(AnyOutput, [], 'propset', 'p', 'v', dir)
4777
4562
 
4778
4563
    path = os.path.join(dir, 'new_file')
4779
4564
    svntest.main.file_write(path, "This is the file 'new_file'.\n")
4780
 
    svntest.actions.run_and_verify_svn(None, None, [], 'add', path)
 
4565
    svntest.actions.run_and_verify_svn(None, [], 'add', path)
4781
4566
 
4782
4567
    path = os.path.join(dir, 'C', 'N')
4783
4568
    os.mkdir(path)
4784
4569
    path2 = os.path.join(dir, 'C', 'N', 'nu')
4785
4570
    svntest.main.file_write(path2, "This is the file 'nu'.\n")
4786
 
    svntest.actions.run_and_verify_svn(None, None, [], 'add', path)
 
4571
    svntest.actions.run_and_verify_svn(None, [], 'add', path)
4787
4572
 
4788
4573
    path = os.path.join(dir, 'B', 'lambda')
4789
 
    svntest.actions.run_and_verify_svn(None, None, [], 'delete', path)
 
4574
    svntest.actions.run_and_verify_svn(None, [], 'delete', path)
4790
4575
 
4791
4576
    path = os.path.join(dir, 'B', 'E', 'alpha')
4792
4577
    svntest.main.file_append(path, "An extra line.\n")
4793
4578
 
4794
4579
  # Prep for both scenarios
4795
4580
  modify_dir(A)
4796
 
  run_and_verify_svn(None, AnyOutput, [], 'ci', A, '-m', 'modify_dir')
4797
 
  run_and_verify_svn(None, AnyOutput, [], 'up', wc_dir)
 
4581
  run_and_verify_svn(AnyOutput, [], 'ci', A, '-m', 'modify_dir')
 
4582
  run_and_verify_svn(AnyOutput, [], 'up', wc_dir)
4798
4583
 
4799
4584
  # Existing scenario
4800
4585
  wc2 = sbox.add_wc_path('wc2')
4801
4586
  A2 = os.path.join(wc2, 'A')
4802
4587
  svntest.actions.duplicate_dir(sbox.wc_dir, wc2)
4803
 
  run_and_verify_svn(None, AnyOutput, [], 'delete', A2)
 
4588
  run_and_verify_svn(AnyOutput, [], 'delete', A2)
4804
4589
 
4805
4590
  # New scenario (starts at the revision before the committed mods)
4806
 
  run_and_verify_svn(None, AnyOutput, [], 'up', A, '-r1')
4807
 
  run_and_verify_svn(None, AnyOutput, [], 'delete', A)
 
4591
  run_and_verify_svn(AnyOutput, [], 'up', A, '-r1')
 
4592
  run_and_verify_svn(AnyOutput, [], 'delete', A)
4808
4593
 
4809
4594
  expected_output = None
4810
4595
  expected_disk = None
4861
4646
      })
4862
4647
 
4863
4648
  run_and_verify_commit(wc_dir, expected_output, expected_status,
4864
 
                        None, wc_dir, '-m', 'commit resolved tree')
 
4649
                        [], wc_dir, '-m', 'commit resolved tree')
4865
4650
 
4866
4651
 
4867
4652
# Issue #3334: a delete-onto-modified tree conflict should leave the node
4905
4690
  def modify_dir(dir):
4906
4691
    """Make some set of local modifications to an existing tree:
4907
4692
    A prop change, add a child, delete a child, change a child."""
4908
 
    run_and_verify_svn(None, AnyOutput, [],
 
4693
    run_and_verify_svn(AnyOutput, [],
4909
4694
                       'propset', 'p', 'v', dir)
4910
4695
    path = os.path.join(dir, 'new_file')
4911
4696
    svntest.main.file_write(path, "This is the file 'new_file'.\n")
4912
 
    svntest.actions.run_and_verify_svn(None, None, [], 'add', path)
 
4697
    svntest.actions.run_and_verify_svn(None, [], 'add', path)
4913
4698
 
4914
4699
    path = os.path.join(dir, 'B', 'lambda')
4915
 
    svntest.actions.run_and_verify_svn(None, None, [], 'delete', path)
 
4700
    svntest.actions.run_and_verify_svn(None, [], 'delete', path)
4916
4701
 
4917
4702
    path = os.path.join(dir, 'B', 'E', 'alpha')
4918
4703
    svntest.main.file_append(path, "An extra line.\n")
4919
4704
 
4920
4705
  # Prepare the repos so that a later 'update' has an incoming deletion:
4921
4706
  # Delete the dir in the repos, making r2
4922
 
  run_and_verify_svn(None, AnyOutput, [],
 
4707
  run_and_verify_svn(AnyOutput, [],
4923
4708
                     '-m', '', 'delete', dir_url)
4924
4709
 
4925
4710
  # Existing scenario
4927
4712
  wc2 = sbox.add_wc_path('wc2')
4928
4713
  dir2 = os.path.join(wc2, dir)
4929
4714
  svntest.actions.duplicate_dir(sbox.wc_dir, wc2)
4930
 
  run_and_verify_svn(None, AnyOutput, [], 'up', wc2)
4931
 
  run_and_verify_svn(None, AnyOutput, [], 'copy', dir_url + '@1', dir2)
 
4715
  run_and_verify_svn(AnyOutput, [], 'up', wc2)
 
4716
  run_and_verify_svn(AnyOutput, [], 'copy', dir_url + '@1', dir2)
4932
4717
  modify_dir(dir2)
4933
4718
 
4934
4719
  # New scenario
5030
4815
                                        expected_output,
5031
4816
                                        expected_disk,
5032
4817
                                        expected_status,
5033
 
                                        None, None, None,
5034
 
                                        None, None, 1,
 
4818
                                        [], True,
5035
4819
                                        '--set-depth', 'empty',
5036
4820
                                        B_path)
5037
4821
 
5062
4846
                                        expected_output,
5063
4847
                                        expected_disk,
5064
4848
                                        expected_status,
5065
 
                                        None, None, None,
5066
 
                                        None, None, 1,
 
4849
                                        [], True,
5067
4850
                                        '--set-depth', 'immediates',
5068
4851
                                        D_path)
5069
4852
 
5091
4874
                                        expected_output,
5092
4875
                                        expected_disk,
5093
4876
                                        expected_status,
5094
 
                                        None, None, None,
5095
 
                                        None, None, 1,
 
4877
                                        [], True,
5096
4878
                                        '--set-depth', 'infinity',
5097
4879
                                        A_path)
5098
4880
 
5106
4888
  # Create working copy of 'A' directory
5107
4889
  A_url = sbox.repo_url + "/A"
5108
4890
  other_wc_dir = sbox.add_wc_path("other")
5109
 
  svntest.actions.run_and_verify_svn(None, None, [], "co", A_url, other_wc_dir)
 
4891
  svntest.actions.run_and_verify_svn(None, [], "co", A_url, other_wc_dir)
5110
4892
 
5111
4893
  # Delete 'A' directory from repository
5112
 
  svntest.actions.run_and_verify_svn(None, None, [], "rm", A_url, "-m", "")
 
4894
  svntest.actions.run_and_verify_svn(None, [], "rm", A_url, "-m", "")
5113
4895
 
5114
4896
  # Try to update working copy of 'A' directory
5115
 
  svntest.actions.run_and_verify_svn(None, None,
 
4897
  svntest.actions.run_and_verify_svn(None,
5116
4898
                                     "svn: E160005: Target path '/A' does not exist",
5117
4899
                                     "up", other_wc_dir)
5118
4900
 
5136
4918
                                        None,
5137
4919
                                        expected_disk_empty,
5138
4920
                                        expected_status_empty,
5139
 
                                        None, None, None,
5140
 
                                        None, None, 1,
 
4921
                                        [], True,
5141
4922
                                        '-r', '0',
5142
4923
                                        wc_dir)
5143
4924
 
5146
4927
                                        None,
5147
4928
                                        expected_disk,
5148
4929
                                        expected_status,
5149
 
                                        None, None, None,
5150
 
                                        None, None, 1,
 
4930
                                        [], True,
5151
4931
                                        wc_dir)
5152
4932
 
5153
4933
  # Update to revision 0 - Removes all files from WC
5155
4935
                                        None,
5156
4936
                                        expected_disk_empty,
5157
4937
                                        expected_status_empty,
5158
 
                                        None, None, None,
5159
 
                                        None, None, 1,
 
4938
                                        [], True,
5160
4939
                                        '-r', '0',
5161
4940
                                        wc_dir)
5162
4941
 
5165
4944
                                        None,
5166
4945
                                        expected_disk_empty,
5167
4946
                                        expected_status_empty,
5168
 
                                        None, None, None,
5169
 
                                        None, None, 1,
 
4947
                                        [], True,
5170
4948
                                        '--depth', 'empty',
5171
4949
                                        wc_dir)
5172
4950
 
5179
4957
                                        None,
5180
4958
                                        expected_disk,
5181
4959
                                        expected_status,
5182
 
                                        None, None, None,
5183
 
                                        None, None, 1,
5184
 
                                        wc_dir)
 
4960
                                        check_props=True)
5185
4961
 
5186
4962
#----------------------------------------------------------------------
5187
4963
# Test for issue #3573 'local non-inheritable mergeinfo changes not
5188
4964
# properly merged with updated mergeinfo'
 
4965
@SkipUnless(server_has_mergeinfo)
5189
4966
def mergeinfo_updates_merge_with_local_mods(sbox):
5190
4967
  "local mergeinfo changes are merged with updates"
5191
4968
 
5203
4980
  ### No, we are not checking the merge output for these simple
5204
4981
  ### merges.  This is already covered *TO DEATH* in merge_tests.py.
5205
4982
  ###
5206
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
5207
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
4983
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
4984
  svntest.actions.run_and_verify_svn(None, [],
5208
4985
                                     'merge', '-c3', '--depth', 'empty',
5209
4986
                                     sbox.repo_url + '/A', A_COPY_path)
5210
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
4987
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
5211
4988
                                     'Merge r3 from A to A_COPY at depth empty',
5212
4989
                                     wc_dir)
5213
4990
  # Merge -c5 from A to A_COPY (at default --depth infinity), commit as r8.
5214
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
5215
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
4991
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
4992
  svntest.actions.run_and_verify_svn(None, [],
5216
4993
                                     'merge', '-c5',
5217
4994
                                     sbox.repo_url + '/A', A_COPY_path)
5218
 
  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
 
4995
  svntest.actions.run_and_verify_svn(None, [], 'ci', '-m',
5219
4996
                                     'Merge r5 from A to A_COPY', wc_dir)
5220
4997
 
5221
4998
  # Update WC to r7, repeat merge of -c3 from A to A_COPY but this
5222
4999
  # time do it at --depth infinity.  Confirm that the mergeinfo
5223
5000
  # on A_COPY is no longer inheritable.
5224
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', '-r7', wc_dir)
5225
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
5001
  svntest.actions.run_and_verify_svn(None, [], 'up', '-r7', wc_dir)
 
5002
  svntest.actions.run_and_verify_svn(None, [],
5226
5003
                                     'merge', '-c3', '--depth', 'infinity',
5227
5004
                                     sbox.repo_url + '/A', A_COPY_path)
5228
 
  svntest.actions.run_and_verify_svn(None, [A_COPY_path + " - /A:3\n"], [],
 
5005
  svntest.actions.run_and_verify_svn([A_COPY_path + " - /A:3\n"], [],
5229
5006
                                     'pg', SVN_PROP_MERGEINFO, '-R',
5230
5007
                                     A_COPY_path)
5231
5008
 
5234
5011
  # brought down by the update (/A:3* --> /A:3*,5) leaving us with /A:3,5.
5235
5012
  ### This was failing because of issue #3573.  The local mergeinfo change
5236
5013
  ### is reverted, leaving '/A:3*,5' on A_COPY.
5237
 
  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
5238
 
  svntest.actions.run_and_verify_svn(None, [A_COPY_path + " - /A:3,5\n"], [],
 
5014
  svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
 
5015
  svntest.actions.run_and_verify_svn([A_COPY_path + " - /A:3,5\n"], [],
5239
5016
                                     'pg', SVN_PROP_MERGEINFO, '-R',
5240
5017
                                     A_COPY_path)
5241
5018
 
5260
5037
  expected_status.remove('A/D/G', 'A/D/G/pi', 'A/D/G/rho', 'A/D/G/tau')
5261
5038
  svntest.actions.run_and_verify_update(wc_dir, expected_output,
5262
5039
                                        expected_disk, expected_status,
5263
 
                                        None, None, None, None, None, False,
 
5040
                                        [], False,
5264
5041
                                        '--set-depth=exclude', G)
5265
5042
 
5266
5043
  # Commit a new revision so there is something to update to.
5320
5097
    'nonexistent'             : Item(verb='Skipped'),
5321
5098
  })
5322
5099
  svntest.actions.run_and_verify_update(os.path.join('A2', 'nonexistent'),
5323
 
                                        expected_output, None, None, None)
 
5100
                                        expected_output, None, None)
5324
5101
 
5325
5102
  # Try updating a deleted path in the copied dir.
5326
5103
  svntest.main.run_svn(None, 'delete', os.path.join('A2', 'mu'))
5329
5106
    'mu'             : Item(verb='Skipped'),
5330
5107
  })
5331
5108
  svntest.actions.run_and_verify_update(os.path.join('A2', 'mu'),
5332
 
                                        expected_output, None, None, None)
 
5109
                                        expected_output, None, None)
5333
5110
  if os.path.exists('A2/mu'):
5334
5111
    raise svntest.Failure("A2/mu improperly revived")
5335
5112
 
5396
5173
                                        expected_output,
5397
5174
                                        None,
5398
5175
                                        expected_status,
5399
 
                                        None,
5400
 
                                        None, None,
5401
 
                                        None, None, None, wc_dir, '-r', '1')
 
5176
                                        [], False,
 
5177
                                        wc_dir, '-r', '1')
5402
5178
 
5403
5179
  f.close()
5404
5180
 
5413
5189
  # revision".)
5414
5190
  svntest.actions.run_and_verify_update(wc_dir,
5415
5191
                                        None, None, None,
5416
 
                                        "E160006.*No such.*revision",
5417
 
                                        None, None,
5418
 
                                        None, None, None, wc_dir, '-r', '2')
 
5192
                                        ".*E160006.*No such.*revision.*",
 
5193
                                        False,
 
5194
                                        wc_dir, '-r', '2')
5419
5195
 
5420
5196
  other_wc = sbox.add_wc_path('other')
5421
5197
  other_url = sbox.repo_url + '/A'
5422
 
  svntest.actions.run_and_verify_svn("subtree checkout", None, [],
 
5198
  svntest.actions.run_and_verify_svn(None, [],
5423
5199
                                     'co', other_url, other_wc)
5424
5200
  svntest.actions.run_and_verify_update(other_wc,
5425
5201
                                        None, None, None,
5426
 
                                        "E160006.*No such.*revision",
5427
 
                                        None, None,
5428
 
                                        None, None, None, other_wc, '-r', '2')
 
5202
                                        ".*E160006.*No such.*revision.*",
 
5203
                                        False,
 
5204
                                        other_wc, '-r', '2')
5429
5205
 
5430
5206
def update_moved_dir_leaf_del(sbox):
5431
5207
  "update locally moved dir with leaf del"
5465
5241
                                        expected_output,
5466
5242
                                        expected_disk,
5467
5243
                                        expected_status,
5468
 
                                        None, None, None,
5469
 
                                        None, None, 1)
 
5244
                                        check_props=True)
5470
5245
 
5471
5246
  # Now resolve the conflict, using --accept=mine-conflict applying
5472
5247
  # the update to A/B/E2
5473
 
  svntest.actions.run_and_verify_svn("resolve failed", None, [],
 
5248
  svntest.actions.run_and_verify_svn(None, [],
5474
5249
                                     'resolve',
5475
5250
                                     '--accept=mine-conflict',
5476
5251
                                     sbox.ospath('A/B/E'))
5520
5295
                                        expected_output,
5521
5296
                                        expected_disk,
5522
5297
                                        expected_status,
5523
 
                                        None, None, None,
5524
 
                                        None, None, 1)
 
5298
                                        check_props=True)
5525
5299
 
5526
5300
  # Now resolve the conflict, using --accept=mine-conflict.
5527
5301
  # This should apply the update to A/B/E2, and flag a tree
5528
5302
  # conflict on A/B/E2/alpha (incoming delete vs. local edit)
5529
 
  svntest.actions.run_and_verify_svn("resolve failed", None, [],
 
5303
  svntest.actions.run_and_verify_svn(None, [],
5530
5304
                                     'resolve',
5531
5305
                                     '--accept=mine-conflict',
5532
5306
                                     sbox.ospath('A/B/E'))
5579
5353
                                        expected_output,
5580
5354
                                        expected_disk,
5581
5355
                                        expected_status,
5582
 
                                        None, None, None,
5583
 
                                        None, None, 1)
 
5356
                                        check_props=True)
5584
5357
 
5585
5358
  # Now resolve the conflict, using --accept=mine-conflict.
5586
5359
  # This should apply the update to A/B/E2, adding A/B/E2/foo.
5587
 
  svntest.actions.run_and_verify_svn("resolve failed", None, [],
 
5360
  svntest.actions.run_and_verify_svn(None, [],
5588
5361
                                     'resolve',
5589
5362
                                     '--accept=mine-conflict',
5590
5363
                                     sbox.ospath('A/B/E'))
5640
5413
                                        expected_output,
5641
5414
                                        expected_disk,
5642
5415
                                        expected_status,
5643
 
                                        None, None, None,
5644
 
                                        None, None, 1)
5645
 
  svntest.actions.run_and_verify_svn("resolve failed", None, [],
 
5416
                                        check_props=True)
 
5417
  svntest.actions.run_and_verify_svn(None, [],
5646
5418
                                     'resolve',
5647
5419
                                     '--recursive',
5648
5420
                                     '--accept=mine-conflict', wc_dir)
5697
5469
                                        expected_output,
5698
5470
                                        expected_disk,
5699
5471
                                        expected_status,
5700
 
                                        None, None, None,
5701
 
                                        None, None, 1)
 
5472
                                        check_props=True)
5702
5473
 
5703
5474
  # The incoming change is a delete as we don't yet track server-side
5704
5475
  # moves.  Resolving the tree-conflict as "mine-conflict" applies the
5705
5476
  # delete to the move destination.
5706
 
  svntest.actions.run_and_verify_svn("resolve failed", None, [],
 
5477
  svntest.actions.run_and_verify_svn(None, [],
5707
5478
                                     'resolve',
5708
5479
                                     '--accept=mine-conflict',
5709
5480
                                     sbox.ospath('A/B/E'))
5764
5535
                                        expected_output,
5765
5536
                                        expected_disk,
5766
5537
                                        expected_status,
5767
 
                                        None, None, None,
5768
 
                                        None, None, 1)
 
5538
                                        check_props=True)
5769
5539
 
5770
 
  svntest.actions.run_and_verify_svn("resolve failed", None, [],
 
5540
  svntest.actions.run_and_verify_svn(None, [],
5771
5541
                                     'resolve',
5772
5542
                                     '--recursive',
5773
5543
                                     '--accept=mine-conflict',
5830
5600
                                        expected_output,
5831
5601
                                        expected_disk,
5832
5602
                                        expected_status,
5833
 
                                        None, None, None,
5834
 
                                        None, None, 1)
 
5603
                                        check_props=True)
5835
5604
 
5836
 
  svntest.actions.run_and_verify_svn("resolve failed", None, [],
 
5605
  svntest.actions.run_and_verify_svn(None, [],
5837
5606
                                     'resolve',
5838
5607
                                     '--recursive',
5839
5608
                                     '--accept=mine-conflict',
5866
5635
                                        expected_output,
5867
5636
                                        None,
5868
5637
                                        expected_status,
5869
 
                                        None, None, None,
5870
 
                                        None, None, False,
 
5638
                                        [], False,
5871
5639
                                        '--set-depth', 'exclude',
5872
5640
                                        sbox.ospath('A'))
5873
5641
 
5897
5665
                                        expected_output,
5898
5666
                                        None,
5899
5667
                                        expected_status,
5900
 
                                        None, None, None,
5901
 
                                        None, None, False,
 
5668
                                        [], False,
5902
5669
                                        '--parents',
5903
5670
                                        sbox.ospath('A/B'))
5904
5671
 
5982
5749
                                        expected_output,
5983
5750
                                        expected_disk,
5984
5751
                                        expected_status,
5985
 
                                        None, None, None,
5986
 
                                        None, None, 1,
 
5752
                                        [], True,
5987
5753
                                        '-r', '2', wc_dir)
5988
5754
 
5989
5755
  # Cleanup obstructions
5993
5759
  os.rmdir(sbox.ospath('A/mu'))
5994
5760
 
5995
5761
  # Revert to remove working nodes and tree conflicts
5996
 
  svntest.actions.run_and_verify_svn('Reverting', None, [],
 
5762
  svntest.actions.run_and_verify_svn(None, [],
5997
5763
                                     'revert', '-R',
5998
5764
                                     sbox.ospath('A/B'),
5999
5765
                                     sbox.ospath('A/mu'),
6046
5812
                                        expected_output,
6047
5813
                                        expected_disk,
6048
5814
                                        expected_status,
6049
 
                                        None, None, None,
6050
 
                                        None, None, 1,
 
5815
                                        [], True,
6051
5816
                                        '-r', '3', wc_dir)
6052
5817
 
6053
5818
def update_deleted(sbox):
6069
5834
                                        expected_output,
6070
5835
                                        None,
6071
5836
                                        None,
6072
 
                                        None, None, None,
6073
 
                                        None, None, 1,
 
5837
                                        [], True,
6074
5838
                                        sbox.ospath('A/B'))
6075
5839
 
6076
5840
@Issue(3144,3630)
6115
5879
                                        expected_output,
6116
5880
                                        expected_disk,
6117
5881
                                        expected_status,
6118
 
                                        None, None, None,
6119
 
                                        None, None, 1)
 
5882
                                        check_props=True)
6120
5883
 
6121
5884
  # Now resolve the conflict, using --accept=working
6122
5885
  # This should break the move of A/B/E to A/B/E2, leaving A/B/E2
6123
5886
  # as a copy. The deletion of A/B/E is not reverted.
6124
 
  svntest.actions.run_and_verify_svn("resolve failed", None, [],
 
5887
  svntest.actions.run_and_verify_svn(None, [],
6125
5888
                                     'resolve', '--recursive',
6126
5889
                                     '--accept=working', wc_dir)
6127
5890
  expected_status.tweak('A/B/E', treeconflict=None, moved_to=None)
6178
5941
                                        expected_output,
6179
5942
                                        expected_disk,
6180
5943
                                        expected_status,
6181
 
                                        None, None, None,
6182
 
                                        None, None, 1)
 
5944
                                        check_props=True)
6183
5945
 
6184
5946
  # Now resolve the conflict, using --accept=working
6185
5947
  # This should break the move of A/B/E to A/B/E2, leaving A/B/E2
6186
5948
  # as a copy. A/B/E is not reverted.
6187
 
  svntest.actions.run_and_verify_svn("resolve failed", None, [],
 
5949
  svntest.actions.run_and_verify_svn(None, [],
6188
5950
                                     'resolve', '--recursive',
6189
5951
                                     '--accept=working', wc_dir)
6190
5952
  expected_status.tweak('A/B/E2', moved_from=None)
6200
5962
  wc_dir = sbox.wc_dir
6201
5963
  repo_url = sbox.repo_url
6202
5964
 
6203
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
5965
  svntest.actions.run_and_verify_svn(None, [],
6204
5966
                                     'cp', repo_url + '/A',
6205
5967
                                           repo_url + '/AA', '-m', 'Q')
6206
5968
 
6207
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
5969
  svntest.actions.run_and_verify_svn(None, [],
6208
5970
                                     'co', repo_url + '/A', sbox.wc_dir)
6209
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
5971
  svntest.actions.run_and_verify_svn(None, [],
6210
5972
                                     'switch', repo_url + '/AA/B',
6211
5973
                                               wc_dir + '/B')
6212
5974
 
6213
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
5975
  svntest.actions.run_and_verify_svn(None, [],
6214
5976
                                     'rm', repo_url + '/AA/B', '-m', 'Q')
6215
5977
 
6216
5978
  expected_output = svntest.wc.State(wc_dir, {
6358
6120
                                        expected_output,
6359
6121
                                        r5_disk,
6360
6122
                                        expected_status,
6361
 
                                        None, None, None, None, None,
6362
 
                                        True)
 
6123
                                        check_props=True)
6363
6124
 
6364
6125
  # And now we mark the directory incomplete, as if the update had failed
6365
6126
  # half-way through an update to r3
6389
6150
                                        expected_output,
6390
6151
                                        r3_disk,
6391
6152
                                        r3_status,
6392
 
                                        None, None, None, None, None,
6393
 
                                        True,
 
6153
                                        [], True,
6394
6154
                                        wc_dir, '-r', 3)
6395
6155
 
6396
6156
@Issue(4300)
6456
6216
                                        expected_output,
6457
6217
                                        expected_disk,
6458
6218
                                        expected_status,
6459
 
                                        None, None, None,
6460
 
                                        None, None, 1)
 
6219
                                        check_props=True)
6461
6220
 
6462
6221
def move_update_props(sbox):
6463
6222
  "move-update with property mods"
6516
6275
                                        expected_output,
6517
6276
                                        expected_disk,
6518
6277
                                        expected_status,
6519
 
                                        None, None, None,
6520
 
                                        None, None, 1,
 
6278
                                        [], True,
6521
6279
                                        '-r', '2', wc_dir)
6522
6280
 
6523
6281
  # Resolve conflict moving changes to destination without conflict
6524
 
  svntest.actions.run_and_verify_svn("resolve failed", None, [],
 
6282
  svntest.actions.run_and_verify_svn(None, [],
6525
6283
                                     'resolve',
6526
6284
                                     '--accept=mine-conflict',
6527
6285
                                     sbox.ospath('A/B'))
6543
6301
                                        expected_output,
6544
6302
                                        expected_disk,
6545
6303
                                        expected_status,
6546
 
                                        None, None, None,
6547
 
                                        None, None, 1,
 
6304
                                        [], True,
6548
6305
                                        '-r', '3', wc_dir)
6549
6306
 
6550
6307
  # Resolve conflict moving changes and raising property conflicts
6551
 
  svntest.actions.run_and_verify_svn("resolve failed", None, [],
 
6308
  svntest.actions.run_and_verify_svn(None, [],
6552
6309
                                     'resolve',
6553
6310
                                     '--accept=mine-conflict',
6554
6311
                                     sbox.ospath('A/B'))
6563
6320
                                                      'propertyB' : 'value3'})
6564
6321
  extra_files = ['dir_conflicts.prej', 'beta.prej']
6565
6322
  svntest.actions.verify_disk(wc_dir, expected_disk, True,
6566
 
                              svntest.tree.detect_conflict_files, extra_files)
 
6323
                              extra_files=extra_files)
6567
6324
 
6568
6325
@Issues(3288)
6569
6326
@SkipUnless(svntest.main.is_os_windows)
6570
 
@XFail(svntest.main.is_ra_type_dav)
6571
6327
def windows_update_backslash(sbox):
6572
6328
  "test filename with backslashes inside"
6573
6329
 
6575
6331
 
6576
6332
  wc_dir = sbox.wc_dir
6577
6333
 
6578
 
  svntest.actions.run_and_verify_svnmucc(None, None, [],
6579
 
                    '-U', sbox.repo_url,
 
6334
  mucc_url = sbox.repo_url
 
6335
 
 
6336
  if mucc_url.startswith('http'):
 
6337
    # Apache Httpd doesn't allow creating paths with '\\' in them on Windows
 
6338
    # AH00026: found %2f (encoded '/') in URI (decoded='/svn-test-work/repositories/authz_tests-30/!svn/ver/2/A/completely\\unusable\\dir'), returning 404
 
6339
    #
 
6340
    # Let's use file:// to work around.
 
6341
    mucc_url = 'file:///' + os.path.abspath(sbox.repo_dir).replace('\\', '/')
 
6342
 
 
6343
  svntest.actions.run_and_verify_svnmucc(None, [],
 
6344
                    '-U', mucc_url,
6580
6345
                    '-m', '',
6581
6346
                    'mkdir', 'A/completely\\unusable\\dir')
6582
6347
 
6583
6348
  # No error and a proper skip + recording in the working copy would also
6584
6349
  # be a good result. This just verifies current behavior.
6585
6350
 
6586
 
  expected_error = 'svn: E155000: .* is not valid.*'
6587
 
  svntest.actions.run_and_verify_svn(wc_dir, None, expected_error, 'up',
6588
 
                                     wc_dir)
 
6351
  if sbox.repo_url.startswith('http'):
 
6352
    # Apache Httpd doesn't allow paths with '\\' in them on Windows, so the
 
6353
    # test if a user is allowed to read them returns a failure. This makes
 
6354
    # mod_dav_svn report the path as server excluded (aka absent), which
 
6355
    # doesn't produce output when updating.
 
6356
    expected_output = [
 
6357
      "Updating '%s':\n" % wc_dir,
 
6358
      "At revision 2.\n"
 
6359
    ]
 
6360
    expected_err = []
 
6361
  else:
 
6362
    expected_output = None
 
6363
    expected_err = 'svn: E155000: .* is not valid.*'
 
6364
 
 
6365
  svntest.actions.run_and_verify_svn(expected_output, expected_err,
 
6366
                                     'up', wc_dir)
 
6367
 
 
6368
  if sbox.repo_url.startswith('http'):
 
6369
    expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
 
6370
    svntest.actions.run_and_verify_status(wc_dir, expected_status)
6589
6371
 
6590
6372
def update_moved_away(sbox):
6591
6373
  "update subtree of moved away"
6665
6447
                                        expected_output,
6666
6448
                                        expected_disk,
6667
6449
                                        expected_status,
6668
 
                                        None, None, None,
6669
 
                                        None, None, None,
 
6450
                                        [], False,
6670
6451
                                        sbox.ospath('A/B/E'))
6671
6452
 
6672
6453
@Issues(4323)
6676
6457
  sbox.build()
6677
6458
  wc_dir = sbox.wc_dir
6678
6459
 
6679
 
  svntest.actions.run_and_verify_svn(None, None, [],
 
6460
  svntest.actions.run_and_verify_svn(None, [],
6680
6461
                                     'rm', sbox.repo_url + '/A/B',
6681
6462
                                     '-m', '')
6682
6463
 
6707
6488
                                        expected_output,
6708
6489
                                        None,
6709
6490
                                        expected_status,
6710
 
                                        None, None, None,
6711
 
                                        None, None, None,
 
6491
                                        [], False,
6712
6492
                                        '-r', '2', wc_dir)
6713
6493
 
6714
6494
  # A is tree conflicted, so an update of A/D should be a skip/no-op.
6719
6499
                                        expected_output,
6720
6500
                                        None,
6721
6501
                                        expected_status,
6722
 
                                        None, None, None,
6723
 
                                        None, None, None,
 
6502
                                        [], False,
6724
6503
                                        sbox.ospath('A/D'))
6725
6504
 
6726
6505
  # A is tree conflicted, so an update of A/D/G should be a skip/no-op.
6731
6510
                                        expected_output,
6732
6511
                                        None,
6733
6512
                                        expected_status,
6734
 
                                        None, None, None,
6735
 
                                        None, None, None,
 
6513
                                        [], False,
6736
6514
                                        sbox.ospath('A/D/G'))
6737
6515
 
6738
6516
@Issues(4111)
6743
6521
  wc_dir = sbox.wc_dir
6744
6522
 
6745
6523
  sbox.simple_update('A/B', 0)
 
6524
  e_path = sbox.ospath('A/B/E')
6746
6525
 
6747
 
  # Update skips A/B/E because A/B has a not-present BASE node.
6748
 
  expected_output = svntest.wc.State(wc_dir, {
6749
 
      'A/B/E' : Item(verb='Skipped'),
6750
 
  })
 
6526
  # Update skips and errors on A/B/E because A/B has a not-present BASE node.
 
6527
  expected_output = ["Skipped '"+e_path+"'\n"]
 
6528
  expected_err = "svn: E155007: "
6751
6529
  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
6752
6530
  expected_status.remove('A/B', 'A/B/E', 'A/B/E/alpha', 'A/B/E/beta',
6753
6531
                         'A/B/F', 'A/B/lambda')
6754
 
  svntest.actions.run_and_verify_update(wc_dir,
6755
 
                                        expected_output,
6756
 
                                        None,
6757
 
                                        expected_status,
6758
 
                                        None, None, None,
6759
 
                                        None, None, None,
6760
 
                                        sbox.ospath('A/B/E'))
 
6532
  svntest.actions.run_and_verify_svn(expected_output,
 
6533
                                     expected_err,
 
6534
                                     'update', e_path)
 
6535
  svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
6536
 
6761
6537
 
6762
6538
  # Add working nodes over A/B
6763
6539
  sbox.simple_mkdir('A/B')
6769
6545
      'A/B/E'       : Item(status='A ', wc_rev='-'),
6770
6546
      'A/B/E/alpha' : Item(status='A ', wc_rev='-'),
6771
6547
  })
 
6548
  expected_output = svntest.wc.State(wc_dir, {
 
6549
      'A/B/E' : Item(verb='Skipped'),
 
6550
  })
6772
6551
  # Update should still skip A/B/E
6773
6552
  svntest.actions.run_and_verify_update(wc_dir,
6774
6553
                                        expected_output,
6775
6554
                                        None,
6776
6555
                                        expected_status,
6777
 
                                        None, None, None,
6778
 
                                        None, None, None,
 
6556
                                        [], False,
6779
6557
                                        sbox.ospath('A/B/E'))
6780
6558
 
 
6559
def update_conflict_details(sbox):
 
6560
  "update conflict details"
 
6561
 
 
6562
  sbox.build()
 
6563
  wc_dir = sbox.wc_dir
 
6564
 
 
6565
  sbox.simple_append('A/B/E/new', 'new\n')
 
6566
  sbox.simple_add('A/B/E/new')
 
6567
  sbox.simple_append('A/B/E/alpha', '\nextra\nlines\n')
 
6568
  sbox.simple_rm('A/B/E/beta', 'A/B/F')
 
6569
  sbox.simple_propset('key', 'VAL', 'A/B/E', 'A/B')
 
6570
  sbox.simple_mkdir('A/B/E/new-dir1')
 
6571
  sbox.simple_mkdir('A/B/E/new-dir2')
 
6572
  sbox.simple_mkdir('A/B/E/new-dir3')
 
6573
  sbox.simple_rm('A/B/lambda')
 
6574
  sbox.simple_mkdir('A/B/lambda')
 
6575
  sbox.simple_commit()
 
6576
 
 
6577
  sbox.simple_update('', 1)
 
6578
 
 
6579
  sbox.simple_propset('key', 'vAl', 'A/B')
 
6580
  sbox.simple_move('A/B/E/beta', 'beta')
 
6581
  sbox.simple_propset('a', 'b', 'A/B/F', 'A/B/lambda')
 
6582
  sbox.simple_append('A/B/E/alpha', 'other\nnew\nlines')
 
6583
  sbox.simple_mkdir('A/B/E/new')
 
6584
  sbox.simple_mkdir('A/B/E/new-dir1')
 
6585
  sbox.simple_append('A/B/E/new-dir2', 'something')
 
6586
  sbox.simple_append('A/B/E/new-dir3', 'something')
 
6587
  sbox.simple_add('A/B/E/new-dir3')
 
6588
 
 
6589
  expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
 
6590
  expected_status.add({
 
6591
    'A/B/E/new'         : Item(status='R ', treeconflict='C', wc_rev='2'),
 
6592
    'A/B/E/new-dir2'    : Item(status='D ', treeconflict='C', wc_rev='2'),
 
6593
    'A/B/E/new-dir3'    : Item(status='R ', treeconflict='C', wc_rev='2'),
 
6594
    'A/B/E/new-dir1'    : Item(status='  ', wc_rev='2'),
 
6595
    'A/C'               : Item(status='  ', wc_rev='2'),
 
6596
    'iota'              : Item(status='  ', wc_rev='2'),
 
6597
    'beta'              : Item(status='A ', copied='+', wc_rev='-')
 
6598
  })
 
6599
  expected_status.tweak('A/B', status=' C', wc_rev='2')
 
6600
  expected_status.tweak('A/B/E/alpha', status='C ', wc_rev='2')
 
6601
  expected_status.tweak('A/B/E/beta', status='! ', treeconflict='C', wc_rev=None)
 
6602
  expected_status.tweak('A/B/F', status='A ', copied='+', treeconflict='C', wc_rev='-')
 
6603
  expected_status.tweak('A/B/lambda', status='RM', copied='+', treeconflict='C', wc_rev='-')
 
6604
  expected_status.tweak('A/mu', status='  ', wc_rev='2')
 
6605
  expected_output = svntest.wc.State(wc_dir, {
 
6606
    'A/B'               : Item(status=' C'),
 
6607
    'A/B/E'             : Item(status=' U'),
 
6608
    'A/B/E/new'         : Item(status='  ', treeconflict='C'),
 
6609
    'A/B/E/beta'        : Item(status='  ', treeconflict='C'),
 
6610
    'A/B/E/alpha'       : Item(status='C '),
 
6611
    'A/B/E/new-dir2'    : Item(status='  ', treeconflict='C'),
 
6612
    'A/B/E/new-dir3'    : Item(status='  ', treeconflict='C'),
 
6613
    'A/B/E/new-dir1'    : Item(status='E '),
 
6614
    'A/B/F'             : Item(status='  ', treeconflict='C'),
 
6615
    # ### 2 tree conflict reports; one for delete; one for add...
 
6616
    'A/B/lambda'        : Item(status='  ', treeconflict='A',
 
6617
                               prev_status='  ', prev_treeconflict='C'),
 
6618
  })
 
6619
  svntest.actions.run_and_verify_update(wc_dir, expected_output,
 
6620
                                        None, expected_status)
 
6621
 
 
6622
  # Update can't pass source as none at a specific URL@revision,
 
6623
  # because it doesn't know... the working copy could be mixed
 
6624
  # revision or may have excluded parts...
 
6625
  expected_info = [
 
6626
    {
 
6627
      "Path" : re.escape(sbox.ospath('A/B')),
 
6628
 
 
6629
      "Conflict Properties File" :
 
6630
            re.escape(sbox.ospath('A/B/dir_conflicts.prej')) + '.*',
 
6631
      "Conflict Details": re.escape(
 
6632
            'incoming dir edit upon update' +
 
6633
            ' Source  left: (dir) ^/A/B@1' +
 
6634
            ' Source right: (dir) ^/A/B@2')
 
6635
    },
 
6636
    {
 
6637
      "Path" : re.escape(sbox.ospath('A/B/E')),
 
6638
    },
 
6639
    {
 
6640
      "Path" : re.escape(sbox.ospath('A/B/E/alpha')),
 
6641
      "Conflict Previous Base File" : '.*alpha.*',
 
6642
      "Conflict Previous Working File" : '.*alpha.*',
 
6643
      "Conflict Current Base File": '.*alpha.*',
 
6644
      "Conflict Details": re.escape(
 
6645
          'incoming file edit upon update' +
 
6646
          ' Source  left: (file) ^/A/B/E/alpha@1' +
 
6647
          ' Source right: (file) ^/A/B/E/alpha@2')
 
6648
    },
 
6649
    {
 
6650
      "Path" : re.escape(sbox.ospath('A/B/E/beta')),
 
6651
      "Tree conflict": re.escape(
 
6652
          'local file moved away, incoming file delete or move upon update' +
 
6653
          ' Source  left: (file) ^/A/B/E/beta@1' +
 
6654
          ' Source right: (none) ^/A/B/E/beta@2')
 
6655
    },
 
6656
    {
 
6657
      "Path" : re.escape(sbox.ospath('A/B/E/new')),
 
6658
      "Tree conflict": re.escape(
 
6659
          'local dir add, incoming file add upon update' +
 
6660
          ' Source  left: (none)' +
 
6661
          ' Source right: (file) ^/A/B/E/new@2')
 
6662
    },
 
6663
    {
 
6664
      "Path" : re.escape(sbox.ospath('A/B/E/new-dir1')),
 
6665
      # No tree conflict. Existing directory taken over
 
6666
    },
 
6667
    {
 
6668
      "Path" : re.escape(sbox.ospath('A/B/E/new-dir2')),
 
6669
      "Tree conflict": re.escape(
 
6670
          'local file unversioned, incoming dir add upon update' +
 
6671
          ' Source  left: (none)' +
 
6672
          ' Source right: (dir) ^/A/B/E/new-dir2@2')
 
6673
    },
 
6674
    {
 
6675
      "Path" : re.escape(sbox.ospath('A/B/E/new-dir3')),
 
6676
      "Tree conflict": re.escape(
 
6677
          'local file add, incoming dir add upon update' +
 
6678
          ' Source  left: (none)' +
 
6679
          ' Source right: (dir) ^/A/B/E/new-dir3@2')
 
6680
    },
 
6681
    {
 
6682
      "Path" : re.escape(sbox.ospath('A/B/F')),
 
6683
      "Tree conflict": re.escape(
 
6684
          'local dir edit, incoming dir delete or move upon update' +
 
6685
          ' Source  left: (dir) ^/A/B/F@1' +
 
6686
          ' Source right: (none) ^/A/B/F@2')
 
6687
    },
 
6688
    {
 
6689
      "Path" : re.escape(sbox.ospath('A/B/lambda')),
 
6690
      "Tree conflict": re.escape(
 
6691
          'local file edit, incoming replace with dir upon update' +
 
6692
          ' Source  left: (file) ^/A/B/lambda@1' +
 
6693
          ' Source right: (dir) ^/A/B/lambda@2')
 
6694
    },
 
6695
  ]
 
6696
 
 
6697
  svntest.actions.run_and_verify_info(expected_info, sbox.ospath('A/B'),
 
6698
                                      '--depth', 'infinity')
6781
6699
 
6782
6700
#######################################################################
6783
6701
# Run the tests
6823
6741
              update_copied_from_replaced_and_changed,
6824
6742
              update_copied_and_deleted_prop,
6825
6743
              update_accept_conflicts,
6826
 
              eof_in_interactive_conflict_resolver,
6827
6744
              update_uuid_changed,
6828
6745
              restarted_update_should_delete_dir_prop,
6829
6746
              tree_conflicts_on_update_1_1,
6865
6782
              update_moved_away,
6866
6783
              bump_below_tree_conflict,
6867
6784
              update_child_below_add,
 
6785
              update_conflict_details,
6868
6786
             ]
6869
6787
 
6870
6788
if __name__ == '__main__':