say goodbye finally
This commit is contained in:
parent
209c270add
commit
7ccbf7f59d
|
@ -1,12 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.wit.com/lib/gui/repolist"
|
|
||||||
)
|
|
||||||
|
|
||||||
// like tcl/tk, use ENV variables to set display preferences
|
// like tcl/tk, use ENV variables to set display preferences
|
||||||
|
/*
|
||||||
func hideFunction(r *repolist.RepoRow) {
|
func hideFunction(r *repolist.RepoRow) {
|
||||||
// always show dirty repos
|
// always show dirty repos
|
||||||
if r.Status.IsDirty() {
|
if r.Status.IsDirty() {
|
||||||
|
@ -40,3 +35,4 @@ func hideFunction(r *repolist.RepoRow) {
|
||||||
// as read-only=true
|
// as read-only=true
|
||||||
r.Show()
|
r.Show()
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
53
http.go
53
http.go
|
@ -77,7 +77,6 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
case "/rescanAll":
|
case "/rescanAll":
|
||||||
me.repos.View.ScanRepositories()
|
me.repos.View.ScanRepositories()
|
||||||
case "/setCurrentRepo":
|
case "/setCurrentRepo":
|
||||||
|
|
||||||
log.Info("repo: " + repoName)
|
log.Info("repo: " + repoName)
|
||||||
log.Info("version: " + version)
|
log.Info("version: " + version)
|
||||||
log.Info("comment: " + comment)
|
log.Info("comment: " + comment)
|
||||||
|
@ -89,59 +88,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
setCurrentRepo(repo, "HTTP", "doRelease() ?")
|
setCurrentRepo(repo, "HTTP", "doRelease() ?")
|
||||||
case "/IncrementRevisonVersion":
|
|
||||||
log.Info("repo: " + repoName)
|
|
||||||
log.Info("version: " + version)
|
|
||||||
me.current.IncrementTargetRevision()
|
|
||||||
case "/IncrementMinorVersion":
|
|
||||||
log.Info("repo: " + repoName)
|
|
||||||
log.Info("version: " + version)
|
|
||||||
|
|
||||||
me.current.IncrementTargetMinor()
|
|
||||||
case "/setAllBranchesToMaster":
|
|
||||||
log.Info("set all branches to master")
|
|
||||||
me.Disable()
|
|
||||||
defer me.Enable()
|
|
||||||
if setAllBranchesToMaster() {
|
|
||||||
// if it succeeds, disable this button
|
|
||||||
me.setBranchesToMasterB.Disable()
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
case "/setTargetVersion":
|
|
||||||
log.Info("repo: " + repoName)
|
|
||||||
log.Info("version: " + version)
|
|
||||||
if repoName != "" {
|
|
||||||
repo := me.repos.View.FindByName(repoName)
|
|
||||||
if repo == nil {
|
|
||||||
log.Info("could not find repo", repoName)
|
|
||||||
} else {
|
|
||||||
log.Info("setting target version", version)
|
|
||||||
repo.Status.SetTargetVersion(version)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if me.current == nil {
|
|
||||||
log.Info("me.current == nil")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
me.current.SetTargetVersion(version)
|
|
||||||
return
|
|
||||||
case "/setAllTargetVersions":
|
|
||||||
log.Info("version: " + version)
|
|
||||||
|
|
||||||
loop := me.repos.View.ReposSortByName()
|
|
||||||
for loop.Scan() {
|
|
||||||
repo := loop.Repo()
|
|
||||||
|
|
||||||
master := repo.Status.GetMasterVersion()
|
|
||||||
lastTag := repo.Status.LastTag()
|
|
||||||
if master == lastTag {
|
|
||||||
repo.Status.SetTargetVersion(master)
|
|
||||||
} else {
|
|
||||||
repo.Status.IncrementRevisionVersion("Nov 2024 test")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case "/whitelist":
|
case "/whitelist":
|
||||||
repo := me.repos.View.FindByName(repoName)
|
repo := me.repos.View.FindByName(repoName)
|
||||||
if repo == nil {
|
if repo == nil {
|
||||||
|
|
38
main.go
38
main.go
|
@ -29,21 +29,23 @@ func main() {
|
||||||
me.forge = forgepb.Init()
|
me.forge = forgepb.Init()
|
||||||
me.found = new(gitpb.Repos)
|
me.found = new(gitpb.Repos)
|
||||||
|
|
||||||
var bad bool = false
|
/*
|
||||||
all := me.forge.Repos.SortByFullPath()
|
var bad bool = false
|
||||||
for all.Scan() {
|
all := me.forge.Repos.SortByFullPath()
|
||||||
repo := all.Next()
|
for all.Scan() {
|
||||||
if repo.IsDevelBranch() {
|
repo := all.Next()
|
||||||
continue
|
if repo.IsDevelBranch() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
log.Info("not on devel branch:", repo.GetCurrentBranchName(), repo.GetDevelBranchName())
|
||||||
|
log.Info("not on devel branch:", repo.GetFullPath())
|
||||||
|
log.Info("you can not continue if repos are not on devel branches")
|
||||||
|
bad = true
|
||||||
}
|
}
|
||||||
log.Info("not on devel branch:", repo.GetCurrentBranchName(), repo.GetDevelBranchName())
|
if bad {
|
||||||
log.Info("not on devel branch:", repo.GetFullPath())
|
os.Exit(-1)
|
||||||
log.Info("you can not continue if repos are not on devel branches")
|
}
|
||||||
bad = true
|
*/
|
||||||
}
|
|
||||||
if bad {
|
|
||||||
os.Exit(-1)
|
|
||||||
}
|
|
||||||
|
|
||||||
// me.forge.ConfigPrintTable()
|
// me.forge.ConfigPrintTable()
|
||||||
os.Setenv("REPO_WORK_PATH", me.forge.GetGoSrc())
|
os.Setenv("REPO_WORK_PATH", me.forge.GetGoSrc())
|
||||||
|
@ -109,7 +111,7 @@ func main() {
|
||||||
me.Disable()
|
me.Disable()
|
||||||
|
|
||||||
// register a Show/Hide function for the repo list table
|
// register a Show/Hide function for the repo list table
|
||||||
me.repos.View.RegisterHideFunction(hideFunction)
|
// me.repos.View.RegisterHideFunction(hideFunction)
|
||||||
|
|
||||||
// scan in the State of all the repos
|
// scan in the State of all the repos
|
||||||
// TODO: should not really be necessary directly after init()
|
// TODO: should not really be necessary directly after init()
|
||||||
|
@ -124,9 +126,9 @@ func main() {
|
||||||
repo.Status.SetReadOnly(false)
|
repo.Status.SetReadOnly(false)
|
||||||
}
|
}
|
||||||
if me.forge.Config.IsPrivate(repo.GetGoPath()) {
|
if me.forge.Config.IsPrivate(repo.GetGoPath()) {
|
||||||
repo.Status.SetPrivate(true)
|
// repo.Status.SetPrivate(true)
|
||||||
} else {
|
} else {
|
||||||
repo.Status.SetPrivate(false)
|
// repo.Status.SetPrivate(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,6 +153,7 @@ func main() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
// start the initail scan and make sure each repo is set
|
// start the initail scan and make sure each repo is set
|
||||||
// to the master branch
|
// to the master branch
|
||||||
func setAllBranchesToMaster() bool {
|
func setAllBranchesToMaster() bool {
|
||||||
|
@ -177,3 +180,4 @@ func setAllBranchesToMaster() bool {
|
||||||
}
|
}
|
||||||
return worked
|
return worked
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
|
@ -14,14 +14,16 @@ func makePrepareRelease() {
|
||||||
me.release.box.Disable()
|
me.release.box.Disable()
|
||||||
defer me.Enable()
|
defer me.Enable()
|
||||||
|
|
||||||
if setAllBranchesToMaster() {
|
/*
|
||||||
// if it succeeds, disable this button
|
if setAllBranchesToMaster() {
|
||||||
me.setBranchesToMasterB.Disable()
|
// if it succeeds, disable this button
|
||||||
me.release.box.Enable()
|
me.setBranchesToMasterB.Disable()
|
||||||
me.forge.PrintReleaseReport(me.found)
|
me.release.box.Enable()
|
||||||
} else {
|
me.forge.PrintReleaseReport(me.found)
|
||||||
log.Info("setAllBranchesToMaster() failed")
|
} else {
|
||||||
}
|
log.Info("setAllBranchesToMaster() failed")
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// run this each time something gets published successfully
|
// run this each time something gets published successfully
|
||||||
rePrepareRelease()
|
rePrepareRelease()
|
||||||
|
|
|
@ -188,10 +188,12 @@ func createReleaseBox(box *gui.Node) {
|
||||||
me.setBranchesToMasterB = grid.NewButton("set all branches to master", func() {
|
me.setBranchesToMasterB = grid.NewButton("set all branches to master", func() {
|
||||||
me.Disable()
|
me.Disable()
|
||||||
defer me.Enable()
|
defer me.Enable()
|
||||||
if setAllBranchesToMaster() {
|
/*
|
||||||
// if it succeeds, disable this button
|
if setAllBranchesToMaster() {
|
||||||
me.setBranchesToMasterB.Disable()
|
// if it succeeds, disable this button
|
||||||
}
|
me.setBranchesToMasterB.Disable()
|
||||||
|
}
|
||||||
|
*/
|
||||||
})
|
})
|
||||||
grid.NextRow()
|
grid.NextRow()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue