Certain extensions (specifically infinite push) call full fledge mercurial
commands. Since all proper mercurial commands might change the repo state,
these are tracked and changes are recorded, which at best causes confusing repo
states for the user and at worst prevents the user from undo-ing due to
precieved gaps in the log. By using an env flag we can avoid this.
This change was tested in a repo with infinite push enabled with unit tests.
I don't think you need to use os.environ. It doesn't give any benefits because infinitepush doesn't create a separate process. A global variable is enough.