Class WorkingSetResolver
java.lang.Object
network.ike.workspace.WorkingSetResolver
Resolves the
WorkingSet a working-tree operation acts on, from a
starting directory (IKE-Network/ike-issues#609, under #601).
Searches upward from the start directory for a manifest — "working-set.yaml", or "workspace.yaml" in a working set the scaffold has not upgraded yet (ike-issues#1054). When one is found, the working set is what it declares: its subprojects plus the working-set root. When none is found, the working set is the single repository at the start directory: a working set of one.
This is the single home for the "am I in a declared working set, or a
lone repo?" decision that working-tree goals otherwise each make for
themselves — the scattered isWorkspaceMode() + bare-mode branches
the migration in ike-issues#611 retires.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic PathmanifestIn(Path dir) The manifest already present in a directory — the current name preferred, the former name accepted.static PathmanifestToWrite(Path dir) Where a writer should write a directory's manifest: the file that is already there, or the current name when there is none.static WorkingSetResolve the working set from a starting directory.static WorkingSetsingleRepo(Path dir) Build a single-repository working set rooted atdir, without searching for a manifest — a working set of one.
-
Field Details
-
MANIFEST_FILE
The manifest file name — the thing it describes is a working set, so that is what the file is called (IKE-Network/ike-issues#1054).- See Also:
-
LEGACY_MANIFEST_FILE
The manifest's former name. Read forever: manifests written before the rename live in tagged trees, and a working set is upgraded by the scaffold, not by every reader assuming it already happened.- See Also:
-
-
Method Details
-
manifestIn
-
manifestToWrite
Where a writer should write a directory's manifest: the file that is already there, or the current name when there is none. A writer must never introduce a second manifest beside an existing one.- Parameters:
dir- the working-set root directory- Returns:
- the path to write
-
resolve
Resolve the working set from a starting directory.- Parameters:
startDir- the directory to resolve from (typically the CWD)- Returns:
- the declared working set when a manifest is found at or
above
startDir; otherwise the single-repository working set rooted atstartDir
-
singleRepo
Build a single-repository working set rooted atdir, without searching for a manifest — a working set of one.- Parameters:
dir- the repository directory- Returns:
- the single-repository working set
-