258
257
replace_sbox_with_tarfile(sbox, 'basic_upgrade.tar.bz2')
260
259
# Attempt to use the working copy, this should give an error
261
svntest.actions.run_and_verify_svn(None, None, wc_is_too_old_regex,
260
svntest.actions.run_and_verify_svn(None, wc_is_too_old_regex,
262
261
'info', sbox.wc_dir)
264
263
# Upgrade on something anywhere within a versioned subdir gives a
267
266
# Both cases use the same error code.
268
267
not_wc = ".*(E155007|E155019).*%s'.*not a working copy.*"
269
268
os.mkdir(sbox.ospath('X'))
270
svntest.actions.run_and_verify_svn(None, None, not_wc % 'X',
269
svntest.actions.run_and_verify_svn(None, not_wc % 'X',
271
270
'upgrade', sbox.ospath('X'))
273
272
# Upgrade on a non-existent subdir within an old WC gives a
274
273
# 'not a working copy' error.
275
svntest.actions.run_and_verify_svn(None, None, not_wc % 'Y',
274
svntest.actions.run_and_verify_svn(None, not_wc % 'Y',
276
275
'upgrade', sbox.ospath('Y'))
277
276
# Upgrade on a versioned file within an old WC gives a
278
277
# 'not a working copy' error.
279
svntest.actions.run_and_verify_svn(None, None, not_wc % 'mu',
278
svntest.actions.run_and_verify_svn(None, not_wc % 'mu',
280
279
'upgrade', sbox.ospath('A/mu'))
281
280
# Upgrade on a versioned dir within an old WC gives a
282
281
# 'not a working copy' error.
283
svntest.actions.run_and_verify_svn(None, None, not_wc % 'A',
282
svntest.actions.run_and_verify_svn(None, not_wc % 'A',
284
283
'upgrade', sbox.ospath('A'))
286
285
# Now upgrade the working copy
287
svntest.actions.run_and_verify_svn(None, None, [],
286
svntest.actions.run_and_verify_svn(None, [],
288
287
'upgrade', sbox.wc_dir)
290
289
# Actually check the format number of the upgraded working copy
305
304
# Attempt to use the working copy, this should give an error
306
305
expected_stderr = wc_is_too_old_regex
307
svntest.actions.run_and_verify_svn(None, None, expected_stderr,
306
svntest.actions.run_and_verify_svn(None, expected_stderr,
308
307
'info', sbox.wc_dir)
309
308
# Now upgrade the working copy
310
svntest.actions.run_and_verify_svn(None, None, [],
309
svntest.actions.run_and_verify_svn(None, [],
311
310
'upgrade', sbox.wc_dir)
313
312
# Actually check the format number of the upgraded working copy
321
320
# Attempt to use the working copy, this should give an error
322
321
expected_stderr = wc_is_too_old_regex
323
svntest.actions.run_and_verify_svn(None, None, expected_stderr,
322
svntest.actions.run_and_verify_svn(None, expected_stderr,
324
323
subcommand, sbox.wc_dir)
327
326
# Now upgrade the working copy
328
svntest.actions.run_and_verify_svn(None, None, [],
327
svntest.actions.run_and_verify_svn(None, [],
329
328
'upgrade', sbox.wc_dir)
331
330
# Check the format of the working copy
360
359
# Try to upgrade, this should give an error
361
360
expected_stderr = (".*Cannot upgrade with existing logs; .*")
362
svntest.actions.run_and_verify_svn(None, None, expected_stderr,
361
svntest.actions.run_and_verify_svn(None, expected_stderr,
363
362
'upgrade', sbox.wc_dir)
367
366
"test upgrading a working copy with wcprops"
369
368
replace_sbox_with_tarfile(sbox, 'upgrade_wcprops.tar.bz2')
370
svntest.actions.run_and_verify_svn(None, None, [],
369
svntest.actions.run_and_verify_svn(None, [],
371
370
'upgrade', sbox.wc_dir)
373
372
# Make sure that .svn/all-wcprops has disappeared
438
437
# Attempt to use the working copy, this should give an error
439
438
expected_stderr = wc_is_too_old_regex
440
svntest.actions.run_and_verify_svn(None, None, expected_stderr,
439
svntest.actions.run_and_verify_svn(None, expected_stderr,
441
440
'info', sbox.wc_dir)
444
443
# Now upgrade the working copy
445
svntest.actions.run_and_verify_svn(None, None, [],
444
svntest.actions.run_and_verify_svn(None, [],
446
445
'upgrade', sbox.wc_dir)
447
446
# And the separate working copy below COPIED or check_format() fails
448
svntest.actions.run_and_verify_svn(None, None, [],
447
svntest.actions.run_and_verify_svn(None, [],
450
449
os.path.join(sbox.wc_dir, 'COPIED', 'G'))
521
520
def do_x3_upgrade(sbox, expected_error=[]):
522
521
# Attempt to use the working copy, this should give an error
523
522
expected_stderr = wc_is_too_old_regex
524
svntest.actions.run_and_verify_svn(None, None, expected_stderr,
523
svntest.actions.run_and_verify_svn(None, expected_stderr,
525
524
'info', sbox.wc_dir)
528
527
# Now upgrade the working copy
529
svntest.actions.run_and_verify_svn(None, None, expected_error,
528
svntest.actions.run_and_verify_svn(None, expected_error,
530
529
'upgrade', sbox.wc_dir)
532
531
if expected_error != []:
600
599
'A/G_new/rho' : {'svn:eol-style': 'native'}
603
svntest.actions.run_and_verify_svn(None, 'Reverted.*', [],
602
svntest.actions.run_and_verify_svn('Reverted.*', [],
604
603
'revert', '-R', sbox.wc_dir)
606
605
expected_status = svntest.wc.State(sbox.wc_dir,
665
664
# touch wc/A/D wc/A/B_new/F
667
666
replace_sbox_with_tarfile(sbox, 'missing-dirs.tar.bz2')
668
svntest.actions.run_and_verify_svn(None, None, [],
667
svntest.actions.run_and_verify_svn(None, [],
669
668
'upgrade', sbox.wc_dir)
670
669
expected_status = svntest.wc.State(sbox.wc_dir,
694
693
os.remove(sbox.ospath('A/B_new/F'))
695
694
os.mkdir(sbox.ospath('A/D'))
696
695
os.mkdir(sbox.ospath('A/B_new/F'))
697
svntest.actions.run_and_verify_svn(None, None, [],
696
svntest.actions.run_and_verify_svn(None, [],
698
697
'upgrade', sbox.wc_dir)
699
698
expected_status = svntest.wc.State(sbox.wc_dir,
722
721
replace_sbox_with_tarfile(sbox, 'wc-delete.tar.bz2')
724
svntest.actions.run_and_verify_svn(None, None, [],
723
svntest.actions.run_and_verify_svn(None, [],
725
724
'upgrade', sbox.wc_dir)
727
726
expected_status = svntest.wc.State(sbox.wc_dir,
752
751
expected_output = ["Upgraded '%s'\n" % (sbox.ospath('').rstrip(os.path.sep)),
753
752
"Upgraded '%s'\n" % (sbox.ospath('A'))]
755
svntest.actions.run_and_verify_svn(None, expected_output, [],
754
svntest.actions.run_and_verify_svn(expected_output, [],
756
755
'upgrade', sbox.wc_dir)
758
757
expected_status = svntest.wc.State(sbox.wc_dir, {
823
822
wc_dir = sbox.wc_dir
824
823
replace_sbox_with_tarfile(sbox, 'delete-in-copy.tar.bz2')
826
svntest.actions.run_and_verify_svn(None, None, [],
825
svntest.actions.run_and_verify_svn(None, [],
827
826
'upgrade', sbox.wc_dir)
829
828
expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
838
837
run_and_verify_status_no_server(sbox.wc_dir, expected_status)
840
svntest.actions.run_and_verify_svn(None, 'Reverted.*', [], 'revert', '-R',
839
svntest.actions.run_and_verify_svn('Reverted.*', [], 'revert', '-R',
841
840
sbox.ospath('A/B-copied/E'))
843
842
expected_status.tweak('A/B-copied/E',
856
855
wc_dir = sbox.wc_dir
857
856
replace_sbox_with_tarfile(sbox, 'replaced-files.tar.bz2')
859
svntest.actions.run_and_verify_svn(None, None, [],
858
svntest.actions.run_and_verify_svn(None, [],
860
859
'upgrade', sbox.wc_dir)
862
861
# A is a checked-out dir containing A/f and A/g, then
894
893
[sbox.ospath('B/f'), '395dfb603d8a4e0348d0b082803f2b7426c76eb9'],
895
894
[sbox.ospath('B/g'), None]])
897
svntest.actions.run_and_verify_svn(None, 'Reverted.*', [], 'revert',
896
svntest.actions.run_and_verify_svn('Reverted.*', [], 'revert',
898
897
sbox.ospath('A/f'), sbox.ospath('B/f'),
899
898
sbox.ospath('A/g'), sbox.ospath('B/g'))
917
916
replace_sbox_with_tarfile(sbox, 'upgrade_with_scheduled_change.tar.bz2')
919
svntest.actions.run_and_verify_svn(None, None, [],
918
svntest.actions.run_and_verify_svn(None, [],
920
919
'upgrade', sbox.wc_dir)
921
920
expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
922
921
expected_status.add({
931
930
replace_sbox_with_tarfile(sbox, 'tree-replace1.tar.bz2')
933
svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
932
svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
935
934
expected_status = svntest.wc.State(sbox.wc_dir,
937
936
'' : Item(status=' M', wc_rev=17),
938
937
'B' : Item(status='R ', copied='+', wc_rev='-'),
939
'B/f' : Item(status='R ', copied='+', wc_rev='-'),
938
'B/f' : Item(status=' ', copied='+', wc_rev='-'),
940
939
'B/g' : Item(status='D ', wc_rev=17),
941
'B/h' : Item(status='A ', copied='+', wc_rev='-'),
942
'B/C' : Item(status='R ', copied='+', wc_rev='-'),
943
'B/C/f' : Item(status='R ', copied='+', wc_rev='-'),
940
'B/h' : Item(status=' ', copied='+', wc_rev='-'),
941
'B/C' : Item(status=' ', copied='+', wc_rev='-'),
942
'B/C/f' : Item(status=' ', copied='+', wc_rev='-'),
944
943
'B/D' : Item(status='D ', wc_rev=17),
945
944
'B/D/f' : Item(status='D ', wc_rev=17),
946
'B/E' : Item(status='A ', copied='+', wc_rev='-'),
947
'B/E/f' : Item(status='A ', copied='+', wc_rev='-'),
945
'B/E' : Item(status=' ', copied='+', wc_rev='-'),
946
'B/E/f' : Item(status=' ', copied='+', wc_rev='-'),
949
948
run_and_verify_status_no_server(sbox.wc_dir, expected_status)
955
954
replace_sbox_with_tarfile(sbox, 'tree-replace2.tar.bz2')
957
svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
956
svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
959
958
expected_status = svntest.wc.State(sbox.wc_dir,
962
961
'B' : Item(status='R ', copied='+', wc_rev='-'),
963
962
'B/f' : Item(status='D ', wc_rev=12),
964
963
'B/D' : Item(status='D ', wc_rev=12),
965
'B/g' : Item(status='A ', copied='+', wc_rev='-'),
966
'B/E' : Item(status='A ', copied='+', wc_rev='-'),
964
'B/g' : Item(status=' ', copied='+', wc_rev='-'),
965
'B/E' : Item(status=' ', copied='+', wc_rev='-'),
967
966
'C' : Item(status='R ', copied='+', wc_rev='-'),
968
'C/f' : Item(status='A ', copied='+', wc_rev='-'),
969
'C/D' : Item(status='A ', copied='+', wc_rev='-'),
967
'C/f' : Item(status=' ', copied='+', wc_rev='-'),
968
'C/D' : Item(status=' ', copied='+', wc_rev='-'),
970
969
'C/g' : Item(status='D ', wc_rev=12),
971
970
'C/E' : Item(status='D ', wc_rev=12),
988
987
assert not os.path.exists(new_pristine_path)
991
svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
990
svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
993
992
assert not os.path.exists(old_pristine_path)
994
993
assert os.path.exists(new_pristine_path)
1000
999
replace_sbox_with_tarfile(sbox, 'depth_exclude.tar.bz2')
1002
svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
1001
svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
1004
1003
expected_status = svntest.wc.State(sbox.wc_dir,
1016
1015
replace_sbox_with_tarfile(sbox, 'depth_exclude_2.tar.bz2')
1018
svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
1017
svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
1020
1019
expected_status = svntest.wc.State(sbox.wc_dir,
1031
1030
replace_sbox_with_tarfile(sbox, 'add_add_del_del_tc.tar.bz2')
1033
svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
1032
svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
1035
1034
expected_status = svntest.wc.State(sbox.wc_dir,
1049
1048
replace_sbox_with_tarfile(sbox, 'add_add_x2.tar.bz2')
1051
svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
1050
svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
1053
1052
expected_status = svntest.wc.State(sbox.wc_dir,
1079
1078
# Attempt to use the working copy, this should give an error
1080
1079
expected_stderr = wc_is_too_old_regex
1081
svntest.actions.run_and_verify_svn(None, None, expected_stderr,
1080
svntest.actions.run_and_verify_svn(None, expected_stderr,
1082
1081
'info', sbox.wc_dir)
1084
1083
# Now remove a subdirectory
1094
1093
"Upgraded '%s'\n" % sbox.ospath('A/D/G'),
1095
1094
"Upgraded '%s'\n" % sbox.ospath('A/D/H'),
1097
svntest.actions.run_and_verify_svn(None, expected_output, [],
1096
svntest.actions.run_and_verify_svn(expected_output, [],
1098
1097
'upgrade', sbox.wc_dir)
1100
1099
# And now perform an update. (This used to fail with an assertion)
1123
1122
replace_sbox_with_tarfile(sbox, 'upgrade_locked.tar.bz2')
1125
svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
1124
svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
1127
1126
expected_status = svntest.wc.State(sbox.wc_dir,
1145
1144
'07146bbd-0b64-4aaf-ab70-cd76a0df2d41')
1147
1146
expected_output = svntest.verify.RegexOutput('r2 committed.*')
1148
svntest.actions.run_and_verify_svnmucc(None, expected_output, [],
1147
svntest.actions.run_and_verify_svnmucc(expected_output, [],
1150
1149
'propset', 'svn:externals',
1151
1150
'^/A/B/E EX\n^/A/mu muX',
1152
1151
sbox.repo_url + '/A/B/F')
1154
1153
expected_output = svntest.verify.RegexOutput('r3 committed.*')
1155
svntest.actions.run_and_verify_svnmucc(None, expected_output, [],
1154
svntest.actions.run_and_verify_svnmucc(expected_output, [],
1157
1156
'propset', 'svn:externals',
1158
1157
'^/A/B/F FX\n^/A/B/lambda lambdaX',
1159
1158
sbox.repo_url + '/A/C')
1161
1160
expected_output = svntest.verify.RegexOutput('r4 committed.*')
1162
svntest.actions.run_and_verify_svnmucc(None, expected_output, [],
1161
svntest.actions.run_and_verify_svnmucc(expected_output, [],
1164
1163
'propset', 'pname1', 'pvalue1',
1165
1164
sbox.repo_url + '/A/mu',
1168
1167
'propset', 'pname3', 'pvalue3',
1169
1168
sbox.repo_url + '/A/B/E/alpha')
1171
svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
1172
svntest.actions.run_and_verify_svn(None, None, [], 'relocate',
1170
svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
1171
svntest.actions.run_and_verify_svn(None, [], 'relocate',
1173
1172
'file:///tmp/repo', sbox.repo_url,
1214
1213
sbox.build(create_wc=False)
1215
1214
replace_sbox_with_tarfile(sbox, 'upgrade_missing_replaced.tar.bz2')
1217
svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
1216
svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
1218
1217
svntest.main.run_svnadmin('setuuid', sbox.repo_dir,
1219
1218
'd7130b12-92f6-45c9-9217-b9f0472c3fab')
1220
svntest.actions.run_and_verify_svn(None, None, [], 'relocate',
1219
svntest.actions.run_and_verify_svn(None, [], 'relocate',
1221
1220
'file:///tmp/repo', sbox.repo_url,
1240
1239
svntest.actions.run_and_verify_update(sbox.wc_dir, expected_output,
1241
1240
None, expected_status)
1243
svntest.actions.run_and_verify_svn(None, 'Reverted.*', [], 'revert', '-R',
1242
svntest.actions.run_and_verify_svn('Reverted.*', [], 'revert', '-R',
1245
1244
expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
1246
1245
# And verify that the state is now valid in both the entries an status world.
1253
1252
sbox.build(create_wc=False)
1254
1253
replace_sbox_with_tarfile(sbox, 'upgrade_not_present_replaced.tar.bz2')
1256
svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
1255
svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
1257
1256
svntest.main.run_svnadmin('setuuid', sbox.repo_dir,
1258
1257
'd7130b12-92f6-45c9-9217-b9f0472c3fab')
1259
svntest.actions.run_and_verify_svn(None, None, [], 'relocate',
1258
svntest.actions.run_and_verify_svn(None, [], 'relocate',
1260
1259
'file:///tmp/repo', sbox.repo_url,
1280
1279
# The working copy contains a text conflict, and upgrading such
1281
1280
# a working copy used to cause a pointless 'upgrade required' error.
1282
svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
1281
svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
1284
1283
def do_iprops_upgrade(nonrootfile, rootfile, sbox):
1286
1285
wc_dir = sbox.wc_dir
1288
1287
replace_sbox_with_tarfile(sbox, nonrootfile)
1289
svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
1290
svntest.actions.run_and_verify_svn(None, None, [], 'relocate',
1288
svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
1289
svntest.actions.run_and_verify_svn(None, [], 'relocate',
1291
1290
'file:///tmp/repo', sbox.repo_url, wc_dir)
1293
1292
expected_output = []
1335
1334
# Now try with a repository root working copy
1336
1335
replace_sbox_with_tarfile(sbox, rootfile)
1337
svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
1338
svntest.actions.run_and_verify_svn(None, None, [], 'relocate',
1336
svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
1337
svntest.actions.run_and_verify_svn(None, [], 'relocate',
1339
1338
'file:///tmp/repo', sbox.repo_url, wc_dir)
1341
1340
# Unswitched inherited props available after upgrade
1418
1417
svntest.main.run_svnadmin('setuuid', sbox.repo_dir,
1419
1418
'aa4c97bd-2e1a-4e55-a1e5-3db22cff2673')
1420
1419
replace_sbox_with_tarfile(sbox, 'changelist_upgrade_1_6.tar.bz2')
1421
svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
1420
svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
1423
1422
exit_code, output, errput = svntest.main.run_svn(None, 'info', sbox.wc_dir,
1424
1423
'--depth', 'infinity',
1438
1437
# This fails for 'make check EXCLUSIVE_WC_LOCKS=1' giving an error:
1439
1438
# svn: warning: W200033: sqlite[S5]: database is locked
1440
svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
1439
svntest.actions.run_and_verify_svn(None, [], 'upgrade', sbox.wc_dir)
1441
@SkipUnless(svntest.wc.python_sqlite_can_read_wc)
1442
1442
def auto_analyze(sbox):
1443
1443
"""automatic SQLite ANALYZE"""