trying to verify new protobuf works
This commit is contained in:
parent
f3803d5929
commit
9a57a20ef7
1
Makefile
1
Makefile
|
@ -37,6 +37,7 @@ redomod:
|
||||||
GO111MODULE= go mod tidy
|
GO111MODULE= go mod tidy
|
||||||
|
|
||||||
list: build
|
list: build
|
||||||
|
reset
|
||||||
./forge --list
|
./forge --list
|
||||||
|
|
||||||
list-config: build
|
list-config: build
|
||||||
|
|
1
argv.go
1
argv.go
|
@ -9,6 +9,7 @@ var argv args
|
||||||
type args struct {
|
type args struct {
|
||||||
List bool `arg:"--list" help:"list found repos"`
|
List bool `arg:"--list" help:"list found repos"`
|
||||||
ListConf bool `arg:"--list-conf" help:"list your .config/forge/ configuration"`
|
ListConf bool `arg:"--list-conf" help:"list your .config/forge/ configuration"`
|
||||||
|
ReadOnly bool `arg:"--read-only" help:"include read-only repos"`
|
||||||
GetMine bool `arg:"--mine" help:"download private and writeable repos"`
|
GetMine bool `arg:"--mine" help:"download private and writeable repos"`
|
||||||
GetFav bool `arg:"--favorites" help:"download repos marked as favorites"`
|
GetFav bool `arg:"--favorites" help:"download repos marked as favorites"`
|
||||||
Pull bool `arg:"--git-pull" help:"run 'git pull' on all your repos"`
|
Pull bool `arg:"--git-pull" help:"run 'git pull' on all your repos"`
|
||||||
|
|
19
list.go
19
list.go
|
@ -1,6 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
|
@ -16,11 +17,25 @@ func list() {
|
||||||
repos := me.forge.Repos.SortByGoPath()
|
repos := me.forge.Repos.SortByGoPath()
|
||||||
for repos.Scan() {
|
for repos.Scan() {
|
||||||
repo := repos.Next()
|
repo := repos.Next()
|
||||||
|
var rtype string
|
||||||
if !repo.IsValid() {
|
if !repo.IsValid() {
|
||||||
log.Printf("%10s %-50s", "old?", repo.GetGoPath())
|
rtype = "rm?"
|
||||||
|
continue
|
||||||
|
} else {
|
||||||
|
rtype = repo.RepoType()
|
||||||
|
}
|
||||||
|
if me.forge.IsReadOnly(repo.GetGoPath()) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
log.Printf("%10s %-50s", repo.RepoType(), repo.GetGoPath())
|
var end string
|
||||||
|
if repo.CheckDirty() {
|
||||||
|
end += "(dirty) "
|
||||||
|
}
|
||||||
|
mver := repo.GetMasterVersion()
|
||||||
|
dver := repo.GetDevelVersion()
|
||||||
|
uver := repo.GetUserVersion()
|
||||||
|
s := fmt.Sprintf("%-50s %-8s %-10s %-10s %-10s", repo.GetGoPath(), rtype, mver, dver, uver)
|
||||||
|
log.Info(s, end)
|
||||||
}
|
}
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ import (
|
||||||
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
"go.wit.com/lib/gadgets"
|
"go.wit.com/lib/gadgets"
|
||||||
"go.wit.com/lib/gui/gowit"
|
|
||||||
"go.wit.com/lib/gui/repolist"
|
"go.wit.com/lib/gui/repolist"
|
||||||
"go.wit.com/lib/gui/shell"
|
"go.wit.com/lib/gui/shell"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
|
@ -57,10 +56,11 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
|
||||||
|
|
||||||
s.grid.NewButton("Update Patch Counts", func() {
|
s.grid.NewButton("Update Patch Counts", func() {
|
||||||
var repocount, patchcount int
|
var repocount, patchcount int
|
||||||
loop := me.repos.View.UnmergedRepos()
|
// broken after move to forge protobuf
|
||||||
|
loop := me.forge.Repos.SortByGoPath()
|
||||||
for loop.Scan() {
|
for loop.Scan() {
|
||||||
repo := loop.Repo()
|
repo := loop.Next()
|
||||||
if repo.ReadOnly() {
|
if repo.GetReadOnly() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
i, _ := repo.GetMasterPatches()
|
i, _ := repo.GetMasterPatches()
|
||||||
|
@ -74,10 +74,11 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
|
||||||
|
|
||||||
repocount = 0
|
repocount = 0
|
||||||
patchcount = 0
|
patchcount = 0
|
||||||
loop = me.repos.View.UnmergedRepos()
|
// broken after move to forge protobuf
|
||||||
|
loop = me.forge.Repos.SortByGoPath()
|
||||||
for loop.Scan() {
|
for loop.Scan() {
|
||||||
repo := loop.Repo()
|
repo := loop.Next()
|
||||||
if repo.ReadOnly() {
|
if repo.GetReadOnly() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
i, _ := repo.GetUserPatches()
|
i, _ := repo.GetUserPatches()
|
||||||
|
@ -175,6 +176,7 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
|
||||||
s.submitB.Disable()
|
s.submitB.Disable()
|
||||||
s.grid.NextRow()
|
s.grid.NextRow()
|
||||||
|
|
||||||
|
/*
|
||||||
// map a path to gitea
|
// map a path to gitea
|
||||||
s.unknownOL = gadgets.NewBasicEntry(s.grid, "Unknown Repo:")
|
s.unknownOL = gadgets.NewBasicEntry(s.grid, "Unknown Repo:")
|
||||||
s.unknownSubmitB = s.grid.NewButton("map new repo path", func() {
|
s.unknownSubmitB = s.grid.NewButton("map new repo path", func() {
|
||||||
|
@ -185,7 +187,7 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
localurl := repo.Status.GitURL()
|
localurl := repo.GetURL()
|
||||||
log.Info("found repo:", repo.GoPath(), "with giturl", localurl)
|
log.Info("found repo:", repo.GoPath(), "with giturl", localurl)
|
||||||
if localurl == "" {
|
if localurl == "" {
|
||||||
log.Info("local repo check failed. repo")
|
log.Info("local repo check failed. repo")
|
||||||
|
@ -200,6 +202,7 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
*/
|
||||||
s.unknownOL.Disable()
|
s.unknownOL.Disable()
|
||||||
s.unknownSubmitB.Disable()
|
s.unknownSubmitB.Disable()
|
||||||
s.grid.NextRow()
|
s.grid.NextRow()
|
||||||
|
@ -212,31 +215,29 @@ func (s *patchSummary) Update() {
|
||||||
var total, totalgo, dirty, readonly int
|
var total, totalgo, dirty, readonly int
|
||||||
var userT, develT, masterT int
|
var userT, develT, masterT int
|
||||||
// var userP, develP, masterP 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() {
|
for loop.Scan() {
|
||||||
repo := loop.Repo()
|
repo := loop.Next()
|
||||||
total += 1
|
total += 1
|
||||||
if repo.Status.IsDirty() {
|
if repo.IsDirty() {
|
||||||
dirty += 1
|
dirty += 1
|
||||||
}
|
}
|
||||||
if repo.Status.IsGoLang() {
|
if repo.GetReadOnly() {
|
||||||
totalgo += 1
|
|
||||||
}
|
|
||||||
if repo.Status.ReadOnly() {
|
|
||||||
readonly += 1
|
readonly += 1
|
||||||
// don't count these in any further stats
|
// don't count these in any further stats
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// compute which GUI repos are out of sync with master
|
// compute which GUI repos are out of sync with master
|
||||||
userV := repo.Status.GetUserVersion()
|
userV := repo.GetUserVersion()
|
||||||
develV := repo.Status.GetDevelVersion()
|
develV := repo.GetDevelVersion()
|
||||||
masterV := repo.Status.GetMasterVersion()
|
masterV := repo.GetMasterVersion()
|
||||||
lastV := repo.Status.GetLastTagVersion()
|
lastV := repo.GetLastTagVersion()
|
||||||
if userV != develV {
|
if userV != develV {
|
||||||
userT += 1
|
userT += 1
|
||||||
}
|
}
|
||||||
if develV != masterV {
|
if develV != masterV {
|
||||||
log.Info("develV != masterV", develV, masterV, repo.GoPath())
|
log.Info("develV != masterV", develV, masterV, repo.GetGoPath())
|
||||||
develT += 1
|
develT += 1
|
||||||
}
|
}
|
||||||
if masterV != lastV {
|
if masterV != lastV {
|
||||||
|
|
Loading…
Reference in New Issue