From b3d807c4df2d3497728722935c992fd623837b1e Mon Sep 17 00:00:00 2001 From: Chad Austin Date: Wed, 19 Oct 2022 17:59:03 -0700 Subject: [PATCH] don't stat the existing directory before mounting Summary: I can't easily reproduce the failure case, but D39900481 (https://github.com/facebookexperimental/eden/commit/29d29e0f141cc28a933ea5b671dc1c208572fc4a) caused early stats() during doctor and mount that don't handle the case that a broken EdenFS mount underlies where want to place a new one. We don't care about sniffing the .hg directory, so lazily search for it. Reviewed By: muirdm Differential Revision: D40530670 fbshipit-source-id: 0b10eb0778575f1e69a998d3fcb84866dd383229 --- eden/fs/cli/config.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/eden/fs/cli/config.py b/eden/fs/cli/config.py index 46b48197fc..837f1b0a2e 100644 --- a/eden/fs/cli/config.py +++ b/eden/fs/cli/config.py @@ -10,6 +10,7 @@ import binascii import collections import datetime import errno +import functools import json import logging import os @@ -1106,9 +1107,7 @@ class EdenCheckout: def __init__(self, instance: EdenInstance, path: Path, state_dir: Path) -> None: self.instance = instance self.path = path - from . import hg_util - self.hg_dot_path: Path = path / hg_util.sniff_dot_dir(path) self.state_dir = state_dir self._config: Optional[CheckoutConfig] = None @@ -1224,6 +1223,12 @@ class EdenCheckout: # Update our local config cache self._config = checkout_config + @functools.cached_property + def hg_dot_path(self) -> Path: + from . import hg_util + + return self.path / hg_util.sniff_dot_dir(self.path) + def _config_path(self) -> Path: return self.state_dir / MOUNT_CONFIG