changes for new .proto files

This commit is contained in:
Jeff Carr 2025-09-23 10:17:06 -05:00
parent 2b6107fa51
commit ada923ea05
3 changed files with 14 additions and 14 deletions

View File

@ -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)

View File

@ -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
}

View File

@ -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)