summaryrefslogtreecommitdiff
path: root/windowPatchset.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-10 14:57:33 -0500
committerJeff Carr <[email protected]>2025-03-10 14:57:33 -0500
commit391a988e5f638f5c4b33b78f1f0ac9df7e670518 (patch)
treee826774ee14b1b165aa81bf116c90e80ccf9f0a5 /windowPatchset.go
parent18d9a7a099978174f81c016e90cdc9b6cd3162f2 (diff)
working on more standard patch windows
Diffstat (limited to 'windowPatchset.go')
-rw-r--r--windowPatchset.go74
1 files changed, 2 insertions, 72 deletions
diff --git a/windowPatchset.go b/windowPatchset.go
index 6f9c6a1..9eda8df 100644
--- a/windowPatchset.go
+++ b/windowPatchset.go
@@ -3,19 +3,7 @@
package main
-import (
- "os"
- "path/filepath"
- "sync"
-
- "go.wit.com/lib/gadgets"
- "go.wit.com/lib/protobuf/forgepb"
- "go.wit.com/lib/protobuf/gitpb"
- "go.wit.com/log"
-
- "go.wit.com/gui"
-)
-
+/*
type patchWindow struct {
once sync.Once // only init() the window once
win *gadgets.BasicWindow // the patches window
@@ -123,28 +111,6 @@ func makePatchWindow(pset *forgepb.Patchset) *patchWindow {
grid.NewLabel("Applied in current branch?")
grid.NewLabel("start hash")
grid.NewLabel("")
- /*
- grid.NewButton("Extract", func() {
- if err := savePatchset(pset); err != nil {
- log.Info("Save err:", err)
- return
- }
- })
- grid.NewButton("Apply with git am", func() {
- if _, _, _, err := IsEverythingOnUser(); err != nil {
- log.Info("You can only apply patches to the user 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)
- }
- })
- */
grid.NextRow()
// add the patches to the grid
@@ -153,25 +119,6 @@ func makePatchWindow(pset *forgepb.Patchset) *patchWindow {
}
func (r *patchWindow) addPatchset(grid *gui.Node, pset *forgepb.Patchset) {
- /*
- repomap := make(map[*gitpb.Repo][]*forgepb.Patch)
- repohash := make(map[*gitpb.Repo]string)
-
- // sort patches by repo namespace
- all := pset.Patches.SortByFilename()
- for all.Scan() {
- p := all.Next()
- s := p.RepoNamespace
- repo := me.forge.FindByGoPath(s)
- if repo == nil {
- log.Info("Could not figure out repo path", s)
- continue
- }
- repomap[repo] = append(repomap[repo], p)
- repohash[repo] = p.StartHash
- }
- */
-
all := pset.Patches.SortByFilename()
for all.Scan() {
p := all.Next()
@@ -185,14 +132,6 @@ func (r *patchWindow) addPatchset(grid *gui.Node, pset *forgepb.Patchset) {
log.Info("Adding patches for", rn)
grid.NewLabel(rn)
- /*
- for i, p := range patches {
- log.Info(i, p.Filename)
- grid.NewLabel(p.Comment)
- grid.NewLabel("in current branch?")
- break
- }
- */
// hash := repohash[repo]
grid.NewLabel(p.StartHash)
grid.NewLabel(p.Filename)
@@ -216,16 +155,6 @@ func (r *patchWindow) addPatchset(grid *gui.Node, pset *forgepb.Patchset) {
// for _, pat := range patches {
// }
})
- /*
- grid.NewButton("view hash", func() {
- cmd := []string{"git", "whatchanged", hash}
- log.Info(repo.GetFullPath(), cmd)
- })
- grid.NewButton("git am", func() {
- cmd := []string{"git", "whatchanged", hash}
- log.Info(repo.GetFullPath(), cmd)
- })
- */
grid.NextRow()
}
}
@@ -279,3 +208,4 @@ func savePatchset(pset *forgepb.Patchset) error {
}
return nil
}
+*/