| b69ab31 | | | 1 | /** |
| b69ab31 | | | 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| b69ab31 | | | 3 | * |
| b69ab31 | | | 4 | * This source code is licensed under the MIT license found in the |
| b69ab31 | | | 5 | * LICENSE file in the root directory of this source tree. |
| b69ab31 | | | 6 | */ |
| b69ab31 | | | 7 | |
| b69ab31 | | | 8 | import type {ConfigName} from 'isl/src/types'; |
| b69ab31 | | | 9 | import type {ServerSideTracker} from './analytics/serverSideTracker'; |
| b69ab31 | | | 10 | import type {Logger} from './logger'; |
| b69ab31 | | | 11 | |
| b69ab31 | | | 12 | /** |
| b69ab31 | | | 13 | * Per-connection context with which to access a repository. |
| b69ab31 | | | 14 | * Repositories instances are shared and reused, but |
| b69ab31 | | | 15 | * this context is not. It's used for any state that cannot be shared. |
| b69ab31 | | | 16 | */ |
| b69ab31 | | | 17 | export type RepositoryContext = { |
| b69ab31 | | | 18 | cmd: string; |
| b69ab31 | | | 19 | cwd: string; |
| b69ab31 | | | 20 | logger: Logger; |
| b69ab31 | | | 21 | tracker: ServerSideTracker; |
| b69ab31 | | | 22 | |
| b69ab31 | | | 23 | knownConfigs?: ReadonlyMap<ConfigName, string> | undefined; |
| b69ab31 | | | 24 | /** Whether we pass --debug to sl commands */ |
| b69ab31 | | | 25 | debug?: boolean; |
| b69ab31 | | | 26 | /** Whether we pass --verbose to sl commands */ |
| b69ab31 | | | 27 | verbose?: boolean; |
| b69ab31 | | | 28 | /** |
| b69ab31 | | | 29 | * Configured merge tool, from `ui.merge`, as long as merge-tools.$tool.gui is also True. |
| b69ab31 | | | 30 | * null -> no merge tool configured or not valid |
| b69ab31 | | | 31 | * undefined -> not cached yet |
| b69ab31 | | | 32 | */ |
| b69ab31 | | | 33 | cachedMergeTool?: string | null; |
| b69ab31 | | | 34 | // TODO: visible commit age range |
| b69ab31 | | | 35 | }; |