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:

  1. Getting the global workspace list via WorkspaceHandler.Get().GetWorkspaceList()

  2. Filtering workspaces whose repository spec matches this repository's info

  3. Building a name-keyed dictionary of Workspace objects

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

Goal
How

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

Property
Type
Access
Description

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.

Parameter
Type
Default
Description

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

circle-exclamation
circle-exclamation

See Also

Last updated