[PATCH 6 of 7 V4] delta: have a native implementation of _findsnapshot

Yuya Nishihara yuya at tcha.org
Thu Jan 3 03:57:34 EST 2019


On Wed, 2 Jan 2019 23:38:15 +0100, Boris FELD wrote:
> On 02/01/2019 04:04, Yuya Nishihara wrote:
> > On Sun, 30 Dec 2018 19:43:53 +0100, Boris Feld wrote:
> >> # HG changeset patch
> >> # User Boris Feld <boris.feld at octobus.net>
> >> # Date 1545297320 -3600
> >> #      Thu Dec 20 10:15:20 2018 +0100
> >> # Node ID a6bb015a9fb1a2c23d73f1c55e7d4160a9701191
> >> # Parent  5aff42c50dd1bc1e7c2e533a8e052fa42c6f9304
> >> # EXP-Topic sparse-revlog
> >> # Available At https://bitbucket.org/octobus/mercurial-devel/
> >> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r a6bb015a9fb1
> >> delta: have a native implementation of _findsnapshot

> >> +	if (!PyArg_ParseTuple(args, "On", &cache, &start_rev)) {
> >> +		return NULL;
> >> +	}
> >> +	if (!PyDict_Check(cache)) {
> >> +		PyErr_SetString(PyExc_TypeError,
> >> +		                "cache argument must be a dict");
> >> +		return NULL;
> >> +	}
> > Nit: maybe this can be "O!" with &PyDict_Type.
> I can't find if O! match subtype or only the exact type. I've delayed
> this update for now.

It calls PyType_IsSubtype(), so plain subtypes should be accepted.

https://github.com/python/cpython/blob/2.7/Python/getargs.c#L1258


More information about the Mercurial-devel mailing list