summaryrefslogtreecommitdiff
path: root/submitPatches.go
diff options
context:
space:
mode:
Diffstat (limited to 'submitPatches.go')
-rw-r--r--submitPatches.go85
1 files changed, 43 insertions, 42 deletions
diff --git a/submitPatches.go b/submitPatches.go
index f2e7842..30ba9b3 100644
--- a/submitPatches.go
+++ b/submitPatches.go
@@ -6,7 +6,6 @@ import (
"go.wit.com/gui"
"go.wit.com/lib/gadgets"
- "go.wit.com/lib/gui/gowit"
"go.wit.com/lib/gui/repolist"
"go.wit.com/lib/gui/shell"
"go.wit.com/log"
@@ -57,10 +56,11 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
s.grid.NewButton("Update Patch Counts", func() {
var repocount, patchcount int
- loop := me.repos.View.UnmergedRepos()
+ // broken after move to forge protobuf
+ loop := me.forge.Repos.SortByGoPath()
for loop.Scan() {
- repo := loop.Repo()
- if repo.ReadOnly() {
+ repo := loop.Next()
+ if repo.GetReadOnly() {
continue
}
i, _ := repo.GetMasterPatches()
@@ -74,10 +74,11 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
repocount = 0
patchcount = 0
- loop = me.repos.View.UnmergedRepos()
+ // broken after move to forge protobuf
+ loop = me.forge.Repos.SortByGoPath()
for loop.Scan() {
- repo := loop.Repo()
- if repo.ReadOnly() {
+ repo := loop.Next()
+ if repo.GetReadOnly() {
continue
}
i, _ := repo.GetUserPatches()
@@ -175,31 +176,33 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
s.submitB.Disable()
s.grid.NextRow()
- // map a path to gitea
- s.unknownOL = gadgets.NewBasicEntry(s.grid, "Unknown Repo:")
- s.unknownSubmitB = s.grid.NewButton("map new repo path", func() {
- log.Info("Submit repo:", s.unknownOL.String())
- repo := me.repos.View.FindRepo(s.unknownOL.String())
- if repo == nil {
- log.Info("could not find repo:", s.unknownOL.String(), "in ~/go/src")
- return
- }
+ /*
+ // map a path to gitea
+ s.unknownOL = gadgets.NewBasicEntry(s.grid, "Unknown Repo:")
+ s.unknownSubmitB = s.grid.NewButton("map new repo path", func() {
+ log.Info("Submit repo:", s.unknownOL.String())
+ repo := me.repos.View.FindRepo(s.unknownOL.String())
+ if repo == nil {
+ log.Info("could not find repo:", s.unknownOL.String(), "in ~/go/src")
+ return
+ }
- localurl := repo.Status.GitURL()
- log.Info("found repo:", repo.GoPath(), "with giturl", localurl)
- if localurl == "" {
- log.Info("local repo check failed. repo")
- } else {
- log.Info("local repo has", localurl)
- // check if go.wit.com works, if not, add it
- // attempts to register the unknown repo
- if gowit.Register(repo.GoPath(), localurl) {
- // todo: check if this works
- // s.unknownOL.Hide()
- // s.unknownSubmitB.Hide()
+ localurl := repo.GetURL()
+ log.Info("found repo:", repo.GoPath(), "with giturl", localurl)
+ if localurl == "" {
+ log.Info("local repo check failed. repo")
+ } else {
+ log.Info("local repo has", localurl)
+ // check if go.wit.com works, if not, add it
+ // attempts to register the unknown repo
+ if gowit.Register(repo.GoPath(), localurl) {
+ // todo: check if this works
+ // s.unknownOL.Hide()
+ // s.unknownSubmitB.Hide()
+ }
}
- }
- })
+ })
+ */
s.unknownOL.Disable()
s.unknownSubmitB.Disable()
s.grid.NextRow()
@@ -212,31 +215,29 @@ func (s *patchSummary) Update() {
var total, totalgo, dirty, readonly int
var userT, develT, masterT int
// var userP, develP, masterP int
- loop := me.repos.View.UnmergedRepos()
+ // broken after move to forge protobuf
+ loop := me.forge.Repos.SortByGoPath()
for loop.Scan() {
- repo := loop.Repo()
+ repo := loop.Next()
total += 1
- if repo.Status.IsDirty() {
+ if repo.IsDirty() {
dirty += 1
}
- if repo.Status.IsGoLang() {
- totalgo += 1
- }
- if repo.Status.ReadOnly() {
+ if repo.GetReadOnly() {
readonly += 1
// don't count these in any further stats
continue
}
// compute which GUI repos are out of sync with master
- userV := repo.Status.GetUserVersion()
- develV := repo.Status.GetDevelVersion()
- masterV := repo.Status.GetMasterVersion()
- lastV := repo.Status.GetLastTagVersion()
+ 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.GoPath())
+ log.Info("develV != masterV", develV, masterV, repo.GetGoPath())
develT += 1
}
if masterV != lastV {