[PATCH evolve-ext v2] py3: broad pass for python3 compatibility

Ludovic Chabant ludovic at chabant.com
Tue Jul 2 10:52:02 EDT 2019

> This patch don't apply anymore :-/ It is also very invasive and will be 
> painful for all other contributors.

It might be because I created the patch on top of `stable` instead of some other head?
To be precise it was applied on top of the 9.0 release since that was the latest on the stable branch last week.

> Do you think we could get to a point where no manual tweaking is needed 
> ? (could be simply adding dedicated comment to line that need to be 
> skipped). If we have a script only approach we could use the 
> format-source extensions for that.

I already mentioned the steps to reproduce the patch, but there's one more step now:

1. Run `byteify-strings` with `--dictiter`
2. Remove the added `b` prefix where `exthelper.addattr` is used (there should be only 2 places with it in `obsdiscovery.py`).
3. In `templatekw.py` we wrap some functions and re-feed them to `templatekeyword`. Down the callstack it tries to encode the docstring, but it had already been encoded once, so you'll notice 2 more manual edits to decode the docstring back into its original form.

To get to a script-only approach, you can submit the 2 changes from step 3 as a separate changeset, and then somehow modify `byteify-strings` so that step 2 isn't necessary... a simple approach would be to add some support for a line-end comment like the `#noqa` that some linters support... so say you add `#nobytestr` at the end of the 2 appropriate lines in `obsdiscovery.py` so that the script skips them.

More information about the Mercurial-devel mailing list