unrelease

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-31 05:04:18 -06:00
parent df8d238f2f
commit 3e9a55b2ac
3 changed files with 51 additions and 5 deletions

View File

@ -9,7 +9,7 @@ import (
// "go.wit.com/gui/gadgets" // "go.wit.com/gui/gadgets"
) )
func globalDisplaySetRepoState() { func showHideRepos() {
for _, repo := range me.allrepos { for _, repo := range me.allrepos {
if me.autoHideReadOnly.Checked() { if me.autoHideReadOnly.Checked() {
if repo.status.ReadOnly() { if repo.status.ReadOnly() {
@ -49,14 +49,14 @@ func globalDisplayOptions(box *gui.Node) {
group1 := vbox.NewGroup("Global Display Options") group1 := vbox.NewGroup("Global Display Options")
group1.NewButton("Show Repository Window", func() { group1.NewButton("Show Repository Window", func() {
globalDisplaySetRepoState() showHideRepos()
reposwin.Toggle() reposwin.Toggle()
}) })
me.autoHideReadOnly = group1.NewCheckbox("Hide read-only repos").SetChecked(true) me.autoHideReadOnly = group1.NewCheckbox("Hide read-only repos").SetChecked(true)
me.autoHideReadOnly.Custom = func() { me.autoHideReadOnly.Custom = func() {
if me.autoHideReadOnly.Checked() { if me.autoHideReadOnly.Checked() {
globalDisplaySetRepoState() showHideRepos()
} else { } else {
globalDisplayShow() globalDisplayShow()
} }
@ -65,7 +65,7 @@ func globalDisplayOptions(box *gui.Node) {
me.autoHidePerfect = group1.NewCheckbox("Hide Perfectly clean repos").SetChecked(true) me.autoHidePerfect = group1.NewCheckbox("Hide Perfectly clean repos").SetChecked(true)
me.autoHidePerfect.Custom = func() { me.autoHidePerfect.Custom = func() {
if me.autoHidePerfect.Checked() { if me.autoHidePerfect.Checked() {
globalDisplaySetRepoState() showHideRepos()
} else { } else {
globalDisplayShow() globalDisplayShow()
} }

View File

@ -36,7 +36,9 @@ func main() {
log.Info("Creating the Release Window") log.Info("Creating the Release Window")
createReleaseBox(me.mainBox) createReleaseBox(me.mainBox)
globalDisplaySetRepoState() createUnreleaseBox(me.mainBox)
showHideRepos()
release.openrepo.Disable() release.openrepo.Disable()

44
unreleaseWindow.go Normal file
View File

@ -0,0 +1,44 @@
// This is a simple example
package main
import (
"go.wit.com/gui"
"go.wit.com/log"
)
func createUnreleaseBox(box *gui.Node) {
group := release.box.NewGroup("undo and redo things")
group.NewButton("punk the zip", func() {
me.Disable()
defer me.Enable()
})
group.NewButton("re-release"+release.versionS, func() {
me.Disable()
defer me.Enable()
if release.current.status.CheckDirty() {
log.Info("sorry, it's still dirty")
return
}
curName := release.current.status.GetCurrentBranchName()
mName := release.current.status.GetMasterBranchName()
if curName != mName {
log.Info("\trepo is not working from main branch", curName, "!=", mName)
return
}
log.Info("\treset to devel", curName, release.versionS, release.reasonS)
release.current.status.RunCmd([]string{"git", "checkout", "devel"})
release.current.status.RunCmd([]string{"git", "branch", "-d", mName})
/*
release.current.status.RunCmd([]string{"git", "add", "-f", "go.sum"})
release.current.status.RunCmd([]string{"git", "commit", "-m", release.reasonS})
release.current.status.RunCmd([]string{"git", "push"})
release.current.status.RunCmd([]string{"git", "tag", "-m", release.reasonS, "v" + release.versionS})
release.current.status.RunCmd([]string{"git", "push", "origin", "v" + release.versionS})
*/
})
}