Skip to content
Snippets Groups Projects
Commit ed5b302a authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

benchmark: add a mechanism to cleanup repo that have been updated

We don't want to run a full cleanup step all the time, so we introduce a way for
benchmark to indicate they will after a repository. We do not do this in a
`teardown` phase because we are never really sure they will be run.
parent f5a5c4d4
No related branches found
No related tags found
No related merge requests found
......@@ -397,6 +397,20 @@
message=message
)
# make sure the repos has a `.hg/scmperf/` directory for internal usage
self._repo_scmperf_dir = os.path.join(self.repo_path, b'.hg/', b'scmperf')
if not os.path.exists(self._repo_scmperf_dir):
os.makedirs(self._repo_scmperf_dir)
# if `.hg/scmperf/updated` exists a previous test touched the repo and
# we need to restore the repo.
self.need_update_marker_path = os.path.join(self._repo_scmperf_dir, b'updated')
if os.path.exists(self.need_update_marker_path):
self.hg("purge", "--all", "--config", "extensions.purge=")
self.hg("up", "-Cr", "tip")
# and marke the repository as clean
os.unlink(self.need_update_marker_path)
def get_util_hg_path(self):
cmd = os.environ.get("ASV_UTIL_HG", "hg")
# Get out of the virtualenv
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment