Bug 1870175 - Only run check_for_hgrc_state_dir_mismatch() if hg is installed r=firefox-build-system-reviewers,glandium

Differential Revision: https://phabricator.services.mozilla.com/D196507
This commit is contained in:
ahochheiden 2023-12-15 20:50:52 +00:00
parent 8905b2cca6
commit e074614f1f

View File

@ -355,7 +355,12 @@ class Bootstrapper(object):
def bootstrap(self, settings):
state_dir = Path(get_state_dir())
check_for_hgrc_state_dir_mismatch(state_dir)
hg = to_optional_path(which("hg"))
hg_installed = bool(hg)
if hg_installed:
check_for_hgrc_state_dir_mismatch(state_dir)
if self.choice is None:
applications = APPLICATIONS
@ -404,8 +409,6 @@ class Bootstrapper(object):
self.instance.state_dir = state_dir
hg = to_optional_path(which("hg"))
# We need to enable the loading of hgrc in case extensions are
# required to open the repo.
(checkout_type, checkout_root) = current_firefox_checkout(
@ -433,7 +436,6 @@ class Bootstrapper(object):
# Possibly configure Mercurial, but not if the current checkout or repo
# type is Git.
hg_installed = bool(hg)
if checkout_type == "hg":
hg_installed, hg_modern = self.instance.ensure_mercurial_modern()