fix commandline patch submit

This commit is contained in:
Jeff Carr 2025-01-17 13:59:59 -06:00
parent fc9c26cc8d
commit 2b10e228d2
4 changed files with 19 additions and 10 deletions

View File

@ -37,8 +37,9 @@ type EmptyCmd struct {
type testCmd string type testCmd string
type PatchCmd struct { type PatchCmd struct {
List *EmptyCmd `arg:"subcommand:list" help:"list available patches"` List *EmptyCmd `arg:"subcommand:list" help:"list available patches"`
Show *EmptyCmd `arg:"subcommand:show" help:"show a specific patch"` Show *EmptyCmd `arg:"subcommand:show" help:"show a specific patch"`
Submit string `arg:"--submit" help:"name of patchset"`
} }
type ConfigAddCmd struct { type ConfigAddCmd struct {

13
doSubmitPatch.go Normal file
View File

@ -0,0 +1,13 @@
package main
import (
"go.wit.com/log"
)
func doSubmit(name string) {
if err := sendDevelDiff(name); err != nil {
log.Info("sending patches failed", err)
} else {
log.Info("sent patch set ok")
}
}

View File

@ -172,9 +172,8 @@ func main() {
okExit("") okExit("")
} }
if argv.Patch != nil { if argv.Patch != nil {
if argv.Patch.Show != nil { if argv.Patch.Submit != "" {
sendDevelDiff("fixme") doSubmit(argv.Patch.Submit)
// sendMasterDiff()
okExit("") okExit("")
} }

View File

@ -71,11 +71,7 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
} }
} }
s.submitB = s.grid.NewButton("Submit", func() { s.submitB = s.grid.NewButton("Submit", func() {
if err := sendDevelDiff(s.reason.String()); err != nil { doSubmit(s.reason.String())
log.Info("sending patches failed", err)
} else {
log.Info("sent patch set ok")
}
}) })
s.grid.NewButton("List Patchsets", func() { s.grid.NewButton("List Patchsets", func() {