# HG changeset patch # User Nicolas Dumazet # Date 2010-08-12 06:41:58 # Node ID 7830e693b704f0759c5a35890aabbc5f1dc431c9 # Parent 38e3f973a4f33916338324a60167af14b1c7ffd9 tests: unify test-verify diff --git a/tests/test-verify.out b/tests/test-verify.out deleted file mode 100644 --- a/tests/test-verify.out +++ /dev/null @@ -1,52 +0,0 @@ -% prepare repo -adding FOO.txt -adding QUICK.txt -adding bar.txt - -% verify -checking changesets -checking manifests -crosschecking files in changesets and manifests -checking files -3 files, 1 changesets, 3 total revisions - -% verify with journal -abandoned transaction found - run hg recover -checking changesets -checking manifests -crosschecking files in changesets and manifests -checking files -3 files, 1 changesets, 3 total revisions - -% introduce some bugs in repo - -% verify -checking changesets -checking manifests -crosschecking files in changesets and manifests -checking files - data/FOO.txt.i@0: missing revlog! - 0: empty or missing FOO.txt - FOO.txt@0: f62022d3d590 in manifests not found - data/QUICK.txt.i@0: missing revlog! - 0: empty or missing QUICK.txt - QUICK.txt@0: 88b857db8eba in manifests not found - data/bar.txt.i@0: missing revlog! - 0: empty or missing bar.txt - bar.txt@0: 256559129457 in manifests not found -3 files, 1 changesets, 0 total revisions -9 integrity errors encountered! -(first damaged changeset appears to be 0) -% test revlog corruption - -% verify -checking changesets -checking manifests -crosschecking files in changesets and manifests -checking files - a@0: broken revlog! (index data/a.i is corrupted) -warning: orphan revlog 'data/a.i' -1 files, 1 changesets, 0 total revisions -1 warnings encountered! -1 integrity errors encountered! -(first damaged changeset appears to be 0) diff --git a/tests/test-verify b/tests/test-verify.t old mode 100755 new mode 100644 rename from tests/test-verify rename to tests/test-verify.t --- a/tests/test-verify +++ b/tests/test-verify.t @@ -1,51 +1,87 @@ -#!/bin/sh +prepare repo + + $ hg init a + $ cd a + $ echo "some text" > FOO.txt + $ echo "another text" > bar.txt + $ echo "more text" > QUICK.txt + $ hg add + adding FOO.txt + adding QUICK.txt + adding bar.txt + $ hg ci -mtest1 + +verify -echo % prepare repo -hg init a -cd a -echo "some text" > FOO.txt -echo "another text" > bar.txt -echo "more text" > QUICK.txt -hg add -hg ci -mtest1 + $ hg verify + checking changesets + checking manifests + crosschecking files in changesets and manifests + checking files + 3 files, 1 changesets, 3 total revisions + +verify with journal -echo -echo % verify -hg verify + $ touch .hg/store/journal + $ hg verify + abandoned transaction found - run hg recover + checking changesets + checking manifests + crosschecking files in changesets and manifests + checking files + 3 files, 1 changesets, 3 total revisions + $ rm .hg/store/journal -echo -echo % verify with journal -touch .hg/store/journal -hg verify -rm .hg/store/journal +introduce some bugs in repo + + $ cd .hg/store/data + $ mv _f_o_o.txt.i X_f_o_o.txt.i + $ mv bar.txt.i xbar.txt.i + $ rm _q_u_i_c_k.txt.i -echo -echo % introduce some bugs in repo -cd .hg/store/data -mv _f_o_o.txt.i X_f_o_o.txt.i -mv bar.txt.i xbar.txt.i -rm _q_u_i_c_k.txt.i + $ hg verify + checking changesets + checking manifests + crosschecking files in changesets and manifests + checking files + data/FOO.txt.i@0: missing revlog! + 0: empty or missing FOO.txt + FOO.txt@0: f62022d3d590 in manifests not found + data/QUICK.txt.i@0: missing revlog! + 0: empty or missing QUICK.txt + QUICK.txt@0: 88b857db8eba in manifests not found + data/bar.txt.i@0: missing revlog! + 0: empty or missing bar.txt + bar.txt@0: 256559129457 in manifests not found + 3 files, 1 changesets, 0 total revisions + 9 integrity errors encountered! + (first damaged changeset appears to be 0) -echo -echo % verify -hg verify + $ cd .. -cd .. +test revlog corruption -echo % test revlog corruption -hg init b -cd b + $ hg init b + $ cd b -touch a -hg add a -hg ci -m a + $ touch a + $ hg add a + $ hg ci -m a + + $ echo 'corrupted' > b + $ dd if=.hg/store/data/a.i of=start bs=1 count=20 2>/dev/null + $ cat start b > .hg/store/data/a.i -echo 'corrupted' > b -dd if=.hg/store/data/a.i of=start bs=1 count=20 2>/dev/null -cat start b > .hg/store/data/a.i + $ hg verify + checking changesets + checking manifests + crosschecking files in changesets and manifests + checking files + a@0: broken revlog! (index data/a.i is corrupted) + warning: orphan revlog 'data/a.i' + 1 files, 1 changesets, 0 total revisions + 1 warnings encountered! + 1 integrity errors encountered! + (first damaged changeset appears to be 0) -echo -echo % verify -hg verify - -exit 0 + $ exit 0