[PATCH] rev: C implementation of delta chain resolution

Yuya Nishihara yuya at tcha.org
Fri Jun 30 23:39:16 EDT 2017


On Tue, 27 Jun 2017 23:24:43 +0900, Yuya Nishihara wrote:
> On Sun, 25 Jun 2017 12:42:53 -0700, Gregory Szorc wrote:
> > # HG changeset patch
> > # User Gregory Szorc <gregory.szorc at gmail.com>
> > # Date 1498419694 25200
> > #      Sun Jun 25 12:41:34 2017 -0700
> > # Node ID 9e98095e4daca1f22c70f5374d1110c81be98cc4
> > # Parent  8e3021fd1a44e48a4720bb6fa4538fba399ad213
> > rev: C implementation of delta chain resolution

> > +		if (value == NULL) {
> > +			goto bail;
> > +		}
> > +		if (PyList_Append(chain, value)) {
> > +			Py_DECREF(value);
> > +			goto bail;
> > +		}
> > +		Py_DECREF(value);
> > +
> > +		if (generaldelta) {
> > +			iterrev = baserev;
> > +		}
> > +		else {
> > +			iterrev--;
> > +		}
> > +
> > +		if (iterrev < 0) {
> > +			break;
> > +		}
> > +
> > +		if (iterrev >= length) {
> 
> Maybe 'iterrev >= length - 1'? index_baserev() seems not to handle the index
> of the null entry, and the real null revision should be caught by the "break"
> above.

Fixed this in flight (because it could lead to SEGV) and queued, thanks.

Please send follow ups for the other nits.


More information about the Mercurial-devel mailing list