Bug 1539681 - Remove mercurial clone on failure. r=releng-reviewers,bhearsum

Differential Revision: https://phabricator.services.mozilla.com/D182129
This commit is contained in:
Mike Hommey 2023-06-27 21:18:20 +00:00
Родитель 15e4b08ef2
Коммит e0c9d9a9a8
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -470,6 +470,10 @@ def vcs_checkout(source_repo, dest, store_path,
res = run_and_prefix_output(b'vcs', args,
extra_env={'PYTHONUNBUFFERED': '1'})
if res:
# Mitigation for bug 1539681: if for some reason the clone failed,
# we just remove it, so that its possible incomplete state doesn't
# interfere with cloning in subsequent tasks.
shutil.rmtree(dest, ignore_errors=True)
sys.exit(res)
# Update the current revision hash and ensure that it is well formed.