package vcs
import "cmd/go/internal/vcs"
Index ¶
- func CheckNested(vcs *Cmd, dir, srcRoot string) error
- type Cmd
- func FromDir(dir, srcRoot string) (vcs *Cmd, root string, err error)
- func (v *Cmd) Create(dir, repo string) error
- func (v *Cmd) Download(dir string) error
- func (v *Cmd) IsSecure(repo string) bool
- func (v *Cmd) Ping(scheme, repo string) error
- func (v *Cmd) String() string
- func (v *Cmd) TagSync(dir, tag string) error
- func (v *Cmd) Tags(dir string) ([]string, error)
- type ImportMismatchError
- type ModuleMode
- type RepoRoot
Functions ¶
func CheckNested ¶
CheckNested checks for an incorrectly-nested VCS-inside-VCS situation for dir, checking parents up until srcRoot.
Types ¶
type Cmd ¶
type Cmd struct { Name string Cmd string // name of binary to invoke command CreateCmd []string // commands to download a fresh copy of a repository DownloadCmd []string // commands to download updates into an existing repository TagCmd []tagCmd // commands to list tags TagLookupCmd []tagCmd // commands to lookup tags before running tagSyncCmd TagSyncCmd []string // commands to sync to specific tag TagSyncDefault []string // commands to sync to default tag Scheme []string PingCmd string RemoteRepo func(v *Cmd, rootDir string) (remoteRepo string, err error) ResolveRepo func(v *Cmd, rootDir, remoteRepo string) (realRepo string, err error) }
A vcsCmd describes how to use a version control system like Mercurial, Git, or Subversion.
func FromDir ¶
FromDir inspects dir and its parents to determine the version control system and code repository to use. On return, root is the import path corresponding to the root of the repository.
func (*Cmd) Create ¶
Create creates a new copy of repo in dir. The parent of dir must exist; dir must not.
func (*Cmd) Download ¶
Download downloads any new changes for the repo in dir.
func (*Cmd) IsSecure ¶
func (*Cmd) Ping ¶
Ping pings to determine scheme to use.
func (*Cmd) String ¶
func (*Cmd) TagSync ¶
tagSync syncs the repo in dir to the named tag, which either is a tag returned by tags or is v.tagDefault.
func (*Cmd) Tags ¶
Tags returns the list of available tags for the repo in dir.
type ImportMismatchError ¶
type ImportMismatchError struct {
// contains filtered or unexported fields
}
A ImportMismatchError is returned where metaImport/s are present but none match our import path.
func (ImportMismatchError) Error ¶
func (m ImportMismatchError) Error() string
type ModuleMode ¶
type ModuleMode int
ModuleMode specifies whether to prefer modules when looking up code sources.
const ( IgnoreMod ModuleMode = iota PreferMod )
type RepoRoot ¶
type RepoRoot struct { Repo string // repository URL, including scheme Root string // import path corresponding to root of repo IsCustom bool // defined by served <meta> tags (as opposed to hard-coded pattern) VCS *Cmd }
RepoRoot describes the repository root for a tree of source code.
func RepoRootForImportPath ¶
func RepoRootForImportPath(importPath string, mod ModuleMode, security web.SecurityMode) (*RepoRoot, error)
RepoRootForImportPath analyzes importPath to determine the version control system, and code repository to use.
Source Files ¶
- Version
- v1.16.9
- Published
- Oct 7, 2021
- Platform
- darwin/amd64
- Imports
- 22 packages
- Last checked
- 1 minute ago –
Tools for package owners.