Ejemplo n.º 1
0
def check_running_mount(
    tracker: ProblemTracker,
    instance: EdenInstance,
    checkout_info: CheckoutInfo,
    mount_table: mtab.MountTable,
    watchman_info: check_watchman.WatchmanCheckInfo,
) -> None:
    if checkout_info.configured_state_dir is None:
        tracker.add_problem(CheckoutNotConfigured(checkout_info))
        return
    elif checkout_info.configured_state_dir != checkout_info.running_state_dir:
        tracker.add_problem(CheckoutConfigurationMismatch(checkout_info))
        return

    checkout = checkout_info.get_checkout()
    try:
        config = checkout.get_config()
    except Exception as ex:
        tracker.add_problem(ConfigurationParsingProblem(checkout_info, ex))
        # Just skip the remaining checks.
        # Most of them rely on values from the configuration.
        return

    check_filesystems.check_using_nfs_path(tracker, checkout.path)
    check_watchman.check_active_mount(tracker, str(checkout.path),
                                      watchman_info)
    check_redirections.check_redirections(tracker, instance, checkout,
                                          mount_table)
    if sys.platform == "win32":
        check_filesystems.check_materialized_are_accessible(
            tracker, instance, checkout)
        check_filesystems.check_loaded_content(tracker, instance, checkout,
                                               prjfs.PrjGetOnDiskFileState)
    if config.scm_type == "hg":
        check_hg.check_hg(tracker, checkout)
Ejemplo n.º 2
0
def check_mount_overlay_type(tracker: ProblemTracker,
                             checkout_info: CheckoutInfo) -> None:
    config = checkout_info.get_checkout().get_config()
    if not config.enable_tree_overlay:
        tracker.add_problem(CheckoutLegacyOverlayType(checkout_info))