From ed686fc4d634caf05595b9c710d5de8e420ac5be Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 1 Feb 2025 11:55:17 -0600 Subject: more improvements to viewing patchsets --- applyPatch.go | 31 ------- doDirty.go | 2 + doExamine.go | 2 + doGui.go | 2 + windowForgePatchsets.go | 217 +++++++++++++++++++++++++++++++++++++++++++++++ windowPatches.go | 210 --------------------------------------------- windowPatchset.go | 189 +++++++++++++++++++++++++++++++++++++++++ windowViewPatchset.go | 171 ------------------------------------- windowViewRepoPatches.go | 2 - 9 files changed, 412 insertions(+), 414 deletions(-) create mode 100644 windowForgePatchsets.go delete mode 100644 windowPatches.go create mode 100644 windowPatchset.go delete mode 100644 windowViewPatchset.go diff --git a/applyPatch.go b/applyPatch.go index 3610c06..1ca716c 100644 --- a/applyPatch.go +++ b/applyPatch.go @@ -95,11 +95,6 @@ func applyPatchset(pset *forgepb.Patchset) error { log.Info("Should run: at", basedir, ":", cmd) log.Info(basedir, filename) result := shell.PathRun(basedir, cmd) - /* - if err != nil { - log.Info("git am failed", err) - } - */ for _, line := range result.Stdout { log.Warn("stdout:", line) } @@ -107,32 +102,6 @@ func applyPatchset(pset *forgepb.Patchset) error { log.Warn("stderr:", line) } } - /* - // log.Info("pset filename FILENAME IS REAL?", p.Filename, pset.Name, pset.Comment) - basepath, filename := filepath.Split(p.Filename) - fullpath := filepath.Join(me.forge.GetGoSrc(), basepath) - log.Info("pset filename FILENAME IS REAL? fullpath", fullpath) - fullTmpdir := filepath.Join(tmpdir, basepath) - err := os.MkdirAll(fullTmpdir, os.ModePerm) - if err != nil { - log.Info("applyPathces() MkdirAll failed for", fullTmpdir) - log.Info("applyPathces() MkdirAll failed err", err) - everythingworked = false - continue - } - log.Info("pset filename FILENAME IS REAL? tmp fullTmpdir", fullTmpdir) - tmpname := filepath.Join(fullTmpdir, filename) - raw, _ := os.OpenFile(tmpname, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) - raw.Write(p.Data) - raw.Close() - */ - /* - result := shell.PathRun(fullpath, cmd) - if result.Exit != 0 { - log.Info("cmd failed", cmd, result.Exit) - everythingworked = false - } - */ everythingworked = false } if everythingworked { diff --git a/doDirty.go b/doDirty.go index afd39cf..9febe94 100644 --- a/doDirty.go +++ b/doDirty.go @@ -1,3 +1,5 @@ +// Copyright 2025 WIT.COM Inc Licensed GPL 3.0 + package main import ( diff --git a/doExamine.go b/doExamine.go index c6b9091..26665f5 100644 --- a/doExamine.go +++ b/doExamine.go @@ -1,3 +1,5 @@ +// Copyright 2025 WIT.COM Inc Licensed GPL 3.0 + package main import ( diff --git a/doGui.go b/doGui.go index 96b964f..fa011a0 100644 --- a/doGui.go +++ b/doGui.go @@ -1,3 +1,5 @@ +// Copyright 2025 WIT.COM Inc Licensed GPL 3.0 + package main // An app to submit patches for the 30 GO GUI repos diff --git a/windowForgePatchsets.go b/windowForgePatchsets.go new file mode 100644 index 0000000..8fec827 --- /dev/null +++ b/windowForgePatchsets.go @@ -0,0 +1,217 @@ +package main + +// this is the "main" patch window. The first one +// then you can dig down and examine the patchsets and the files + +import ( + "fmt" + "strconv" + + "go.wit.com/lib/gadgets" + "go.wit.com/lib/protobuf/forgepb" + "go.wit.com/log" + + "go.wit.com/gui" +) + +type patchesWindow struct { + win *gadgets.BasicWindow // the patches window + stack *gui.Node // the top box set as vertical + grid *gui.Node // the list of available patches + reason *gadgets.BasicEntry // the name of the patchset + submitB *gui.Node // the submit patchet button + psetgrid *gui.Node // the list of each patchset + totalOL *gadgets.OneLiner + dirtyOL *gadgets.OneLiner + readonlyOL *gadgets.OneLiner + rw *gadgets.OneLiner + // checkB *gui.Node +} + +func (r *patchesWindow) Hidden() bool { + return r.win.Hidden() +} + +func (r *patchesWindow) Toggle() { + if r.Hidden() { + r.Show() + } else { + r.Hide() + } +} + +func (r *patchesWindow) Show() { + r.win.Show() +} + +func (r *patchesWindow) Hide() { + r.win.Hide() +} + +// you can only have one of these +func (r *patchesWindow) initWindow() { + r.win = gadgets.RawBasicWindow("Forge Patchesets") + r.win.Make() + + r.stack = r.win.Box().NewBox("bw vbox", false) + // me.reposwin.Draw() + r.win.Custom = func() { + log.Warn("Patchset Window close. setting hidden=true") + // sets the hidden flag to false so Toggle() works + r.win.Hide() + } + + r.grid = r.stack.RawGrid() + r.submitPatchesBox() + + // update the stats about the repos and patches + r.Update() +} + +func (r *patchesWindow) submitPatchesBox() { + // s := new(patchSummary) + group1 := r.stack.NewGroup("Repo Summary") + grid := group1.RawGrid() + + // make the header table for repo stats + r.totalOL = gadgets.NewOneLiner(grid, "Total") + grid.NextRow() + r.dirtyOL = gadgets.NewOneLiner(grid, "dirty") + grid.NextRow() + r.readonlyOL = gadgets.NewOneLiner(grid, "read-only") + grid.NextRow() + r.rw = gadgets.NewOneLiner(grid, "r/w") + grid.NextRow() + + // now, make the 'widget group' and the buttons at the bottom of the window + group1 = r.stack.NewGroup("Patchset Create") + grid = group1.RawGrid() + + grid.NewButton("current patch summary", func() { + r.Update() + pset, err := me.forge.MakeDevelPatchSet("current patches") + if err != nil { + log.Info("patchset creation failed", err) + return + } + if pset == nil { + log.Info("you have no current patches") + return + } + win := makePatchWindow(pset) + win.Show() + }) + + r.reason = gadgets.NewBasicEntry(grid, "Patchset name:") + r.reason.Custom = func() { + if r.reason.String() != "" { + r.submitB.Enable() + } else { + r.submitB.Disable() + } + } + r.submitB = grid.NewButton("Submit", func() { + pset, err := me.forge.SubmitDevelPatchSet(r.reason.String()) + if err != nil { + log.Info(err) + return + } + r.addPatchsetNew(pset) + }) + + psets, err := openPatchsets() + if err != nil { + log.Info("Open Patchsets failed", err) + } + + grid.NewButton("Update Patchset List", func() { + psets, err = me.forge.GetPatchesets() + if err != nil { + log.Info("Get Patchsets failed", err) + return + } + savePatchsets(psets) + + log.Info("got psets len", len(psets.Patchsets)) + all := psets.SortByName() + for all.Scan() { + pset := all.Next() + r.addPatchsetNew(pset) + } + }) + + // disables the submit button until the user enters a name + r.submitB.Disable() + grid.NextRow() + + g := r.stack.NewGroup("Patchset List") + // add the grid + r.psetgrid = g.RawGrid() + + // will look in ~/.config/forge for an existing patchset file + // attempt to read in patchsets saved on disk + + if psets != nil { + log.Info("got psets len", len(psets.Patchsets)) + all := psets.SortByName() + for all.Scan() { + pset := all.Next() + // log.Info("pset name =", pset.Name) + r.addPatchsetNew(pset) + } + } +} + +func (r *patchesWindow) addPatchsetNew(pset *forgepb.Patchset) { + r.psetgrid.NewLabel(pset.Name) + r.psetgrid.NewLabel(pset.Comment) + r.psetgrid.NewLabel(pset.GitAuthorName) + + ctime := pset.Ctime.AsTime() + stime := ctime.UTC().Format("2006-01-02_15:04:05_UTC") + r.psetgrid.NewLabel(stime) + if pset.State == "BROKEN" { + r.psetgrid.NewLabel("Bad") + } else { + r.psetgrid.NewLabel("Good") + } + + var win *patchWindow + r.psetgrid.NewButton("View", func() { + // has the window already been created? + if win != nil { + win.Toggle() + return + } + + win = makePatchWindow(pset) + win.Show() + }) + r.psetgrid.NextRow() +} + +// will update this from the current state of the protobuf +func (r *patchesWindow) Update() { + var total, dirty, readonly, rw int + + // figure out the totals + all := me.forge.Repos.SortByFullPath() + for all.Scan() { + repo := all.Next() + total += 1 + if repo.IsDirty() { + dirty += 1 + } + if me.forge.Config.IsReadOnly(repo.GetGoPath()) { + readonly += 1 + } else { + rw += 1 + } + } + + // send the values to the GUI toolkit + r.totalOL.SetText(strconv.Itoa(total) + " repos") + r.dirtyOL.SetText(strconv.Itoa(dirty) + " repos") + r.readonlyOL.SetText(strconv.Itoa(readonly) + " repos") + r.rw.SetText(fmt.Sprintf("%d repos", rw)) +} diff --git a/windowPatches.go b/windowPatches.go deleted file mode 100644 index 1bdc755..0000000 --- a/windowPatches.go +++ /dev/null @@ -1,210 +0,0 @@ -package main - -import ( - "fmt" - "strconv" - - "go.wit.com/lib/gadgets" - "go.wit.com/lib/protobuf/forgepb" - "go.wit.com/log" - - "go.wit.com/gui" -) - -type patchesWindow struct { - win *gadgets.BasicWindow // the patches window - stack *gui.Node // the top box set as vertical - grid *gui.Node // the list of available patches - reason *gadgets.BasicEntry // the name of the patchset - submitB *gui.Node // the submit patchet button - psetgrid *gui.Node // the list of each patchset - totalOL *gadgets.OneLiner - dirtyOL *gadgets.OneLiner - readonlyOL *gadgets.OneLiner - rw *gadgets.OneLiner - // checkB *gui.Node -} - -func (r *patchesWindow) Hidden() bool { - return r.win.Hidden() -} - -func (r *patchesWindow) Toggle() { - if r.Hidden() { - r.Show() - } else { - r.Hide() - } -} - -func (r *patchesWindow) Show() { - r.win.Show() -} - -func (r *patchesWindow) Hide() { - r.win.Hide() -} - -// you can only have one of these -func (r *patchesWindow) initWindow() { - r.win = gadgets.RawBasicWindow("Forge Patchesets") - r.win.Make() - - r.stack = r.win.Box().NewBox("bw vbox", false) - // me.reposwin.Draw() - r.win.Custom = func() { - log.Warn("Patchset Window close. setting hidden=true") - // sets the hidden flag to false so Toggle() works - r.win.Hide() - } - - r.grid = r.stack.RawGrid() - r.submitPatchesBox() - - // update the stats about the repos and patches - r.Update() -} - -func (r *patchesWindow) submitPatchesBox() { - // s := new(patchSummary) - group1 := r.stack.NewGroup("Repo Summary") - grid := group1.RawGrid() - - // make the header table for repo stats - r.totalOL = gadgets.NewOneLiner(grid, "Total") - grid.NextRow() - r.dirtyOL = gadgets.NewOneLiner(grid, "dirty") - grid.NextRow() - r.readonlyOL = gadgets.NewOneLiner(grid, "read-only") - grid.NextRow() - r.rw = gadgets.NewOneLiner(grid, "r/w") - grid.NextRow() - - // now, make the 'widget group' and the buttons at the bottom of the window - group1 = r.stack.NewGroup("Patchset Create") - grid = group1.RawGrid() - - grid.NewButton("current patch summary", func() { - r.Update() - pset, err := me.forge.MakeDevelPatchSet("current patches") - if err != nil { - log.Info("patchset creation failed", err) - return - } - if pset == nil { - log.Info("you have no current patches") - return - } - win := makePatchWindow(pset) - win.Show() - }) - - r.reason = gadgets.NewBasicEntry(grid, "Patchset name:") - r.reason.Custom = func() { - if r.reason.String() != "" { - r.submitB.Enable() - } else { - r.submitB.Disable() - } - } - r.submitB = grid.NewButton("Submit", func() { - pset, err := me.forge.SubmitDevelPatchSet(r.reason.String()) - if err != nil { - log.Info(err) - return - } - r.addPatchsetNew(pset) - }) - grid.NewButton("Get Patchset List", func() { - if psets, err := me.forge.GetPatchesets(); err != nil { - log.Info("Get Patchsets failed", err) - return - } else { - log.Info("got psets len", len(psets.Patchsets)) - all := psets.SortByName() - for all.Scan() { - pset := all.Next() - r.addPatchsetNew(pset) - } - } - }) - r.submitB.Disable() - grid.NextRow() - - g := r.stack.NewGroup("Patchset List") - // add the grid - r.psetgrid = g.RawGrid() - - psets, err := openPatchsets() - if err != nil { - log.Info("Open Patchsets failed", err) - // return err - } else { - log.Info("got psets len", len(psets.Patchsets)) - all := psets.SortByName() - for all.Scan() { - pset := all.Next() - // log.Info("pset name =", pset.Name) - r.addPatchsetNew(pset) - } - } -} - -func (r *patchesWindow) addPatchsetNew(pset *forgepb.Patchset) { - r.psetgrid.NewLabel(pset.Name) - r.psetgrid.NewLabel(pset.Comment) - r.psetgrid.NewLabel(pset.GitAuthorName) - // r.psetgrid.NewLabel(pset.RepoNamespace) - if pset.State == "BROKEN" { - r.psetgrid.NewLabel("Bad") - } else { - r.psetgrid.NewLabel("Good") - } - - var win *patchWindow - r.psetgrid.NewButton("View", func() { - // has the window already been created? - if win != nil { - win.Toggle() - return - } - - win = makePatchWindow(pset) - win.Show() - }) - - if pset.State == "BROKEN" { - // a.Disable() - } else { - r.psetgrid.NewButton("Apply (git am)", func() { - applyPatchset(pset) - }) - } - r.psetgrid.NextRow() -} - -// will update this from the current state of the protobuf -func (r *patchesWindow) Update() { - var total, dirty, readonly, rw int - - // figure out the totals - all := me.forge.Repos.SortByFullPath() - for all.Scan() { - repo := all.Next() - total += 1 - if repo.IsDirty() { - dirty += 1 - } - if me.forge.Config.IsReadOnly(repo.GetGoPath()) { - readonly += 1 - } else { - rw += 1 - } - } - - // send the values to the GUI toolkit - r.totalOL.SetText(strconv.Itoa(total) + " repos") - r.dirtyOL.SetText(strconv.Itoa(dirty) + " repos") - r.readonlyOL.SetText(strconv.Itoa(readonly) + " repos") - r.rw.SetText(fmt.Sprintf("%d repos", rw)) -} diff --git a/windowPatchset.go b/windowPatchset.go new file mode 100644 index 0000000..337de2d --- /dev/null +++ b/windowPatchset.go @@ -0,0 +1,189 @@ +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 + stack *gui.Node // the top box set as vertical + shelf *gui.Node // the first box in the stack, set as horizontal + grid *gui.Node // the list of available patches + // summary *patchSummary // summary of current patches + setgrid *gui.Node // the list of each patchset + pset *forgepb.Patchset // the patchset in question +} + +// todo: autogenerate these or make them standared 'gui' package functions +// make this an go interface somehow + +// is the window hidden right now? +func (w *patchWindow) Hidden() bool { + return w.win.Hidden() +} + +// switches between the window being visable or hidden on the desktop +func (w *patchWindow) Toggle() { + if w.Hidden() { + w.Show() + } else { + w.Hide() + } +} + +// hides the window completely +func (w *patchWindow) Show() { + w.win.Show() +} + +func (w *patchWindow) Hide() { + w.win.Hide() +} + +// should be the first box/widget in the window +// greys out the window to the user +func (w *patchWindow) Disable() { + w.stack.Disable() +} + +func (w *patchWindow) Enable() { + w.stack.Enable() +} + +// you can only have one of these +func makePatchWindow(pset *forgepb.Patchset) *patchWindow { + pw := new(patchWindow) + + // sync.Once() + pw.win = gadgets.RawBasicWindow("Patcheset for " + pset.Name + " (" + pset.Comment + ")") + pw.win.Make() + + pw.stack = pw.win.Box().NewBox("bw vbox", false) + // me.reposwin.Draw() + pw.win.Custom = func() { + // sets the hidden flag to false so Toggle() works + pw.win.Hide() + } + + grid := pw.stack.NewGrid("", 0, 0) + + grid.NewLabel("Patchset Details:") + grid.NewLabel(pset.GitAuthorName) + grid.NewLabel(pset.GitAuthorEmail) + grid.NewLabel("start branch: " + pset.StartBranchName) + grid.NewLabel(pset.StartBranchHash) + grid.NewLabel("end branch: " + pset.EndBranchName) + grid.NewLabel(pset.EndBranchHash) + grid.NextRow() + + g := pw.stack.NewGroup("PatchSet List") + + // make a grid to put the list of git repos that have patches + // in this particular patchset + grid = g.NewGrid("", 0, 0) + grid.NewLabel("repo") + grid.NewLabel("patch name") + 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 + pw.addPatchset(grid, pset) + return pw +} + +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 + } + + for repo, patches := range repomap { + log.Info(repo.GetGoPath()) + grid.NewLabel(repo.GetGoPath()) + + 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(hash) + var win *repoPatchWindow + grid.NewButton("View", func() { + if win != nil { + win.Toggle() + log.Info("TRYING TO TOGGLE WINDOW") + return + } + + win = makeRepoPatchWindow(repo, patches) + win.Show() + }) + grid.NewCheckbox("").SetChecked(true) + grid.NewCheckbox("").SetChecked(true) + grid.NewButton("save", func() { + for _, p := range patches { + _, filen := filepath.Split(p.Filename) + tmpname := filepath.Join("/tmp", filen) + log.Info("saving as", tmpname, p.Filename) + raw, _ := os.OpenFile(tmpname, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) + raw.Write(p.Data) + raw.Close() + } + }) + 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() + } +} diff --git a/windowViewPatchset.go b/windowViewPatchset.go deleted file mode 100644 index a9ff69d..0000000 --- a/windowViewPatchset.go +++ /dev/null @@ -1,171 +0,0 @@ -package main - -import ( - "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 - stack *gui.Node // the top box set as vertical - shelf *gui.Node // the first box in the stack, set as horizontal - grid *gui.Node // the list of available patches - // summary *patchSummary // summary of current patches - setgrid *gui.Node // the list of each patchset - pset *forgepb.Patchset // the patchset in question -} - -// todo: autogenerate these or make them standared 'gui' package functions -// make this an go interface somehow - -// is the window hidden right now? -func (w *patchWindow) Hidden() bool { - return w.win.Hidden() -} - -// switches between the window being visable or hidden on the desktop -func (w *patchWindow) Toggle() { - if w.Hidden() { - w.Show() - } else { - w.Hide() - } -} - -// hides the window completely -func (w *patchWindow) Show() { - w.win.Show() -} - -func (w *patchWindow) Hide() { - w.win.Hide() -} - -// should be the first box/widget in the window -// greys out the window to the user -func (w *patchWindow) Disable() { - w.stack.Disable() -} - -func (w *patchWindow) Enable() { - w.stack.Enable() -} - -// you can only have one of these -func makePatchWindow(pset *forgepb.Patchset) *patchWindow { - pw := new(patchWindow) - - // sync.Once() - pw.win = gadgets.RawBasicWindow("Patcheset for " + pset.Name + " (" + pset.Comment + ")") - pw.win.Make() - - pw.stack = pw.win.Box().NewBox("bw vbox", false) - // me.reposwin.Draw() - pw.win.Custom = func() { - // sets the hidden flag to false so Toggle() works - pw.win.Hide() - } - - grid := pw.stack.NewGrid("", 0, 0) - - grid.NewLabel("Patchset Details:") - grid.NewLabel(pset.GitAuthorName) - grid.NewLabel(pset.GitAuthorEmail) - grid.NewLabel("start branch: " + pset.StartBranchName) - grid.NewLabel(pset.StartBranchHash) - grid.NewLabel("end branch: " + pset.EndBranchName) - grid.NewLabel(pset.EndBranchHash) - grid.NextRow() - - g := pw.stack.NewGroup("PatchSet List") - - // make a grid to put the list of git repos that have patches - // in this particular patchset - grid = g.NewGrid("", 0, 0) - grid.NewLabel("repo") - grid.NewLabel("patch name") - 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 - pw.addPatchset(grid, pset) - return pw -} - -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 - } - - // var repo *gitpb.Repo - - for repo, patches := range repomap { - log.Info(repo.GetGoPath()) - grid.NewLabel(repo.GetGoPath()) - - 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(hash) - var win *repoPatchWindow - grid.NewButton("View", func() { - if win != nil { - win.Toggle() - log.Info("TRYING TO TOGGLE WINDOW") - return - } - - win = makeRepoPatchWindow(repo, patches) - win.Show() - }) - grid.NewCheckbox("").SetChecked(true) - grid.NewCheckbox("").SetChecked(true) - grid.NextRow() - } -} diff --git a/windowViewRepoPatches.go b/windowViewRepoPatches.go index 9b7ed83..a0cdfc5 100644 --- a/windowViewRepoPatches.go +++ b/windowViewRepoPatches.go @@ -124,8 +124,6 @@ func (r *repoPatchWindow) addPatchset(grid *gui.Node, pset *forgepb.Patchset) { repohash[repo] = p.StartHash } - // var repo *gitpb.Repo - for repo, patches := range repomap { log.Info(repo.GetGoPath()) grid.NewLabel(repo.GetGoPath()) -- cgit v1.2.3