summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doMerge.go18
-rw-r--r--handlePatches.go8
-rw-r--r--http.go2
3 files changed, 14 insertions, 14 deletions
diff --git a/doMerge.go b/doMerge.go
index 2703215..9dfb6bb 100644
--- a/doMerge.go
+++ b/doMerge.go
@@ -21,7 +21,7 @@ func doMerge() error {
return nil
}
-func findAutoPatchset() *forgepb.Patchset {
+func findAutoPatchset() *forgepb.Set {
for pset := range me.forge.Patchsets.IterAll() {
if pset.Name == "forge auto commit" {
return pset
@@ -29,14 +29,14 @@ func findAutoPatchset() *forgepb.Patchset {
}
}
- var fauto *forgepb.Patchset
+ var fauto *forgepb.Set
log.Warn("findAutoPatchset() had to create 'forge auto commit'")
if fauto == nil {
- fauto = new(forgepb.Patchset)
+ fauto = new(forgepb.Set)
fauto.Name = "forge auto commit"
fauto.Patches = forgepb.NewPatches()
fauto.Uuid = uuid.New().String()
- me.forge.Patchsets.Patchsets = append(me.forge.Patchsets.Patchsets, fauto)
+ me.forge.Patchsets.Append(fauto)
}
return fauto
}
@@ -63,7 +63,7 @@ func addRandomPatch(patch *forgepb.Patch) error {
/*
// adds a patchset or just the patches
-func addPatchset(filename string, pb *forgepb.Patchset) {
+func addPatchset(filename string, pb *forgepb.Set) {
// if the name of the patchset is "forge auto commit"
// then just add all the patches
if pb.Name == "forge auto commit" {
@@ -96,8 +96,8 @@ func addPatchset(filename string, pb *forgepb.Patchset) {
}
// Clone() this protobuf into me.forge.Patchsets
- var newpb *forgepb.Patchset
- newpb = proto.Clone(pb).(*forgepb.Patchset)
+ var newpb *forgepb.Set
+ newpb = proto.Clone(pb).(*forgepb.Set)
if newpb != nil {
me.forge.Patchsets.Patchsets = append(me.forge.Patchsets.Patchsets, newpb)
}
@@ -122,8 +122,8 @@ func mergePatchsets() {
fmt.Println(entry.Name(), err)
continue
}
- var p *forgepb.Patchset
- p = new(forgepb.Patchset)
+ var p *forgepb.Set
+ p = new(forgepb.Set)
err = p.Unmarshal(bytes)
if err != nil {
fmt.Println(entry.Name(), err)
diff --git a/handlePatches.go b/handlePatches.go
index 1237cba..0bc6dff 100644
--- a/handlePatches.go
+++ b/handlePatches.go
@@ -38,8 +38,8 @@ func sendPendingPatches(pb *forgepb.Patches, reqPB *httppb.HttpRequest) *forgepb
return allPatchesPB
}
-func sendPendingPatchsets(pb *forgepb.Patchsets, reqPB *httppb.HttpRequest) *forgepb.Patchsets {
- allPatchsetsPB := new(forgepb.Patchsets)
+func sendPendingPatchsets(pb *forgepb.Sets, reqPB *httppb.HttpRequest) *forgepb.Sets {
+ allPatchsetsPB := new(forgepb.Sets)
for pset := range me.forge.Patchsets.IterAll() {
allPatchsetsPB.Append(pset)
}
@@ -54,8 +54,8 @@ func makePatchesPB(reqPB *httppb.HttpRequest) (*forgepb.Patches, error) {
}
*/
-func makePatchsetsPB(reqPB *httppb.HttpRequest) (*forgepb.Patchsets, error) {
- pb := forgepb.NewPatchsets()
+func makePatchsetsPB(reqPB *httppb.HttpRequest) (*forgepb.Sets, error) {
+ pb := forgepb.NewSets()
err := pb.Unmarshal(reqPB.ServerData)
return pb, err
}
diff --git a/http.go b/http.go
index c4d3c94..f482499 100644
--- a/http.go
+++ b/http.go
@@ -100,7 +100,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
if err != nil {
reqPB.Logf("%v", err)
}
- result := forgepb.NewPatchsets()
+ result := forgepb.NewSets()
switch route {
case "/patches/get":
result = sendPendingPatchsets(pb, reqPB)