lots of things broken

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-19 12:36:52 -06:00
parent 7a283a1da6
commit e7257a919d
4 changed files with 18 additions and 25 deletions

View File

@ -348,7 +348,7 @@ func (rs *RepoStatus) setGitCommands() {
tmp = append(tmp, s) tmp = append(tmp, s)
} }
rs.versionCmdOutput.SetText(strings.Join(tmp, "\n")) rs.versionCmdOutput.SetValue(strings.Join(tmp, "\n"))
} }
func (rs *RepoStatus) setMergeDevelCommands() { func (rs *RepoStatus) setMergeDevelCommands() {
@ -375,7 +375,7 @@ func (rs *RepoStatus) setMergeDevelCommands() {
tmp = append(tmp, s) tmp = append(tmp, s)
} }
rs.versionCmdOutput.SetText(strings.Join(tmp, "\n")) rs.versionCmdOutput.SetValue(strings.Join(tmp, "\n"))
} }
func (rs *RepoStatus) setMergeUserCommands() { func (rs *RepoStatus) setMergeUserCommands() {
@ -402,5 +402,5 @@ func (rs *RepoStatus) setMergeUserCommands() {
tmp = append(tmp, s) tmp = append(tmp, s)
} }
rs.versionCmdOutput.SetText(strings.Join(tmp, "\n")) rs.versionCmdOutput.SetValue(strings.Join(tmp, "\n"))
} }

18
git.go
View File

@ -32,14 +32,14 @@ func (rs *RepoStatus) GetLastTagVersion() string {
func (rs *RepoStatus) getCurrentBranchName() string { func (rs *RepoStatus) getCurrentBranchName() string {
out := run(rs.repopath, "git", "branch --show-current") out := run(rs.repopath, "git", "branch --show-current")
log.Warn("getCurrentBranchName() =", out) log.Warn("getCurrentBranchName() =", out)
rs.currentBranch.SetText(out) rs.currentBranch.SetValue(out)
return out return out
} }
func (rs *RepoStatus) getCurrentBranchVersion() string { func (rs *RepoStatus) getCurrentBranchVersion() string {
out := run(rs.repopath, "git", "describe --tags") out := run(rs.repopath, "git", "describe --tags")
log.Warn("getCurrentBranchVersion()", out) log.Warn("getCurrentBranchVersion()", out)
rs.currentVersion.SetText(out) rs.currentVersion.SetValue(out)
return out return out
} }
@ -51,7 +51,7 @@ func (rs *RepoStatus) getLastTagVersion() string {
lastreal := "describe --tags " + out lastreal := "describe --tags " + out
// out = run(r.path, "git", "describe --tags c871d5ecf051a7dc4e3a77157cdbc0a457eb9ae1") // out = run(r.path, "git", "describe --tags c871d5ecf051a7dc4e3a77157cdbc0a457eb9ae1")
out = run(rs.repopath, "git", lastreal) out = run(rs.repopath, "git", lastreal)
rs.lasttag.SetText(out) rs.lasttag.SetValue(out)
rs.tagsDrop.SetText(out) rs.tagsDrop.SetText(out)
// rs.lastLabel.SetText(out) // rs.lastLabel.SetText(out)
return out return out
@ -109,17 +109,17 @@ func (rs *RepoStatus) CheckDirty() bool {
log.Warn("CheckDirty() out =", out) log.Warn("CheckDirty() out =", out)
log.Warn("CheckDirty() err =", err) log.Warn("CheckDirty() err =", err)
log.Error(err, "CheckDirty() error") log.Error(err, "CheckDirty() error")
rs.dirtyLabel.SetText("error") rs.dirtyLabel.SetValue("error")
return true return true
} }
if b { if b {
log.Warn("CheckDirty() b =", b, "path =", path, "out =", out) log.Warn("CheckDirty() b =", b, "path =", path, "out =", out)
log.Warn("CheckDirty() no", rs.repopath) log.Warn("CheckDirty() no", rs.repopath)
rs.dirtyLabel.SetText("no") rs.dirtyLabel.SetValue("no")
return false return false
} }
log.Warn("CheckDirty() true", rs.repopath) log.Warn("CheckDirty() true", rs.repopath)
rs.dirtyLabel.SetText("dirty") rs.dirtyLabel.SetValue("dirty")
return true return true
} }
@ -147,11 +147,11 @@ func (rs *RepoStatus) checkoutBranch(level string, branch string) {
switch level { switch level {
case "master": case "master":
rs.masterBranchVersion.SetText(realversion) rs.masterBranchVersion.SetValue(realversion)
case "devel": case "devel":
rs.develBranchVersion.SetText(realversion) rs.develBranchVersion.SetValue(realversion)
case "user": case "user":
rs.userBranchVersion.SetText(realversion) rs.userBranchVersion.SetValue(realversion)
default: default:
} }
} }

View File

@ -15,5 +15,5 @@ func (ls *RepoStatus) SetSpeedActual(s string) {
if !ls.Ready() { if !ls.Ready() {
return return
} }
ls.speedActual.SetText(s) ls.speedActual.SetValue(s)
} }

View File

@ -17,19 +17,12 @@ func (rs *RepoStatus) Update() {
log.Log(WARN, "Update() START") log.Log(WARN, "Update() START")
duration := timeFunction(func() { duration := timeFunction(func() {
// do things that are safe even if the git tree is dirty // do things that are safe even if the git tree is dirty
log.Warn("path.SetText()") rs.path.SetValue(rs.repopath)
rs.path.SetText(rs.repopath)
log.Warn("getCurrentBranchName()")
rs.getCurrentBranchName() rs.getCurrentBranchName()
log.Warn("set window Title()")
rs.window.Title(rs.repopath + " GO repo Details") rs.window.Title(rs.repopath + " GO repo Details")
log.Warn("getCurrentBranchVersion()")
rs.getCurrentBranchVersion() rs.getCurrentBranchVersion()
log.Warn("getLastTagVersion()")
rs.getLastTagVersion() rs.getLastTagVersion()
log.Warn("populateTags()")
rs.populateTags() rs.populateTags()
log.Warn("CheckDirty()")
rs.CheckDirty() rs.CheckDirty()
if rs.dirtyLabel.String() != "no" { if rs.dirtyLabel.String() != "no" {
@ -67,14 +60,14 @@ func (rs *RepoStatus) setSpeed(duration time.Duration) {
log.Log(WARN, "can't actually warn") log.Log(WARN, "can't actually warn")
return return
} }
rs.speedActual.SetText(s) rs.speedActual.SetValue(s)
if duration > 500*time.Millisecond { if duration > 500*time.Millisecond {
rs.speed.SetText("SLOW") rs.speed.SetValue("SLOW")
} else if duration > 100*time.Millisecond { } else if duration > 100*time.Millisecond {
rs.speed.SetText("OK") rs.speed.SetValue("OK")
} else { } else {
rs.speed.SetText("FAST") rs.speed.SetValue("FAST")
} }
} }