attempt to make a patchset protobuf

This commit is contained in:
Jeff Carr 2024-12-11 18:50:14 -06:00
parent aff3268ca6
commit 353290ecb1
4 changed files with 41 additions and 7 deletions

View File

@ -55,3 +55,6 @@ pull: install
mine: install
forge --find-mine
gui: install
forge --do-gui

18
exit.go Normal file
View File

@ -0,0 +1,18 @@
package main
import (
"os"
"go.wit.com/log"
)
func okExit(thing string) {
log.Info(thing, "ok")
// log.Info("Finished go-clean on", check.GetGoPath(), "ok")
os.Exit(0)
}
func badExit(err error) {
log.Info("forge failed: ", err, me.forge.GetGoSrc())
os.Exit(-1)
}

15
main.go
View File

@ -66,8 +66,21 @@ func main() {
// do the gui at the very end
if argv.DoGui {
pset, err := me.forge.MakePatchSet()
if err != nil {
badExit(err)
}
all := pset.SortByFilename()
for all.Scan() {
p := all.Next()
log.Info("read in patch:", p.Filename)
}
err = me.forge.SendPatchSet(pset)
if err != nil {
badExit(err)
}
okExit("patches")
doGui()
os.Exit(0)
}
if !done {
// if nothing was selected, print out a table of them on STDOUT

View File

@ -176,8 +176,8 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
s.submitB.Disable()
s.grid.NextRow()
s.unknownOL.Disable()
s.unknownSubmitB.Disable()
// s.unknownOL.Disable()
// s.unknownSubmitB.Disable()
s.grid.NextRow()
return s
@ -229,12 +229,12 @@ func (s *patchSummary) Update() {
if dirty == 0 {
s.reason.Enable()
s.submitB.Enable()
s.unknownOL.Enable()
s.unknownSubmitB.Enable()
// s.unknownOL.Enable()
// s.unknownSubmitB.Enable()
} else {
s.reason.Disable()
s.submitB.Enable()
s.unknownOL.Enable()
s.unknownSubmitB.Enable()
// s.unknownOL.Enable()
// s.unknownSubmitB.Enable()
}
}