summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-13 22:52:10 -0600
committerJeff Carr <[email protected]>2025-02-13 22:52:10 -0600
commitf0572a6198edbc1c4c5d08f46799cc703eb643c3 (patch)
tree7de12ab2f8cff35ccc760ef8b5434346b8b056a2
parenteee34ec9f0e0dacdcb2a07bc3dce63de8fe8c317 (diff)
attempt at merge to devel button
-rw-r--r--doGui.go54
1 files changed, 54 insertions, 0 deletions
diff --git a/doGui.go b/doGui.go
index bf062c1..18daed6 100644
--- a/doGui.go
+++ b/doGui.go
@@ -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()
+ })
}