diff options
| author | Jeff Carr <[email protected]> | 2025-09-06 17:14:46 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-06 17:14:46 -0500 |
| commit | 1087b39f9ccedd3042f2f8d884b281b535cbb93c (patch) | |
| tree | aaa6294b09a8bdf6a9354d22789f44167b844e1d | |
| parent | 893c88bbf5d6aea99b7b6dfd28b590a3d65b1eeb (diff) | |
start reporting applied patchesv0.22.144
| -rw-r--r-- | doMerge.go | 2 | ||||
| -rw-r--r-- | doPatch.go | 9 | ||||
| -rw-r--r-- | helperPatches.go | 31 |
3 files changed, 40 insertions, 2 deletions
@@ -38,8 +38,6 @@ func doMergeDevel() (*gitpb.Repos, error) { break } done.Append(repo) - // only do one at a time. to debug this - break } configSave = true return done, err @@ -81,6 +81,15 @@ func doPatch() error { } me.forge.Patchsets.PrintTable() // return doPatchList() + applied := findApplied() + // for patch := range applied.IterAll() { + // log.Info("SEND APPLIED: newhash:", patch.NewHash, "commithash:", patch.CommitHash, "patch", patch.Namespace) + // } + newpb, err := applied.HttpPostVerbose(myServer(), "applied") + if err != nil { + return err + } + newpb.PrintTable() return nil } diff --git a/helperPatches.go b/helperPatches.go index 2d2d90c..d6e07d7 100644 --- a/helperPatches.go +++ b/helperPatches.go @@ -309,3 +309,34 @@ func findExpired() *forgepb.Patches { return found } + +func findApplied() *forgepb.Patches { + var pset *forgepb.Patches + for found := range me.forge.Patchsets.IterAll() { + if found.Name == "forge auto commit" { + pset = found.Patches + } + } + + if pset == nil { + log.Info("failed to find 'forge auto commit'") + return pset + } + + found := forgepb.NewPatches() + + for patch := range pset.IterAll() { + cmd := []string{"git", "merge-base", "--is-ancestor", patch.CommitHash, "devel"} + repo := me.forge.Repos.FindByNamespace(patch.Namespace) + _, err := repo.RunStrict(cmd) + if err != nil { + // log.Info("NOT APPLIED", patch.Namespace, result, err) + // log.Info("NOT APPLIED newhash:", patch.NewHash, "commithash:", patch.CommitHash, "patch", patch.Namespace) + } else { + // log.Info("APPLIED newhash:", patch.NewHash, "commithash:", patch.CommitHash, "patch", patch.Namespace) + found.Append(patch) + } + } + + return found +} |
