Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7122794
D5691.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D5691.diff
View Options
diff --git a/swh/loader/mercurial/from_disk.py b/swh/loader/mercurial/from_disk.py
--- a/swh/loader/mercurial/from_disk.py
+++ b/swh/loader/mercurial/from_disk.py
@@ -167,10 +167,6 @@
# If set, will override the default value
self._visit_status = None
- self.old_environ = os.environ.copy()
- os.environ.clear()
- os.environ.update(get_minimum_env())
-
def pre_cleanup(self) -> None:
"""As a first step, will try and check for dangling data to cleanup.
This should do its best to avoid raising issues.
@@ -182,6 +178,10 @@
log=self.log,
)
+ self.old_environ = os.environ.copy()
+ os.environ.clear()
+ os.environ.update(get_minimum_env())
+
def cleanup(self) -> None:
"""Last step executed by the loader."""
os.environ.clear()
diff --git a/swh/loader/mercurial/tests/conftest.py b/swh/loader/mercurial/tests/conftest.py
--- a/swh/loader/mercurial/tests/conftest.py
+++ b/swh/loader/mercurial/tests/conftest.py
@@ -47,3 +47,4 @@
"""
os.environ["HGPLAIN"] = ""
os.environ["HGRCPATH"] = ""
+ os.environ["HGRCSKIPREPO"] = ""
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Dec 17 2024, 12:51 AM (14 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3221169
Attached To
D5691: Remove `os.environ` manipulation in tests
Event Timeline
Log In to Comment