113
112
# Set props on file which is copy-source later on
114
113
pi_path = sbox.ospath('A/D/G/pi')
115
114
rho_path = sbox.ospath('A/D/G/rho')
116
svntest.actions.run_and_verify_svn(None, None, [],
115
svntest.actions.run_and_verify_svn(None, [],
117
116
'ps', 'phony-prop', '-F',
118
117
prop_path, pi_path)
119
118
os.remove(prop_path)
120
svntest.actions.run_and_verify_svn(None, None, [],
119
svntest.actions.run_and_verify_svn(None, [],
121
120
'ps', 'svn:eol-style', 'LF', rho_path)
123
122
# Verify props having been set
139
138
expected_status.tweak('A/D/G/rho', wc_rev='2')
140
139
svntest.actions.run_and_verify_commit(wc_dir,
145
143
# Bring wc into sync
146
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
144
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
148
146
# File scheduled for deletion
149
svntest.actions.run_and_verify_svn(None, None, [], 'rm', rho_path)
147
svntest.actions.run_and_verify_svn(None, [], 'rm', rho_path)
151
149
# Status before attempting copies
152
150
expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
282
279
svntest.main.file_append(rho_path, 'new appended text for rho')
284
281
# Copy rho to D -- local mods
285
svntest.actions.run_and_verify_svn(None, None, [], 'cp', rho_path, D_path)
282
svntest.actions.run_and_verify_svn(None, [], 'cp', rho_path, D_path)
287
284
# Copy alpha to C -- no local mods, and rename it to 'alpha2' also
288
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
285
svntest.actions.run_and_verify_svn(None, [], 'cp',
289
286
alpha_path, alpha2_path)
291
288
# Move mu to H -- local mods
292
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
289
svntest.actions.run_and_verify_svn(None, [], 'mv',
295
292
# Move iota to F -- no local mods
296
svntest.actions.run_and_verify_svn(None, None, [], 'mv', iota_path, F_path)
293
svntest.actions.run_and_verify_svn(None, [], 'mv', iota_path, F_path)
298
295
# Created expected output tree for 'svn ci':
299
296
# We should see four adds, two deletes, and one change in total.
337
332
expected_status.tweak('A/C/alpha2', wc_rev=3)
338
333
svntest.actions.run_and_verify_commit(wc_dir,
344
337
# Assure that attempts at local copy and move fail when a log
345
338
# message is provided.
346
339
expected_stderr = \
347
340
".*Local, non-commit operations do not take a log message"
348
svntest.actions.run_and_verify_svn(None, None, expected_stderr,
341
svntest.actions.run_and_verify_svn(None, expected_stderr,
349
342
'cp', '-m', 'op fails', rho_path, D_path)
350
svntest.actions.run_and_verify_svn(None, None, expected_stderr,
343
svntest.actions.run_and_verify_svn(None, expected_stderr,
351
344
'mv', '-m', 'op fails', rho_path, D_path)
547
534
dirURL2 = sbox.repo_url + "/A/D/H"
549
536
# Expect out-of-date failure if 'svn cp URL URL' tries to overwrite a file
550
svntest.actions.run_and_verify_svn("Whoa, I was able to overwrite a file!",
551
None, svntest.verify.AnyOutput,
537
svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput,
552
538
'cp', fileURL1, fileURL2,
555
541
# Create A/D/H/G by running 'svn cp ...A/D/G .../A/D/H'
556
svntest.actions.run_and_verify_svn(None, None, [],
542
svntest.actions.run_and_verify_svn(None, [],
557
543
'cp', dirURL1, dirURL2,
560
546
# Repeat the last command. It should *fail* because A/D/H/G already exists.
561
547
svntest.actions.run_and_verify_svn(
562
"Whoa, I was able to overwrite a directory!",
563
None, svntest.verify.AnyOutput,
548
None, ".*'/A/D/H/G'.*",
564
549
'cp', dirURL1, dirURL2,
647
630
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
648
631
expected_status.tweak('A/D/G/rho', status=' ', wc_rev=2)
649
632
svntest.actions.run_and_verify_commit(wc_dir,
650
expected_output, expected_status,
633
expected_output, expected_status)
653
635
# Set another property, but don't commit it yet
654
svntest.actions.run_and_verify_svn(None, None, [],
636
svntest.actions.run_and_verify_svn(None, [],
655
637
'propset', 'pname2', 'pval2', rho_path)
657
639
# WC to WC copy of file with committed and uncommitted properties
658
640
rho_wc_path = sbox.ospath('A/D/G/rho_wc')
659
svntest.actions.run_and_verify_svn(None, None, [],
641
svntest.actions.run_and_verify_svn(None, [],
660
642
'copy', rho_path, rho_wc_path)
662
644
# REPOS to WC copy of file with properties
663
645
rho_url_path = sbox.ospath('A/D/G/rho_url')
664
646
rho_url = sbox.repo_url + '/A/D/G/rho'
665
svntest.actions.run_and_verify_svn(None, None, [],
647
svntest.actions.run_and_verify_svn(None, [],
666
648
'copy', rho_url, rho_url_path)
668
650
# Properties are not visible in WC status 'A'
674
656
svntest.actions.run_and_verify_status(wc_dir, expected_status)
676
658
# Check properties explicitly
677
svntest.actions.run_and_verify_svn(None, ['pval\n'], [],
659
svntest.actions.run_and_verify_svn(['pval\n'], [],
678
660
'propget', 'pname', rho_wc_path)
679
svntest.actions.run_and_verify_svn(None, ['pval2\n'], [],
661
svntest.actions.run_and_verify_svn(['pval2\n'], [],
680
662
'propget', 'pname2', rho_wc_path)
681
svntest.actions.run_and_verify_svn(None, ['pval\n'], [],
663
svntest.actions.run_and_verify_svn(['pval\n'], [],
682
664
'propget', 'pname', rho_url_path)
684
666
# Commit and properties are visible in status
710
691
B2_path = sbox.ospath('A/B2')
713
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
694
svntest.actions.run_and_verify_svn(None, [], 'cp',
716
697
# delete two files
717
698
lambda_path = sbox.ospath('A/B2/lambda')
718
699
alpha_path = sbox.ospath('A/B2/E/alpha')
719
svntest.actions.run_and_verify_svn(None, None, [],
700
svntest.actions.run_and_verify_svn(None, [],
720
701
'rm', alpha_path, lambda_path)
722
703
# commit copied tree containing a deleted file
728
709
svntest.actions.run_and_verify_commit(wc_dir,
735
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
714
svntest.actions.run_and_verify_svn(None, [], 'cp',
736
715
sbox.ospath('A/B'),
737
716
sbox.ospath('A/B3'))
739
718
# delete a directory
740
719
E_path = sbox.ospath('A/B3/E')
741
svntest.actions.run_and_verify_svn(None, None, [], 'rm', E_path)
720
svntest.actions.run_and_verify_svn(None, [], 'rm', E_path)
743
722
# commit copied tree containing a deleted directory
744
723
expected_output = svntest.wc.State(wc_dir, {
804
781
# Create the first file.
805
782
svntest.main.file_append(newpath1, "a new file")
806
svntest.actions.run_and_verify_svn(None, None, [], 'add', newpath1)
783
svntest.actions.run_and_verify_svn(None, [], 'add', newpath1)
808
785
mode1 = os.stat(newpath1)[stat.ST_MODE]
810
787
# Doing this to get the executable bit set on systems that support
811
788
# that -- the property itself is not the point.
812
svntest.actions.run_and_verify_svn(None, None, [], 'propset',
789
svntest.actions.run_and_verify_svn(None, [], 'propset',
813
790
'svn:executable', 'on', newpath1)
815
792
mode2 = os.stat(newpath1)[stat.ST_MODE]
850
827
# modify some items to be copied
851
828
svntest.main.file_append(sbox.ospath('A/D/H/omega'),
853
svntest.actions.run_and_verify_svn(None, None, [], 'propset', 'foo', 'bar',
830
svntest.actions.run_and_verify_svn(None, [], 'propset', 'foo', 'bar',
857
svntest.actions.run_and_verify_svn(None, None, [], '-m', 'fumble file',
834
svntest.actions.run_and_verify_svn(None, [], '-m', 'fumble file',
858
835
'copy', beta_path, beta2_url)
859
836
# and a directory
860
svntest.actions.run_and_verify_svn(None, None, [], '-m', 'fumble dir',
837
svntest.actions.run_and_verify_svn(None, [], '-m', 'fumble dir',
861
838
'copy', H_path, H2_url)
862
839
# copy a file to a directory
863
svntest.actions.run_and_verify_svn(None, None, [], '-m', 'fumble file',
840
svntest.actions.run_and_verify_svn(None, [], '-m', 'fumble file',
864
841
'copy', beta_path, H2_url)
866
843
# update the working copy. post-update mereinfo elision will remove
927
904
pi_url = sbox.repo_url + "/A/D/G/pi"
928
905
pi_path = sbox.ospath('pi')
930
svntest.actions.run_and_verify_svn(None, None, [], 'copy', E_url, wc_dir)
931
svntest.actions.run_and_verify_svn(None, None, [], 'copy', pi_url, wc_dir)
907
svntest.actions.run_and_verify_svn(None, [], 'copy', E_url, wc_dir)
908
svntest.actions.run_and_verify_svn(None, [], 'copy', pi_url, wc_dir)
933
910
# Extra test: modify file ASAP to check there was a timestamp sleep
934
911
svntest.main.file_append(pi_path, 'zig\n')
995
972
'A %s\n' % sbox.ospath('E/beta'),
996
973
'A %s\n' % sbox.ospath('E/alpha'),
998
svntest.actions.run_and_verify_svn(None, expected_output, [],
975
svntest.actions.run_and_verify_svn(expected_output, [],
999
976
'copy', E_url, wc_dir)
1001
978
expected_output = [
1002
979
'--- Copying from foreign repository URL \'%s\':\n' % pi_url,
1003
980
'A %s\n' % sbox.ospath('pi'),
1005
svntest.actions.run_and_verify_svn(None, expected_output, [],
982
svntest.actions.run_and_verify_svn(expected_output, [],
1006
983
'copy', pi_url, wc_dir)
1008
985
expected_output = svntest.actions.get_virginal_state(wc_dir, 1)
1258
1235
target_wc_path = sbox.ospath('new_file')
1260
1237
# Copy a file from the repository to the working copy.
1261
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
1238
svntest.actions.run_and_verify_svn(None, [], 'cp',
1262
1239
iota_repos_path, target_wc_path)
1265
svntest.actions.run_and_verify_svn(None, None, [], 'diff', wc_dir)
1242
svntest.actions.run_and_verify_svn(None, [], 'diff', wc_dir)
1268
1245
#-------------------------------------------------------------
1287
1264
"Hello\nSubversion\n$LastChangedRevision$\n",
1290
svntest.actions.run_and_verify_svn(None, None, [],
1267
svntest.actions.run_and_verify_svn(None, [],
1291
1268
'propset', 'svn:eol-style',
1292
1269
'CRLF', iota_wc_path)
1294
svntest.actions.run_and_verify_svn(None, None, [],
1271
svntest.actions.run_and_verify_svn(None, [],
1295
1272
'propset', 'svn:keywords',
1296
1273
'Rev', iota_wc_path)
1298
svntest.actions.run_and_verify_svn(None, None, [],
1275
svntest.actions.run_and_verify_svn(None, [],
1299
1276
'commit', '-m', 'log msg',
1302
1279
# Copy a file from the repository to the working copy.
1303
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
1280
svntest.actions.run_and_verify_svn(None, [], 'cp',
1304
1281
iota_repos_path, target_wc_path)
1306
1283
# The original bug was that the copy would seg fault. So we test
1342
1319
expected_output = svntest.wc.State(wc_dir, {
1343
1320
'A/mu' : Item(verb='Sending'), })
1344
1321
svntest.main.file_append(mu_path, "New r2 text.\n")
1345
svntest.actions.run_and_verify_commit(wc_dir, expected_output, None,
1322
svntest.actions.run_and_verify_commit(wc_dir, expected_output, None)
1347
1323
svntest.main.file_append(mu_path, "New r3 text.\n")
1348
svntest.actions.run_and_verify_commit(wc_dir, expected_output, None,
1350
svntest.actions.run_and_verify_svn(None, None, [], 'up', '-r2', mu_path)
1324
svntest.actions.run_and_verify_commit(wc_dir, expected_output, None)
1325
svntest.actions.run_and_verify_svn(None, [], 'up', '-r2', mu_path)
1351
1326
svntest.main.file_append(mu_path, "Working copy.\n")
1353
1328
r1 = "This is the file 'mu'.\n"
1369
1344
for dst, from_rev, text, peg_rev in sub_tests:
1370
1345
dst_path = os.path.join(wc_dir, dst)
1371
1346
if peg_rev is None:
1372
svntest.actions.run_and_verify_svn(None, None, [], "copy",
1347
svntest.actions.run_and_verify_svn(None, [], "copy",
1373
1348
mu_path, dst_path)
1375
svntest.actions.run_and_verify_svn(None, None, [], "copy",
1350
svntest.actions.run_and_verify_svn(None, [], "copy",
1376
1351
mu_path + "@" + peg_rev, dst_path)
1377
1352
expected_disk.add({ dst: Item(contents=text) })
1475
1449
base_url = sbox.repo_url + '/base'
1478
svntest.actions.run_and_verify_svn(None, None, [],
1452
svntest.actions.run_and_verify_svn(None, [],
1479
1453
'mkdir', '-m', 'mybase',
1482
1456
orig_url = base_url + '/foo%20bar'
1485
svntest.actions.run_and_verify_svn(None, None, [],
1459
svntest.actions.run_and_verify_svn(None, [],
1486
1460
'mkdir', '-m', 'r1',
1491
1465
new_url = base_url + '/foo_bar'
1492
svntest.actions.run_and_verify_svn(None, None, [],
1466
svntest.actions.run_and_verify_svn(None, [],
1493
1467
'mv', '-m', 'r2',
1494
1468
orig_url, new_url)
1496
1470
# This had failed with ra_neon because "foo bar" would be double-encoded
1497
1471
# "foo bar" ==> "foo%20bar" ==> "foo%2520bar"
1498
svntest.actions.run_and_verify_svn(None, None, [],
1472
svntest.actions.run_and_verify_svn(None, [],
1499
1473
'ls', ('-r'+str(orig_rev)),
1500
1474
'-R', base_url)
1676
1648
new_url = sbox.repo_url + '/newfile'
1678
1650
# Delete a directory
1679
svntest.actions.run_and_verify_svn(None, None, [],
1651
svntest.actions.run_and_verify_svn(None, [],
1681
1653
adg_url, '-m', '')
1683
1655
# Copy a file to where the directory used to be
1684
svntest.actions.run_and_verify_svn(None, None, [],
1656
svntest.actions.run_and_verify_svn(None, [],
1686
1658
iota_url, adg_url,
1689
1661
# Try copying a file that was in the deleted directory that is now a
1691
svntest.actions.run_and_verify_svn(None, None, [],
1663
svntest.actions.run_and_verify_svn(None, [],
1693
1665
pi_url + '@1', new_url,
1742
1714
rho_path = sbox.ospath('A/D/G/rho')
1744
1716
# Remove A/D/G/pi, then commit that removal.
1745
svntest.actions.run_and_verify_svn(None, None, [], 'rm', pi_path)
1746
svntest.actions.run_and_verify_svn(None, None, [],
1717
svntest.actions.run_and_verify_svn(None, [], 'rm', pi_path)
1718
svntest.actions.run_and_verify_svn(None, [],
1747
1719
'ci', '-m', "Delete pi.", wc_dir)
1749
1721
# Make a modification to A/D/G/rho, then commit that modification.
1750
1722
svntest.main.file_append(rho_path, "\nFirst modification to rho.\n")
1751
svntest.actions.run_and_verify_svn(None, None, [],
1723
svntest.actions.run_and_verify_svn(None, [],
1752
1724
'ci', '-m', "Modify rho.", wc_dir)
1754
1726
# Make another modification to A/D/G/rho, but don't commit it.
1755
1727
svntest.main.file_append(rho_path, "Second modification to rho.\n")
1757
1729
# Copy into the source, delete part of the copy, add a non-copied directory
1758
svntest.actions.run_and_verify_svn(None, None, [],
1730
svntest.actions.run_and_verify_svn(None, [],
1759
1731
'cp', B_path, X_path)
1760
svntest.actions.run_and_verify_svn(None, None, [],
1732
svntest.actions.run_and_verify_svn(None, [],
1761
1733
'rm', alpha_path)
1762
svntest.actions.run_and_verify_svn(None, None, [],
1734
svntest.actions.run_and_verify_svn(None, [],
1763
1735
'mkdir', Y_path)
1765
1737
# Now copy local A/D/G to create new directory A/D/Z the repository.
1766
svntest.actions.run_and_verify_svn(None, None, [],
1739
expected_status = svntest.wc.State(G_path, {
1740
'' : Item(status=' ', wc_rev='1'),
1741
'X' : Item(status='A ', copied='+', wc_rev='-'),
1742
'X/F' : Item(status=' ', copied='+', wc_rev='-'),
1743
'X/E' : Item(status=' ', copied='+', wc_rev='-'),
1744
'X/E/alpha' : Item(status='D ', copied='+', wc_rev='-'),
1745
'X/E/beta' : Item(status=' ', copied='+', wc_rev='-'),
1746
'X/lambda' : Item(status=' ', copied='+', wc_rev='-'),
1747
'Y' : Item(status='A ', wc_rev='-'),
1748
'rho' : Item(status='M ', wc_rev='3'),
1749
'tau' : Item(status=' ', wc_rev='1'),
1752
svntest.actions.run_and_verify_status(G_path, expected_status)
1754
expected_output = svntest.verify.UnorderedOutput([
1755
'Adding copy of %s\n' % sbox.ospath('A/D/G'),
1756
'Adding copy of %s\n' % sbox.ospath('A/D/G/X'),
1757
'Deleting copy of %s\n' % sbox.ospath('A/D/G/X/E/alpha'),
1758
'Adding copy of %s\n' % sbox.ospath('A/D/G/Y'),
1759
'Deleting copy of %s\n' % sbox.ospath('A/D/G/pi'),
1760
'Replacing copy of %s\n' % sbox.ospath('A/D/G/rho'),
1761
'Transmitting file data .done\n',
1762
'Committing transaction...\n',
1763
'Committed revision 4.\n',
1765
svntest.actions.run_and_verify_svn(expected_output, [],
1767
1766
'cp', '-m', "Make a copy.",
1769
1768
expected_output = svntest.verify.UnorderedOutput([
1778
1777
'A + A/D/Z/rho\n',
1779
1778
' (from A/D/G/rho:r3)\n',
1781
svntest.actions.run_and_verify_svnlook(None, expected_output, [],
1780
svntest.actions.run_and_verify_svnlook(expected_output, [],
1782
1781
'changed', sbox.repo_dir,
1785
1784
# Copy from copied source
1786
svntest.actions.run_and_verify_svn(None, None, [],
1785
svntest.actions.run_and_verify_svn(None, [],
1787
1786
'cp', '-m', "Make a copy.",
1788
1787
E_path, Z2_url)
1789
1788
expected_output = svntest.verify.UnorderedOutput([
1791
1790
' (from A/B/E/:r1)\n',
1792
1791
'D A/D/Z2/alpha\n',
1794
svntest.actions.run_and_verify_svnlook(None, expected_output, [],
1793
svntest.actions.run_and_verify_svnlook(expected_output, [],
1795
1794
'changed', sbox.repo_dir,
1798
1797
# Check out A/D/Z. If it has pi, that's a bug; or if its rho does
1799
1798
# not have the second local mod, that's also a bug.
1800
1799
svntest.main.safe_rmtree(wc_dir)
1801
svntest.actions.run_and_verify_svn(None, None, [],
1800
svntest.actions.run_and_verify_svn(None, [],
1802
1801
'co', Z_url, wc_dir)
1804
1803
if os.path.exists(sbox.ospath('pi')):
1858
1857
# Copy 'pi' over 'rho' with history.
1859
1858
pi_src = sbox.ospath('A/D/G/pi')
1860
svntest.actions.run_and_verify_svn(None, None, [], 'cp', pi_src, rho_path)
1859
svntest.actions.run_and_verify_svn(None, [], 'cp', pi_src, rho_path)
1862
1861
# Check that file copied.
1863
1862
expected_status.tweak('A/D/G/rho', status='R ', copied='+', wc_rev='-')
1864
1863
svntest.actions.run_and_verify_status(wc_dir, expected_status)
1866
1865
# Now delete replaced file.
1867
svntest.actions.run_and_verify_svn(None, None, [], 'rm',
1866
svntest.actions.run_and_verify_svn(None, [], 'rm',
1868
1867
'--force', rho_path)
1870
1869
# Verify status after deletion.
1889
1888
svntest.main.file_append(unver_path_2, "another unversioned file")
1891
1890
# Try to move an unversioned file.
1892
svntest.actions.run_and_verify_svn(None, None,
1891
svntest.actions.run_and_verify_svn(None,
1893
1892
".*unversioned1' " +
1894
1893
"(does not exist|is not under version control)",
1895
1894
'mv', unver_path_1, dest_path_1)
1897
1896
# Try to forcibly move an unversioned file.
1898
svntest.actions.run_and_verify_svn(None, None,
1897
svntest.actions.run_and_verify_svn(None,
1899
1898
".*unversioned2.* " +
1900
1899
"(does not exist|is not under version control)",
1979
1977
rho_copy_path_2 = sbox.ospath('A/B/F/rho_copy_2')
1981
1979
# Copy A/D/G/rho to A/D/rho_copy_1
1982
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
1980
svntest.actions.run_and_verify_svn(None, [], 'cp',
1983
1981
rho_path, rho_copy_path_1)
1985
1983
# Copy the copied file: A/D/rho_copy_1 to A/B/F/rho_copy_2
1986
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
1984
svntest.actions.run_and_verify_svn(None, [], 'cp',
1987
1985
rho_copy_path_1, rho_copy_path_2)
1989
1987
E_path = sbox.ospath('A/B/E')
1991
1989
E_path_copy_2 = sbox.ospath('A/D/G/E_copy_2')
1993
1991
# Copy A/B/E to A/B/F/E_copy_1
1994
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
1992
svntest.actions.run_and_verify_svn(None, [], 'cp',
1995
1993
E_path, E_path_copy_1)
1997
1995
# Copy the copied dir: A/B/F/E_copy_1 to A/D/G/E_copy_2
1998
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
1996
svntest.actions.run_and_verify_svn(None, [], 'cp',
1999
1997
E_path_copy_1, E_path_copy_2)
2001
1999
# Created expected output tree for 'svn ci':
2037
2033
rho_copy_move_path = sbox.ospath('A/B/F/rho_copy_moved')
2039
2035
# Copy A/D/G/rho to A/D/rho_copy
2040
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
2036
svntest.actions.run_and_verify_svn(None, [], 'cp',
2041
2037
rho_path, rho_copy_path)
2043
2039
# Move the copied file: A/D/rho_copy to A/B/F/rho_copy_moved
2044
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
2040
svntest.actions.run_and_verify_svn(None, [], 'mv',
2045
2041
rho_copy_path, rho_copy_move_path)
2047
2043
E_path = sbox.ospath('A/B/E')
2049
2045
E_path_copy_move = sbox.ospath('A/D/G/E_copy_moved')
2051
2047
# Copy A/B/E to A/B/F/E_copy
2052
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
2048
svntest.actions.run_and_verify_svn(None, [], 'cp',
2053
2049
E_path, E_path_copy)
2055
2051
# Move the copied file: A/B/F/E_copy to A/D/G/E_copy_moved
2056
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
2052
svntest.actions.run_and_verify_svn(None, [], 'mv',
2057
2053
E_path_copy, E_path_copy_move)
2059
2055
# Created expected output tree for 'svn ci':
2092
2086
rho_move_moved_path = sbox.ospath('A/B/F/rho_move_moved')
2094
2088
# Move A/D/G/rho to A/D/rho_moved
2095
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
2089
svntest.actions.run_and_verify_svn(None, [], 'mv',
2096
2090
rho_path, rho_move_path)
2098
2092
# Move the moved file: A/D/rho_moved to A/B/F/rho_move_moved
2099
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
2093
svntest.actions.run_and_verify_svn(None, [], 'mv',
2100
2094
rho_move_path, rho_move_moved_path)
2102
2096
E_path = sbox.ospath('A/B/E')
2104
2098
E_path_move_moved = sbox.ospath('A/D/G/E_move_moved')
2106
2100
# Copy A/B/E to A/B/F/E_moved
2107
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
2101
svntest.actions.run_and_verify_svn(None, [], 'mv',
2108
2102
E_path, E_path_moved)
2110
2104
# Move the moved file: A/B/F/E_moved to A/D/G/E_move_moved
2111
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
2105
svntest.actions.run_and_verify_svn(None, [], 'mv',
2112
2106
E_path_moved, E_path_move_moved)
2114
2108
# Created expected output tree for 'svn ci':
2456
2438
D_move_path = sbox.ospath('D_moved')
2458
2440
# Move A/D to D_moved
2459
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
2441
svntest.actions.run_and_verify_svn(None, [], 'mv',
2460
2442
D_path, D_move_path)
2462
2444
# Move the moved dir: D_moved back to its starting
2463
2445
# location at A/D.
2465
svntest.actions.run_and_verify_svn(None, None, [], 'mv', D_move_path, D_path)
2447
svntest.actions.run_and_verify_svn(None, [], 'mv', D_move_path, D_path)
2467
2449
# Verify that the status indicates a replace with history
2468
2450
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
2490
2472
svntest.main.file_write(eta_path, "This is the file 'eta'\n")
2491
2473
svntest.main.file_write(theta_path, "This is the file 'theta'\n")
2492
2474
svntest.main.file_write(kappa_path, "This is the file 'kappa'\n")
2493
svntest.actions.run_and_verify_svn(None, None, [], 'add', I_path)
2475
svntest.actions.run_and_verify_svn(None, [], 'add', I_path)
2495
2477
# Create another dir and schedule it for addition
2496
2478
K_path = sbox.ospath('K')
2497
2479
os.mkdir(K_path)
2498
svntest.actions.run_and_verify_svn(None, None, [], 'add', K_path)
2480
svntest.actions.run_and_verify_svn(None, [], 'add', K_path)
2500
2482
# Verify all the adds took place correctly.
2501
2483
expected_status_after_adds = svntest.actions.get_virginal_state(wc_dir, 1)
2523
2505
# Copy added dir A/D/I to added dir K/I
2524
2506
I_copy_path = os.path.join(K_path, 'I')
2525
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
2507
svntest.actions.run_and_verify_svn(None, [], 'cp',
2526
2508
I_path, I_copy_path)
2528
2510
# Copy added file A/D/upsilon into added dir K
2529
2511
upsilon_copy_path = os.path.join(K_path, 'upsilon')
2530
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
2512
svntest.actions.run_and_verify_svn(None, [], 'cp',
2531
2513
upsilon_path, upsilon_copy_path)
2533
2515
# Move added file A/D/upsilon to upsilon,
2534
2516
# then move it again to A/upsilon
2535
2517
upsilon_move_path = sbox.ospath('upsilon')
2536
2518
upsilon_move_path_2 = sbox.ospath('A/upsilon')
2537
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
2519
svntest.actions.run_and_verify_svn(None, [], 'mv',
2538
2520
upsilon_path, upsilon_move_path)
2539
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
2521
svntest.actions.run_and_verify_svn(None, [], 'mv',
2540
2522
upsilon_move_path, upsilon_move_path_2)
2542
2524
# Move added dir A/D/I to A/B/I,
2543
2525
# then move it again to A/D/H/I
2544
2526
I_move_path = sbox.ospath('A/B/I')
2545
2527
I_move_path_2 = sbox.ospath('A/D/H/I')
2546
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
2528
svntest.actions.run_and_verify_svn(None, [], 'mv',
2547
2529
I_path, I_move_path)
2548
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
2530
svntest.actions.run_and_verify_svn(None, [], 'mv',
2549
2531
I_move_path, I_move_path_2)
2551
2533
# Created expected output tree for 'svn ci'
2614
2594
# Create a new file, schedule it for addition and set properties
2615
2595
upsilon_path = sbox.ospath('A/D/upsilon')
2616
2596
svntest.main.file_write(upsilon_path, "This is the file 'upsilon'\n")
2617
svntest.actions.run_and_verify_svn(None, None, [], 'add', upsilon_path)
2618
svntest.actions.run_and_verify_svn(None, None, [], 'propset',
2597
svntest.actions.run_and_verify_svn(None, [], 'add', upsilon_path)
2598
svntest.actions.run_and_verify_svn(None, [], 'propset',
2619
2599
'foo', 'bar', upsilon_path)
2621
2601
# Create a dir and schedule it for addition and set properties
2622
2602
I_path = sbox.ospath('A/D/I')
2623
2603
os.mkdir(I_path)
2624
svntest.actions.run_and_verify_svn(None, None, [], 'add', I_path)
2625
svntest.actions.run_and_verify_svn(None, None, [], 'propset',
2604
svntest.actions.run_and_verify_svn(None, [], 'add', I_path)
2605
svntest.actions.run_and_verify_svn(None, [], 'propset',
2626
2606
'foo', 'bar', I_path)
2628
2608
# Verify all the adds took place correctly.
2645
2625
# Copy added dir I to dir A/C
2646
2626
I_copy_path = sbox.ospath('A/C/I')
2647
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
2627
svntest.actions.run_and_verify_svn(None, [], 'cp',
2648
2628
I_path, I_copy_path)
2650
2630
# Copy added file A/upsilon into dir A/C
2651
2631
upsilon_copy_path = sbox.ospath('A/C/upsilon')
2652
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
2632
svntest.actions.run_and_verify_svn(None, [], 'cp',
2653
2633
upsilon_path, upsilon_copy_path)
2655
2635
# Created expected output tree for 'svn ci'
2733
2711
# Copy added file A/D/upsilon to URL://A/C/upsilon
2734
2712
upsilon_copy_URL = sbox.repo_url + '/A/C/upsilon'
2735
svntest.actions.run_and_verify_svn(None, None, [],
2713
svntest.actions.run_and_verify_svn(None, [],
2736
2714
'cp', '-m', '',
2737
2715
upsilon_path, upsilon_copy_URL)
2739
# Validate the merge info of the copy destination (we expect none).
2740
svntest.actions.run_and_verify_svn(None, [], [],
2717
# Validate the mergeinfo of the copy destination (we expect none).
2718
svntest.actions.run_and_verify_svn([], '.*W200017: Property.*not found',
2742
2720
SVN_PROP_MERGEINFO, upsilon_copy_URL)
2744
2722
# Copy added dir A/D/I to URL://A/D/G/I
2745
2723
I_copy_URL = sbox.repo_url + '/A/D/G/I'
2746
svntest.actions.run_and_verify_svn(None, None, [],
2724
svntest.actions.run_and_verify_svn(None, [],
2747
2725
'cp', '-m', '',
2748
2726
I_path, I_copy_URL)
3159
3131
# We need this in order to check that we don't end up with URI-encoded
3160
3132
# paths in the WC (issue #2955)
3161
svntest.actions.run_and_verify_svn(None, None, [], 'mv', '-m', 'log_msg',
3133
svntest.actions.run_and_verify_svn(None, [], 'mv', '-m', 'log_msg',
3162
3134
sbox.repo_url + '/A/D/H/omega',
3163
3135
omega_with_space_url)
3165
3137
# Perform the copy and check the output
3166
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
3138
svntest.actions.run_and_verify_svn(None, [], 'cp',
3167
3139
chi_url, psi_url, omega_with_space_url,
3269
3240
# Play a shell game with some WC files, then commit the changes back
3270
3241
# to the repository (making r2).
3271
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
3242
svntest.actions.run_and_verify_svn(None, [], 'mv',
3272
3243
psi_path, new_iota_path)
3273
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
3244
svntest.actions.run_and_verify_svn(None, [], 'mv',
3274
3245
iota_path, psi_path)
3275
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
3246
svntest.actions.run_and_verify_svn(None, [], 'mv',
3276
3247
new_iota_path, iota_path)
3278
svntest.actions.run_and_verify_svn(None, None, [],
3249
svntest.actions.run_and_verify_svn(None, [],
3283
3254
# Copy using a peg rev (remember, the object at iota_path at HEAD
3284
3255
# was at psi_path back at r1).
3285
svntest.actions.run_and_verify_svn(None, None, [],
3256
svntest.actions.run_and_verify_svn(None, [],
3287
3258
iota_path + '@HEAD', '-r', '1',
3290
3261
# Commit and verify disk contents
3291
svntest.actions.run_and_verify_svn(None, None, [],
3262
svntest.actions.run_and_verify_svn(None, [],
3321
3292
alpha_path = os.path.join(E_path, 'alpha')
3323
3294
# Make some changes to the repository
3324
svntest.actions.run_and_verify_svn(None, None, [], 'rm',
3295
svntest.actions.run_and_verify_svn(None, [], 'rm',
3326
svntest.actions.run_and_verify_svn(None, None, [],
3297
svntest.actions.run_and_verify_svn(None, [],
3330
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
3301
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
3332
svntest.actions.run_and_verify_svn(None, None, [],
3303
svntest.actions.run_and_verify_svn(None, [],
3334
3305
E_path, I_path)
3335
svntest.actions.run_and_verify_svn(None, None, [],
3306
svntest.actions.run_and_verify_svn(None, [],
3340
svntest.actions.run_and_verify_svn(None, None, [],
3311
svntest.actions.run_and_verify_svn(None, [],
3342
3313
G_path, E_path)
3343
svntest.actions.run_and_verify_svn(None, None, [],
3314
svntest.actions.run_and_verify_svn(None, [],
3348
svntest.actions.run_and_verify_svn(None, None, [],
3319
svntest.actions.run_and_verify_svn(None, [],
3350
3321
I_path, G_path)
3351
svntest.actions.run_and_verify_svn(None, None, [],
3322
svntest.actions.run_and_verify_svn(None, [],
3356
3327
# Copy using a peg rev
3357
svntest.actions.run_and_verify_svn(None, None, [],
3328
svntest.actions.run_and_verify_svn(None, [],
3359
3330
G_path + '@HEAD', '-r', '1',
3362
3333
# Commit and verify disk contents
3363
svntest.actions.run_and_verify_svn(None, None, [],
3334
svntest.actions.run_and_verify_svn(None, [],
3406
3377
iota_text = "This is the file 'iota'.\n"
3408
3379
# Make some changes to the repository
3409
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
3380
svntest.actions.run_and_verify_svn(None, [], 'mv',
3410
3381
psi_path, new_iota_path)
3411
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
3382
svntest.actions.run_and_verify_svn(None, [], 'mv',
3412
3383
iota_path, psi_path)
3413
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
3384
svntest.actions.run_and_verify_svn(None, [], 'mv',
3414
3385
new_iota_path, iota_path)
3416
svntest.actions.run_and_verify_svn(None, None, [],
3387
svntest.actions.run_and_verify_svn(None, [],
3421
3392
# Copy using a peg rev
3422
3393
# Add an empty peg specifier ('@') to sigma_url when copying, to test for
3423
3394
# issue #3651 "svn copy does not eat peg revision within copy target path".
3424
svntest.actions.run_and_verify_svn(None, None, [],
3395
svntest.actions.run_and_verify_svn(None, [],
3426
3397
iota_url + '@HEAD', '-r', '1',
3427
3398
sigma_url + '@', '-m', 'rev 3')
3429
3400
# Validate the copy destination's mergeinfo (we expect none).
3430
svntest.actions.run_and_verify_svn(None, [], [],
3401
svntest.actions.run_and_verify_svn([], '.*W200017: Property.*not found',
3431
3402
'propget', SVN_PROP_MERGEINFO, sigma_url)
3433
3404
# Update to HEAD and verify disk contents
3465
3436
alpha_url = E_url + '/alpha'
3467
3438
# delete E/alpha in r2
3468
svntest.actions.run_and_verify_svn(None, None, [],
3439
svntest.actions.run_and_verify_svn(None, [],
3469
3440
'rm', '-m', '', alpha_url)
3471
3442
# delete E in r3
3472
svntest.actions.run_and_verify_svn(None, None, [],
3443
svntest.actions.run_and_verify_svn(None, [],
3473
3444
'rm', '-m', '', E_url)
3475
3446
# Copy an old revision of E into a new path in the WC
3476
svntest.actions.run_and_verify_svn(None, None, [],
3447
svntest.actions.run_and_verify_svn(None, [],
3477
3448
'cp', '-r1', E, E2)
3479
3450
# Create expected output tree.
3946
3908
A2_path = sbox.ospath('A2')
3947
3909
B2_path = os.path.join(A2_path, 'B')
3949
svntest.actions.run_and_verify_svn(None, None, [], 'cp', A_path, A2_path)
3911
svntest.actions.run_and_verify_svn(None, [], 'cp', A_path, A2_path)
3950
3912
saved_cwd = os.getcwd()
3952
3914
os.chdir(B2_path)
3953
svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', 'blah')
3954
svntest.actions.run_and_verify_svn(None, None, [], 'mv', 'lambda', 'blah')
3915
svntest.actions.run_and_verify_svn(None, [], 'mkdir', 'blah')
3916
svntest.actions.run_and_verify_svn(None, [], 'mv', 'lambda', 'blah')
3956
3918
os.chdir(saved_cwd)
4089
4051
new_A_mu = os.path.join(new_A, 'mu')
4090
4052
new_A_new_mu = os.path.join(new_A, 'new_mu')
4092
svntest.actions.run_and_verify_svn(None, None, [],
4054
svntest.actions.run_and_verify_svn(None, [],
4093
4055
'cp', A, new_A)
4095
svntest.actions.run_and_verify_svn(None, None, [],
4057
svntest.actions.run_and_verify_svn(None, [],
4096
4058
'cp', new_A_D, new_A_new_D)
4097
svntest.actions.run_and_verify_svn(None, None, [],
4059
svntest.actions.run_and_verify_svn(None, [],
4098
4060
'cp', new_A_mu, new_A_new_mu)
4100
4062
expected_output = svntest.wc.State(sbox.wc_dir, {
4153
4114
new_A_mu = os.path.join(new_A, 'mu')
4154
4115
new_A_new_mu = os.path.join(new_A, 'new_mu')
4156
svntest.actions.run_and_verify_svn(None, None, [],
4117
svntest.actions.run_and_verify_svn(None, [],
4157
4118
'mv', A, new_A)
4159
svntest.actions.run_and_verify_svn(None, None, [],
4120
svntest.actions.run_and_verify_svn(None, [],
4160
4121
'mv', new_A_D, new_A_new_D)
4161
svntest.actions.run_and_verify_svn(None, None, [],
4122
svntest.actions.run_and_verify_svn(None, [],
4162
4123
'mv', new_A_mu, new_A_new_mu)
4164
4125
expected_output = svntest.wc.State(sbox.wc_dir, {
4219
4179
# Create another working copy path and checkout.
4220
4180
wc2_dir = sbox.add_wc_path('2')
4221
rav_svn(None, None, [], 'co', sbox.repo_url, wc2_dir)
4181
rav_svn(None, [], 'co', sbox.repo_url, wc2_dir)
4223
4183
# Update working directory and ensure that we are at revision 1.
4224
rav_svn(None, exp_noop_up_out(1), [], 'up', wc_dir)
4184
rav_svn(exp_noop_up_out(1), [], 'up', wc_dir)
4226
4186
# Add new folder and file, later commit
4227
4187
new_path = os.path.join(a_dir, 'New')
4229
4189
first_path = os.path.join(new_path, 'first')
4230
4190
svntest.main.file_append(first_path, 'appended first text')
4231
4191
svntest.main.run_svn(None, "add", new_path)
4232
rav_svn(None, None, [], 'ci', wc_dir, '-m', 'Add new folder %s' % new_path)
4233
rav_svn(None, exp_noop_up_out(2), [], 'up', wc_dir)
4192
rav_svn(None, [], 'ci', wc_dir, '-m', 'Add new folder %s' % new_path)
4193
rav_svn(exp_noop_up_out(2), [], 'up', wc_dir)
4235
4195
# Reverse merge to revert previous changes and commit
4236
rav_svn(None, None, [], 'merge', '-c', '-2', a_repo_url, a_dir)
4237
rav_svn(None, None, [], 'ci', '-m', 'Reverting svn merge -c -2.', a_dir)
4238
rav_svn(None, exp_noop_up_out(3), [], 'up', wc_dir)
4196
rav_svn(None, [], 'merge', '-c', '-2', a_repo_url, a_dir)
4197
rav_svn(None, [], 'ci', '-m', 'Reverting svn merge -c -2.', a_dir)
4198
rav_svn(exp_noop_up_out(3), [], 'up', wc_dir)
4240
4200
# Reverse merge again to undo last revert.
4241
rav_svn(None, None, [], 'merge', '-c', '-3', a_repo_url, a_dir)
4201
rav_svn(None, [], 'merge', '-c', '-3', a_repo_url, a_dir)
4243
4203
# Move new added file to another one and commit.
4244
4204
second_path = os.path.join(new_path, 'second')
4245
rav_svn(None, None, [], 'move', first_path, second_path)
4246
rav_svn(None, "Adding.*New|Adding.*first||Committed revision 4.", [],
4205
rav_svn(None, [], 'move', first_path, second_path)
4206
rav_svn("Adding.*New|Adding.*first||Committed revision 4.", [],
4248
4208
'Revert svn merge. svn mv %s %s.' % (first_path, second_path), a_dir)
4342
4302
# Alias for svntest.actions.run_and_verify_svn
4343
4303
rav_svn = svntest.actions.run_and_verify_svn
4345
rav_svn(None, None, [], 'mkdir', new_dir)
4346
rav_svn(None, None, [], 'cp', sbox.ospath('A/mu'), new_dir)
4347
rav_svn(None, None, [], 'cp', new_dir, new_dir2)
4305
rav_svn(None, [], 'mkdir', new_dir)
4306
rav_svn(None, [], 'cp', sbox.ospath('A/mu'), new_dir)
4307
rav_svn(None, [], 'cp', new_dir, new_dir2)
4349
4309
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
4405
4365
"""move a directory containing moved node"""
4408
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
4368
svntest.actions.run_and_verify_svn(None, [], 'mv',
4409
4369
sbox.ospath('A/B/E/alpha'),
4410
4370
sbox.ospath('A/B/E/alpha_moved'))
4412
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
4372
svntest.actions.run_and_verify_svn(None, [], 'mv',
4413
4373
sbox.ospath('A/B/F'),
4414
4374
sbox.ospath('A/B/F_moved'))
4416
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
4376
svntest.actions.run_and_verify_svn(None, [], 'mv',
4417
4377
sbox.ospath('A/B'),
4418
4378
sbox.ospath('A/B_tmp'))
4533
4492
svntest.actions.run_and_verify_commit(wc_dir,
4534
4493
expected_output,
4538
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
4496
svntest.actions.run_and_verify_svn(None, [], 'cp',
4539
4497
sbox.ospath('E with spaces'),
4540
4498
sbox.ospath('E also spaces')
4543
svntest.actions.run_and_verify_svn(None, None, [], 'cp',
4501
svntest.actions.run_and_verify_svn(None, [], 'cp',
4544
4502
sbox.ospath('E with spaces/al pha'),
4545
4503
sbox.ospath('E also spaces/al b')
4559
4517
svntest.actions.run_and_verify_commit(wc_dir,
4560
4518
expected_output,
4564
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
4521
svntest.actions.run_and_verify_svn(None, [], 'mv',
4565
4522
sbox.ospath('E with spaces'),
4566
4523
sbox.ospath('E new spaces')
4569
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
4526
svntest.actions.run_and_verify_svn(None, [], 'mv',
4570
4527
sbox.ospath('E new spaces/al pha'),
4571
4528
sbox.ospath('E also spaces/al c')
4607
4563
verify_dir = sbox.add_wc_path('verify')
4609
svntest.actions.run_and_verify_svn(None, None, [], 'copy', A_B_E, E_new)
4565
svntest.actions.run_and_verify_svn(None, [], 'copy', A_B_E, E_new)
4611
4567
sbox.simple_commit()
4613
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
4569
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
4615
svntest.actions.run_and_verify_svn(None, None, [], 'co', sbox.repo_url, verify_dir)
4571
svntest.actions.run_and_verify_svn(None, [], 'co', sbox.repo_url, verify_dir)
4617
4573
was_cwd = os.getcwd()
4618
4574
os.chdir(verify_dir)
4638
4594
verify_dir = sbox.add_wc_path('verify')
4640
svntest.actions.run_and_verify_svn(None, None, [], 'copy', A_B, B_new)
4596
svntest.actions.run_and_verify_svn(None, [], 'copy', A_B, B_new)
4642
4598
sbox.simple_commit()
4644
svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
4600
svntest.actions.run_and_verify_svn(None, [], 'up', wc_dir)
4646
svntest.actions.run_and_verify_svn(None, None, [], 'co', sbox.repo_url, verify_dir)
4602
svntest.actions.run_and_verify_svn(None, [], 'co', sbox.repo_url, verify_dir)
4648
4604
was_cwd = os.getcwd()
4649
4605
os.chdir(verify_dir)
4678
4634
svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
4680
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
4636
svntest.actions.run_and_verify_svn(None, [], 'mv',
4681
4637
sbox.ospath('X/Y'),
4682
4638
sbox.ospath('X/Z'))
4683
4639
expected_status.remove('X/Y')
4684
4640
expected_status.add({'X/Z' : Item(status='A ', wc_rev='0')})
4685
4641
svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
4687
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
4643
svntest.actions.run_and_verify_svn(None, [], 'mv',
4688
4644
sbox.ospath('X/Z'),
4689
4645
sbox.ospath('Z'))
4690
4646
expected_status.remove('X/Z')
4691
4647
expected_status.add({'Z' : Item(status='A ', wc_rev='0')})
4692
4648
svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
4694
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
4650
svntest.actions.run_and_verify_svn(None, [], 'mv',
4695
4651
sbox.ospath('Z'),
4696
4652
sbox.ospath('X/Z'))
4697
4653
expected_status.remove('Z')
5181
5132
sbox.build(read_only = True)
5182
5133
wc_dir = sbox.wc_dir
5184
svntest.actions.run_and_verify_svn(None, None, [], 'rm', sbox.ospath('A/mu'))
5135
svntest.actions.run_and_verify_svn(None, [], 'rm', sbox.ospath('A/mu'))
5185
5136
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
5186
5137
expected_status.tweak('A/mu', status='D ')
5187
5138
svntest.actions.run_and_verify_status(wc_dir, expected_status)
5189
svntest.actions.run_and_verify_svn(None, None, [], 'cp', '-rBASE',
5140
svntest.actions.run_and_verify_svn(None, [], 'cp', '-rBASE',
5190
5141
sbox.ospath('A/mu'), sbox.ospath('A/mu2'))
5191
5142
expected_status.add({
5192
5143
'A/mu2' : Item(status='A ', copied='+', wc_rev='-'),
5467
5425
# E155035 - SVN_ERR_WC_PATH_UNEXPECTED_STATUS
5468
5426
# E155010 - SVN_ERR_WC_PATH_NOT_FOUND
5470
svntest.actions.run_and_verify_svn(None, None,
5428
svntest.actions.run_and_verify_svn(None,
5471
5429
'svn: (E145000|E155035|E155010): ' +
5472
5430
'(Path \'.*iota\' does not exist)|' +
5473
5431
'(Deleted node .*iota\' copied)',
5474
5432
'cp', sbox.ospath('iota'),
5475
5433
sbox.ospath('new_iota'))
5477
svntest.actions.run_and_verify_svn(None, None,
5435
svntest.actions.run_and_verify_svn(None,
5478
5436
'svn: (E145000|E155035|E155010): ' +
5479
5437
'(Path \'.*D\' does not exist)|' +
5480
5438
'(Deleted node .*D\' copied)',
5486
5444
os.mkdir(sbox.ospath('A/D'))
5488
5446
# At one time these two invocations raised an assertion.
5489
svntest.actions.run_and_verify_svn(None, None,
5447
svntest.actions.run_and_verify_svn(None,
5490
5448
'svn: (E155035|E155010): ' +
5491
5449
'(Path \'.*iota\' does not exist)|' +
5492
5450
'(Deleted node.* .*iota\' can\'t be.*)',
5493
5451
'cp', sbox.ospath('iota'),
5494
5452
sbox.ospath('new_iota'))
5495
svntest.actions.run_and_verify_svn(None, None,
5453
svntest.actions.run_and_verify_svn(None,
5496
5454
'svn: (E155035|E155010): ' +
5497
5455
'(Path \'.*D\' does not exist)|' +
5498
5456
'(Deleted node.* .*D\' can\'t be.*)',
5509
5467
D_path = sbox.ospath('A/D')
5511
5469
# iota -> A/D/iota; verify we cannot commit just A/D/iota
5512
svntest.actions.run_and_verify_svn(None, None, [], 'mv', iota_path, D_path)
5470
svntest.actions.run_and_verify_svn(None, [], 'mv', iota_path, D_path)
5513
5471
expected_error = "svn: E200009: Cannot commit '.*%s' because it was " \
5514
5472
"moved from '.*%s'" % (re.escape(sbox.ospath('A/D/iota')),
5515
5473
re.escape(iota_path))
5516
svntest.actions.run_and_verify_svn(None, None, expected_error,
5474
svntest.actions.run_and_verify_svn(None, expected_error,
5517
5475
'commit', '-m', 'foo',
5518
5476
os.path.join(D_path, 'iota'))
5521
5479
expected_error = "svn: E200009: Cannot commit '.*%s' because it was " \
5522
5480
"moved from '.*%s'" % (re.escape(sbox.ospath('A/D/iota')),
5523
5481
re.escape(iota_path))
5524
svntest.actions.run_and_verify_svn(None, None, expected_error,
5482
svntest.actions.run_and_verify_svn(None, expected_error,
5525
5483
'commit', '-m', 'foo', D_path)
5527
5485
# A/D -> A/C/D; verify we cannot commit just A/C
5528
5486
C_path = sbox.ospath('A/C')
5530
svntest.actions.run_and_verify_svn(None, None, [], 'mv', D_path, C_path)
5488
svntest.actions.run_and_verify_svn(None, [], 'mv', D_path, C_path)
5531
5489
expected_error = "svn: E200009: Cannot commit '.*%s' because it was moved " \
5532
5490
"from '.*%s'" % (re.escape(os.path.join(C_path, "D")),
5533
5491
re.escape(D_path))
5534
svntest.actions.run_and_verify_svn(None, None, expected_error,
5492
svntest.actions.run_and_verify_svn(None, expected_error,
5535
5493
'commit', '-m', 'foo', C_path)
5537
5495
# A/C/D/iota -> A/iota; verify that iota's moved-from hasn't changed
5538
5496
D_iota_path = sbox.ospath('A/C/D/iota')
5539
5497
A_iota_path = sbox.ospath('A/iota')
5540
svntest.actions.run_and_verify_svn(None, None, [], 'mv', D_iota_path,
5498
svntest.actions.run_and_verify_svn(None, [], 'mv', D_iota_path,
5542
5500
expected_error = "svn: E200009: Cannot commit '.*%s' because it was " \
5543
5501
"moved from '.*%s'" % (re.escape(A_iota_path),
5544
5502
re.escape(iota_path))
5545
svntest.actions.run_and_verify_svn(None, None, expected_error,
5503
svntest.actions.run_and_verify_svn(None, expected_error,
5546
5504
'commit', '-m', 'foo', A_iota_path)
5557
5515
D_path = sbox.ospath('A/D')
5559
5517
# iota -> A/D/iota; verify we cannot commit just iota
5560
svntest.actions.run_and_verify_svn(None, None, [], 'mv', iota_path, D_path)
5518
svntest.actions.run_and_verify_svn(None, [], 'mv', iota_path, D_path)
5562
5520
expected_error = "svn: E200009: Cannot commit '.*%s' because it was moved " \
5563
5521
"to '.*%s'" % (re.escape(iota_path),
5564
5522
re.escape(os.path.join(D_path, "iota")))
5565
svntest.actions.run_and_verify_svn(None, None, expected_error,
5523
svntest.actions.run_and_verify_svn(None, expected_error,
5566
5524
'commit', '-m', 'foo', iota_path)
5568
5526
# A/D -> C; verify we cannot commit just A
5569
5527
C_path = sbox.ospath('C')
5571
svntest.actions.run_and_verify_svn(None, None, [], 'mv', D_path, C_path)
5529
svntest.actions.run_and_verify_svn(None, [], 'mv', D_path, C_path)
5572
5530
expected_error = "svn: E200009: Cannot commit '.*%s' because it was moved " \
5573
5531
"to '.*%s'" % (re.escape(D_path), re.escape(C_path))
5574
svntest.actions.run_and_verify_svn(None, None, expected_error,
5532
svntest.actions.run_and_verify_svn(None, expected_error,
5575
5533
'commit', '-m', 'foo', A_path)
5663
5620
wc_dir = sbox.wc_dir
5665
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
5622
svntest.actions.run_and_verify_svn(None, [], 'mv',
5666
5623
sbox.ospath('A/B'),
5667
5624
sbox.ospath('A/B2'))
5668
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
5625
svntest.actions.run_and_verify_svn(None, [], 'mv',
5669
5626
sbox.ospath('A/B2/E'),
5670
5627
sbox.ospath('A/B2/E2'))
5671
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
5628
svntest.actions.run_and_verify_svn(None, [], 'mv',
5672
5629
sbox.ospath('A/B2/E2/alpha'),
5673
5630
sbox.ospath('A/B2/E2/alpha2'))
5705
5661
# This succeeds
5706
#svntest.actions.run_and_verify_svn(None, None, [], 'cp', '--parents',
5662
#svntest.actions.run_and_verify_svn(None, [], 'cp', '--parents',
5707
5663
# sbox.ospath('A/B'),
5708
5664
# sbox.ospath('New/B2'))
5710
5666
# And this currently fails with The node '.*Unversioned' was not found,
5711
5667
# while it should succeed or returns some error that a GUI client can use.
5712
5668
os.mkdir(sbox.ospath('Unversioned'))
5713
svntest.actions.run_and_verify_svn(None, None, [], 'cp', '--parents',
5669
svntest.actions.run_and_verify_svn(None, [], 'cp', '--parents',
5714
5670
sbox.ospath('A/B'),
5715
5671
sbox.ospath('Unversioned/B2'))
5769
5725
sbox.build(read_only = True)
5770
5726
wc_dir = sbox.wc_dir
5772
svntest.actions.run_and_verify_svn(None, None, [],
5728
svntest.actions.run_and_verify_svn(None, [],
5773
5729
'update', '--set-depth', 'exclude',
5774
5730
sbox.ospath('A/D'))
5776
5732
expected_error = "svn: E155000: Path '.*D' exists.*excluded.*"
5778
svntest.actions.run_and_verify_svn(None, None, expected_error,
5734
svntest.actions.run_and_verify_svn(None, expected_error,
5780
5736
sbox.repo_url + '/A/C',
5781
5737
sbox.ospath('A/D'))
5783
5739
expected_error = "svn: E155000: Path '.*D' exists.*excluded.*"
5784
svntest.actions.run_and_verify_svn(None, None, expected_error,
5740
svntest.actions.run_and_verify_svn(None, expected_error,
5786
5742
sbox.ospath('A/C'),
5787
5743
sbox.ospath('A/D'))
5793
5749
wc_dir = sbox.wc_dir
5795
tmp_dir = sbox.add_wc_path('relocated')
5751
tmp_dir, url = sbox.add_repo_path('relocated')
5797
5753
shutil.copytree(sbox.repo_dir, tmp_dir)
5801
if sys.platform == 'win32':
5804
url += os.path.abspath(tmp_dir).replace(os.path.sep, '/')
5806
svntest.actions.run_and_verify_svn(None, None, [],
5755
svntest.actions.run_and_verify_svn(None, [],
5807
5756
'relocate', url, wc_dir)
5809
5758
copiedpath = sbox.ospath('AA')
5810
svntest.actions.run_and_verify_svn(None, None, [],
5759
svntest.actions.run_and_verify_svn(None, [],
5811
5760
'cp', url + '/A', copiedpath)
5813
svntest.actions.run_and_verify_svn(None, None, [],
5762
svntest.actions.run_and_verify_svn(None, [],
5814
5763
'info', copiedpath)
5816
5765
def ext_wc_copy_deleted(sbox):
5824
5773
sbox.simple_rm('A/B')
5825
5774
sbox.simple_commit()
5827
svntest.actions.run_and_verify_svn(None, None, [],
5776
svntest.actions.run_and_verify_svn(None, [],
5828
5777
'up', '--set-depth', 'exclude',
5829
5778
sbox.ospath('A/D'))
5831
svntest.actions.run_and_verify_svn(None, None, [],
5780
svntest.actions.run_and_verify_svn(None, [],
5832
5781
'co', sbox.repo_url, wc2_dir, '-r', 1)
5834
svntest.actions.run_and_verify_svn(None, None, [],
5783
svntest.actions.run_and_verify_svn(None, [],
5835
5784
'cp', sbox.path('A'), os.path.join(wc2_dir,'AA'))
5837
5786
expected_output = expected_output = svntest.wc.State(wc2_dir, {
5860
5808
'AA/B' : Item(verb='Deleting'),
5862
5810
svntest.actions.run_and_verify_commit(wc_dir,
5863
expected_output, None, None,
5811
expected_output, None, [],
5864
5812
sbox.ospath('AA'))
5866
5814
# Commit copy between working copies
5867
svntest.actions.run_and_verify_svn(None, None, [],
5815
svntest.actions.run_and_verify_svn(None, [],
5868
5816
'cp', sbox.path('A'),
5869
5817
os.path.join(wc2_dir,'AA2'))
5870
5818
expected_output = expected_output = svntest.wc.State(wc2_dir, {
5872
5820
'AA2/B' : Item(verb='Deleting'),
5874
5822
svntest.actions.run_and_verify_commit(wc2_dir,
5875
expected_output, None, None,
5823
expected_output, None)
5825
def resurrect_at_root(sbox):
5826
"resurrect directory at root"
5828
sbox.build(create_wc=False)
5830
svntest.actions.run_and_verify_svn(None, [], 'rm', sbox.repo_url + '/A',
5833
svntest.actions.run_and_verify_svn(None, [], 'cp',
5834
sbox.repo_url + '/A/D/H@1',
5835
sbox.repo_url + '/A', '-m', '')
5879
5837
########################################################################
5880
5838
# Run the tests