diff options
| author | Jeff Carr <[email protected]> | 2025-03-25 07:27:21 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-03-25 13:17:00 -0500 |
| commit | 99e30376f0a7835b564e408e877f2faca6ceae29 (patch) | |
| tree | 9b4b3bc04a7deb5008aff57201b05553ce909bbb | |
| parent | aed4c927130f5bc52f062dff40f3b48500b14081 (diff) | |
button to show all patchesv0.22.113
| -rw-r--r-- | doGui.go | 2 | ||||
| -rw-r--r-- | windowPatches.go | 24 | ||||
| -rw-r--r-- | windowPatchsets.go | 14 |
3 files changed, 32 insertions, 8 deletions
@@ -237,7 +237,7 @@ func drawWindow(win *gadgets.GenericWindow) { all := me.psets.All() for all.Scan() { pset := all.Next() - AddNotDonePatches(notdone, pset) + AddNotDonePatches(notdone, pset, false) } for patch := range notdone.IterAll() { diff --git a/windowPatches.go b/windowPatches.go index b12a061..3eb1d7b 100644 --- a/windowPatches.go +++ b/windowPatches.go @@ -57,7 +57,24 @@ func makePatchesWin(patches *forgepb.Patches) *stdPatchTableWin { grid.NewLabel(fmt.Sprintf("total repos")) grid.NextRow() - grid.NewButton("reload", func() { + grid.NewButton("show all", func() { + if me.psets == nil { + log.Info("No Patchsets loaded") + return + } + notdone := new(forgepb.Patches) + + all := me.psets.All() + for all.Scan() { + pset := all.Next() + AddNotDonePatches(notdone, pset, true) + } + + for patch := range notdone.IterAll() { + comment := cleanSubject(patch.Comment) + log.Info("new patch:", patch.NewHash, "commithash:", patch.CommitHash, patch.RepoNamespace, comment) + } + dwin.doPatchesTable(notdone) }) grid.NewButton("Apply All", func() { var count int @@ -135,6 +152,11 @@ func AddPatchesPB(tbox *gui.Node, pb *forgepb.Patches) *forgepb.PatchesTable { t.SetParent(tbox) gitam := t.AddButtonFunc("apply", func(p *forgepb.Patch) string { + rn := p.RepoNamespace + if repo := me.forge.FindByGoPath(rn); repo == nil { + // log.Info("Could not figure out repo path", rn) + return "" + } return "git am" }) gitam.Custom = func(p *forgepb.Patch) { diff --git a/windowPatchsets.go b/windowPatchsets.go index 4251a19..9c005fe 100644 --- a/windowPatchsets.go +++ b/windowPatchsets.go @@ -145,7 +145,7 @@ func makePatchsetsWin() *stdPatchsetTableWin { all := me.psets.All() for all.Scan() { pset := all.Next() - AddNotDonePatches(notdone, pset) + AddNotDonePatches(notdone, pset, false) } for patch := range notdone.IterAll() { @@ -266,7 +266,7 @@ func setPatchsetState(p *forgepb.Patchset) { // log.Info("patch:", patch.StartHash, patch.CommitHash, patch.RepoNamespace, patch.Filename) repo := me.forge.FindByGoPath(patch.RepoNamespace) if repo == nil { - log.Info("couldn't find repo", patch.RepoNamespace) + log.Info("could not find repo", patch.RepoNamespace) bad = true continue } @@ -332,7 +332,7 @@ func setNewCommitHash(p *forgepb.Patchset) bool { repo := me.forge.FindByGoPath(patch.RepoNamespace) if repo == nil { - log.Info("couldn't find repo", patch.RepoNamespace) + log.Info("could not find repo", patch.RepoNamespace) continue } @@ -356,7 +356,7 @@ func setNewCommitHash(p *forgepb.Patchset) bool { return done } -func AddNotDonePatches(notdone *forgepb.Patches, pset *forgepb.Patchset) { +func AddNotDonePatches(notdone *forgepb.Patches, pset *forgepb.Patchset, full bool) { for patch := range pset.Patches.IterAll() { comment := cleanSubject(patch.Comment) @@ -367,8 +367,10 @@ func AddNotDonePatches(notdone *forgepb.Patches, pset *forgepb.Patchset) { repo := me.forge.FindByGoPath(patch.RepoNamespace) if repo == nil { - log.Info("couldn't find repo", patch.RepoNamespace) - notdone.Append(patch) + log.Info("could not find repo", patch.RepoNamespace) + if full { + notdone.AppendByCommitHash(patch) // double check to ensure the commit hash isn't added twice + } continue } |
