Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Unified Diff: appengine/cmd/dm/mutate/merge_quest.go

Issue 1537883002: Initial distributor implementation (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: self review Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/cmd/dm/mutate/merge_quest.go
diff --git a/appengine/cmd/dm/mutate/merge_quest.go b/appengine/cmd/dm/mutate/merge_quest.go
index 80bc506fc4086c9ae0fd6edade4fe1bfa60f9d84..54fb90ab0531b7875808db44e0ee69bbcf29942b 100644
--- a/appengine/cmd/dm/mutate/merge_quest.go
+++ b/appengine/cmd/dm/mutate/merge_quest.go
@@ -15,19 +15,20 @@ import (
// MergeQuest ensures that the given Quest exists and contains the merged
// set of BuiltBy entries.
type MergeQuest struct {
- Quest *model.Quest
+ Quest *model.Quest
+ AndThen []tumble.Mutation
}
// Root implements tumble.Mutation.
func (m *MergeQuest) Root(c context.Context) *datastore.Key {
- return datastore.Get(c).KeyForObj(m.Quest)
+ return model.QuestKeyFromID(c, m.Quest.ID)
}
// RollForward implements tumble.Mutation.
func (m *MergeQuest) RollForward(c context.Context) (muts []tumble.Mutation, err error) {
ds := datastore.Get(c)
- curQuest := &model.Quest{ID: m.Quest.ID}
+ curQuest := model.QuestFromID(m.Quest.ID)
c = logging.SetField(c, "qid", m.Quest.ID)
@@ -49,6 +50,8 @@ func (m *MergeQuest) RollForward(c context.Context) (muts []tumble.Mutation, err
logging.WithError(err).Errorf(c, "%s", reason)
}
+ muts = m.AndThen
+
return
}

Powered by Google App Engine
This is Rietveld 408576698