#
# add_file "tests/t_db_kill_rev_locally.at"
#
# patch "ChangeLog"
# from [1ad5ff493c189d3c10a89a2b74be8ec2002208ca]
# to [d3cfa314ffc85173aa9ce533f5e2fc5f485ce0bb]
#
# patch "tests/t_db_kill_rev_locally.at"
# from []
# to [7833b3652bf45b72b9fb6490b86fe2b66d7105ee]
#
# patch "testsuite.at"
# from [5c3edfba27e5b828d6080f873f035114c54e7823]
# to [78e75421c02747bc50d1966394370014a1e16858]
#
--- ChangeLog
+++ ChangeLog
@@ -1,9 +1,14 @@
2005-04-17 Olivier Andrieu
* transforms.cc: fix glob_to_regexp assertions
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.
@@ -2948,7 +2953,7 @@
* AUTHORS: Mention Wojciech and Neil.
* revision.cc (calculate_ancestors_from_graph): Make non-recursive.
-2005-01-17 Wojciech MiÅkowski
+2005-01-17 Wojciech MiÅkowski
* std_hooks.lua: Teach about meld.
--- 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)