From 695da486d28ebbb61fa556ba21470a526c2cb2c8 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 12 Mar 2025 09:21:09 -0500 Subject: [PATCH] work on getting new patchset lists --- doPatch.go | 1 + windowNewPatchsets.go | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/doPatch.go b/doPatch.go index 3bae740..8198524 100644 --- a/doPatch.go +++ b/doPatch.go @@ -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) diff --git a/windowNewPatchsets.go b/windowNewPatchsets.go index 96b293f..a32fd4e 100644 --- a/windowNewPatchsets.go +++ b/windowNewPatchsets.go @@ -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() {