summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-06 17:14:46 -0500
committerJeff Carr <[email protected]>2025-09-06 17:14:46 -0500
commit1087b39f9ccedd3042f2f8d884b281b535cbb93c (patch)
treeaaa6294b09a8bdf6a9354d22789f44167b844e1d
parent893c88bbf5d6aea99b7b6dfd28b590a3d65b1eeb (diff)
start reporting applied patchesv0.22.144
-rw-r--r--doMerge.go2
-rw-r--r--doPatch.go9
-rw-r--r--helperPatches.go31
3 files changed, 40 insertions, 2 deletions
diff --git a/doMerge.go b/doMerge.go
index 1007b76..a4ef512 100644
--- a/doMerge.go
+++ b/doMerge.go
@@ -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
diff --git a/doPatch.go b/doPatch.go
index a890852..94b2c7a 100644
--- a/doPatch.go
+++ b/doPatch.go
@@ -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
+}