attempt at merge to devel button

This commit is contained in:
Jeff Carr 2025-02-13 22:52:10 -06:00
parent eee34ec9f0
commit f0572a6198
1 changed files with 54 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import (
"go.wit.com/lib/gadgets"
"go.wit.com/lib/gui/repolist"
"go.wit.com/lib/gui/shell"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
)
@ -228,4 +229,57 @@ func drawWindow(win *gadgets.BasicWindow) {
grid.NewButton("debugger()", func() {
debugger.DebugWindow()
})
grid.NewButton("merge to devel", func() {
win.Disable()
defer win.Enable()
me.found = new(gitpb.Repos)
findReposWithPatches()
if me.found.Len() == 0 {
log.Info("you currently have no patches in your user branches")
return
}
me.forge.PrintHumanTable(me.found)
now := time.Now()
// check for devel branches
total, count, nope, _ := IsEverythingOnDevel()
log.Printf("Devel branch check. %d total repos. (%d ok) (%d not on devel branch) (%s)\n", total, count, nope, shell.FormatDuration(time.Since(now)))
if nope != 0 {
return
} else {
}
all := me.found.SortByFullPath()
for all.Scan() {
repo := all.Next()
log.Info("repo:", repo.GetGoPath())
if result, err := repo.MergeToDevel(); err == nil {
log.Warn("THINGS SEEM OK", repo.GetFullPath())
for _, line := range result.Stdout {
log.Warn("stdout:", line)
}
for _, line := range result.Stderr {
log.Warn("stderr:", line)
}
} else {
log.Warn("THINGS FAILED ", repo.GetFullPath())
log.Warn("err", err)
if result == nil {
break
}
for _, line := range result.Stdout {
log.Warn("stdout:", line)
}
for _, line := range result.Stderr {
log.Warn("stderr:", line)
}
break
}
me.forge.SetConfigSave(true)
// view.Update()
}
me.forge.ConfigSave()
})
}