[PATCH 3 of 8 V3] revlog: catch revlog corruption in index_baserev

Yuya Nishihara yuya at tcha.org
Sun Dec 30 03:46:57 EST 2018


On Fri, 28 Dec 2018 19:12:49 +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld at octobus.net>
> # Date 1545950077 -3600
> #      Thu Dec 27 23:34:37 2018 +0100
> # Node ID a85d334d94953fa99f96055baf20f1f0d946b172
> # Parent  d313cef8450897c3abf201940f73f57b5dfe8b37
> # EXP-Topic sparse-revlog
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r a85d334d9495
> revlog: catch revlog corruption in index_baserev

> +	if (result > rev) {
> +		PyErr_Format(
> +		    PyExc_ValueError,
> +		    "corrupted revlog, revision base above revision: %d, %d",
> +		    rev, result);
> +		return -2;
> +	}

Perhaps, we can catch rev < -1 as well, so index_issnapshotrev() can report
the error properly.


More information about the Mercurial-devel mailing list