#
# add_file "tests/t_db_kill_rev_locally.at"
#
# patch "ChangeLog"
# from [121999fc08f8913be21aa8d8cb9dd06c80f71158]
# to [2515cce751cd755cd4da1d699b14aa15d16b07c1]
#
# patch "tests/t_db_kill_rev_locally.at"
# from []
# to [7833b3652bf45b72b9fb6490b86fe2b66d7105ee]
#
# patch "testsuite.at"
# from [5c3edfba27e5b828d6080f873f035114c54e7823]
# to [78e75421c02747bc50d1966394370014a1e16858]
#
--- ChangeLog
+++ ChangeLog
@@ -1,5 +1,10 @@
2005-04-17 Sebastian Spaeth
+
+ * tests/t_db_kill_rev_locally.at: new test;
+ make sure that db kill_rev_locally works as intended
+2005-04-17 Sebastian Spaeth
+
* commands.cc,database.cc: add 'db kill_rev_locally ' command
still missing: documentation and autotests. Otherwise seems ok.
--- tests/t_db_kill_rev_locally.at
+++ tests/t_db_kill_rev_locally.at
@@ -0,0 +1,24 @@
+AT_SETUP([db kill_rev_locally command])
+MONOTONE_SETUP
+
+# This tests the db kill_rev_locally command
+
+# Prepare a db with two revisions
+AT_CHECK(echo "test">tmp, [], ignore, ignore)
+AT_CHECK(MONOTONE add tmp, [], ignore, ignore)
+AT_CHECK(MONOTONE --branch="test" --message="logtext" commit, [], ignore, stderr)
+ANCESTOR=`cat stderr|awk '/committed revision/ {print $4}'`
+AT_CHECK(echo "test2">>tmp, [], ignore, ignore)
+AT_CHECK(MONOTONE --message="logtext" commit, [], ignore, stderr)
+CHILD=`cat stderr|awk '/committed revision/ {print $4}'`
+
+# trying to kill the ancestor. This *is supposed to fail*
+AT_CHECK(MONOTONE db kill_rev_locally $ANCESTOR, [1], ignore, ignore)
+AT_CHECK(MONOTONE db check, [], ignore, ignore)
+
+# killing children is ok, though :)
+AT_CHECK(MONOTONE db kill_rev_locally $CHILD, [], ignore, ignore)
+AT_CHECK(MONOTONE db check, [], ignore, ignore)
+
+AT_CLEANUP
+(END)
--- testsuite.at
+++ testsuite.at
@@ -564,3 +564,4 @@
m4_include(tests/t_override_author_date.at)
m4_include(tests/t_add_stomp_file.at)
m4_include(tests/t_database_check_minor.at)
+m4_include(tests/t_db_kill_rev_locally.at)