summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doPatch.go1
-rw-r--r--windowNewPatchsets.go31
2 files changed, 32 insertions, 0 deletions
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() {