summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-06 20:08:28 -0500
committerJeff Carr <[email protected]>2025-09-06 20:08:28 -0500
commitf6a79c3be8239e80e39c8992b71b43fdc95d61bb (patch)
tree5a45d37962e86b46fd0ddd61b4e4c800e04553cc
parenta6c0edb89d150036e7e66afdd23a5fe2a16cb57b (diff)
apply patches working more smoothlyv0.22.145
-rw-r--r--doPatch.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/doPatch.go b/doPatch.go
index 37f255e..ee74dca 100644
--- a/doPatch.go
+++ b/doPatch.go
@@ -6,6 +6,7 @@ package main
import (
"path/filepath"
+ "go.wit.com/lib/fhelp"
"go.wit.com/lib/protobuf/forgepb"
"go.wit.com/log"
)
@@ -60,12 +61,17 @@ func doPatch() error {
if argv.Patch.List != nil {
var changed bool
+ newpatches := forgepb.NewPatches()
for pset := range me.forge.Patchsets.IterAll() {
log.Info(pset.Uuid)
for patch := range pset.Patches.IterAll() {
if setNewCommitHash(patch) {
changed = true
}
+ if patch.NewHash == "na" {
+ newpatches.Append(patch)
+ log.Info("apply this patch?")
+ }
}
/*
@@ -84,6 +90,22 @@ func doPatch() error {
}
}
me.forge.Patchsets.PrintTable()
+ if newpatches.Len() != 0 {
+ for patch := range newpatches.IterAll() {
+ log.Info("new patch:", patch.CommitHash, patch.NewHash, patch.Filename)
+ repo := me.forge.FindByGoPath(patch.Namespace)
+ if repo == nil {
+ log.Info("\tCould not find namespace:", patch.Namespace)
+ continue
+ }
+ if fhelp.QuestionUser("apply this patch?") {
+ newhash, err := applyAndTrackPatch(repo, patch)
+ log.Info("apply results:", newhash, err)
+ }
+ }
+ return log.Errorf("patches need to be applied")
+ }
+
// return doPatchList()
applied := findApplied()
if applied.Len() == 0 {