summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-30 18:46:35 -0600
committerJeff Carr <[email protected]>2025-01-30 18:46:35 -0600
commitb60e7aa98b9d11ea441f6bc8c3e9c12a4a3c7966 (patch)
tree032b174c3ad2c6c0a36315c547e5cc7bc1d0e2c5
parenta491579a6dca359308259177977e0c36e69bf0f9 (diff)
marks patchsets as defective and remembers that
-rw-r--r--doGui.go10
-rw-r--r--doPatch.go31
2 files changed, 30 insertions, 11 deletions
diff --git a/doGui.go b/doGui.go
index bc0fbdd..955d664 100644
--- a/doGui.go
+++ b/doGui.go
@@ -6,9 +6,11 @@ import (
"os"
"os/user"
"path/filepath"
+ "time"
"go.wit.com/gui"
"go.wit.com/lib/gadgets"
+ "go.wit.com/lib/gui/shell"
"go.wit.com/log"
)
@@ -38,11 +40,19 @@ func doGui() {
mainWindow.Show()
mainWindow.Custom = func() {
log.Warn("MAIN WINDOW CLOSE")
+ now := time.Now()
count := me.forge.RillReload()
log.Info("Repo Reload count =", count)
if count != 0 {
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)
}
diff --git a/doPatch.go b/doPatch.go
index 345c361..4fd3330 100644
--- a/doPatch.go
+++ b/doPatch.go
@@ -37,7 +37,7 @@ func doPatch() error {
}
func doPatchList() error {
- psets, err := me.forge.GetPatchesets()
+ psets, err := openPatchsets()
if err != nil {
log.Info("Get Patchsets failed", err)
return err
@@ -46,13 +46,13 @@ func doPatchList() error {
all := psets.SortByName()
for all.Scan() {
pset := all.Next()
- log.Info("pset name =", pset.Name)
+ // log.Info("pset name =", pset.Name)
dumpPatchset(pset)
}
- if err := savePatchsets(psets); err != nil {
- return err
- }
+ // if err := savePatchsets(psets); err != nil {
+ // return err
+ // }
return nil
}
@@ -94,12 +94,21 @@ func openPatchsets() (*forgepb.Patchsets, error) {
// returns bad if patches can not be applied
// logic is not great here but it was a first pass
func dumpPatchset(pset *forgepb.Patchset) bool {
- log.Info("applyPatches() NAME", pset.Name)
- log.Info("applyPatches() COMMENT", pset.Comment)
- log.Info("applyPatches() GIT_AUTHOR_NAME", pset.GetGitAuthorName())
- log.Info("applyPatches() GIT_AUTHOR_EMAIL", pset.GetGitAuthorEmail())
- log.Info("applyPatches() Branch Name", pset.GetStartBranchName())
- log.Info("applyPatches() Start Hash", pset.GetStartBranchHash())
+
+ // don't even bother to continue if we already know it's broken
+ if pset.State == "BROKEN" {
+ log.Printf("Patchset Name: %-24s Author: %s <%s> IS BAD\n", pset.Name, pset.GetGitAuthorName(), pset.GetGitAuthorEmail())
+ return false
+ } 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 bad int