# # add_file "tests/t_restricted_commit_with_inodeprints.at" # # add_file "tests/t_update_with_pending_add.at" # # add_file "tests/t_update_with_pending_drop.at" # # add_file "tests/t_update_with_pending_rename.at" # # patch "ChangeLog" # from [eff8ef8c62509c7896de7251bb0e6ea8d232977a] # to [b27a3df25e3f18ffd36e8adee0ee2ac651edbd15] # # patch "tests/t_restricted_commit_with_inodeprints.at" # from [] # to [0761808634d3e002cf9bd48b83e8a9a4ef088d9a] # # patch "tests/t_update_with_pending_add.at" # from [] # to [ce5bc7da954e468ee7a419435a64329266d5f95f] # # patch "tests/t_update_with_pending_drop.at" # from [] # to [a13daf2fd6702fe09632ccda621bb3d0a999d1af] # # patch "tests/t_update_with_pending_rename.at" # from [] # to [2d30e1dfbac75a361b0380937077c31f3e98c7ff] # # patch "testsuite.at" # from [cf4de323a000b8dc76eff061d7be4abb382ced77] # to [4a1a612444d0916a4fcbe71053f66ba1d7aaa18e] # --- ChangeLog +++ ChangeLog @@ -1,3 +1,11 @@ +2005-06-04 Derek Scherger + + * tests/t_update_with_pending_drop.at: + * tests/t_update_with_pending_add.at: + * tests/t_update_with_pending_rename.at: + * tests/t_restricted_commit_with_inodeprints.at: new bug reports + * testsuite.at: call them + 2005-06-02 graydon hoare * rcs_import.cc --- tests/t_restricted_commit_with_inodeprints.at +++ tests/t_restricted_commit_with_inodeprints.at @@ -0,0 +1,46 @@ +# -*- Autoconf -*- + +AT_SETUP([restricted commit with inodeprints]) + +MONOTONE_SETUP + +# this test is a bug report. the problem is that inodeprints tries to update its +# cache for all files in the complete manifest, but a restricted commit can +# succeed with missing files if they are excluded. subsequently the inodeprint +# update fails because it can't build a complete manifest due to the missing +# files. + +# one solution is to let inodeprints update its cache only for files that are +# included in the restriction, which seems to be safe. the only gaurentee that +# inodeprints mode makes is that if a file's current inodeprint matches its +# cached inodprint then it has not changed. i.e. for a missing file, the cache +# would not be updated but the old cached value can't possibly equal the current +# value since the file does not exist and cannot have an inodeprint. + +# also, it may be a useful feature (?) to allow refresh_inodeprints to update +# its cache for a restricted set of files by allowing paths on the command line +# to establish a restriction. + +AT_XFAIL_IF(true) + +ADD_FILE(file1, [file1 +]) + +COMMIT(testbranch) + +# enable inodeprints mode +AT_CHECK(MONOTONE refresh_inodeprints, [], [ignore], [ignore]) + +ADD_FILE(file2, [file2 +]) + +# create a missing file + +AT_CHECK(rm file1, [], [ignore], [ignore]) + +# restricted commit of file2 succeeds with file1 missing +# but the corresponding inodeprint update fails + +AT_CHECK(MONOTONE commit --message 'file2' file2, [], [ignore], [ignore]) + +AT_CLEANUP --- tests/t_update_with_pending_add.at +++ tests/t_update_with_pending_add.at @@ -0,0 +1,58 @@ +# -*- Autoconf -*- + +AT_SETUP([update with pending add]) + +MONOTONE_SETUP + +# this test is a bug report. the problem seems to be that update with a pending +# add doesn't remove the pending add from MT/work if the file is also added +# in the selected revision. +# +# as a side note, for some reason cat revision doesn't seem to work with an +# abbreviated revision id. this seems like it might be a problem with autotest +# or something, or possibly even (gasp) pilot error! ;) + +AT_XFAIL_IF(true) + +ADD_FILE(file, [file +]) + +COMMIT(testbranch) + +AT_CHECK(MONOTONE --branch testbranch co codir, [], [ignore], [ignore]) + +ADD_FILE(file2, [file2 +]) + +COMMIT(testbranch) + +AT_DATA(codir/file2, [file2 +]) + +AT_CHECK(cd codir && MONOTONE add file2, [], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE update, [], [ignore], [ignore]) + +# why doesn't an abbreviated revision id work +AT_CHECK(cd codir && MONOTONE cat revision b482, [1], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE cat revision b482c907f27f160f7ff9259d353d5d5399fb9fc4, [], [ignore], [ignore]) + +AT_CHECK(cd codir && MONOTONE cat manifest 1ff6, [], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE cat manifest 3eff, [], [ignore], [ignore]) + +AT_CHECK(cat codir/MT/work, [], [ignore], [ignore]) +AT_CHECK(cat codir/MT/revision, [], [ignore], [ignore]) + +# the working copy is now in a somewhat bad state. the revision it is based on +# has file2 in the manifest, but MT/work still contains add_file +# "file2". pending rearrangements, need to be resolved by update + +AT_CHECK(cd codir && MONOTONE cat revision, [3], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE cat manifest, [3], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE status, [3], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE ls unknown, [3], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE ls ignored, [3], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE ls missing, [3], [ignore], [ignore]) + +AT_CHECK(false) + +AT_CLEANUP --- tests/t_update_with_pending_drop.at +++ tests/t_update_with_pending_drop.at @@ -0,0 +1,57 @@ +# -*- Autoconf -*- + +AT_SETUP([update with pending drop]) + +MONOTONE_SETUP + +# this test is a bug report. the problem seems to be that update with a pending +# drop doesn't remove the pending drop from MT/work if the file is also dropped +# in the selected revision. +# +# as a side note, for some reason cat revision doesn't seem to work with an +# abbreviated revision id. this seems like it might be a problem with autotest +# or something, or possibly even (gasp) pilot error! ;) + +AT_XFAIL_IF(true) + +ADD_FILE(file, [test1 +]) + +COMMIT(testbranch) + +AT_CHECK(MONOTONE --branch testbranch co codir, [], [ignore], [ignore]) + +AT_CHECK(rm file, [], [ignore], [ignore]) +AT_CHECK(MONOTONE drop file, [], [ignore], [ignore]) + +COMMIT(testbranch) + +AT_CHECK(cd codir && MONOTONE drop file, [], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE update, [], [ignore], [ignore]) + +# why doesn't an abbreviated revision id work +AT_CHECK(cd codir && MONOTONE cat revision a12d, [1], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE cat revision a12d8ad50bf5861310c22979ef6c3a8b8a686522, [], [ignore], [ignore]) + +AT_CHECK(cd codir && MONOTONE cat manifest 6905, [], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE cat manifest da39, [], [ignore], [ignore]) + +# it appears that da39 (the empty manifest) gets stored in the database + +AT_CHECK(cat codir/MT/work, [], [ignore], [ignore]) +AT_CHECK(cat codir/MT/revision, [], [ignore], [ignore]) + +# the working copy is now in a somewhat bad state. the revision it is based on +# has an empty manifest, but MT/work still contains drop_file "file". pending +# rearrangements, need to be resolved by update + +AT_CHECK(cd codir && MONOTONE cat revision, [3], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE cat manifest, [3], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE status, [3], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE ls unknown, [3], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE ls ignored, [3], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE ls missing, [3], [ignore], [ignore]) + +AT_CHECK(false) + +AT_CLEANUP --- tests/t_update_with_pending_rename.at +++ tests/t_update_with_pending_rename.at @@ -0,0 +1,57 @@ +# -*- Autoconf -*- + +AT_SETUP([update with pending rename]) + +MONOTONE_SETUP + +# this test is a bug report. the problem seems to be that update with a pending +# rename doesn't remove the pending rename from MT/work if the file is also renamed +# in the selected revision. +# +# as a side note, for some reason cat revision doesn't seem to work with an +# abbreviated revision id. this seems like it might be a problem with autotest +# or something, or possibly even (gasp) pilot error! ;) + +AT_XFAIL_IF(true) + +ADD_FILE(file, [test1 +]) + +COMMIT(testbranch) + +AT_CHECK(MONOTONE --branch testbranch co codir, [], [ignore], [ignore]) + +AT_CHECK(mv file file2, [], [ignore], [ignore]) +AT_CHECK(MONOTONE rename file file2, [], [ignore], [ignore]) + +COMMIT(testbranch) + +AT_CHECK(mv codir/file codir/file2, [], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE rename file file2, [], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE update, [], [ignore], [ignore]) + +# why doesn't an abbreviated revision id work +#AT_CHECK(cd codir && MONOTONE cat revision a12d, [1], [ignore], [ignore]) +#AT_CHECK(cd codir && MONOTONE cat revision a12d8ad50bf5861310c22979ef6c3a8b8a686522, [], [ignore], [ignore]) + +#AT_CHECK(cd codir && MONOTONE cat manifest 6905, [], [ignore], [ignore]) +#AT_CHECK(cd codir && MONOTONE cat manifest da39, [], [ignore], [ignore]) + + +AT_CHECK(cat codir/MT/work, [], [ignore], [ignore]) +AT_CHECK(cat codir/MT/revision, [], [ignore], [ignore]) + +# the working copy is now in a somewhat bad state. the revision it is based on +# has renamed file to file2, but MT/work still contains rename_file "file" +# "file2". pending rearrangements need to be resolved by update + +AT_CHECK(cd codir && MONOTONE cat revision, [3], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE cat manifest, [3], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE status, [3], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE ls unknown, [3], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE ls ignored, [3], [ignore], [ignore]) +AT_CHECK(cd codir && MONOTONE ls missing, [3], [ignore], [ignore]) + +AT_CHECK(false) + +AT_CLEANUP --- testsuite.at +++ testsuite.at @@ -653,3 +653,7 @@ m4_include(tests/t_merge_binary.at) m4_include(tests/t_automate_stdio.at) m4_include(tests/t_cvsimport_drepper.at) +m4_include(tests/t_update_with_pending_drop.at) +m4_include(tests/t_update_with_pending_add.at) +m4_include(tests/t_update_with_pending_rename.at) +m4_include(tests/t_restricted_commit_with_inodeprints.at)