"apply all" button for a patchset

This commit is contained in:
Jeff Carr 2025-02-19 17:54:45 -06:00
parent f735cb937f
commit be3e625f15
1 changed files with 24 additions and 0 deletions

View File

@ -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")