work on getting new patchset lists

This commit is contained in:
Jeff Carr 2025-03-12 09:21:09 -05:00
parent 6cf3648b94
commit 695da486d2
2 changed files with 32 additions and 0 deletions

View File

@ -59,6 +59,7 @@ func savePatchsets() error {
if me.psets == nil {
return fmt.Errorf("savePatchesets() can't save nil")
}
log.Info("savePatchsets() len =", me.psets.Len())
data, err := me.psets.Marshal()
if err != nil {
log.Info("protobuf.Marshal() failed:", err)

View File

@ -54,7 +54,38 @@ func makePatchsetsWin() *stdPatchsetTableWin {
log.Info("Get Patchsets failed", err)
return
}
var foundnew bool
all := psets.All()
for all.Scan() {
pset := all.Next()
found := me.psets.FindByUuid(pset.Uuid)
if found == nil {
log.Info("new patchset", pset.Name, pset.Uuid)
pset.State = "new"
foundnew = true
} else {
log.Info("patchset already on disk", found.Name, found.State)
pset.State = found.State
if pset.State == "" {
pset.State = "new"
}
}
}
dwin.doPatchsetsTable(psets)
if foundnew {
log.Info("should save these here")
me.psets = psets
savePatchsets()
}
})
grid.NewButton("save", func() {
if me.psets == nil {
log.Info("No Patchsets loaded")
return
}
savePatchsets()
})
grid.NewButton("analyse and save patchsets", func() {