Repository
Wraps a Plastic SCM repository, providing workspace management, branch operations, and changeset queries. Initialized from RepositoryInfo and resolved to a RepositorySpec for API calls.
Definition
Namespace: Paragon.Editor.ModuleManager.Plastic Assembly: Paragon.Editor.dll
internal class Repository : IEquatable<Repository>Implements: IEquatable<Repository>
Remarks
Repository wraps Plastic SCM's RepositoryInfo and RepositorySpec into a single object with high-level operations for workspace, branch, and changeset management. All API calls are delegated to PlasticSCM.API.
Initialization
Initialize() resolves the RepositorySpec from RepositoryInfo and discovers all workspaces associated with this repository by:
Getting the global workspace list via
WorkspaceHandler.Get().GetWorkspaceList()Filtering workspaces whose repository spec matches this repository's info
Building a name-keyed dictionary of
Workspaceobjects
Equality
Two repositories are equal if their RepositoryInfo instances are equal. The == and != operators are overloaded. GetHashCode() is based on the Address string.
Quick Lookup
Get repository name
repository.Name
Get server address
repository.Address
Get a workspace
repository.GetWorkspace("WorkspaceName")
Create a workspace
repository.CreateWorkspace("NewWorkspace")
List all workspaces
repository.GetWorkspaces()
Get a branch by name
repository.GetBranch("/main")
Get a branch by ID
repository.GetBranch(branchId)
Create a branch
repository.CreateBranch("feature/new", "/main")
Get a changeset
repository.GetChangeset(changesetId)
Get branch at changeset
repository.GetBranchAtChangeset(changesetId)
Properties
Spec
RepositorySpec
public
The resolved repository spec for API calls
Info
RepositoryInfo
public
The raw repository info from Plastic SCM
Name
string
public
Repository name (from RepositoryInfo)
Address
string
public
Full repository address (RepositorySpec.ToString())
Constructors
Repository(RepositoryInfo)
Creates a repository wrapper and calls Initialize().
Methods
Initialize
Resolves the RepositorySpec and discovers all workspaces for this repository.
CreateWorkspace
Creates a new workspace in this repository. Delegates to PlasticSCM.CreateWorkspace and adds the workspace to the local dictionary.
GetWorkspace
Returns the workspace with the specified name, or null.
GetChangeset
Retrieves changeset information by ID.
CreateBranch
Creates a new branch, optionally from a parent branch and/or changeset.
branchName
string
—
Name for the new branch
parentBranchName
string
null
Parent branch (defaults to /main)
changesetId
long
-1
Changeset to branch from (defaults to parent branch head)
comment
string
null
Optional branch comment
GetBranch (2 overloads)
Retrieves branch information by name or by ID.
GetBranchAtChangeset
Retrieves the branch that contains a specific changeset.
GetWorkspaces
Returns all workspaces associated with this repository.
Common Pitfalls
Initialize can be called multiple times Initialize() is called in the constructor and can be called again externally (e.g., by EngineModule.Initialize()). Each call re-fetches the workspace list, which involves a server query.
CreateBranch defaults to /main If parentBranchName is null or empty, the branch is created from /main. Ensure /main exists in the repository.
See Also
Workspace — workspaces owned by a repository
PlasticSCM — discovers repositories
EngineModule — uses repository for module mounting
PlasticSCM Overview — subsystem overview
Last updated