working on patch handling
This commit is contained in:
parent
557a5853a4
commit
30dcc8af9f
2
Makefile
2
Makefile
|
@ -69,7 +69,7 @@ pull: install
|
||||||
# cloudflare blocks POST due to captcha checks / human detection?
|
# cloudflare blocks POST due to captcha checks / human detection?
|
||||||
# POST must be direct socket. probably for the best anyway
|
# POST must be direct socket. probably for the best anyway
|
||||||
submit:
|
submit:
|
||||||
FORGE_URL="https://forge.grid.wit.com/" forge patch --submit "forge auto commit"
|
FORGE_URL="https://forge.grid.wit.com/" forge patch submit "forge auto commit"
|
||||||
# forge patch --submit "forge auto commit"
|
# forge patch --submit "forge auto commit"
|
||||||
|
|
||||||
commit:
|
commit:
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
|
||||||
|
$be926ad9-f07f-484c-adf2-d96eeabf3079'v0.0.45 go.wit.com/lib/protobuf/forgepb
|
12
argv.go
12
argv.go
|
@ -62,10 +62,14 @@ type CleanDevelCmd struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type PatchCmd struct {
|
type PatchCmd struct {
|
||||||
List *EmptyCmd `arg:"subcommand:list" help:"your downloaded patchsets"`
|
List *EmptyCmd `arg:"subcommand:list" help:"your downloaded patchsets"`
|
||||||
Get *EmptyCmd `arg:"subcommand:get" help:"get the new patchsets"`
|
Get *EmptyCmd `arg:"subcommand:get" help:"get the new patchsets"`
|
||||||
Show *EmptyCmd `arg:"subcommand:show" help:"your pending commits to your code"`
|
Show *EmptyCmd `arg:"subcommand:show" help:"your pending commits to your code"`
|
||||||
Submit string `arg:"--submit" help:"submit your commits"`
|
Submit *SubmitCmd `arg:"subcommand:submit" help:"submit your commits"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type SubmitCmd struct {
|
||||||
|
Match string `arg:"positional"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type PullCmd struct {
|
type PullCmd struct {
|
||||||
|
|
|
@ -52,7 +52,7 @@ func (args) doBashAuto() {
|
||||||
case "--find":
|
case "--find":
|
||||||
fmt.Println("foo bar")
|
fmt.Println("foo bar")
|
||||||
case "patch":
|
case "patch":
|
||||||
fmt.Println("get list --submit show")
|
fmt.Println("get list submit show")
|
||||||
case "user":
|
case "user":
|
||||||
fmt.Println("--force")
|
fmt.Println("--force")
|
||||||
case "devel":
|
case "devel":
|
||||||
|
|
3
doGui.go
3
doGui.go
|
@ -146,7 +146,8 @@ func drawWindow(win *gadgets.GenericWindow) {
|
||||||
patchesWin.Toggle()
|
patchesWin.Toggle()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
loadUpstreamPatchsets()
|
me.forge.GetPatches()
|
||||||
|
// loadUpstreamPatchsets()
|
||||||
if me.psets == nil {
|
if me.psets == nil {
|
||||||
log.Info("failed to download current patchsets")
|
log.Info("failed to download current patchsets")
|
||||||
return
|
return
|
||||||
|
|
39
doPatch.go
39
doPatch.go
|
@ -13,8 +13,15 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func doPatch() error {
|
func doPatch() error {
|
||||||
if argv.Patch.Submit != "" {
|
if err := me.forge.LoadPatchsets(); err != nil {
|
||||||
_, err := me.forge.SubmitDevelPatchSet(argv.Patch.Submit)
|
log.Info("patches failed to open", err)
|
||||||
|
if err := me.forge.SavePatchsets(); err != nil {
|
||||||
|
log.Warn("savePatchsets() failed", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if argv.Patch.Submit != nil {
|
||||||
|
_, err := me.forge.SubmitDevelPatchSet(argv.Patch.Submit.Match)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -22,7 +29,12 @@ func doPatch() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if argv.Patch.Get != nil {
|
if argv.Patch.Get != nil {
|
||||||
return doPatchGet()
|
if err := me.forge.GetPatches(); err != nil {
|
||||||
|
log.Info("Get Patchsets Failed", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
me.forge.Patchsets.PrintTable()
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if argv.Patch.List != nil {
|
if argv.Patch.List != nil {
|
||||||
|
@ -156,24 +168,3 @@ func IsValidPatch(p *forgepb.Patch) bool {
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func doPatchGet() error {
|
|
||||||
psets, err := me.forge.GetPatchesets()
|
|
||||||
if err != nil {
|
|
||||||
log.Info("Get Patchsets failed", err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
log.Info("Got Patchsets ok", psets.Uuid)
|
|
||||||
|
|
||||||
log.Info("got psets len", len(psets.Patchsets))
|
|
||||||
all := psets.SortByName()
|
|
||||||
for all.Scan() {
|
|
||||||
pset := all.Next()
|
|
||||||
// log.Info("pset name =", pset.Name)
|
|
||||||
dumpPatchset(pset)
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Info("FIXME: can't save these yet. must merge with on disk psets here")
|
|
||||||
// savePatchsets()
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ func (w *stdPatchsetTableWin) Toggle() {
|
||||||
w.win.Toggle()
|
w.win.Toggle()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
func loadUpstreamPatchsets() {
|
func loadUpstreamPatchsets() {
|
||||||
psets, err := me.forge.GetPatchesets()
|
psets, err := me.forge.GetPatchesets()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -66,6 +67,7 @@ func loadUpstreamPatchsets() {
|
||||||
savePatchsets()
|
savePatchsets()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
func makePatchsetsWin() *stdPatchsetTableWin {
|
func makePatchsetsWin() *stdPatchsetTableWin {
|
||||||
dwin := new(stdPatchsetTableWin)
|
dwin := new(stdPatchsetTableWin)
|
||||||
|
@ -84,10 +86,12 @@ func makePatchsetsWin() *stdPatchsetTableWin {
|
||||||
dwin.doPatchsetsTable(me.psets)
|
dwin.doPatchsetsTable(me.psets)
|
||||||
})
|
})
|
||||||
|
|
||||||
grid.NewButton("upstream", func() {
|
/*
|
||||||
loadUpstreamPatchsets()
|
grid.NewButton("upstream", func() {
|
||||||
dwin.doPatchsetsTable(me.psets)
|
loadUpstreamPatchsets()
|
||||||
})
|
dwin.doPatchsetsTable(me.psets)
|
||||||
|
})
|
||||||
|
*/
|
||||||
|
|
||||||
grid.NewButton("save", func() {
|
grid.NewButton("save", func() {
|
||||||
if me.psets == nil {
|
if me.psets == nil {
|
||||||
|
|
Loading…
Reference in New Issue