summaryrefslogtreecommitdiff
path: root/doPatches.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-22 11:08:59 -0500
committerJeff Carr <[email protected]>2025-10-22 11:08:59 -0500
commite8a7433c9588827b275cbcf7a8745f886dd59ad4 (patch)
tree727fc242f5d5da8ea36a50a09af9324ad903aa9d /doPatches.go
parentde85934267a150290d4ffff052027a3363f3ce10 (diff)
adapt to the new lib/config and lib/ENVv0.0.65
Diffstat (limited to 'doPatches.go')
-rw-r--r--doPatches.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/doPatches.go b/doPatches.go
index e4008c6..b2ea050 100644
--- a/doPatches.go
+++ b/doPatches.go
@@ -1,6 +1,7 @@
package main
import (
+ "go.wit.com/lib/ENV"
"go.wit.com/lib/protobuf/forgepb"
"go.wit.com/log"
)
@@ -8,13 +9,13 @@ import (
func doPatches() error {
if argv.Patch.List != nil {
log.Printf("forge.Init() %s len()=%d\n", me.forge.Config.Filename, me.forge.Repos.Len())
- me.forge.Config.DumpENV()
+ ENV.PrintTable()
return doList()
}
if argv.Patch.Clean != nil {
log.Printf("forge.Init() %s len()=%d\n", me.forge.Config.Filename, me.forge.Repos.Len())
- me.forge.Config.DumpENV()
+ ENV.PrintTable()
return doClean()
}
@@ -22,17 +23,17 @@ func doPatches() error {
}
func doList() error {
- log.Infof("do list here. Patchsets.Len()=%d\n", me.forge.Patchsets.Len())
- for pset := range me.forge.Patchsets.IterAll() {
+ log.Infof("do list here. Patchsets.Len()=%d\n", me.Patchsets.Len())
+ for pset := range me.Patchsets.IterAll() {
pset.PrintTable()
}
return nil
}
func doClean() error {
- log.Infof("clean Patchsets.Len()=%d\n", me.forge.Patchsets.Len())
+ log.Infof("clean Patchsets.Len()=%d\n", me.Patchsets.Len())
// show all the patchsets with Names
- for pset := range me.forge.Patchsets.IterAll() {
+ for pset := range me.Patchsets.IterAll() {
for patch := range pset.Patches.IterAll() {
if patch.PatchId == "" {
log.Info("Delete", patch.CommitHash, patch.PatchId, patch.Namespace)
@@ -42,7 +43,7 @@ func doClean() error {
}
}
}
- me.forge.SavePatchsets()
+ me.Patchsets.Save()
return nil
}
@@ -50,7 +51,7 @@ func doClean() error {
func findPatch(newpatch *forgepb.Patch) bool {
// log.Info("\tlook for patch:", newpatch.CommitHash, newpatch.Namespace)
- for pset := range me.forge.Patchsets.IterAll() {
+ for pset := range me.Patchsets.IterAll() {
for _, patch := range pset.Patches.Patches {
if patch.CommitHash == newpatch.CommitHash {
// log.Info("\tfound pset!!!!!!", pset.Uuid, patch.Namespace)
@@ -67,7 +68,7 @@ func findPatch(newpatch *forgepb.Patch) bool {
func expirePatch(newpatch *forgepb.Patch) bool {
// log.Info("\tlook for patch:", newpatch.CommitHash, newpatch.Namespace)
- for pset := range me.forge.Patchsets.IterAll() {
+ for pset := range me.Patchsets.IterAll() {
for _, patch := range pset.Patches.Patches {
if patch.CommitHash == newpatch.CommitHash {
patch.NewHash = newpatch.NewHash