summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-19 17:54:45 -0600
committerJeff Carr <[email protected]>2025-02-19 17:54:45 -0600
commitbe3e625f1585c24d1b755efdbd79bacb932b5a29 (patch)
treeaec25db63f984b3d71b6530e4da397fb2576c7df
parentf735cb937f51ee91e61849767ff21cbf37a9a83b (diff)
"apply all" button for a patchsetv0.22.85v0.22.84
-rw-r--r--windowPatchset.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/windowPatchset.go b/windowPatchset.go
index 2ac5138..6f9c6a1 100644
--- a/windowPatchset.go
+++ b/windowPatchset.go
@@ -87,6 +87,30 @@ func makePatchWindow(pset *forgepb.Patchset) *patchWindow {
grid.NewLabel(pset.StartBranchHash)
grid.NewLabel("end branch: " + pset.EndBranchName)
grid.NewLabel(pset.EndBranchHash)
+ grid.NewButton("Apply All", func() {
+ var count int
+ all := pset.Patches.SortByFilename()
+ for all.Scan() {
+ p := all.Next()
+ rn := p.RepoNamespace
+ repo := me.forge.FindByGoPath(rn)
+ if repo == nil {
+ log.Info("Could not figure out repo path", rn)
+ return
+ }
+ filename, err := savePatch(p)
+ if err != nil {
+ log.Info("savePatch() failed", err)
+ return
+ }
+ count += 1
+ if err := applyPatch(repo, filename); err != nil {
+ log.Info("warn user of git am error", err)
+ return
+ }
+ }
+ log.Info("ALL PATCHES WORKED! count =", count)
+ })
grid.NextRow()
g := pw.stack.NewGroup("PatchSet List")