diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootstrap.py index 10be8ee78d75..43931a3ab507 100644 --- a/python/mozboot/mozboot/bootstrap.py +++ b/python/mozboot/mozboot/bootstrap.py @@ -402,17 +402,19 @@ class Bootstrapper(object): # as possible if this check fails. self.instance.ensure_python_modern() - if self.instance.no_system_changes: - state_dir_available, state_dir = self.try_to_create_state_dir() - # We need to enable the loading of hgrc in case extensions are - # required to open the repo. - r = current_firefox_checkout( - env=self.instance._hg_cleanenv(load_hgrc=True), - hg=self.instance.which('hg')) - (checkout_type, checkout_root) = r - self.instance.validate_environment(checkout_root) - have_clone = bool(checkout_type) + state_dir_available, state_dir = self.try_to_create_state_dir() + if state_dir_available: + self.instance.state_dir = state_dir + # We need to enable the loading of hgrc in case extensions are + # required to open the repo. + (checkout_type, checkout_root) = current_firefox_checkout( + env=self.instance._hg_cleanenv(load_hgrc=True), + hg=self.instance.which('hg')) + self.instance.validate_environment(checkout_root) + have_clone = bool(checkout_type) + + if self.instance.no_system_changes: if state_dir_available: self.check_telemetry_opt_in(state_dir) self.maybe_install_private_packages_or_exit(state_dir, @@ -432,16 +434,6 @@ class Bootstrapper(object): if not self.instance.artifact_mode: self.instance.ensure_rust_modern() - state_dir_available, state_dir = self.try_to_create_state_dir() - - # We need to enable the loading of hgrc in case extensions are - # required to open the repo. - r = current_firefox_checkout(env=self.instance._hg_cleanenv(load_hgrc=True), - hg=self.instance.which('hg')) - (checkout_type, checkout_root) = r - - self.instance.validate_environment(checkout_root) - # If we didn't specify a VCS, and we aren't in an exiting clone, # offer a choice if not self.vcs: