diff options
| author | Jeff Carr <[email protected]> | 2025-09-07 20:34:08 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-07 21:41:26 -0500 |
| commit | a099bbd3e656ac2d0cf1db656f08d91c673db437 (patch) | |
| tree | 43a5c6e3902d85a73ecc5cadba281c6dafaa0b8c /handlePatches.go | |
| parent | c2e0e8e80b5831996da38efbfaa4bb206875bf40 (diff) | |
add support for old version of the tool using new code
Diffstat (limited to 'handlePatches.go')
| -rw-r--r-- | handlePatches.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/handlePatches.go b/handlePatches.go index 5d07924..4265e55 100644 --- a/handlePatches.go +++ b/handlePatches.go @@ -29,6 +29,16 @@ 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) + for pset := range me.forge.Patchsets.IterAll() { + if pset.Name == "forge auto submit" { + allPatchsetsPB.Append(pset) + } + } + return allPatchsetsPB +} + func handlePatches(w http.ResponseWriter, pb *forgepb.Patches) error { route := pb.HttpRequest.Route @@ -55,6 +65,12 @@ func makePatchesPB(reqPB *httppb.HttpRequest) (*forgepb.Patches, error) { return pb, err } +func makePatchsetsPB(reqPB *httppb.HttpRequest) (*forgepb.Patchsets, error) { + pb := forgepb.NewPatchsets() + err := pb.Unmarshal(reqPB.Body) + return pb, err +} + func sendPatchesError(w http.ResponseWriter, r *forgepb.Patches, err error) error { log.Info("send error back to user", err) return nil |
