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

@ -201,37 +201,40 @@ 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()
log.Info("merge all here") if ! mergeAllUserToDevel() {
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 devel" {
log.Info("skipping. not merge to devel", 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 return
} }
repo.status.Update()
repo.newScan()
}
log.Warn("EVERYTHING WORKED")
reposwin.Enable() reposwin.Enable()
}) })
grid1.NewButton("merge all devel to main", func() { grid1.NewButton("merge all devel to main", func() {
reposwin.Disable() 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") log.Info("merge all here")
for _, repo := range me.allrepos { for _, repo := range me.allrepos {
if repo.status.ReadOnly() { if repo.status.ReadOnly() {
@ -252,19 +255,41 @@ 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("status.Update() all", func() { func mergeAllUserToDevel() bool {
log.Info("merge all here")
for _, repo := range me.allrepos { 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 devel" {
log.Info("skipping. not merge to devel", 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.status.Update()
repo.newScan() repo.newScan()
} }
}) log.Warn("EVERYTHING WORKED")
return true
} }