| Index: dm/api/template/loader.go
|
| diff --git a/dm/api/template/loader.go b/dm/api/template/loader.go
|
| index af6b6b97aff1cce80ef92c37e8b4c90b56f0782b..3edf73501b87be4949e5bd1286d7e7985a7358ac 100644
|
| --- a/dm/api/template/loader.go
|
| +++ b/dm/api/template/loader.go
|
| @@ -9,10 +9,10 @@ import (
|
|
|
| "golang.org/x/net/context"
|
|
|
| - "github.com/luci/luci-go/common/config"
|
| "github.com/luci/luci-go/common/data/text/templateproto"
|
| - "github.com/luci/luci-go/common/proto"
|
| dm "github.com/luci/luci-go/dm/api/service/v1"
|
| + "github.com/luci/luci-go/server/config"
|
| + "github.com/luci/luci-go/server/config/textproto"
|
| )
|
|
|
| // LoadFile loads a File by configSet and path.
|
| @@ -21,16 +21,13 @@ func LoadFile(c context.Context, project, ref string) (file *File, vers string,
|
| if ref != "" {
|
| cfgSet += "/" + ref
|
| }
|
| - templateData, err := config.GetConfig(c, cfgSet, "dm/quest_templates.cfg", false)
|
| - if err != nil {
|
| - return
|
| - }
|
| +
|
| file = &File{}
|
| - vers = templateData.ContentHash
|
| - err = proto.UnmarshalTextML(templateData.Content, file)
|
| - if err != nil {
|
| + var meta config.Meta
|
| + if err = config.Get(c, config.AsService, cfgSet, "dm/quest_templates.cfg", textproto.Message(file), &meta); err != nil {
|
| return
|
| }
|
| + vers = meta.ContentHash
|
| err = file.Normalize()
|
| return
|
| }
|
|
|