From 9b9df05f33e20277ff0e5e811c55d95ab56f562c Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 3 Dec 2024 18:00:42 -0600 Subject: [PATCH] more removal of old stuff --- doRelease.go | 2 +- findNext.go | 24 ++++++++++++++++++++---- http.go | 16 +++++++++++----- human.go | 6 +++++- releaseBox.go | 16 ---------------- 5 files changed, 37 insertions(+), 27 deletions(-) diff --git a/doRelease.go b/doRelease.go index 4a8c42f..91b3449 100644 --- a/doRelease.go +++ b/doRelease.go @@ -62,7 +62,7 @@ func doRelease() bool { var all [][]string all = append(all, []string{"git", "add", "-f", "go.mod"}) - if me.current.Status.IsPrimitive() { + if ok, _ := check.IsPrimitive(); ok { // don't add go.sum here. TODO: check for go.sum file and fail } else { all = append(all, []string{"git", "add", "-f", "go.sum"}) diff --git a/findNext.go b/findNext.go index 4c368e9..ce1fd6d 100644 --- a/findNext.go +++ b/findNext.go @@ -4,6 +4,7 @@ package main import ( "go.wit.com/log" + "go.wit.com/lib/gui/repolist" "go.wit.com/lib/protobuf/gitpb" ) @@ -24,11 +25,8 @@ func findNext() bool { log.Info("boo, you didn't git clone", repo.GoPath()) return false } - log.Info("findNext() STARTING", check.GoPath) - log.Info("findNext() STARTING", check.GoPath) - log.Info("findNext() STARTING", check.GoPath) if check.GetTargetVersion() == check.GetCurrentBranchVersion() { - log.Info("findNext() no update needed", check.GoPath, check.GetTargetVersion(), "vs", check.GetCurrentBranchVersion()) + // log.Info("findNext() no update needed", check.GoPath, check.GetTargetVersion(), "vs", check.GetCurrentBranchVersion()) continue } else { log.Info("findNext() update needed", check.GoPath, check.GetTargetVersion(), "vs", check.GetCurrentBranchVersion()) @@ -126,3 +124,21 @@ func fixGodeps(check *gitpb.Repo) bool { } return good } + +func setCurrentRepo(repo *repolist.RepoRow, s string, note string) bool { + check := me.forge.Repos.FindByGoPath(repo.GoPath()) + if check == nil { + log.Info("boo, you didn't git clone", repo.GoPath()) + return false + } + + me.release.repo.SetText(check.GoPath) + me.release.status.SetText(s) + me.release.notes.SetText(note) + me.current = repo + me.release.version.SetText(check.GetTargetVersion()) + me.release.releaseVersionB.SetText("release version " + check.GetTargetVersion()) + me.release.openrepo.Enable() + + return true +} diff --git a/http.go b/http.go index 99b2863..846f93a 100644 --- a/http.go +++ b/http.go @@ -259,22 +259,28 @@ func showNext() { return } + check := me.forge.Repos.FindByGoPath(me.current.GoPath()) + if check == nil { + log.Info("forge: how was this not found?", me.current.GoPath()) + return + } + if me.current.Status.IsReleased() { - log.Info("IsReleased() == true SHOULD NOT RELEASE THIS") + log.Info("IsReleased() == true. do not release this a second time") } else { log.Info("IsReleased() == false") } - if me.current.Status.CheckDirty() { - log.Info("CheckDirty() == true. SHOULD NOT RELEASE THIS") + if check.CheckDirty() { + log.Info("CheckDirty() == true. do not release dirty repos") } else { log.Info("CheckDirty() == false") } - if me.current.Status.IsPrimitive() { + if ok, _ := check.IsPrimitive(); ok { log.Info("IsPrimitive() == true") } else { log.Info("IsPrimitive() == false") } - if me.current.Status.IsPrivate() { + if me.forge.IsPrivate(check.GoPath) { log.Info("IsPrivate() == true") } else { log.Info("IsPrivate() == false") diff --git a/human.go b/human.go index fab7e94..e771238 100644 --- a/human.go +++ b/human.go @@ -74,7 +74,11 @@ func PrintReleaseReport(readonly string, perfect string) { log.Info("boo, you didn't git clone", check.GoPath) continue } - log.Info(me.forge.StandardReleaseHeader(check, "")) + var state string + if check.CheckDirty() { + state = "(dirty)" + } + log.Info(me.forge.StandardReleaseHeader(check, state)) } log.Info(fmt.Sprintf("total repo count = %d", count)) } diff --git a/releaseBox.go b/releaseBox.go index 99f50c7..d366f63 100644 --- a/releaseBox.go +++ b/releaseBox.go @@ -238,19 +238,3 @@ func buttonDisable() { func buttonEnable() { me.Enable() } - -func setCurrentRepo(newcur *repolist.RepoRow, s string, note string) bool { - if newcur.ReadOnly() { - return false - } - - me.release.repo.SetText(newcur.GoPath()) - me.release.status.SetText(s) - me.release.notes.SetText(note) - me.current = newcur - me.release.version.SetText(me.current.Status.GetTargetVersion()) - me.release.releaseVersionB.SetText("release version " + me.current.Status.GetTargetVersion()) - me.release.openrepo.Enable() - - return true -}