add a do-it all button for merging

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-02-02 15:22:48 -06:00
parent 4c2739186c
commit 7071aad1a5
2 changed files with 67 additions and 42 deletions

View File

@ -100,5 +100,5 @@ func attemptAutoRebuild() {
quickCmd(fullpath, []string{"go", "build", "-v", "-x", "-buildmode=plugin", "-o", libfile}) quickCmd(fullpath, []string{"go", "build", "-v", "-x", "-buildmode=plugin", "-o", libfile})
fullpath = filepath.Join(homeDir, "go/src/go.wit.com") fullpath = filepath.Join(homeDir, "go/src/go.wit.com")
quickCmd(fullpath, []string{"go", "install", "-v", "go.wit.com/apps/autotypist@"+version}) quickCmd(fullpath, []string{"go", "install", "-v", "go.wit.com/apps/autotypist@" + version})
} }

View File

@ -201,6 +201,70 @@ func repoAllButtons(box *gui.Node) {
grid1.NewButton("merge all user to devel", func() { grid1.NewButton("merge all user to devel", func() {
reposwin.Disable() reposwin.Disable()
if ! mergeAllUserToDevel() {
return
}
reposwin.Enable()
})
grid1.NewButton("merge all devel to main", func() {
reposwin.Disable()
if ! mergeAllDevelToMain() {
return
}
reposwin.Enable()
})
grid1.NewButton("merge it all", func() {
reposwin.Disable()
if ! mergeAllUserToDevel() {
return
}
if ! mergeAllDevelToMain() {
return
}
reposwin.Enable()
})
grid1.NewButton("status.Update() all", func() {
for _, repo := range me.allrepos {
repo.status.Update()
repo.newScan()
}
})
}
func mergeAllDevelToMain() bool {
log.Info("merge all here")
for _, repo := range me.allrepos {
if repo.status.ReadOnly() {
log.Info("skipping readonly", repo.String(), repo.dirtyLabel.String())
continue
}
if repo.dirtyLabel.String() != "merge to main" {
log.Info("skipping. not merge to main", repo.String(), repo.dirtyLabel.String())
continue
}
if repo.status.CheckDirty() {
log.Info("skipping dirty", repo.String(), repo.dirtyLabel.String())
continue
}
log.Info("found", repo.String(), repo.dirtyLabel.String())
// repo.status.Update()
if repo.status.RunDevelMergeB() {
log.Warn("THINGS SEEM OK fullAutomation() returned true.")
} else {
log.Warn("THINGS FAILED fullAutomation() returned false")
return false
}
repo.status.Update()
repo.newScan()
}
log.Warn("EVERYTHING WORKED")
return true
}
func mergeAllUserToDevel() bool {
log.Info("merge all here") log.Info("merge all here")
for _, repo := range me.allrepos { for _, repo := range me.allrepos {
if repo.status.ReadOnly() { if repo.status.ReadOnly() {
@ -221,50 +285,11 @@ func repoAllButtons(box *gui.Node) {
log.Warn("THINGS SEEM OK fullAutomation() returned true.") log.Warn("THINGS SEEM OK fullAutomation() returned true.")
} else { } else {
log.Warn("THINGS FAILED fullAutomation() returned false") log.Warn("THINGS FAILED fullAutomation() returned false")
return return false
} }
repo.status.Update() repo.status.Update()
repo.newScan() repo.newScan()
} }
log.Warn("EVERYTHING WORKED") log.Warn("EVERYTHING WORKED")
reposwin.Enable() return true
})
grid1.NewButton("merge all devel to main", func() {
reposwin.Disable()
log.Info("merge all here")
for _, repo := range me.allrepos {
if repo.status.ReadOnly() {
log.Info("skipping readonly", repo.String(), repo.dirtyLabel.String())
continue
}
if repo.dirtyLabel.String() != "merge to main" {
log.Info("skipping. not merge to main", repo.String(), repo.dirtyLabel.String())
continue
}
if repo.status.CheckDirty() {
log.Info("skipping dirty", repo.String(), repo.dirtyLabel.String())
continue
}
log.Info("found", repo.String(), repo.dirtyLabel.String())
// repo.status.Update()
if repo.status.RunDevelMergeB() {
log.Warn("THINGS SEEM OK fullAutomation() returned true.")
} else {
log.Warn("THINGS FAILED fullAutomation() returned false")
return
}
repo.status.Update()
repo.newScan()
}
log.Warn("EVERYTHING WORKED")
reposwin.Enable()
})
grid1.NewButton("status.Update() all", func() {
for _, repo := range me.allrepos {
repo.status.Update()
repo.newScan()
}
})
} }