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()) {
|
|
|
|
log.Warn("repo actually exists", r.getPath())
|
|
|
|
} else {
|
|
|
|
log.Warn("repo does not exist", r.getPath())
|
|
|
|
return false
|
|
|
|
}
|
2024-01-19 18:37:27 -06:00
|
|
|
mn := r.status.GetMasterBranchName()
|
|
|
|
r.masterName.SetLabel(mn)
|
2024-01-13 23:42:06 -06:00
|
|
|
mv := r.status.GetMasterVersion()
|
2024-01-19 18:37:27 -06:00
|
|
|
r.masterVersion.SetLabel(mv)
|
2024-01-13 23:42:06 -06:00
|
|
|
|
2024-01-19 18:37:27 -06:00
|
|
|
dn := r.status.GetDevelBranchName()
|
|
|
|
r.develName.SetLabel(dn)
|
2024-01-13 23:42:06 -06:00
|
|
|
dv := r.status.GetDevelVersion()
|
2024-01-19 18:37:27 -06:00
|
|
|
r.develVersion.SetLabel(dv)
|
2024-01-13 23:42:06 -06:00
|
|
|
|
2024-01-19 18:37:27 -06:00
|
|
|
un := r.status.GetUserBranchName()
|
|
|
|
r.userName.SetLabel(un)
|
2024-01-13 23:42:06 -06:00
|
|
|
uv := r.status.GetUserVersion()
|
2024-01-19 18:37:27 -06:00
|
|
|
r.userVersion.SetLabel(uv)
|
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
|
|
|
}
|