diff options
| author | Jeff Carr <[email protected]> | 2025-01-30 15:18:46 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-30 15:18:46 -0600 |
| commit | 4d4aad27e433ca0658379c4cd1f50c26cfdc33dd (patch) | |
| tree | e8c6c9fa43329bbbb185c2990fd1aca1f53585b0 /applyPatch.go | |
| parent | f26e5e9980255c74a5fdaa0e89351b5812f460f1 (diff) | |
dump patchsets to the console
Diffstat (limited to 'applyPatch.go')
| -rw-r--r-- | applyPatch.go | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/applyPatch.go b/applyPatch.go index a7c891e..bd55cc3 100644 --- a/applyPatch.go +++ b/applyPatch.go @@ -42,52 +42,6 @@ func savePatchset(pset *forgepb.Patchset) error { return nil } -// returns bad if patches can not be applied -func dumpPatchset(pset *forgepb.Patchset) bool { - log.Info("applyPatches() NAME", pset.Name) - log.Info("applyPatches() COMMENT", pset.Comment) - log.Info("applyPatches() GIT_AUTHOR_NAME", pset.GetGitAuthorName()) - log.Info("applyPatches() GIT_AUTHOR_EMAIL", pset.GetGitAuthorEmail()) - log.Info("applyPatches() Branch Name", pset.GetStartBranchName()) - log.Info("applyPatches() Start Hash", pset.GetStartBranchHash()) - - var count int - var bad int - all := pset.Patches.SortByFilename() - for all.Scan() { - p := all.Next() - if IsValidPatch(p) { - // ok - } else { - bad += 1 - } - count += 1 - } - log.Info("pset has", count, "total patches, ", bad, "bad patches") - if bad == 0 { - return true - } - return false -} - -func IsValidPatch(p *forgepb.Patch) bool { - basepath, filename := filepath.Split(p.Filename) - repo := me.forge.FindByGoPath(basepath) - if repo == nil { - log.Info("can not apply patch! repo not found", basepath, filename) - return false - } - if repo.DevelHash() != p.StartHash { - log.Info("can not apply patch! devel hash mismatch", basepath, filename) - return false - } - log.Info("start:", p.StartHash, "end:", p.CommitHash, "file:", basepath, filename, "devel version", repo.GetDevelVersion()) - for _, line := range p.Files { - log.Info("\t", line) - } - return true -} - // re-run git CheckDirty() on everything func IsAnythingDirty() bool { me.found = new(gitpb.Repos) |
