unison-cli-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.Cli.ProjectUtils

Description

Project-related utilities.

Synopsis

Project/path helpers

resolveProjectBranch :: ProjectAndBranch (Maybe ProjectName) (Maybe ProjectBranchName) -> Cli (ProjectAndBranch Project ProjectBranch) Source #

Expect/resolve branch reference with the following rules:

  1. If the project is missing, use the current project.
  2. If we have an unambiguous `branch` or `projectbranch`, resolve it using the current project, defaulting to main if branch is unspecified.

resolveProjectBranchInProject :: Project -> ProjectAndBranch (Maybe ProjectName) (Maybe ProjectBranchName) -> Cli (ProjectAndBranch Project ProjectBranch) Source #

Expect/resolve branch reference with the following rules:

  1. If the project is missing, use the provided project.
  2. If we have an unambiguous `branch` or `projectbranch`, resolve it using the provided project, defaulting to main if branch is unspecified.

Name hydration

Loading local project info

getProjectBranchCausalHash :: ProjectBranch -> Transaction CausalHash Source #

Get the causal hash of a project branch.

Loading remote project info

expectRemoteProjectById :: RemoteProjectId -> ProjectName -> Cli RemoteProject Source #

Expect a remote project by id. Its latest-known name is also provided, for error messages.

Projecting out common things

Other helpers

expectLatestReleaseBranchName :: RemoteProject -> Cli ProjectBranchName Source #

Expect the given remote project to have a latest release, and return it as a valid branch name.

Export fields so we can use dot-notation

data ProjectBranch #

A project branch.

Instances

Instances details
Generic ProjectBranch 
Instance details

Defined in U.Codebase.Sqlite.ProjectBranch

Associated Types

type Rep ProjectBranch :: Type -> Type #

Show ProjectBranch 
Instance details

Defined in U.Codebase.Sqlite.ProjectBranch

Eq ProjectBranch 
Instance details

Defined in U.Codebase.Sqlite.ProjectBranch

Pathy ProjectPath 
Instance details

Defined in Unison.Codebase.ProjectPath

From ProjectPath Text 
Instance details

Defined in Unison.Codebase.ProjectPath

Methods

from :: ProjectPath -> Text #

type Rep ProjectBranch 
Instance details

Defined in U.Codebase.Sqlite.ProjectBranch

data Project #

A project.

Constructors

Project 

Instances

Instances details
Generic Project 
Instance details

Defined in U.Codebase.Sqlite.Project

Associated Types

type Rep Project :: Type -> Type #

Methods

from :: Project -> Rep Project x #

to :: Rep Project x -> Project #

Show Project 
Instance details

Defined in U.Codebase.Sqlite.Project

Eq Project 
Instance details

Defined in U.Codebase.Sqlite.Project

Methods

(==) :: Project -> Project -> Bool #

(/=) :: Project -> Project -> Bool #

FromRow Project 
Instance details

Defined in U.Codebase.Sqlite.Project

ToRow Project 
Instance details

Defined in U.Codebase.Sqlite.Project

Methods

toRow :: Project -> [SQLData] #

Pathy ProjectPath 
Instance details

Defined in Unison.Codebase.ProjectPath

From ProjectPath Text 
Instance details

Defined in Unison.Codebase.ProjectPath

Methods

from :: ProjectPath -> Text #

type Rep Project 
Instance details

Defined in U.Codebase.Sqlite.Project

type Rep Project = D1 ('MetaData "Project" "U.Codebase.Sqlite.Project" "unison-codebase-sqlite-0.0.0-B6bSU9X4ngQLNkk2Du2PiW" 'False) (C1 ('MetaCons "Project" 'PrefixI 'True) (S1 ('MetaSel ('Just "projectId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ProjectId) :*: S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ProjectName)))