[PATCH CREW] parsers: add apiversion module constant to C implementation of parsers

Matt Mackall mpm at selenic.com
Tue Dec 3 15:43:08 CST 2013


On Tue, 2013-12-03 at 03:35 -0800, Chris Jerdonek wrote:
> # HG changeset patch
> # User Chris Jerdonek <chris.jerdonek at gmail.com>
> # Date 1386070245 28800
> #      Tue Dec 03 03:30:45 2013 -0800
> # Node ID 2b49d4087af707302eb2acf23b2ec9cea17a4adc
> # Parent  7eda5bb9ec8ff230d035164efde065d4f5ae92a2
> parsers: add apiversion module constant to C implementation of parsers
> 
> This change adds a module constant called "apiversion" to the C implementation
> of the parsers module.  Going forward, the presence of this constant can be
> used to distinguish the C implementation of parsers from the pure Python
> version (e.g. from within unit test modules).  The value is initially set to 1.

This is still tightly coupled. Hint: bisect travels backwards and
forwards in history. I don't want to run 'make' if I'm not tracking down
an extension bug.

> In addition, this value can be incremented as a way to signal changes in
> the C API.

Also, this is a known recipe for failure, as already demonstrated in the
very bug this was created in response to. Human beings simply cannot be
entrusted to do this correctly, or more importantly, in a timely
fashion.

In C: add a new interface (do not change old interfaces)
In Python: check for existence of new interface

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list