Ejemplo n.º 1
0
// PrepareResolvedRevRouteVars is a mux.BuildVarsFunc that converts
// from a ResolvedRev's component route vars (Rev and CommitID) to a
// single ResolvedRev var.
func PrepareResolvedRevRouteVars(vars map[string]string) map[string]string {
	vars["ResolvedRev"] = spec.ResolvedRevString(vars["Rev"], vars["CommitID"])
	return vars
}
Ejemplo n.º 2
0
// ResolvedRevString encodes the revision and commit ID. If CommitID
// is set, the return value is "Rev===CommitID"; otherwise, it is just
// "Rev". See the docstring for RepoRevSpec for an explanation why.
func (s RepoRevSpec) ResolvedRevString() string {
	return spec.ResolvedRevString(s.Rev, s.CommitID)
}