# HG changeset patch # User Sean Russell # Date 1315175750 14400 # Sun Sep 04 18:35:50 2011 -0400 # Branch weekly # Node ID 7238bc0bc3effc8f9c437423e6b75a2d36e938a1 # Parent 104a399e472bdc25e5fa3239646e7c07fb5d3c25 Return tip, rather than workspace, by default diff --git a/config/config.go b/config/config.go --- a/config/config.go +++ b/config/config.go @@ -38,13 +38,13 @@ return keys(h.Workspace) } +// Gets the tip by default. 0 is the workspace func (h Configuration) GetComponent(component_name string, rev string) Store { - components := h.Workspace // Get the workspace by default - if rev != "" || len(components) == 0 { - var revision StoreMap - json.Unmarshal([]byte(h.Repo.Get(rev)), &revision) - components = revision + var components StoreMap + if rev == "0" || rev == "" { + rev = h.Repo.Tip() } + json.Unmarshal([]byte(h.Repo.Get(h.Repo.Tip())), &components) path := strings.Split(component_name, "/") attrset := expand(components, path) return attrset