[PATCH 1 of 2 STABLE] diffhelpers: add canstripcr=True to fix_newline

Jun Wu quark at fb.com
Tue Apr 25 14:23:24 EDT 2017


Excerpts from Yuya Nishihara's message of 2017-04-25 22:56:13 +0900:
> This will break C API compatibility: new build of diffhelpers.so with old
> Mercurial. In general, we do rename the C function, but it wouldn't help
> since there's no try-catch around the call site of fix_newline().

I don't get it. For "fix_newline" as a Python method exported by
"diffhelpers.so", it accepts an optional 4th argument. So it'll be fine to
have new diffhelpers.so with older mercurial python code - the 4th argument
is set to True by default to maintain the old behavior.

For "static void _fix_newline(PyObject *hunk, PyObject *a, PyObject *b,
bool canstripcr)", its signature changed (so using old diffhelpers.so with
new mercurial python code will be troublesome). But it's marked "static",
which means it's not intended for being used by other code.

The problem is new python code won't work with old .so files. But that does
not sound like a strict rule we have to maintain. Bisect users could still
build the new version first and start bisecting without rebuild.

> [...]


More information about the Mercurial-devel mailing list