HomeSoftware Heritage

Move `os.environ` manipulation to pre_cleanup

Description

Move os.environ manipulation to pre_cleanup

Simply initializing a loader would empty the environment, which can
cause seemingly unrelated things to break. Moving the environment
handling to the pre_cleanup phase ensures that cleanup will also
be called and the environment will not be left in a broken state.

We also add the HGRCSKIPREPO variable that I forgot to add in the
test environment. This is still needed because the tests invoke
hg directly. We could potentially have a wrapper util that uses a
context-manager to do the environment manipulation closer to the issue,
but we'd have to make sure that no other bare hg invocations can
happen, even in random subprocesses.

Details

Provenance
AlphareAuthored on May 5 2021, 10:29 PM
AlpharePushed on May 7 2021, 1:33 PM
AlpharePushed on May 7 2021, 1:32 PM
Differential Revision
D5691: Remove `os.environ` manipulation in tests
Parents
rDLDHG888471483a7b: Handle more cases of corruption
Branches
Unknown
Tags
Unknown
Build Status
Buildable 21370
Build 33195: test-and-buildJenkins console · Jenkins