From dfb60a287c18948c37f0adc213b1e2c024a201dc Mon Sep 17 00:00:00 2001 From: Vadim Gelfer Date: Fri, 18 Aug 2006 14:49:12 -0700 Subject: [PATCH 1/2] add test for issue 322. no .out file because issue is still live. --- tests/test-issue322 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 tests/test-issue322 diff --git a/tests/test-issue322 b/tests/test-issue322 new file mode 100755 index 0000000000..3811408072 --- /dev/null +++ b/tests/test-issue322 @@ -0,0 +1,20 @@ +#!/bin/sh +# http://www.selenic.com/mercurial/bts/issue322 + +hg init a +cd a +echo a > a +hg commit -Ama +rm a +mkdir a +echo a > a/a + +echo % should fail - will corrupt dirstate +hg add a/a +hg commit -mb + +echo % should fail - manifest is corrupt +hg verify +cd .. + +hg --debug --traceback clone a b From feeb6e59ebc9aaa3d9f4ab977200ab85ffd5744e Mon Sep 17 00:00:00 2001 From: Vadim Gelfer Date: Fri, 18 Aug 2006 15:53:14 -0700 Subject: [PATCH 2/2] add other dir/file case to test for issue322. --- tests/test-issue322 | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/tests/test-issue322 b/tests/test-issue322 index 3811408072..86e0aed18c 100755 --- a/tests/test-issue322 +++ b/tests/test-issue322 @@ -1,6 +1,8 @@ #!/bin/sh # http://www.selenic.com/mercurial/bts/issue322 +echo % file replaced with directory + hg init a cd a echo a > a @@ -9,12 +11,35 @@ rm a mkdir a echo a > a/a -echo % should fail - will corrupt dirstate +echo % should fail - would corrupt dirstate hg add a/a + +echo % should fail - if add succeeded, would corrupt manifest hg commit -mb -echo % should fail - manifest is corrupt +echo % should fail if commit succeeded - manifest is corrupt hg verify -cd .. +cd .. +echo % should succeed, but manifest is corrupt hg --debug --traceback clone a b + +echo % directory replaced with file + +hg init c +cd c +mkdir a +echo a > a/a +hg commit -Ama + +rm -rf a +echo a > a + +echo % should fail - would corrupt dirstate +hg add a + +echo % should fail - if add succeeded, would corrupt manifest +hg commit -mb a + +echo % should fail if commit succeeded - manifest is corrupt +hg verify