Bug 1747280 - nuke comm/ after cross-channel. r=releng-reviewers,jmaher DONTBUILD

We clean up our Gecko clone between tasks via `hg robustcheckout --purge`, which runs `hg purge`. This is very effective, *but* it doesn't detect or clean up any nested clones.

Because we run cross-channel on Gecko workers, and because we clone `comm/` in cross-channel and haven't cleaned it up, and because `hg purge` doesn't detect or clean up nested clones, and because our current virtualenv setup code traverses the tree and can error out on `comm/` clones, let's clean up `comm/` after running cross-channel.

We'll be moving TB cross-channel to different tasks/workers in bug 1742711, and ideally we can update robustcheckout and/or `hg purge` to be able to detect and/or clean up nested clones.

Differential Revision: https://phabricator.services.mozilla.com/D134582
This commit is contained in:
Aki Sasaki 2021-12-23 19:25:02 +00:00
parent 38873ef4da
commit a6f09dd1ef
2 changed files with 7 additions and 0 deletions

View file

@ -48,6 +48,7 @@ def get_default_config(topsrcdir, strings_path):
},
"comm-central": {
"path": topsrcdir / "comm",
"post-clobber": True,
"url": "https://hg.mozilla.org/comm-central/",
"heads": {
# This list of repositories is ordered, starting with the

View file

@ -279,6 +279,8 @@ def _do_create_content(
repo_config["path"],
heads=repo_config.get("heads", {}).keys(),
)
if repo_config.get("post-clobber", False):
_nuke_hg_repo(command_context, str(repo_config["path"]))
else:
_check_hg_repo(command_context, strings_path)
for repo_config in config.get("source", {}).values():
@ -397,3 +399,7 @@ def _check_hg_repo(command_context, path, heads=None):
def _clone_hg_repo(command_context, url, path):
_retry_run_process(command_context, ["hg", "clone", url, str(path)])
def _nuke_hg_repo(command_context, path):
_retry_run_process(command_context, ["rm", "-rf", str(path)])