diff --git a/windowViewPatch.go b/windowViewPatch.go index eeac7c7..4ea414d 100644 --- a/windowViewPatch.go +++ b/windowViewPatch.go @@ -6,6 +6,7 @@ import ( "go.wit.com/lib/gadgets" "go.wit.com/lib/protobuf/forgepb" + "go.wit.com/log" "go.wit.com/gui" ) @@ -82,13 +83,28 @@ func makePatchWindow(pset *forgepb.Patchset) *patchWindow { grid.NextRow() grid.NewLabel("end branch: " + pset.EndBranchName) grid.NewLabel(pset.EndBranchHash) + grid.NextRow() - /* - r.shelf = r.initGroup() - group1 := r.stack.NewGroup("stuff") - vbox := group1.Box() - vbox.Vertical() - */ + grid.NewButton("Extract", func() { + if err := savePatchset(pset); err != nil { + log.Info("Save err:", err) + return + } + }) + grid.NewButton("Apply", func() { + if _, _, _, err := IsEverythingOnDevel(); err != nil { + log.Info("You can only apply patches to the devel branch") + return + } + if IsAnythingDirty() { + log.Info("You can't apply patches when repos are dirty") + me.forge.PrintHumanTable(me.found) + return + } + if argv.Force { + applyPatchset(pset) + } + }) g := pw.stack.NewGroup("PatchSet List") @@ -99,6 +115,8 @@ func makePatchWindow(pset *forgepb.Patchset) *patchWindow { for all.Scan() { p := all.Next() // if IsValidPatch(p) { + filegrid.NewLabel(p.RepoNamespace) + filegrid.NewLabel(p.Comment) filegrid.NewLabel(p.Filename) filegrid.NewLabel(p.RepoPath) filegrid.NewLabel(p.BranchName)