@@ 38,13 38,13 @@ func (h Configuration) GetComponents() [
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