diff options
| author | Jeff Carr <[email protected]> | 2025-09-05 12:53:05 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-05 12:53:05 -0500 |
| commit | e639f7d7b7930185aa319a91317087015887d75e (patch) | |
| tree | 27228d32cd811adb6ead90b5db93fa7b725c1284 /doPatch.go | |
| parent | 790c48e0d0ef2fde8583820b8ab834449bf00ac0 (diff) | |
set patch NewHash
Diffstat (limited to 'doPatch.go')
| -rw-r--r-- | doPatch.go | 39 |
1 files changed, 29 insertions, 10 deletions
@@ -10,14 +10,19 @@ import ( "go.wit.com/log" ) -func doPatch() error { +func doPatchInit() { + if me.forge.Patchsets != nil { + log.Info("IGNORE: patches already initalized") + } if err := me.forge.LoadPatchsets(); err != nil { log.Info("patches failed to open", err) if err := me.forge.SavePatchsets(); err != nil { log.Warn("savePatchsets() failed", err) } } +} +func doPatch() error { if argv.Patch.Submit != nil { _, err := me.forge.SubmitDevelPatchSet(argv.Patch.Submit.Match) if err != nil { @@ -43,21 +48,35 @@ func doPatch() error { } if argv.Patch.Check != nil { + log.Info("remove this option") + return nil + } + + if argv.Patch.List != nil { + var changed bool for pset := range me.forge.Patchsets.IterAll() { log.Info(pset.Uuid) for patch := range pset.Patches.IterAll() { - if repo, ok := me.forge.IsPatchApplied(patch); ok { - log.Info("found patch in repo", repo.Namespace, patch.Filename) - } else { - // log.Info("did not find patch", patch.CommitHash, patch.NewHash, patch.Filename) + if setNewCommitHash(patch) { + changed = true } } - } - // me.forge.Patchsets.PrintTable() - return nil - } - if argv.Patch.List != nil { + /* + for patch := range pset.Patches.IterAll() { + if repo, ok := me.forge.IsPatchApplied(patch); ok { + log.Info("\tfound patch in repo", repo.Namespace, patch.Filename) + } else { + log.Info("\tdid not find patch", patch.CommitHash, patch.NewHash, patch.Filename) + } + } + */ + } + if changed { + if err := me.forge.SavePatchsets(); err != nil { + log.Warn("savePatchsets() failed", err) + } + } me.forge.Patchsets.PrintTable() // return doPatchList() return nil |
