[PATCH 1 of 2] test-remove : addition of some comments and file removal testing

mathieu.clabaut at gmail.com mathieu.clabaut at gmail.com
Sat Dec 8 08:40:46 CST 2007


# HG changeset patch
# User Mathieu Clabaut <mathieu.clabaut at gmail.com>
# Date 1197123725 -3600
# Node ID b76d9044a0e5751faa8a6b0b5e931ac53246315f
# Parent  1db1c7c1eb5e441f6744784535e4586c565110ea
test-remove : addition of some comments and file removal testing

diff --git a/tests/test-remove b/tests/test-remove
--- a/tests/test-remove
+++ b/tests/test-remove
@@ -3,14 +3,18 @@ hg init a
 hg init a
 cd a
 echo a > foo
-hg rm foo
+	#rm file not managed
+hg rm foo 
 hg add foo
 hg commit -m 1 -d "1000000 0"
+	#rm with no file specified
 hg remove
+	#standard remove +revert
 rm foo
 hg remove foo
 hg revert --all
 rm foo
+	# remove after
 hg remove --after
 hg commit -m 2 -d "1000000 0"
 hg export --nodates 0
@@ -20,8 +24,12 @@ hg log -p -r 1
 
 echo a > a
 hg add a
+	# not removing added file
 hg rm a
+test -f a && echo OK a still exists || echo NOK a was removed
+	# unless --force
 hg rm -f a
+test ! -f a && echo NOK a still exists || echo OK a was removed
 echo b > b
 mkdir c
 echo d > c/d
diff --git a/tests/test-remove.out b/tests/test-remove.out
--- a/tests/test-remove.out
+++ b/tests/test-remove.out
@@ -50,6 +50,8 @@ diff -r 8ba83d44753d -r a1fce69c50d9 foo
 -a
 
 not removing a: file has been marked for add (use -f to force removal)
+OK a still exists
+OK a was removed
 adding a
 adding b
 adding c/d


More information about the Mercurial-devel mailing list