Isolate work in a scope¶
Every branch belongs to one scope, set when the branch is created: the
scope of its parent, unless you name another. lore branch info shows the scope a branch is in,
and no command acts on it yet. Use this guide to create a scope, create branches in it, and rename,
archive and restore it.
Before you start¶
- A repository on a Lore Server that supports scopes. A server that predates scopes fails every
lore scopecommand, andlore branch create --scope, as an unsupported operation. A branch whose first push reaches such a server lands in the default scope there, where it stays. - Write access to the repository. Renaming and archiving a scope also need repository administration, or to be the user who created the scope.
Steps¶
- Create the scope. The command prints the name and the ID of the new scope. The name
defaultis reserved for the scope every repository has.
- Check the scope.
lore scope infoshows a scope named by its name or its ID.
- Create a branch in the scope. Name the scope by its name or its ID. The command asks the remote for the scope, so it needs the remote, and it refuses a scope the remote doesn't hold or an archived one before it creates the branch. It prints the scope the branch is in.
- Push the branch before the branches created off it. The remote creates a branch on its first
push. A branch that names no scope gets the scope of the nearest branch of its stack the remote
holds, and keeps it. A branch pushed before its parent therefore skips the parent's scope.
lore branch infoshows the scope the remote assigned.
- Create branches off it. A branch created without
--scopeinherits the scope of its parent, andlore branch createprints that scope. To leave the scope, name another one, such as--scope default.
- Rename, archive or restore the scope. These commands take the scope's ID, which
lore scope create,lore scope infoandlore branch infoprint. Archiving drops the scope's name and keeps its branches working, andlore scope infothen finds the scope by its ID only. Creating the scope again with its ID restores it under a name, aslore branch create --idrestores an archived branch, which--scopeputs in the scope it names. The default scope can't be renamed or archived.
lore scope rename <scope-id> release-2.0
lore scope archive <scope-id>
lore scope info <scope-id>
lore scope create release-2.0 --id <scope-id>
Result¶
lore branch info on each branch of the release line shows the release-2.0 scope.
See also¶
lore scopeandlore branch createin the CLI command reference- Identity vs name in the system design, on how a branch gets its scope