# # # add_dir "tests/disapproving_of_a_merge_revision" # # add_dir "tests/disapproving_of_a_revision_range" # # add_file "tests/disapproving_of_a_merge_revision/__driver__.lua" # content [0b01979168f9d5ec0fdc08ed28e80e0f79340fcb] # # add_file "tests/disapproving_of_a_merge_revision/badfile" # content [edb043f48a2b91914e3d7f0d443f09405388f42f] # # add_file "tests/disapproving_of_a_merge_revision/badfile2" # content [80f940d81c6c5a81921bc70e9fdc2decd2b87ade] # # add_file "tests/disapproving_of_a_merge_revision/goodfile" # content [1901cbc55ee28e0b3f57d358d4c260dbd92d95e9] # # add_file "tests/disapproving_of_a_merge_revision/rootfile" # content [aa28e376c2dfb3908bfc5fe1f502a7af4cb81d40] # # add_file "tests/disapproving_of_a_revision_range/__driver__.lua" # content [536f510af9a38abfdfca8587764af10c551c28e4] # # add_file "tests/disapproving_of_a_revision_range/badfile" # content [edb043f48a2b91914e3d7f0d443f09405388f42f] # # add_file "tests/disapproving_of_a_revision_range/badfile2" # content [80f940d81c6c5a81921bc70e9fdc2decd2b87ade] # # add_file "tests/disapproving_of_a_revision_range/finalfile" # content [37492211554020fc4264f6e1b786ae3159d14bb4] # # add_file "tests/disapproving_of_a_revision_range/goodfile" # content [1901cbc55ee28e0b3f57d358d4c260dbd92d95e9] # # add_file "tests/disapproving_of_a_revision_range/rootfile" # content [aa28e376c2dfb3908bfc5fe1f502a7af4cb81d40] # # add_file "tests/disapproving_of_a_revision_range/updatefile" # content [cc97f4c30e83293c486e2765904d59a287875888] # ============================================================ --- tests/disapproving_of_a_merge_revision/__driver__.lua 0b01979168f9d5ec0fdc08ed28e80e0f79340fcb +++ tests/disapproving_of_a_merge_revision/__driver__.lua 0b01979168f9d5ec0fdc08ed28e80e0f79340fcb @@ -0,0 +1,34 @@ + +mtn_setup() + +check(get("rootfile", "testfile")) +check(mtn("add", "testfile"), 0, false, false) +commit() +root_r_sha = base_revision() + +check(get("goodfile", "testfile")) +commit() +left_good_r_sha = base_revision() +check(left_good_r_sha ~= root_r_sha) + +check(get("badfile", "testfile")) +commit() +left_bad_r_sha = base_revision() +check(left_bad_r_sha ~= left_good_r_sha) + +check(mtn("update","-r",left_good_r_sha), 0, false, false) +check(get("rootfile", "testfile2")) +check(mtn("add","testfile2"), 0, false, false) +commit() +check(mtn("merge"), 0, false, false) +check(mtn("update"), 0, false,false) + + +check(get("badfile2", "testfile")) +commit() +left_bad2_r_sha = base_revision() +check(left_bad2_r_sha ~= left_good_r_sha) + +check(mtn("disapprove", root_r_sha, left_bad2_r_sha), 1, false, false) +-- disapprove should fail because there is a merge + ============================================================ --- tests/disapproving_of_a_merge_revision/badfile edb043f48a2b91914e3d7f0d443f09405388f42f +++ tests/disapproving_of_a_merge_revision/badfile edb043f48a2b91914e3d7f0d443f09405388f42f @@ -0,0 +1,5 @@ +first line of the file +an insertion between first and second +second line of the file +third line of the file +an evil line which should never be seen ============================================================ --- tests/disapproving_of_a_merge_revision/badfile2 80f940d81c6c5a81921bc70e9fdc2decd2b87ade +++ tests/disapproving_of_a_merge_revision/badfile2 80f940d81c6c5a81921bc70e9fdc2decd2b87ade @@ -0,0 +1,6 @@ +first line of the file +an insertion between first and second +second line of the file +third line of the file +an evil line which should never be seen +another evil line which should never be seen ============================================================ --- tests/disapproving_of_a_merge_revision/goodfile 1901cbc55ee28e0b3f57d358d4c260dbd92d95e9 +++ tests/disapproving_of_a_merge_revision/goodfile 1901cbc55ee28e0b3f57d358d4c260dbd92d95e9 @@ -0,0 +1,4 @@ +first line of the file +an insertion between first and second +second line of the file +third line of the file ============================================================ --- tests/disapproving_of_a_merge_revision/rootfile aa28e376c2dfb3908bfc5fe1f502a7af4cb81d40 +++ tests/disapproving_of_a_merge_revision/rootfile aa28e376c2dfb3908bfc5fe1f502a7af4cb81d40 @@ -0,0 +1,3 @@ +first line of the file +second line of the file +third line of the file ============================================================ --- tests/disapproving_of_a_revision_range/__driver__.lua 536f510af9a38abfdfca8587764af10c551c28e4 +++ tests/disapproving_of_a_revision_range/__driver__.lua 536f510af9a38abfdfca8587764af10c551c28e4 @@ -0,0 +1,40 @@ + +mtn_setup() + +check(get("rootfile", "testfile")) +check(mtn("add", "testfile"), 0, false, false) +commit() +root_r_sha = base_revision() +root_f_sha = sha1("testfile") + +check(get("goodfile", "testfile")) +commit() +left_good_r_sha = base_revision() +left_good_f_sha = sha1("testfile") +check(left_good_r_sha ~= root_r_sha) +check(left_good_f_sha ~= root_f_sha) + +check(get("badfile", "testfile")) +commit() +left_bad_r_sha = base_revision() +left_bad_f_sha = sha1("testfile") +check(left_bad_r_sha ~= left_good_r_sha) +check(left_bad_f_sha ~= left_good_f_sha) + +check(get("badfile2", "testfile")) +commit() +left_bad2_r_sha = base_revision() +left_bad2_f_sha = sha1("testfile") +check(left_bad2_r_sha ~= left_good_r_sha) +check(left_bad2_f_sha ~= left_good_f_sha) + +probe_node("testfile", root_r_sha, root_f_sha) + +check(get("updatefile", "testfile")) +check(mtn("disapprove", left_bad_r_sha, left_bad2_r_sha), 0, false, false) +check(mtn("update"), 0, false, false) + +-- files should now be merged + +check(get("finalfile", "probe")) +check(samefile("testfile", "probe")) ============================================================ --- tests/disapproving_of_a_revision_range/badfile edb043f48a2b91914e3d7f0d443f09405388f42f +++ tests/disapproving_of_a_revision_range/badfile edb043f48a2b91914e3d7f0d443f09405388f42f @@ -0,0 +1,5 @@ +first line of the file +an insertion between first and second +second line of the file +third line of the file +an evil line which should never be seen ============================================================ --- tests/disapproving_of_a_revision_range/badfile2 80f940d81c6c5a81921bc70e9fdc2decd2b87ade +++ tests/disapproving_of_a_revision_range/badfile2 80f940d81c6c5a81921bc70e9fdc2decd2b87ade @@ -0,0 +1,6 @@ +first line of the file +an insertion between first and second +second line of the file +third line of the file +an evil line which should never be seen +another evil line which should never be seen ============================================================ --- tests/disapproving_of_a_revision_range/finalfile 37492211554020fc4264f6e1b786ae3159d14bb4 +++ tests/disapproving_of_a_revision_range/finalfile 37492211554020fc4264f6e1b786ae3159d14bb4 @@ -0,0 +1,5 @@ +first line of the file +an insertion between first and second +second line of the file +an insertion between second and third +third line of the file ============================================================ --- tests/disapproving_of_a_revision_range/goodfile 1901cbc55ee28e0b3f57d358d4c260dbd92d95e9 +++ tests/disapproving_of_a_revision_range/goodfile 1901cbc55ee28e0b3f57d358d4c260dbd92d95e9 @@ -0,0 +1,4 @@ +first line of the file +an insertion between first and second +second line of the file +third line of the file ============================================================ --- tests/disapproving_of_a_revision_range/rootfile aa28e376c2dfb3908bfc5fe1f502a7af4cb81d40 +++ tests/disapproving_of_a_revision_range/rootfile aa28e376c2dfb3908bfc5fe1f502a7af4cb81d40 @@ -0,0 +1,3 @@ +first line of the file +second line of the file +third line of the file ============================================================ --- tests/disapproving_of_a_revision_range/updatefile cc97f4c30e83293c486e2765904d59a287875888 +++ tests/disapproving_of_a_revision_range/updatefile cc97f4c30e83293c486e2765904d59a287875888 @@ -0,0 +1,4 @@ +first line of the file +second line of the file +an insertion between second and third +third line of the file