#
#
# add_dir "tests/add_and_then_drop_file_does_nothing"
#
# add_dir "tests/addition_of_files_and_directories"
#
# add_dir "tests/calculation_of_incorrect_unidiffs"
#
# add_dir "tests/delete_work_file_on_checkout"
#
# add_dir "tests/drop_missing_and_unknown_files"
#
# add_dir "tests/merging_adds"
#
# add_dir "tests/merging_adds_in_unrelated_revisions"
#
# add_dir "tests/merging_data_in_unrelated_files"
#
# add_dir "tests/merging_data_in_unrelated_revisions"
#
# add_dir "tests/revert_file_to_base_revision"
#
# add_file "tests/add_and_then_drop_file_does_nothing/__driver__.lua"
# content [ed74475c0927b2c9c47ab97388d3460fdfd3fe07]
#
# add_file "tests/addition_of_files_and_directories/__driver__.lua"
# content [122cd653d6207b86b5af26699414ae3c3e4b8bce]
#
# add_file "tests/calculation_of_incorrect_unidiffs/__driver__.lua"
# content [3e252f3773737b1c3732d31bd555019b1ef78d53]
#
# add_file "tests/calculation_of_incorrect_unidiffs/firstfile"
# content [2fdc5405a533dfc81e28e02c482ca3d783225d51]
#
# add_file "tests/calculation_of_incorrect_unidiffs/secondfile"
# content [60fd4d4949d680b7ec23f41f610769802a464be1]
#
# add_file "tests/delete_work_file_on_checkout/__driver__.lua"
# content [83bdf136c65453873abd9b44139032aaa27c2eb6]
#
# add_file "tests/drop_missing_and_unknown_files/__driver__.lua"
# content [c13655b9cd05d58f28cf28c410a117cc25b09292]
#
# add_file "tests/merging_adds/__driver__.lua"
# content [dfb2cf3a556ab1477e77e79d064a4b74f2857bea]
#
# add_file "tests/merging_adds_in_unrelated_revisions/__driver__.lua"
# content [3573d2502f0f5b458dc75a54cb976baec7057338]
#
# add_file "tests/merging_data_in_unrelated_files/__driver__.lua"
# content [2675e2d9795e4a10c53ef95c13b23b5040815ac2]
#
# add_file "tests/merging_data_in_unrelated_files/left"
# content [003d966645cd3b96511ccd2c394dc01998da180c]
#
# add_file "tests/merging_data_in_unrelated_files/right"
# content [289d77f035783224b0356a05f749ba0a3b0a3246]
#
# add_file "tests/merging_data_in_unrelated_revisions/__driver__.lua"
# content [162fb9899df051fba839e65d2066fa927fe544db]
#
# add_file "tests/merging_data_in_unrelated_revisions/left"
# content [003d966645cd3b96511ccd2c394dc01998da180c]
#
# add_file "tests/merging_data_in_unrelated_revisions/right"
# content [289d77f035783224b0356a05f749ba0a3b0a3246]
#
# add_file "tests/revert_file_to_base_revision/__driver__.lua"
# content [15e25506eba289749c75a219f1f337092634d79c]
#
# patch "tester.cc"
# from [9d2f465fbe9e75040c0d37959cf23cfa7778502d]
# to [eda5f5ddd204e30c47fd9930f13ba19057a73b01]
#
# patch "tester.lua"
# from [0d1895da110aae38a101dd9822188c775051c56b]
# to [e466aa71c0adb51e51dacd015d7d54aa003500f0]
#
# patch "tests/test_hooks.lua"
# from [234fbb463da7e4614f0b0b279f21c658e74d3706]
# to [ce6008e93ec7c8931517ff0173925418e4c6dd6f]
#
# patch "testsuite.at"
# from [33ef9f80a877e665e9ac8171fb29ad5475178285]
# to [d87e4f1992dc6a6a58b5575317b401748758ee6e]
#
# patch "testsuite.lua"
# from [c04000a84ded45f0920c2fee726b5ac6f4831ab4]
# to [65bc566aa260fd09e30fbfe41566adfb434d9ea1]
#
============================================================
--- tests/add_and_then_drop_file_does_nothing/__driver__.lua ed74475c0927b2c9c47ab97388d3460fdfd3fe07
+++ tests/add_and_then_drop_file_does_nothing/__driver__.lua ed74475c0927b2c9c47ab97388d3460fdfd3fe07
@@ -0,0 +1,12 @@
+
+mtn_setup()
+
+addfile("maude", "the file maude\n")
+check(cmd(mtn("drop", "maude")), 0, false, false)
+check(cmd(mtn("status")), 0, true)
+check(not qgrep("_file", "stdout"))
+
+addfile("liver", "the file liver\n")
+check(cmd(mtn("drop", "liver")), 0, false, false)
+check(cmd(mtn("status")), 0, true)
+check(not qgrep("_file", "stdout"))
============================================================
--- tests/addition_of_files_and_directories/__driver__.lua 122cd653d6207b86b5af26699414ae3c3e4b8bce
+++ tests/addition_of_files_and_directories/__driver__.lua 122cd653d6207b86b5af26699414ae3c3e4b8bce
@@ -0,0 +1,84 @@
+
+mtn_setup()
+
+mkdir("dir")
+writefile("file0", "file 0\n")
+writefile("dir/file1", "file 1\n")
+writefile("dir/file2", "file 2\n")
+
+-- adding a non-existent file should fail
+
+check(cmd(mtn("add", "foobar")), 1, false, false)
+
+-- newly added files should appear as such
+
+check(cmd(mtn("add", "file0")), 0, false, true)
+check(qgrep("adding file0", "stderr"))
+
+check(cmd(mtn("add", "dir")), 0, false, true)
+check(qgrep("adding dir/file1", "stderr"))
+check(qgrep("adding dir/file2", "stderr"))
+
+check(cmd(mtn("status")), 0, true)
+check(qgrep("file0", "stdout"))
+check(qgrep("file1", "stdout"))
+check(qgrep("file2", "stdout"))
+
+commit()
+
+-- redundant additions should not appear
+-- (i.e. they should be ignored)
+
+check(cmd(mtn("add", "file0")), 0, false, true)
+check(qgrep("skipping file0", "stderr"))
+
+check(cmd(mtn("add", "dir")), 0, false, true)
+check(qgrep("skipping dir/file1", "stderr"))
+check(qgrep("skipping dir/file2", "stderr"))
+
+check(cmd(mtn("status")), 0, true)
+check(not qgrep("file0", "stdout"))
+check(not qgrep("file1", "stdout"))
+check(not qgrep("file2", "stdout"))
+
+-- add --unknown should add any files that ls unknown shows you and not ignored
+
+writefile("file3", "file 3\n")
+--writefile("file4.ignore", "file 4 ignore\n")
+writefile("dir/file5", "file 5\n")
+writefile("dir/file6.ignore", "file 6\n")
+mkdir("dir2")
+writefile("dir2/file7", "file 7\n")
+--writefile(".mtn-ignore", ".*\\.ignore$\n")
+
+--check(cmd(raw_mtn("ls", "unkown")), 0, true, false)
+
+check(cmd(mtn("add", "--unknown")), 0, false, true)
+check(qgrep('adding file3', "stderr"))
+--check(not qgrep('adding file4.ignore', "stderr"))
+check(qgrep('adding dir/file5', "stderr"))
+--check(not qgrep('adding dir/file6.ignore', "stderr"))
+check(qgrep('adding dir2', "stderr"))
+check(qgrep('adding dir2/file7', "stderr"))
+check(not qgrep('skipping dir2/file7', "stderr"))
+check(not qgrep('adding test_hooks.lua', "stderr"))
+
+check(cmd(mtn("status")), 0, true)
+check(not qgrep("file0", "stdout"))
+check(not qgrep("file1", "stdout"))
+check(not qgrep("file2", "stdout"))
+check(qgrep("file3", "stdout"))
+--check(not qgrep("file4", "stdout"))
+check(qgrep("file5", "stdout"))
+--check(not qgrep("file6", "stdout"))
+
+commit()
+
+check(cmd(mtn("status")), 0, true)
+check(not qgrep("file0", "stdout"))
+check(not qgrep("file1", "stdout"))
+check(not qgrep("file2", "stdout"))
+check(not qgrep("file3", "stdout"))
+--check(not qgrep("file4", "stdout"))
+check(not qgrep("file5", "stdout"))
+--check(not qgrep("file6", "stdout"))
============================================================
--- tests/calculation_of_incorrect_unidiffs/__driver__.lua 3e252f3773737b1c3732d31bd555019b1ef78d53
+++ tests/calculation_of_incorrect_unidiffs/__driver__.lua 3e252f3773737b1c3732d31bd555019b1ef78d53
@@ -0,0 +1,18 @@
+
+mtn_setup()
+
+-- I don't get it. This seems to work, but WTF is that qgrep looking for?
+
+-- decode first file and commit to db
+getfile("firstfile", "testfile")
+addfile("testfile")
+commit()
+os.rename("testfile", "firstfile")
+
+-- calculate diff to second file using monotone
+getfile("secondfile", "testfile")
+check(cmd(mtn("diff")), 0, true)
+os.rename("stdout", "monodiff")
+
+-- look for a meaningless change
+check(not qgrep("^-$", "monodiff"))
============================================================
--- tests/calculation_of_incorrect_unidiffs/firstfile 2fdc5405a533dfc81e28e02c482ca3d783225d51
+++ tests/calculation_of_incorrect_unidiffs/firstfile 2fdc5405a533dfc81e28e02c482ca3d783225d51
@@ -0,0 +1,1668 @@
+// copyright (C) 2002, 2003 graydon hoare
+// all rights reserved.
+// licensed to the public under the terms of the GNU GPL (>= 2)
+// see the file COPYING for details
+
+#include