pub struct BranchManager { /* private fields */ }Expand description
Orchestrates branch-instance lifecycle against one store.
Implementations§
Source§impl BranchManager
impl BranchManager
pub fn open(store: MetadataStore) -> Result<Self>
pub fn store(&self) -> &MetadataStore
pub fn tracker_definitions(&self) -> &[TrackerDefinition]
Sourcepub fn gitignore_warnings(&self) -> Vec<String>
pub fn gitignore_warnings(&self) -> Vec<String>
The tracker-path invariant, checked loudly: non-source tracker paths must be gitignored unless deliberately dual-tracked with source.
pub fn spawn(&self, name: &str, from: Option<&str>) -> Result<SpawnOutcome>
Sourcepub fn run_action(&self, instance: &str, spec: &str) -> Result<ActionOutcome>
pub fn run_action(&self, instance: &str, spec: &str) -> Result<ActionOutcome>
Run <resource>.<action> for an instance.
Sourcepub fn run_command(
&self,
instance: &str,
command_line: &[String],
) -> Result<(i32, Utf8PathBuf)>
pub fn run_command( &self, instance: &str, command_line: &[String], ) -> Result<(i32, Utf8PathBuf)>
Run an arbitrary command inside the instance with the full export environment loaded. Returns the exit code.
Sourcepub fn assemble_env(
&self,
branch: &BranchInstance,
) -> Result<Vec<(String, String)>>
pub fn assemble_env( &self, branch: &BranchInstance, ) -> Result<Vec<(String, String)>>
The layered environment newgit run and actions see. Later layers
win: resource exports in dependency order → port env vars → newgit
context vars. Trackers own content; command environment wiring lives
outside the tracker primitive.
pub fn add_resource( &self, name: &str, template_name: &str, ) -> Result<AddResourceOutcome>
pub fn resource_definitions(&self) -> &[ResourceDefinition]
pub fn capture_tracker( &self, instance: &str, tracker: &str, ) -> Result<CaptureReport>
pub fn checkout_tracker( &self, instance: &str, tracker: &str, rev: Option<&str>, ) -> Result<RestoreReport>
Sourcepub fn pull_tracker(
&self,
instance: &str,
tracker: &str,
) -> Result<TrackerBindOutcome>
pub fn pull_tracker( &self, instance: &str, tracker: &str, ) -> Result<TrackerBindOutcome>
Pull a tracker’s lane head into an existing instance.
Sourcepub fn merge_tracker(
&self,
instance: &str,
tracker: &str,
) -> Result<MergeTrackerOutcome>
pub fn merge_tracker( &self, instance: &str, tracker: &str, ) -> Result<MergeTrackerOutcome>
Promote this branch instance’s bound tracker revision to the lane head.
pub fn create_tracker( &self, name: &str, audience: &str, storage: Storage, merge_with_source: bool, ) -> Result<AddTrackerOutcome>
pub fn track_paths( &self, tracker: &str, paths: &[Utf8PathBuf], ) -> Result<TrackPathsOutcome>
pub fn statuses(&self) -> Result<Vec<InstanceReport>>
Sourcepub fn remove(&self, name: &str, cwd: &Utf8Path) -> Result<RemoveOutcome>
pub fn remove(&self, name: &str, cwd: &Utf8Path) -> Result<RemoveOutcome>
Deletes the workspace (plain rm -rf; clones have no registration)
and archives the binding record. The source branch in the store is
kept — removal disposes of the workspace, not the history.
Resource cleanup hooks run first, dependents before dependencies and while the workspace still exists. Without that, a resource newgit does not own — a cloud preview, a database — would outlive every trace of the instance that asked for it.
Sourcepub fn cleanup(&self, dry_run: bool) -> Result<CleanupOutcome>
pub fn cleanup(&self, dry_run: bool) -> Result<CleanupOutcome>
Garbage collection across everything: finish instances whose workspace is gone, delete unclaimed workspaces and dead process state, and prune lane revs nothing references.
remove targets one instance; this is the sweep. It never deletes a
checkpoint record, and never a lane rev a checkpoint still points at.
Sourcepub fn export(
&self,
instance: &str,
destination: &Utf8Path,
filter: &ExportFilter,
) -> Result<ExportOutcome>
pub fn export( &self, instance: &str, destination: &Utf8Path, filter: &ExportFilter, ) -> Result<ExportOutcome>
Write a branch instance’s content out as an ordinary Git repository.
Tracker audience is the default filter and it fails closed: only
public lanes ship unless --include names a path. This is
path-level filtering and nothing more — no hunk privacy, no
concealment claim.
Sourcepub fn checkpoint(
&self,
instance: &str,
message: Option<&str>,
) -> Result<CheckpointOutcome>
pub fn checkpoint( &self, instance: &str, message: Option<&str>, ) -> Result<CheckpointOutcome>
Record one coherent snapshot across source, trackers, and resources.