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

Jun Wu quark at fb.com
Thu Apr 27 13:04:46 EDT 2017


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

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.


More information about the Mercurial-devel mailing list