D4022: index: don't include nullid in len()

Yuya Nishihara yuya at tcha.org
Sat Aug 4 02:24:03 EDT 2018


>  	if (PyInt_Check(value)) {
>  		long rev = PyInt_AS_LONG(value);
> -		return rev >= -1 && rev < index_length(self);
> +		return rev >= -1 && rev < index_length(self) - 1;

Fixed this to `index_length(self) + 1`. Maybe you'll want to drop `+ 1` by
a later patch, but excluding the tip rev is clearly wrong.


More information about the Mercurial-devel mailing list