go: go.chromium.org/chromiumos/infra/go/internal/repo Index | Files

package repo

import "go.chromium.org/chromiumos/infra/go/internal/repo"

Copyright 2019 The Chromium OS Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Copyright 2019 The Chromium OS Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Copyright 2019 The Chromium Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Package Files

manifest.go manifest_version.go repotool.go

Variables

var (
    VersionFilePath string = "src/third_party/chromiumos-overlay/" +
        "chromeos/config/chromeos_version.sh"
)

This is a var and not a const for testing purposes.

func GetRepoToRemoteBranchToSourceRootFromManifests Uses

func GetRepoToRemoteBranchToSourceRootFromManifests(authedClient *http.Client, ctx context.Context, manifestCommit string) (map[string]map[string]string, error)

GetRepoToSourceRootFromManifests constructs a Gerrit project to path mapping by fetching manifest XML files from Gitiles.

func GetRepoToSourceRoot Uses

func GetRepoToSourceRoot(chromiumosCheckout, repoToolPath string) (map[string]string, error)

GetRepoToSourceRoot gets the mapping of Gerrit project to Chromium OS source tree path.

func LoadManifestTree Uses

func LoadManifestTree(file string) (map[string]*Manifest, error)

LoadManifestTree loads the manifest at the given file path into a Manifest struct. It also loads all included manifests. Returns a map mapping manifest filenames to file contents.

type Annotation Uses

type Annotation struct {
    Name  string `xml:"name,attr"`
    Value string `xml:"value,attr"`
}

Annotation is an element of a manifest annotating the parent element.

type Default Uses

type Default struct {
    RemoteName string `xml:"remote,attr"`
    Revision   string `xml:"revision,attr"`
}

Default is a manifest element that lists the default.

type Include Uses

type Include struct {
    Name string `xml:"name,attr"`
}

Include is a manifest element that imports another manifest file.

type Manifest Uses

type Manifest struct {
    Includes []Include `xml:"include"`
    Projects []Project `xml:"project"`
    Remotes  []Remote  `xml:"remote"`
    Default  Default   `xml:"default"`
}

Manifest is a top-level Repo definition file.

func LoadManifestFromFile Uses

func LoadManifestFromFile(file string) (Manifest, error)

LoadManifestFromFile ile loads the manifest at the given file into a Manfiest struct.

func (*Manifest) GetRemoteByName Uses

func (m *Manifest) GetRemoteByName(name string) *Remote

GetRemoteByName returns a pointer to the remote with the given name/alias in the given manifest.

func (*Manifest) GetUniqueProject Uses

func (m *Manifest) GetUniqueProject(name string) (Project, error)

GetUnique Project returns the unique project with the given name (nil if the project DNE). It returns an error if multiple projects with the given name exist.

func (*Manifest) Write Uses

func (m *Manifest) Write(path string) error

Write writes the manifest to the given path.

type Project Uses

type Project struct {
    Path        string       `xml:"path,attr"`
    Name        string       `xml:"name,attr"`
    Revision    string       `xml:"revision,attr"`
    Upstream    string       `xml:"upstream,attr"`
    RemoteName  string       `xml:"remote,attr"`
    Annotations []Annotation `xml:"annotation"`
}

Project is an element of a manifest containing a Gerrit project to source path definition.

func (*Project) GetAnnotation Uses

func (p *Project) GetAnnotation(name string) (string, bool)

GetAnnotation returns the value of the annotation with the given name, if it exists. It also returns a bool indicating whether or not the annotation exists.

type Remote Uses

type Remote struct {
    Fetch    string `xml:"fetch,attr"`
    Name     string `xml:"name,attr"`
    Revision string `xml:"revision,attr"`
    Alias    string `xml:"alias,attr"`
}

Remote is a manifest element that lists a remote.

func (*Remote) GitName Uses

func (r *Remote) GitName() string

GitName returns the git name of the remote, which is Alias if it is set, and Name otherwise.

type VersionComponent Uses

type VersionComponent string
const (
    Unspecified  VersionComponent = "UNSPECIFIED"
    ChromeBranch VersionComponent = "CHROME_BRANCH"
    Build        VersionComponent = "CHROMEOS_BUILD"
    Branch       VersionComponent = "CHROMEOS_BRANCH"
    Patch        VersionComponent = "CHROMEOS_PATCH"
)

type VersionInfo Uses

type VersionInfo struct {
    ChromeBranch      int
    BuildNumber       int
    BranchBuildNumber int
    PatchNumber       int
    VersionFile       string
}

func GetVersionInfoFromRepo Uses

func GetVersionInfoFromRepo(sourceRepo string) (VersionInfo, error)

func (*VersionInfo) IncrementVersion Uses

func (v *VersionInfo) IncrementVersion(incrType VersionComponent) string

func (*VersionInfo) StrippedVersionString Uses

func (v *VersionInfo) StrippedVersionString() string

StrippedVersionString returns the stripped version string of the given VersionInfo struct, i.e. the non-zero components of the version. Example: 123.1.0 --> 123.1 Example: 123.0.0 --> 123

func (*VersionInfo) UpdateVersionFile Uses

func (v *VersionInfo) UpdateVersionFile(commitMsg string, dryRun bool, pushTo git.RemoteRef) error

UpdateVersionFile updates the version file with our current version.

func (*VersionInfo) VersionComponents Uses

func (v *VersionInfo) VersionComponents() []int

func (*VersionInfo) VersionString Uses

func (v *VersionInfo) VersionString() string

Package repo imports 17 packages (graph) and is imported by 3 packages. Updated 2019-07-18. Refresh now. Tools for package owners.