2024-02-14 00:09:58 -06:00
|
|
|
package repostatus
|
|
|
|
|
|
|
|
import (
|
|
|
|
"go.wit.com/lib/gadgets"
|
|
|
|
"go.wit.com/log"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (rs *RepoStatus) makeBranchesBox() {
|
|
|
|
rs.gitBranchesGroup = rs.window.Box().NewGroup("branches")
|
2024-02-14 00:19:36 -06:00
|
|
|
newgrid := rs.gitBranchesGroup.NewGrid("gridnuts", 0, 0)
|
2024-02-14 00:09:58 -06:00
|
|
|
|
|
|
|
rs.lasttag = gadgets.NewOneLiner(newgrid, "last tag")
|
2024-02-14 00:19:36 -06:00
|
|
|
newgrid.NextRow()
|
2024-02-14 00:09:58 -06:00
|
|
|
|
|
|
|
rs.masterBranchVersion = gadgets.NewOneLiner(newgrid, "master")
|
2024-02-14 00:19:36 -06:00
|
|
|
newgrid.NextRow()
|
2024-02-14 00:09:58 -06:00
|
|
|
rs.develBranchVersion = gadgets.NewOneLiner(newgrid, "devel")
|
2024-02-14 00:19:36 -06:00
|
|
|
newgrid.NextRow()
|
2024-02-14 00:09:58 -06:00
|
|
|
rs.userBranchVersion = gadgets.NewOneLiner(newgrid, "user")
|
2024-02-14 00:19:36 -06:00
|
|
|
newgrid.NextRow()
|
2024-02-14 00:09:58 -06:00
|
|
|
|
|
|
|
rs.currentBranch = gadgets.NewOneLiner(newgrid, "current branch")
|
2024-02-14 00:19:36 -06:00
|
|
|
newgrid.NextRow()
|
2024-02-14 00:09:58 -06:00
|
|
|
rs.currentVersion = gadgets.NewOneLiner(newgrid, "current version")
|
2024-02-14 00:19:36 -06:00
|
|
|
newgrid.NextRow()
|
2024-02-14 00:09:58 -06:00
|
|
|
|
|
|
|
rs.showBranchesButton = newgrid.NewButton("getBranches()", func() {
|
|
|
|
all := rs.getBranches()
|
|
|
|
i := len(all)
|
|
|
|
log.Log(WARN, "branch count =", i)
|
|
|
|
})
|
2024-02-14 00:19:36 -06:00
|
|
|
newgrid.NextRow()
|
2024-02-14 00:09:58 -06:00
|
|
|
|
|
|
|
rs.checkBranchesButton = newgrid.NewButton("CheckBranches()", func() {
|
|
|
|
if rs.CheckBranches() {
|
|
|
|
log.Log(WARN, "Branches are perfect")
|
|
|
|
} else {
|
|
|
|
log.Log(WARN, "Branches are not perfect")
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|