[PATCH 2 of 2] [mq]: parsers.patch

Matt Mackall mpm at selenic.com
Tue Oct 14 16:26:19 CDT 2008


On Tue, 2008-10-14 at 20:57 +0200, Bernhard Leiner wrote:
> # HG changeset patch
> # User Bernhard Leiner <bleiner at gmail.com>
> # Date 1224010531 -7200
> # Node ID bd4941d0a4a6fe8495073790cefed93dc344e74a
> # Parent  19ccd16c56835f66f764535700320d00ef7a54ed
> [mq]: parsers.patch

(Looks like you're suffering from the bunfight that Gmail has with our
greylisting. Hopefully this is fixed.)

> +	const char nullrev[20] = {'\0','\0','\0','\0','\0','\0','\0','\0',
> +				  '\0','\0','\0','\0','\0','\0','\0','\0',
> +				  '\0','\0','\0','\0'};

Seems you missed my comment about this. The initializer here is
redundant; const and static objects with no initializers are initialized
to all zeros by default.

> +	index = inlined ? PyList_New(0) : PyList_New(size / 64);

And also my comment about the 'magic index[nullrev]' entry. From
revlog.py:

        # add the magic null revision at -1                                     
	self.index.append((0, 0, 0, -1, -1, -1, -1, nullid))

This let's us do things like changelog.parentrevs(-1) without any
conditionals. So we should add 1 to our size calculations, and probably
go ahead and put this in in the C code.

Otherwise, this is looking pretty good.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list