diff options
| -rw-r--r-- | doGui.go | 10 | ||||
| -rw-r--r-- | doPatch.go | 31 |
2 files changed, 30 insertions, 11 deletions
@@ -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) } @@ -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 |
