"apply all" button for a patchset
This commit is contained in:
parent
f735cb937f
commit
be3e625f15
|
@ -87,6 +87,30 @@ func makePatchWindow(pset *forgepb.Patchset) *patchWindow {
|
||||||
grid.NewLabel(pset.StartBranchHash)
|
grid.NewLabel(pset.StartBranchHash)
|
||||||
grid.NewLabel("end branch: " + pset.EndBranchName)
|
grid.NewLabel("end branch: " + pset.EndBranchName)
|
||||||
grid.NewLabel(pset.EndBranchHash)
|
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()
|
grid.NextRow()
|
||||||
|
|
||||||
g := pw.stack.NewGroup("PatchSet List")
|
g := pw.stack.NewGroup("PatchSet List")
|
||||||
|
|
Loading…
Reference in New Issue