summaryrefslogtreecommitdiff
path: root/doPatch.go
diff options
context:
space:
mode:
Diffstat (limited to 'doPatch.go')
-rw-r--r--doPatch.go31
1 files changed, 20 insertions, 11 deletions
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