submit-patchset/scan.go

62 lines
1.3 KiB
Go
Raw Normal View History

// This is a simple example
package main
import (
"go.wit.com/log"
"go.wit.com/gui/gadgets/repostatus"
)
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
}
mn := r.status.GetMasterName()
r.masterName.Set(mn)
mv := r.status.GetMasterVersion()
r.masterVersion.Set(mv)
dn := r.status.GetDevelName()
r.develName.Set(dn)
dv := r.status.GetDevelVersion()
r.develVersion.Set(dv)
un := r.status.GetUserName()
r.userName.Set(un)
uv := r.status.GetUserVersion()
r.userVersion.Set(uv)
cbname := r.status.GetCurrentBranchName()
cbversion := r.status.GetCurrentBranchVersion()
ltversion := r.status.GetLastTagVersion()
r.lastLabel.Set(cbname + "\n" + cbversion)
r.vLabel.Set(cbname + "\n" + ltversion)
if r.status.CheckDirty() {
log.Warn("CheckDirty() true")
r.dirtyLabel.Set("dirty")
return false
}
log.Warn("CheckDirty() no")
r.dirtyLabel.Set("not dirty")
if r.status.CheckBranches() {
log.Warn("Branches are Perfect")
r.dirtyLabel.SetText("PERFECT")
return true
} else {
log.Warn("Branches are not Perfect")
r.dirtyLabel.SetText("merge")
}
return false
}