shows all the patches
This commit is contained in:
parent
f2281a2102
commit
f61891ca88
|
@ -94,10 +94,15 @@ func (r *patchesWindow) initWindow() {
|
|||
return
|
||||
}
|
||||
slices.Reverse(lines)
|
||||
count := 0
|
||||
for i, line := range lines {
|
||||
log.Info(i, line)
|
||||
r.addPatchset(line)
|
||||
count += 1
|
||||
if count < 10 {
|
||||
r.addPatchset(line)
|
||||
}
|
||||
}
|
||||
log.Info("Total patchsets:", count)
|
||||
}
|
||||
|
||||
func (r *patchesWindow) addPatchset(line string) {
|
||||
|
@ -109,14 +114,16 @@ func (r *patchesWindow) addPatchset(line string) {
|
|||
r.setgrid.NewLabel(name)
|
||||
r.setgrid.NewLabel(subject)
|
||||
r.setgrid.NewLabel(author)
|
||||
r.setgrid.NewButton("Download", func() {
|
||||
pset, err := savePatch(name)
|
||||
if err != nil {
|
||||
log.Info(name, "failed to download", err)
|
||||
return
|
||||
}
|
||||
r.setlist[name] = pset
|
||||
})
|
||||
/*
|
||||
r.setgrid.NewButton("Download", func() {
|
||||
pset, err := savePatch(name)
|
||||
if err != nil {
|
||||
log.Info(name, "failed to download", err)
|
||||
return
|
||||
}
|
||||
r.setlist[name] = pset
|
||||
})
|
||||
*/
|
||||
r.setgrid.NewButton("View", func() {
|
||||
// has the window already been created?
|
||||
win := r.setwin[name]
|
||||
|
@ -134,6 +141,7 @@ func (r *patchesWindow) addPatchset(line string) {
|
|||
}
|
||||
r.setlist[name] = pset
|
||||
r.setwin[name] = makePatchWindow(pset)
|
||||
r.setwin[name].Show()
|
||||
})
|
||||
r.setgrid.NewButton("Dump", func() {
|
||||
pset := r.setlist[name]
|
||||
|
@ -146,7 +154,7 @@ func (r *patchesWindow) addPatchset(line string) {
|
|||
return
|
||||
}
|
||||
})
|
||||
r.setgrid.NewButton("Save", func() {
|
||||
r.setgrid.NewButton("Extract", func() {
|
||||
pset := r.setlist[name]
|
||||
if pset == nil {
|
||||
log.Info(name, "was nil")
|
||||
|
|
|
@ -62,7 +62,7 @@ func makePatchWindow(pset *forgepb.Patchset) *patchWindow {
|
|||
pw := new(patchWindow)
|
||||
|
||||
// sync.Once()
|
||||
pw.win = gadgets.RawBasicWindow("Patcheset for")
|
||||
pw.win = gadgets.RawBasicWindow("Patcheset for " + pset.Name + " (" + pset.Comment + ")")
|
||||
pw.win.Make()
|
||||
|
||||
pw.stack = pw.win.Box().NewBox("bw vbox", false)
|
||||
|
@ -75,6 +75,13 @@ func makePatchWindow(pset *forgepb.Patchset) *patchWindow {
|
|||
grid := pw.stack.NewGrid("", 0, 0)
|
||||
|
||||
grid.NewLabel(pset.GitAuthorName)
|
||||
grid.NewLabel(pset.GitAuthorEmail)
|
||||
grid.NextRow()
|
||||
grid.NewLabel("start branch: " + pset.StartBranchName)
|
||||
grid.NewLabel(pset.StartBranchHash)
|
||||
grid.NextRow()
|
||||
grid.NewLabel("end branch: " + pset.EndBranchName)
|
||||
grid.NewLabel(pset.EndBranchHash)
|
||||
|
||||
/*
|
||||
r.shelf = r.initGroup()
|
||||
|
@ -86,14 +93,21 @@ func makePatchWindow(pset *forgepb.Patchset) *patchWindow {
|
|||
g := pw.stack.NewGroup("PatchSet List")
|
||||
|
||||
// add the patch grid
|
||||
g.NewGrid("", 0, 0)
|
||||
filegrid := g.NewGrid("", 0, 0)
|
||||
|
||||
all := pset.Patches.SortByFilename()
|
||||
for all.Scan() {
|
||||
p := all.Next()
|
||||
// if IsValidPatch(p) {
|
||||
filegrid.NewLabel(p.Filename)
|
||||
filegrid.NewLabel(p.RepoPath)
|
||||
filegrid.NewLabel(p.BranchName)
|
||||
filegrid.NewLabel(p.BranchHash)
|
||||
filegrid.NewLabel(p.CommitHash)
|
||||
filegrid.NewLabel(p.StartHash)
|
||||
filegrid.NextRow()
|
||||
}
|
||||
|
||||
/*
|
||||
for i, line := range lines {
|
||||
log.Info(i, line)
|
||||
r.addFile(line)
|
||||
}
|
||||
*/
|
||||
return pw
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue