D8022: chg: pass copies of some envvars so we can detect py37+ modifications

Yuya Nishihara yuya at tcha.org
Tue Jan 28 11:08:40 EST 2020


Another idea. How about sending the true LC_CTYPE value as a command
argument so the env mangling can be reverted?

 1. spawn `hg serve --cmdserver chgunix ...` with
    `--daemon-postexec setenv:LC_CTYPE=$LC_CTYPE`
 2. `runservice()` overwrites `LC_CTYPE` to the specified value (undo coercing)
 3. chgserver hashes the restored environ

Since the "coercing" is 100% useless for Mercurial, restoring LC_CTYPE
should be perfectly fine. And unlike setting `PYTHONCOERCECLOCALE=0`,
Python subprocesses can still see its own "coercing" results for better
or worse.


More information about the Mercurial-devel mailing list