marks patchsets as defective and remembers that
This commit is contained in:
parent
a491579a6d
commit
b60e7aa98b
10
doGui.go
10
doGui.go
|
@ -6,9 +6,11 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"os/user"
|
"os/user"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"time"
|
||||||
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
"go.wit.com/lib/gadgets"
|
"go.wit.com/lib/gadgets"
|
||||||
|
"go.wit.com/lib/gui/shell"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -38,11 +40,19 @@ func doGui() {
|
||||||
mainWindow.Show()
|
mainWindow.Show()
|
||||||
mainWindow.Custom = func() {
|
mainWindow.Custom = func() {
|
||||||
log.Warn("MAIN WINDOW CLOSE")
|
log.Warn("MAIN WINDOW CLOSE")
|
||||||
|
now := time.Now()
|
||||||
count := me.forge.RillReload()
|
count := me.forge.RillReload()
|
||||||
log.Info("Repo Reload count =", count)
|
log.Info("Repo Reload count =", count)
|
||||||
if count != 0 {
|
if count != 0 {
|
||||||
me.forge.ConfigSave()
|
me.forge.ConfigSave()
|
||||||
}
|
}
|
||||||
|
// this is just interesting to see how fast it is on various boxes
|
||||||
|
// and with how many repos you are working with. On my current laptop
|
||||||
|
// I have 320 repos and when I'm using it and most things are in memory
|
||||||
|
// cache, it takes around
|
||||||
|
// 13G 424266 total files
|
||||||
|
|
||||||
|
log.Printf("rill repos.Reload() took (%s)\n", shell.FormatDuration(time.Since(now)))
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
31
doPatch.go
31
doPatch.go
|
@ -37,7 +37,7 @@ func doPatch() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func doPatchList() error {
|
func doPatchList() error {
|
||||||
psets, err := me.forge.GetPatchesets()
|
psets, err := openPatchsets()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Info("Get Patchsets failed", err)
|
log.Info("Get Patchsets failed", err)
|
||||||
return err
|
return err
|
||||||
|
@ -46,13 +46,13 @@ func doPatchList() error {
|
||||||
all := psets.SortByName()
|
all := psets.SortByName()
|
||||||
for all.Scan() {
|
for all.Scan() {
|
||||||
pset := all.Next()
|
pset := all.Next()
|
||||||
log.Info("pset name =", pset.Name)
|
// log.Info("pset name =", pset.Name)
|
||||||
dumpPatchset(pset)
|
dumpPatchset(pset)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := savePatchsets(psets); err != nil {
|
// if err := savePatchsets(psets); err != nil {
|
||||||
return err
|
// return err
|
||||||
}
|
// }
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,12 +94,21 @@ func openPatchsets() (*forgepb.Patchsets, error) {
|
||||||
// returns bad if patches can not be applied
|
// returns bad if patches can not be applied
|
||||||
// logic is not great here but it was a first pass
|
// logic is not great here but it was a first pass
|
||||||
func dumpPatchset(pset *forgepb.Patchset) bool {
|
func dumpPatchset(pset *forgepb.Patchset) bool {
|
||||||
log.Info("applyPatches() NAME", pset.Name)
|
|
||||||
log.Info("applyPatches() COMMENT", pset.Comment)
|
// don't even bother to continue if we already know it's broken
|
||||||
log.Info("applyPatches() GIT_AUTHOR_NAME", pset.GetGitAuthorName())
|
if pset.State == "BROKEN" {
|
||||||
log.Info("applyPatches() GIT_AUTHOR_EMAIL", pset.GetGitAuthorEmail())
|
log.Printf("Patchset Name: %-24s Author: %s <%s> IS BAD\n", pset.Name, pset.GetGitAuthorName(), pset.GetGitAuthorEmail())
|
||||||
log.Info("applyPatches() Branch Name", pset.GetStartBranchName())
|
return false
|
||||||
log.Info("applyPatches() Start Hash", pset.GetStartBranchHash())
|
} else {
|
||||||
|
log.Printf("Patchset Name: %-24s Author: %s <%s> IS GOOD\n", pset.Name, pset.GetGitAuthorName(), pset.GetGitAuthorEmail())
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
log.Info("applyPatches() State", pset.State)
|
||||||
|
log.Info("applyPatches() COMMENT", pset.Comment)
|
||||||
|
log.Info("applyPatches() Branch Name", pset.GetStartBranchName())
|
||||||
|
log.Info("applyPatches() Start Hash", pset.GetStartBranchHash())
|
||||||
|
*/
|
||||||
|
|
||||||
var count int
|
var count int
|
||||||
var bad int
|
var bad int
|
||||||
|
|
Loading…
Reference in New Issue