simple UI changes
This commit is contained in:
parent
cd7d256a80
commit
4d1d02cc1a
4
Makefile
4
Makefile
|
@ -2,12 +2,12 @@ VERSION = $(shell git describe --tags)
|
||||||
BUILDTIME = $(shell date +%Y.%m.%d)
|
BUILDTIME = $(shell date +%Y.%m.%d)
|
||||||
|
|
||||||
info: install
|
info: install
|
||||||
# make dirty
|
|
||||||
@echo "make restart # remove the repos.pb file"
|
@echo "make restart # remove the repos.pb file"
|
||||||
@echo "make private # only the private ones"
|
@echo "make private # only the private ones"
|
||||||
@echo "make mine # just show my repos"
|
@echo "make mine # just show my repos"
|
||||||
@echo "make pull # run git pull on every repo"
|
@echo "make pull-mine # run git pull on my repos"
|
||||||
@echo "make dirty # CheckDirty()"
|
@echo "make dirty # CheckDirty()"
|
||||||
|
forge
|
||||||
|
|
||||||
vet:
|
vet:
|
||||||
@GO111MODULE=off go vet
|
@GO111MODULE=off go vet
|
||||||
|
|
181
windowPatches.go
181
windowPatches.go
|
@ -1,6 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
|
@ -9,28 +10,17 @@ import (
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
/*
|
|
||||||
type patch struct {
|
|
||||||
ref string
|
|
||||||
giturl string
|
|
||||||
comment string
|
|
||||||
rs *repostatus.RepoStatus
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
type patchSummary struct {
|
type patchSummary struct {
|
||||||
grid *gui.Node
|
grid *gui.Node
|
||||||
updateB *gui.Node
|
updateB *gui.Node
|
||||||
docsB *gui.Node
|
docsB *gui.Node
|
||||||
gitPushB *gui.Node
|
gitPushB *gui.Node
|
||||||
gitPullB *gui.Node
|
gitPullB *gui.Node
|
||||||
checkB *gui.Node
|
checkB *gui.Node
|
||||||
|
totalOL *gadgets.OneLiner
|
||||||
// stats
|
|
||||||
totalOL *gadgets.OneLiner
|
|
||||||
// totalGoOL *gadgets.OneLiner
|
|
||||||
dirtyOL *gadgets.OneLiner
|
dirtyOL *gadgets.OneLiner
|
||||||
readonlyOL *gadgets.OneLiner
|
readonlyOL *gadgets.OneLiner
|
||||||
|
rw *gadgets.OneLiner
|
||||||
totalPatchesOL *gadgets.OneLiner
|
totalPatchesOL *gadgets.OneLiner
|
||||||
totalUserRepos *gui.Node
|
totalUserRepos *gui.Node
|
||||||
totalDevelRepos *gui.Node
|
totalDevelRepos *gui.Node
|
||||||
|
@ -38,13 +28,12 @@ type patchSummary struct {
|
||||||
totalUserPatches *gui.Node
|
totalUserPatches *gui.Node
|
||||||
totalDevelPatches *gui.Node
|
totalDevelPatches *gui.Node
|
||||||
totalMasterPatches *gui.Node
|
totalMasterPatches *gui.Node
|
||||||
|
fileCount *gui.Node
|
||||||
// patch set generation
|
unknownOL *gadgets.BasicEntry
|
||||||
unknownOL *gadgets.BasicEntry
|
unknownSubmitB *gui.Node
|
||||||
unknownSubmitB *gui.Node
|
reason *gadgets.BasicEntry
|
||||||
reason *gadgets.BasicEntry
|
submitB *gui.Node
|
||||||
submitB *gui.Node
|
allp []*repolist.Patch
|
||||||
allp []*repolist.Patch
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func submitPatchesBox(box *gui.Node) *patchSummary {
|
func submitPatchesBox(box *gui.Node) *patchSummary {
|
||||||
|
@ -52,98 +41,24 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
|
||||||
group1 := box.NewGroup("Patch Summary")
|
group1 := box.NewGroup("Patch Summary")
|
||||||
s.grid = group1.RawGrid()
|
s.grid = group1.RawGrid()
|
||||||
|
|
||||||
/*
|
|
||||||
s.grid.NewButton("Update Patch Counts", func() {
|
|
||||||
var repocount, patchcount int
|
|
||||||
// broken after move to forge protobuf
|
|
||||||
all := me.forge.Repos.SortByFullPath()
|
|
||||||
for all.Scan() {
|
|
||||||
repo := all.Next()
|
|
||||||
if repo.GetReadOnly() {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
i, _ := repo.GetMasterPatches()
|
|
||||||
patchcount += i
|
|
||||||
if i > 0 {
|
|
||||||
repocount += 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
s.totalMasterPatches.SetText(strconv.Itoa(patchcount) + " patches")
|
|
||||||
s.totalMasterRepos.SetText(strconv.Itoa(repocount) + " go repos")
|
|
||||||
|
|
||||||
repocount = 0
|
|
||||||
patchcount = 0
|
|
||||||
// broken after move to forge protobuf
|
|
||||||
all = me.forge.Repos.SortByFullPath()
|
|
||||||
for all.Scan() {
|
|
||||||
repo := all.Next()
|
|
||||||
if repo.GetReadOnly() {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
i, _ := repo.GetUserPatches()
|
|
||||||
patchcount += i
|
|
||||||
if i > 0 {
|
|
||||||
repocount += 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
s.totalUserPatches.SetText(strconv.Itoa(patchcount) + " patches")
|
|
||||||
s.totalUserRepos.SetText(strconv.Itoa(repocount) + " go repos")
|
|
||||||
})
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* this used to be the way and should probably be revisited
|
|
||||||
s.grid.NewButton("Make Patches", func() {
|
|
||||||
for i, p := range s.allp {
|
|
||||||
log.Info(i, p.Ref, p.RS.String())
|
|
||||||
}
|
|
||||||
})
|
|
||||||
*/
|
|
||||||
|
|
||||||
s.grid.NextRow()
|
|
||||||
|
|
||||||
s.totalOL = gadgets.NewOneLiner(s.grid, "Total")
|
s.totalOL = gadgets.NewOneLiner(s.grid, "Total")
|
||||||
|
_ = s.grid.NewLabel("total changes")
|
||||||
|
_ = s.grid.NewLabel("user to devel")
|
||||||
s.grid.NextRow()
|
s.grid.NextRow()
|
||||||
|
|
||||||
// s.totalGoOL = gadgets.NewOneLiner(s.grid, "Total GO")
|
|
||||||
// s.grid.NextRow()
|
|
||||||
|
|
||||||
s.dirtyOL = gadgets.NewOneLiner(s.grid, "dirty")
|
s.dirtyOL = gadgets.NewOneLiner(s.grid, "dirty")
|
||||||
|
_ = s.grid.NewLabel("") // skip a column
|
||||||
|
s.totalUserRepos = s.grid.NewLabel("x go repos")
|
||||||
s.grid.NextRow()
|
s.grid.NextRow()
|
||||||
|
|
||||||
s.readonlyOL = gadgets.NewOneLiner(s.grid, "read-only")
|
s.readonlyOL = gadgets.NewOneLiner(s.grid, "read-only")
|
||||||
s.grid.NextRow()
|
_ = s.grid.NewLabel("") // skip a column
|
||||||
|
|
||||||
// s.grid = group1.RawGrid()
|
|
||||||
s.grid.NewLabel("")
|
|
||||||
s.grid.NewLabel("")
|
|
||||||
s.grid.NewLabel("user to devel")
|
|
||||||
s.grid.NewLabel("devel to master")
|
|
||||||
s.grid.NewLabel("master to last tag")
|
|
||||||
s.grid.NextRow()
|
|
||||||
|
|
||||||
s.grid.NewLabel("total modified")
|
|
||||||
s.grid.NewLabel("")
|
|
||||||
s.totalUserRepos = s.grid.NewLabel("x go repos")
|
|
||||||
s.totalDevelRepos = s.grid.NewLabel("")
|
|
||||||
s.totalMasterRepos = s.grid.NewLabel("x go repos")
|
|
||||||
s.grid.NextRow()
|
|
||||||
|
|
||||||
s.totalPatchesOL = gadgets.NewOneLiner(s.grid, "total commits")
|
|
||||||
s.totalUserPatches = s.grid.NewLabel("x patches")
|
s.totalUserPatches = s.grid.NewLabel("x patches")
|
||||||
s.totalDevelPatches = s.grid.NewLabel("")
|
|
||||||
s.totalMasterPatches = s.grid.NewLabel("x patches")
|
|
||||||
s.grid.NextRow()
|
s.grid.NextRow()
|
||||||
|
|
||||||
/*
|
s.rw = gadgets.NewOneLiner(s.grid, "r/w")
|
||||||
s.grid.NewLabel("")
|
_ = s.grid.NewLabel("") // skip a column
|
||||||
s.grid.NewLabel("")
|
s.fileCount = s.grid.NewLabel("x files")
|
||||||
s.grid.NewButton("merge from user", func() {
|
|
||||||
log.Info("this should make a patchset of your patches")
|
|
||||||
})
|
|
||||||
s.grid.NewButton("merge from devel", func() {
|
|
||||||
log.Info("this probably should not exist")
|
|
||||||
})
|
|
||||||
*/
|
|
||||||
s.grid.NextRow()
|
s.grid.NextRow()
|
||||||
|
|
||||||
group1 = box.NewGroup("Submit Patch Set")
|
group1 = box.NewGroup("Submit Patch Set")
|
||||||
|
@ -213,27 +128,18 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/*
|
|
||||||
s.submitB = s.grid.NewButton("Submit quilt", func() {
|
|
||||||
log.Info("do a submit here")
|
|
||||||
})
|
|
||||||
*/
|
|
||||||
// disable these until there are not dirty repos
|
// disable these until there are not dirty repos
|
||||||
// s.reason.Disable()
|
// s.reason.Disable()
|
||||||
s.submitB.Disable()
|
s.submitB.Disable()
|
||||||
s.grid.NextRow()
|
s.grid.NextRow()
|
||||||
|
|
||||||
// s.unknownOL.Disable()
|
|
||||||
// s.unknownSubmitB.Disable()
|
|
||||||
s.grid.NextRow()
|
|
||||||
|
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// does not run any commands
|
// does not run any commands
|
||||||
func (s *patchSummary) Update() {
|
func (s *patchSummary) Update() {
|
||||||
var total, dirty, readonly int
|
var total, dirty, readonly, rw int
|
||||||
var userT, develT, masterT int
|
var userT int // , develT, masterT int
|
||||||
// var userP, develP, masterP int
|
// var userP, develP, masterP int
|
||||||
// broken after move to forge protobuf
|
// broken after move to forge protobuf
|
||||||
all := me.forge.Repos.SortByFullPath()
|
all := me.forge.Repos.SortByFullPath()
|
||||||
|
@ -243,45 +149,16 @@ func (s *patchSummary) Update() {
|
||||||
if repo.IsDirty() {
|
if repo.IsDirty() {
|
||||||
dirty += 1
|
dirty += 1
|
||||||
}
|
}
|
||||||
if repo.GetReadOnly() {
|
if me.forge.Config.IsReadOnly(repo.GetGoPath()) {
|
||||||
readonly += 1
|
readonly += 1
|
||||||
// don't count these in any further stats
|
} else {
|
||||||
continue
|
rw += 1
|
||||||
}
|
|
||||||
// compute which GUI repos are out of sync with master
|
|
||||||
userV := repo.GetUserVersion()
|
|
||||||
develV := repo.GetDevelVersion()
|
|
||||||
masterV := repo.GetMasterVersion()
|
|
||||||
lastV := repo.GetLastTagVersion()
|
|
||||||
if userV != develV {
|
|
||||||
userT += 1
|
|
||||||
}
|
|
||||||
if develV != masterV {
|
|
||||||
log.Info("develV != masterV", develV, masterV, repo.GetGoPath())
|
|
||||||
develT += 1
|
|
||||||
}
|
|
||||||
if masterV != lastV {
|
|
||||||
masterT += 1
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s.totalOL.SetText(strconv.Itoa(total) + " repos")
|
s.totalOL.SetText(strconv.Itoa(total) + " repos")
|
||||||
// s.totalGoOL.SetText(strconv.Itoa(totalgo) + " repos")
|
|
||||||
s.dirtyOL.SetText(strconv.Itoa(dirty) + " repos")
|
s.dirtyOL.SetText(strconv.Itoa(dirty) + " repos")
|
||||||
s.readonlyOL.SetText(strconv.Itoa(readonly) + " repos")
|
s.readonlyOL.SetText(strconv.Itoa(readonly) + " repos")
|
||||||
|
s.rw.SetText(fmt.Sprintf("%d repos", rw))
|
||||||
|
|
||||||
s.totalUserRepos.SetText(strconv.Itoa(userT) + " repos")
|
s.totalUserRepos.SetText(strconv.Itoa(userT) + " repos")
|
||||||
s.totalDevelRepos.SetText(strconv.Itoa(develT) + " repos")
|
|
||||||
s.totalMasterRepos.SetText(strconv.Itoa(masterT) + " repos")
|
|
||||||
|
|
||||||
if dirty == 0 {
|
|
||||||
s.reason.Enable()
|
|
||||||
s.submitB.Enable()
|
|
||||||
// s.unknownOL.Enable()
|
|
||||||
// s.unknownSubmitB.Enable()
|
|
||||||
} else {
|
|
||||||
// s.reason.Disable()
|
|
||||||
s.submitB.Enable()
|
|
||||||
// s.unknownOL.Enable()
|
|
||||||
// s.unknownSubmitB.Enable()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue