[PATCH 1 of 9] tests: add tests for missing revlogs and revlog entries

Martin von Zweigbergk martinvonz at google.com
Sun Feb 14 01:30:46 EST 2016


On Fri, Feb 12, 2016 at 2:38 PM, Martin von Zweigbergk
<martinvonz at google.com> wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz at google.com>
> # Date 1454306152 28800
> #      Sun Jan 31 21:55:52 2016 -0800
> # Node ID 435b70f76264c170f59a46490364b4762ad2ac2f
> # Parent  5c10e1389fa604d020fb9e5a6d1870c31856a07b
> tests: add tests for missing revlogs and revlog entries
>
> The verify code is pretty poorly tested. It's easy to test missing
> revlogs and missing revlog entries, so let's add tests for that.
>
> Also add some more tests corrupting each type of revlog, so we test
> the messages presented when reading a revision fails. The pure and
> native implementations produce different error messages, so we have to
> use (glob) in the tests.
>
> diff --git a/tests/test-verify.t b/tests/test-verify.t
> --- a/tests/test-verify.t
> +++ b/tests/test-verify.t
> @@ -63,6 +63,208 @@
>    $ cd ../../..
>    $ cd ..
>
> +Set up a repo for testing missing revlog entries
> +
> +  $ hg init missing-entries
> +  $ cd missing-entries
> +  $ echo 0 > file
> +  $ hg ci -Aqm0
> +  $ cp -r .hg/store .hg/store-partial
> +  $ echo 1 > file
> +  $ hg ci -Aqm1
> +  $ cp -r .hg/store .hg/store-full
> +
> +Entire changelog missing
> +
> +  $ rm .hg/store/00changelog.*
> +  $ hg verify -q
> +   0: empty or missing changelog
> +   manifest at 0: d0b6632564d4 not in changesets
> +   manifest at 1: 941fc4534185 not in changesets
> +  3 integrity errors encountered!
> +  (first damaged changeset appears to be 0)
> +  [1]
> +  $ cp -rT .hg/store-full .hg/store

I wrote this before I learnt that -T is not portable. I'll fix it up
myself on the clowncopter. Sorry.


More information about the Mercurial-devel mailing list