show problem totals
This commit is contained in:
parent
76143a6474
commit
9cc63ce391
|
@ -4,6 +4,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"go.wit.com/lib/gadgets"
|
"go.wit.com/lib/gadgets"
|
||||||
|
@ -92,20 +93,14 @@ func makeRepoProblemsWindow() *repoProblemsWindow {
|
||||||
}
|
}
|
||||||
makeStandardReposWindow(me.found)
|
makeStandardReposWindow(me.found)
|
||||||
})
|
})
|
||||||
|
var found *gitpb.Repos
|
||||||
|
var txt string
|
||||||
|
|
||||||
grid.NewButton("user branch is remote", func() {
|
found = remoteUserBranchProblem()
|
||||||
log.Info("not done yet")
|
txt = fmt.Sprintf("user branch is remote (%d)", found.Len())
|
||||||
me.found = new(gitpb.Repos)
|
grid.NewButton(txt, func() {
|
||||||
all := me.forge.Repos.SortByFullPath()
|
found := remoteUserBranchProblem()
|
||||||
for all.Scan() {
|
makeStandardReposWindow(found)
|
||||||
repo := all.Next()
|
|
||||||
username := repo.GetUserBranchName()
|
|
||||||
if repo.IsBranchRemote(username) {
|
|
||||||
me.found.AppendByGoPath(repo)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
makeStandardReposWindow(me.found)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
grid.NewButton("unknown branches", func() {
|
grid.NewButton("unknown branches", func() {
|
||||||
|
@ -113,14 +108,88 @@ func makeRepoProblemsWindow() *repoProblemsWindow {
|
||||||
})
|
})
|
||||||
grid.NextRow()
|
grid.NextRow()
|
||||||
|
|
||||||
grid.NewButton("remote devel != local devel", func() {
|
found = develRemoteProblem()
|
||||||
log.Info("not done yet")
|
txt = fmt.Sprintf("remote devel != local devel (%d)", found.Len())
|
||||||
|
grid.NewButton(txt, func() {
|
||||||
|
found := develRemoteProblem()
|
||||||
|
makeStandardReposWindow(found)
|
||||||
})
|
})
|
||||||
|
|
||||||
grid.NewButton("remote master != local master", func() {
|
found = masterRemoteProblem()
|
||||||
log.Info("not done yet")
|
txt = fmt.Sprintf("remote master != local master (%d)", found.Len())
|
||||||
|
grid.NewButton(txt, func() {
|
||||||
|
found := masterRemoteProblem()
|
||||||
|
makeStandardReposWindow(found)
|
||||||
})
|
})
|
||||||
grid.NextRow()
|
grid.NextRow()
|
||||||
|
|
||||||
return pw
|
return pw
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func remoteUserBranchProblem() *gitpb.Repos {
|
||||||
|
found := new(gitpb.Repos)
|
||||||
|
all := me.forge.Repos.SortByFullPath()
|
||||||
|
for all.Scan() {
|
||||||
|
repo := all.Next()
|
||||||
|
username := repo.GetUserBranchName()
|
||||||
|
if repo.IsBranchRemote(username) {
|
||||||
|
found.AppendByGoPath(repo)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return found
|
||||||
|
}
|
||||||
|
|
||||||
|
func develRemoteProblem() *gitpb.Repos {
|
||||||
|
found := new(gitpb.Repos)
|
||||||
|
all := me.forge.Repos.SortByFullPath()
|
||||||
|
for all.Scan() {
|
||||||
|
repo := all.Next()
|
||||||
|
brname := repo.GetDevelBranchName()
|
||||||
|
if !repo.IsBranchRemote(brname) {
|
||||||
|
// log.Info("repo does not have remote devel branch", repo.GetGoPath())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
lhash := repo.GetLocalHash(brname)
|
||||||
|
rhash := repo.GetRemoteHash(brname)
|
||||||
|
// log.Info(lhash, rhash, repo.GetGoPath())
|
||||||
|
if lhash == "" || rhash == "" {
|
||||||
|
// something is wrong if either of these are blank
|
||||||
|
found.AppendByGoPath(repo)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if lhash == rhash {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
found.AppendByGoPath(repo)
|
||||||
|
|
||||||
|
}
|
||||||
|
return found
|
||||||
|
}
|
||||||
|
|
||||||
|
func masterRemoteProblem() *gitpb.Repos {
|
||||||
|
found := new(gitpb.Repos)
|
||||||
|
all := me.forge.Repos.SortByFullPath()
|
||||||
|
for all.Scan() {
|
||||||
|
repo := all.Next()
|
||||||
|
brname := repo.GetMasterBranchName()
|
||||||
|
if !repo.IsBranchRemote(brname) {
|
||||||
|
// log.Info("repo does not have remote devel branch", repo.GetGoPath())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
lhash := repo.GetLocalHash(brname)
|
||||||
|
rhash := repo.GetRemoteHash(brname)
|
||||||
|
// log.Info(lhash, rhash, repo.GetGoPath())
|
||||||
|
if lhash == "" || rhash == "" {
|
||||||
|
// something is wrong if either of these are blank
|
||||||
|
found.AppendByGoPath(repo)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if lhash == rhash {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
found.AppendByGoPath(repo)
|
||||||
|
|
||||||
|
}
|
||||||
|
return found
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue