diff --git a/python/l10n/mozxchannel/__init__.py b/python/l10n/mozxchannel/__init__.py index cc88634ca20d..b22892da6714 100644 --- a/python/l10n/mozxchannel/__init__.py +++ b/python/l10n/mozxchannel/__init__.py @@ -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 diff --git a/tools/compare-locales/mach_commands.py b/tools/compare-locales/mach_commands.py index 9645308bc645..c36371e2e8e9 100644 --- a/tools/compare-locales/mach_commands.py +++ b/tools/compare-locales/mach_commands.py @@ -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)])