diff options
Diffstat (limited to 'doPatch.go')
| -rw-r--r-- | doPatch.go | 27 |
1 files changed, 11 insertions, 16 deletions
@@ -103,33 +103,28 @@ func doPatch() error { var changed bool newpatches := forgepb.NewPatches() for pset := range me.forge.Patchsets.IterAll() { - log.Info(pset.Uuid) + pset.PrintTable() for patch := range pset.Patches.IterAll() { - if setNewCommitHash(patch) { - changed = true + if err := setNewCommitHash(patch); err != nil { + log.Infof("%s bad check on patch failure %v\n", patch.Filename, err) + return err } - if patch.NewHash == "na" { - newpatches.Append(patch) - log.Info("apply this patch?") - } - } - - /* - for patch := range pset.Patches.IterAll() { - if repo, ok := me.forge.IsPatchApplied(patch); ok { - log.Info("\tfound patch in repo", repo.Namespace, patch.Filename) + changed = true + if patch.NewHash == "" { + if newpatches.AppendByPatchId(patch) { + log.Info("patchId added here", patch.PatchId) } else { - log.Info("\tdid not find patch", patch.CommitHash, patch.NewHash, patch.Filename) + log.Info("patchId already here", patch.PatchId) } } - */ + } } if changed { if err := me.forge.SavePatchsets(); err != nil { log.Warn("savePatchsets() failed", err) } } - me.forge.Patchsets.PrintTable() + newpatches.PrintTable() if newpatches.Len() != 0 { for patch := range newpatches.IterAll() { log.Info("new patch:", patch.CommitHash, patch.NewHash, patch.Filename) |
