pub struct Layout {
pub primary: PathBuf,
pub scratch: PathBuf,
pub wt_root: PathBuf,
}Expand description
The directories of one repository’s vitrify state.
Fields§
§primary: PathBufThe primary checkout.
scratch: PathBuf<primary>/.vitrify — transactions, logs, run.json.
wt_root: PathBufRoot of the unit worktrees and the integration checkout.
Implementations§
Source§impl Layout
impl Layout
Sourcepub fn resolve(
primary: &Path,
home: Option<&Path>,
worktree_dir: &str,
) -> Result<Layout, CoreError>
pub fn resolve( primary: &Path, home: Option<&Path>, worktree_dir: &str, ) -> Result<Layout, CoreError>
The layout for primary. worktree_dir is run.worktree_dir: empty
puts the worktrees under the vitrify home (home), keyed by the
repository; a relative path is taken from the repository root.
Sourcepub fn at(primary: &Path, wt_root: &Path) -> Layout
pub fn at(primary: &Path, wt_root: &Path) -> Layout
An explicit layout (tests, and callers that already know the root).
Sourcepub fn mainline(&self) -> PathBuf
pub fn mainline(&self) -> PathBuf
The integration checkout: a detached worktree of the mainline head.
Sourcepub fn mainline_lock(&self) -> PathBuf
pub fn mainline_lock(&self) -> PathBuf
The lock that makes integration serial across processes.
Sourcepub fn in_tree(&self) -> Option<PathBuf>
pub fn in_tree(&self) -> Option<PathBuf>
The worktree root relative to the primary checkout, when it lies inside it.
Sourcepub fn ensure_scratch(&self) -> Result<(), CoreError>
pub fn ensure_scratch(&self) -> Result<(), CoreError>
Create .vitrify/ with the ignore file that keeps it out of the
repository. Nothing is built under it, so the * hides nothing a
tool needs to see.
Sourcepub fn ensure_worktree_root(&self, primary: &Git) -> Result<(), CoreError>
pub fn ensure_worktree_root(&self, primary: &Git) -> Result<(), CoreError>
Create the worktree root. A root inside the working tree is added to
.git/info/exclude, and refused when one of the repository’s own
ignore files already covers it — the case in which ignore-aware
tools check nothing there.