2024-01-13 23:42:06 -06:00
|
|
|
// This is a simple example
|
|
|
|
package main
|
|
|
|
|
2024-01-18 00:58:14 -06:00
|
|
|
import (
|
2024-01-13 23:42:06 -06:00
|
|
|
"go.wit.com/log"
|
|
|
|
|
2024-01-18 00:58:14 -06:00
|
|
|
"go.wit.com/lib/gui/repostatus"
|
2024-01-13 23:42:06 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
func (r *repo) newScan() bool {
|
|
|
|
if r.status == nil {
|
|
|
|
log.Warn("repo.status = nil. not initialized for some reason")
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
// r.scan()
|
|
|
|
if repostatus.VerifyLocalGoRepo(r.getPath()) {
|
2024-01-23 11:22:33 -06:00
|
|
|
log.Verbose("repo actually exists", r.getPath())
|
2024-01-13 23:42:06 -06:00
|
|
|
} else {
|
|
|
|
log.Warn("repo does not exist", r.getPath())
|
|
|
|
return false
|
|
|
|
}
|
2024-01-20 18:45:55 -06:00
|
|
|
mname := r.status.GetMasterBranchName()
|
|
|
|
mver := r.status.GetMasterVersion()
|
|
|
|
if mname != "guimaster" {
|
|
|
|
mver = mver + " (" + mname + ")"
|
|
|
|
}
|
|
|
|
r.masterVersion.SetLabel(mver)
|
2024-01-13 23:42:06 -06:00
|
|
|
|
2024-01-20 18:45:55 -06:00
|
|
|
dname := r.status.GetDevelBranchName()
|
|
|
|
dver := r.status.GetDevelVersion()
|
|
|
|
if dname != "devel" {
|
|
|
|
dver = dver + " (" + dname + ")"
|
|
|
|
}
|
|
|
|
r.develVersion.SetLabel(dver)
|
2024-01-13 23:42:06 -06:00
|
|
|
|
2024-01-20 18:45:55 -06:00
|
|
|
uname := r.status.GetUserBranchName()
|
|
|
|
uver := r.status.GetUserVersion()
|
|
|
|
if uname != "jcarr" {
|
|
|
|
uver = uver + " (" + uname + ")"
|
|
|
|
}
|
|
|
|
r.userVersion.SetLabel(uver)
|
2024-01-13 23:42:06 -06:00
|
|
|
|
|
|
|
cbname := r.status.GetCurrentBranchName()
|
|
|
|
cbversion := r.status.GetCurrentBranchVersion()
|
2024-01-15 08:11:08 -06:00
|
|
|
lasttag := r.status.GetLastTagVersion()
|
2024-01-19 18:37:27 -06:00
|
|
|
r.lastTag.SetLabel(lasttag)
|
|
|
|
r.vLabel.SetLabel(cbname + " " + cbversion)
|
2024-01-13 23:42:06 -06:00
|
|
|
|
2024-01-19 18:37:27 -06:00
|
|
|
if r.status.Changed() {
|
|
|
|
log.Warn("should scan here")
|
2024-01-15 08:11:08 -06:00
|
|
|
}
|
2024-01-19 18:37:27 -06:00
|
|
|
status := r.status.GetStatus()
|
|
|
|
r.dirtyLabel.SetLabel(status)
|
2024-01-15 08:11:08 -06:00
|
|
|
if status == "PERFECT" {
|
2024-01-19 18:37:27 -06:00
|
|
|
if me.autoHidePerfect.Checked() {
|
|
|
|
r.Hide()
|
|
|
|
}
|
2024-01-15 08:11:08 -06:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *repo) getStatus() string {
|
2024-01-13 23:42:06 -06:00
|
|
|
if r.status.CheckDirty() {
|
|
|
|
log.Warn("CheckDirty() true")
|
2024-01-15 08:11:08 -06:00
|
|
|
return "dirty"
|
2024-01-13 23:42:06 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
if r.status.CheckBranches() {
|
|
|
|
log.Warn("Branches are Perfect")
|
2024-01-15 08:11:08 -06:00
|
|
|
return "PERFECT"
|
2024-01-13 23:42:06 -06:00
|
|
|
}
|
2024-01-15 08:11:08 -06:00
|
|
|
log.Warn("Branches are not Perfect")
|
|
|
|
return "merge"
|
2024-01-13 23:42:06 -06:00
|
|
|
}
|
2024-01-24 02:41:34 -06:00
|
|
|
|
|
|
|
func scanGoSum() {
|
|
|
|
for repo, _ := range me.allrepos {
|
|
|
|
latestversion := repo.status.GetLastTagVersion()
|
|
|
|
if repo.goSumStatus.String() == "BAD" {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
if repo.goSumStatus.String() == "DIRTY" {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
if repo.status.CheckDirty() {
|
|
|
|
log.Info("dirty repo:", latestversion, repo.status.String())
|
|
|
|
log.Info("dirty repo.goSumStatus =", repo.goSumStatus.String())
|
|
|
|
repo.goSumStatus.SetLabel("DIRTY")
|
|
|
|
|
|
|
|
// release.repo.SetValue(repo.status.String())
|
|
|
|
// release.status.SetValue("dirty")
|
|
|
|
// release.notes.SetValue("You must commit your changes\nbefore you can continue")
|
|
|
|
// release.current = repo
|
|
|
|
// release.openrepo.Enable()
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
if repo.status.CheckGoSum() {
|
|
|
|
log.Info("repo has go.sum requirements that are clean")
|
|
|
|
repo.goSumStatus.SetLabel("CLEAN")
|
|
|
|
} else {
|
|
|
|
log.Info("repo has go.sum requirements that are screwed up")
|
|
|
|
repo.goSumStatus.SetLabel("BAD")
|
|
|
|
|
|
|
|
// release.repo.SetValue(repo.status.String())
|
|
|
|
// release.status.SetValue("bad")
|
|
|
|
// release.notes.SetValue("the go.sum file is wrong")
|
|
|
|
// release.current = repo
|
|
|
|
// release.openrepo.Enable()
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
status := repo.dirtyLabel.String()
|
|
|
|
if status == "PERFECT" {
|
|
|
|
continue
|
|
|
|
} else {
|
|
|
|
repo.status.Update()
|
|
|
|
repo.newScan()
|
|
|
|
}
|
|
|
|
|
|
|
|
// log.Info("find the next repo to release here")
|
|
|
|
log.Info("repo:", latestversion, status, repo.status.String())
|
|
|
|
}
|
|
|
|
log.Info("scan() did everything, not sure what to do next")
|
|
|
|
}
|