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

Yuya Nishihara yuya at tcha.org
Fri Apr 28 08:21:32 EDT 2017


On Thu, 27 Apr 2017 10:04:46 -0700, Jun Wu wrote:
> Excerpts from Yuya Nishihara's message of 2017-04-28 00:44:37 +0900:
> > > Ah, I may have written something similar [1] yesterday. I guess your patches
> > > may be cleaner as I didn't improve __init__.py.
> > > 
> > > [1]: https://bpaste.net/show/742e6c81af22 
> > 
> > Basically I'm going to wrap a module by dualmod(cext, pure) so missing
> > attribute access will automatically fall back to a pure module. This wrapper
> > will be enabled only when the module policy is permissive.
> 
> Then I think my solution (explicit API version in C module) is better:
> 
>   - support falling back to pure transparently if policy is "allow", too
>   - handle signature changes (like in this case)
>   - never load API incompatible C modules built in the past or the future
>   - (optional) trigger an rebuild transparently when C module cannot be used

The key difference is version-per-module or version-per-function. Historically
we chose the latter probably because we wanted to run bisect without recompiling
C modules, which is slow. I don't think there's big reason to rethink about the
versioning strategy.

> By default, policy is "c". My change treats C module with incompatible API
> version like the module does not exist, which is more explicit and permits
> arbitrary changes.

I'll change the default of in-place build to 'allow' since I plan to make
the 'c' policy more strict, e.g. no implicit fallback to pure fm1readmarkers().


More information about the Mercurial-devel mailing list