# # add_file "tests/t_update_with_blocked_rename.at" # # patch "ChangeLog" # from [21e8b621eae08ba6e7b3b16dbb78aae6db143dfd] # to [be42363ea16b85b8910c49eceb7d7717c8477e3e] # # patch "tests/t_update_with_blocked_rename.at" # from [] # to [dc86b21bd469bee17cb8df586f108a13a4a191be] # # patch "testsuite.at" # from [df684acec26c92960c33b4d6a4235b1eb77513d7] # to [3fd0bf5a0738122649a73e4a51a7bc094c308b04] # --- ChangeLog +++ ChangeLog @@ -1,5 +1,10 @@ 2005-05-15 Derek Scherger + * tests/t_update_with_blocked_rename.at: new test + * testsuite.at: call it + +2005-05-15 Derek Scherger + * netsync.cc (process_anonymous_cmd, process_auth_cmd): log details of permissions allowed/denied * tests/t_netsync_permissions.at: new test --- tests/t_update_with_blocked_rename.at +++ tests/t_update_with_blocked_rename.at @@ -0,0 +1,69 @@ +AT_SETUP([update with blocked rename]) +MONOTONE_SETUP + +# This test is a bug report +AT_XFAIL_IF(true) + +# 1. Alice starts a project and creates some files +# 2. Bob checks out the project and gets the files +# 3. Bob creates a file bar, but forgets to add it +# 4. Alice renames one of her files to bar +# 5. Bob updates +# +# the update fails after moving renamed files to MT/tmp/N +# where N is the file's tid. +# +# Bob is left with a bunch of missing files. + +AT_CHECK(mkdir alice) +for i in 1 2 3 4 5 6 7 8 9 10 +do + AT_CHECK(echo "file $i", [], [stdout]) + AT_CHECK(mv stdout alice/file.$i) +done + +# Alice starts a projectand creates foo +AT_CHECK(MONOTONE --branch=testbranch setup alice, [], [ignore], [ignore]) +AT_CHECK( (cd alice; MONOTONE add file.*), [], [ignore], [ignore]) +AT_CHECK( (cd alice; MONOTONE commit -m 'alice adds files'), [], [ignore], [ignore]) + +# Bob checks out project, gets files and creates file bar +AT_CHECK(MONOTONE --branch=testbranch checkout bob, [], [ignore], [ignore]) +AT_DATA(bob/bar, [bob's bar +]) + +# Alice renames some files +AT_CHECK( (cd alice; MONOTONE rename file.3 bar), [], [ignore], [ignore]) +AT_CHECK( (cd alice; MONOTONE rename file.4 bar.4), [], [ignore], [ignore]) +AT_CHECK( (cd alice; MONOTONE rename file.5 bar.5), [], [ignore], [ignore]) +AT_CHECK(mv alice/file.3 alice/bar) +AT_CHECK(mv alice/file.4 alice/bar.4) +AT_CHECK(mv alice/file.5 alice/bar.5) +AT_CHECK( (cd alice; MONOTONE commit -m 'alice renames files'), [], [ignore], [ignore]) + +# Bob updates but bar is in the way +AT_CHECK( (cd bob; MONOTONE update), [], [ignore], [ignore]) + +# non-renamed files remain + +for i in 1 2 6 7 8 9 10 +do + AT_CHECK(test -e bob/file.$i, [1], [stdout]) +done + +# renamed files are gone + +AT_CHECK(test -e bob/file.3, [1], [stdout]) +AT_CHECK(test -e bob/file.4, [1], [stdout]) +AT_CHECK(test -e bob/file.5, [1], [stdout]) + +# original bar still exists + +AT_CHECK(test -e bob/bar, [0], [stdout]) + +# other renames are also gone + +AT_CHECK(test -e bob/bar.4, [1], [stdout]) +AT_CHECK(test -e bob/bar.5, [1], [stdout]) + +AT_CLEANUP --- testsuite.at +++ testsuite.at @@ -644,3 +644,4 @@ m4_include(tests/t_automate_attributes.at) m4_include(tests/t_unidiff3.at) m4_include(tests/t_netsync_permissions.at) +m4_include(tests/t_update_with_blocked_rename.at)