diff --git a/globalDisplayOptions.go b/globalDisplayOptions.go index dfe4623..196118e 100644 --- a/globalDisplayOptions.go +++ b/globalDisplayOptions.go @@ -7,44 +7,43 @@ import ( "go.wit.com/gui" "go.wit.com/lib/debugger" "go.wit.com/lib/gui/logsettings" + "go.wit.com/lib/gui/repolist" "go.wit.com/log" ) -func showHideRepos() { - for _, repo := range me.repos.View.AllRepos() { - // always show dirty repos - if repo.IsDirty() { - repo.Show() - continue - } - // always show repos that have not been merged to main - if repo.GoState() == "merge to devel" { - repo.Show() - continue - } - - // hide read-only repos. These are repos that do not - // match things in the users config file (.config/autotypist) - if me.autoHideReadOnly.Checked() { - if repo.Status.ReadOnly() { - repo.Hide() - continue - } - } - if me.autoHidePerfect.Checked() { - if repo.State() == "PERFECT" { - repo.Hide() - continue - } - } - if me.autoReleased.Checked() { - if repo.GoState() == "RELEASED" { - repo.Hide() - continue - } - } +func showHideRepos(repo *repolist.Repo) { + // always show dirty repos + if repo.IsDirty() { repo.Show() + return } + // always show repos that have not been merged to main + if repo.GoState() == "merge to devel" { + repo.Show() + return + } + + // hide read-only repos. These are repos that do not + // match things in the users config file (.config/autotypist) + if me.autoHideReadOnly.Checked() { + if repo.Status.ReadOnly() { + repo.Hide() + return + } + } + if me.autoHidePerfect.Checked() { + if repo.State() == "PERFECT" { + repo.Hide() + return + } + } + if me.autoReleased.Checked() { + if repo.GoState() == "RELEASED" { + repo.Hide() + return + } + } + repo.Show() } func globalDisplayShow() { @@ -77,7 +76,8 @@ func globalDisplayOptions(box *gui.Node) { me.repos.Hide() } log.Info("showing reposwin") - showHideRepos() + // showHideRepos() + // have to run this twice for now // scanForReady() // scanForReady() @@ -90,7 +90,7 @@ func globalDisplayOptions(box *gui.Node) { me.autoHideReadOnly = hidegrid.NewCheckbox("Hide read-only repos").SetChecked(true) me.autoHideReadOnly.Custom = func() { if me.autoHideReadOnly.Checked() { - showHideRepos() + // showHideRepos() } else { globalDisplayShow() } @@ -99,11 +99,15 @@ func globalDisplayOptions(box *gui.Node) { me.autoHidePerfect = hidegrid.NewCheckbox("Hide Perfectly clean repos").SetChecked(true) me.autoHidePerfect.Custom = func() { - if me.autoHidePerfect.Checked() { - showHideRepos() - } else { - globalDisplayShow() - } + log.Info("registered hide function to showHideRepos()") + me.repos.View.RegisterHideFunction(showHideRepos) + /* + if me.autoHidePerfect.Checked() { + showHideRepos() + } else { + globalDisplayShow() + } + */ } hidegrid.NextRow() @@ -142,6 +146,19 @@ func globalDisplayOptions(box *gui.Node) { setBranchToMaster() }) + grid.NewButton("find first repo", func() { + // set the target versions + setTargetVersion() + + // have to run this twice for now. not sure why + scanForReady() + scanForReady() + + findNextDirty("") + // double check the found next repo + fullDoubleCheckFix() + }) + me.setBranchesToMasterB = grid.NewButton("set all branches to master", func() { me.Disable() for _, repo := range me.repos.View.AllRepos() { diff --git a/releaseBox.go b/releaseBox.go index 5dcaa63..91960c0 100644 --- a/releaseBox.go +++ b/releaseBox.go @@ -263,24 +263,27 @@ func goodCheckGoSum() bool { var maybe bool = true goConfig := release.current.Status.GetGoDeps() for depname, version := range goConfig { - log.Info("Checking repo deps:", depname, version) + log.Info("Starting repo deps:", depname, version) repo := me.repos.View.FindRepo(depname) - if repo != nil { - log.Info(" repo deps: IGNORE", depname, version) + if repo == nil { + log.Info(" skipping repo == nil", depname, version) continue } goSumS := repo.GoState() // ignore dependencies on whitelisted repos // TODO: warn the user about the whitelist if goSumS == "WHITELIST" { + log.Info(" skipping repo == nil", depname, version) continue } // check if the dependent repo is ReadOnly // if so, there isn't anything we can do about // version mis-matches if repo.ReadOnly() { + log.Info(" repo deps: WHITELIST", depname, version) continue } + log.Info("Checking repo deps match:", depname, version) lastS := repo.LastTag() targetS := repo.Status.GetTargetVersion() log.Info(" repo deps:", depname, version, "vs", goSumS, lastS, targetS)