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

Sean Farley sean at farley.io
Tue Apr 25 21:11:04 UTC 2017


Jun Wu <quark at fb.com> writes:

> 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.

I'm not sure if we want to change this policy (perhaps) but mpm rarely
broke this in years past:

http://markmail.org/message/47ljuz23hitan3jk
http://markmail.org/message/kcfl63idjyez6kak
http://markmail.org/message/p2hbqrz4v4cm45rk (opposite update direction,
but linked for his comments about stable)
http://markmail.org/message/tv3a5w5sisbceanm (perhaps reason for doing
it)

I don't have as hard a stance as mpm did but I thought I'd bring up the
previous discussions to shed light on how we got here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 800 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20170425/ab7f294e/attachment.asc>


More information about the Mercurial-devel mailing list