MCPcopy Create free account
hub / github.com/brimdata/super / ResolveRevision

Method ResolveRevision

db/pool.go:150–160  ·  view source on GitHub ↗

ResolveRevision returns the commit id for revision. revision can be either a commit ID in string form or a branch name.

(ctx context.Context, revision string)

Source from the content-addressed store, hash-verified

148// ResolveRevision returns the commit id for revision. revision can be either a
149// commit ID in string form or a branch name.
150func (p *Pool) ResolveRevision(ctx context.Context, revision string) (ksuid.KSUID, error) {
151 id, err := dbid.ParseID(revision)
152 if err != nil {
153 branch, err := p.LookupBranchByName(ctx, revision)
154 if err != nil {
155 return ksuid.Nil, err
156 }
157 id = branch.Commit
158 }
159 return id, nil
160}
161
162func (p *Pool) BatchifyBranches(ctx context.Context, sctx *super.Context, recs []super.Value, m *sup.MarshalBSUPContext, f expr.Evaluator) ([]super.Value, error) {
163 branches, err := p.ListBranches(ctx)

Callers 1

VacuumMethod · 0.80

Calls 2

LookupBranchByNameMethod · 0.95
ParseIDFunction · 0.92

Tested by

no test coverage detected