1198
1199
None, None, None, None, None,
1202
########################################################################
1205
def switch_relative_external(sbox):
1206
"switch a relative external"
1209
wc_dir = sbox.wc_dir
1210
repo_url = sbox.repo_url
1212
# Create a relative external in A/D on ../B
1213
A_path = os.path.join(wc_dir, 'A')
1214
A_copy_path = os.path.join(wc_dir, 'A_copy')
1215
A_copy_url = repo_url + '/A_copy'
1216
D_path = os.path.join(A_path, 'D')
1217
ext_path = os.path.join(D_path, 'ext')
1218
externals_prop = "../B ext\n"
1219
change_external(D_path, externals_prop)
1220
svntest.actions.run_and_verify_svn(None, None, [],
1221
'ci', '-m', 'log msg',
1224
# Update our working copy, and create a "branch" (A => A_copy)
1225
svntest.actions.run_and_verify_svn(None, None, [], 'up',
1227
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
1228
'--quiet', A_path, A_copy_path)
1229
svntest.actions.run_and_verify_svn(None, None, [],
1230
'ci', '-m', 'log msg',
1233
# Okay. We now want to switch A to A_copy, which *should* cause
1234
# A/D/ext to point to the URL for A_copy/D/ext.
1235
svntest.actions.run_and_verify_svn(None, None, [], 'sw',
1236
'--quiet', A_copy_url, A_path)
1239
{ 'Path' : re.escape(D_path),
1240
'URL' : sbox.repo_url + '/A_copy/D',
1242
{ 'Path' : re.escape(ext_path),
1243
'URL' : sbox.repo_url + '/A_copy/B',
1246
svntest.actions.run_and_verify_info(expected_infos, D_path, ext_path)
1248
#----------------------------------------------------------------------
1251
def wc_repos_file_externals(sbox):
1252
"tag directory with file externals from wc to url"
1255
wc_dir = sbox.wc_dir
1256
repo_url = sbox.repo_url
1258
# Add a file A/theta.
1259
theta_path = os.path.join(wc_dir, 'A', 'theta')
1260
svntest.main.file_write(theta_path, 'theta', 'w')
1261
svntest.main.run_svn(None, 'add', theta_path)
1263
# Created expected output tree for 'svn ci'
1264
expected_output = svntest.wc.State(wc_dir, {
1265
'A/theta' : Item(verb='Adding'),
1268
# Create expected status tree
1269
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
1270
expected_status.add({
1271
'A/theta' : Item(status=' ', wc_rev=2),
1274
# Commit the new file, creating revision 2.
1275
svntest.actions.run_and_verify_commit(wc_dir, expected_output,
1276
expected_status, None, wc_dir)
1279
# Create a file external on the file A/theta
1280
C = os.path.join(wc_dir, 'A', 'C')
1281
external = os.path.join(C, 'theta')
1282
externals_prop = "^/A/theta theta\n"
1284
# Set and commit the property.
1285
change_external(C, externals_prop)
1288
# Now, /A/C/theta is designated as a file external pointing to
1289
# the file /A/theta, but the external file is not there yet.
1290
# Try to actually insert the external file via a verified update:
1291
expected_output = svntest.wc.State(wc_dir, {
1292
'A/C/theta' : Item(status='E '),
1295
expected_disk = svntest.main.greek_state.copy()
1297
'A/theta' : Item('theta'),
1298
'A/C' : Item(props={'svn:externals':externals_prop}),
1299
'A/C/theta' : Item('theta'),
1302
expected_status = svntest.actions.get_virginal_state(wc_dir, 3)
1303
expected_status.add({
1304
'A/theta' : Item(status=' ', wc_rev=3),
1307
svntest.actions.run_and_verify_update(wc_dir,
1311
None, None, None, None, None,
1314
# Copy A/C to a new tag in the repos
1315
tag_url = repo_url + '/A/I'
1316
svntest.main.run_svn(None, 'cp', C, tag_url, '-m', 'create tag')
1318
# Try to actually insert the external file (A/I/theta) via a verified update:
1319
expected_output = svntest.wc.State(wc_dir, {
1320
'A/I' : Item(status='A '),
1321
'A/I/theta' : Item(status='E '),
1324
expected_disk = svntest.main.greek_state.copy()
1326
'A/theta' : Item('theta'),
1327
'A/C' : Item(props={'svn:externals':externals_prop}),
1328
'A/C/theta' : Item('theta'),
1329
'A/I' : Item(props={'svn:externals':externals_prop}),
1330
'A/I/theta' : Item('theta'),
1333
expected_status = svntest.actions.get_virginal_state(wc_dir, 4)
1334
expected_status.add({
1335
'A/theta' : Item(status=' ', wc_rev=4),
1336
'A/I' : Item(status=' ', wc_rev=4),
1339
svntest.actions.run_and_verify_update(wc_dir,
1343
None, None, None, None, None,
1202
1347
########################################################################
1203
1348
# Run the tests