start adding logic to check the hashes

This commit is contained in:
Jeff Carr 2025-01-05 03:21:26 -06:00
parent 026e0cde90
commit 92ff05cf6f
1 changed files with 17 additions and 2 deletions

View File

@ -16,13 +16,28 @@ func dumpPatchset(pset *forgepb.Patchs) error {
log.Info("applyPatches() COMMENT", pset.Comment) log.Info("applyPatches() COMMENT", pset.Comment)
log.Info("applyPatches() GIT_AUTHOR_NAME", pset.GetGitAuthorName()) log.Info("applyPatches() GIT_AUTHOR_NAME", pset.GetGitAuthorName())
log.Info("applyPatches() GIT_AUTHOR_EMAIL", pset.GetGitAuthorEmail()) 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
all := pset.SortByFilename() all := pset.SortByFilename()
for all.Scan() { for all.Scan() {
p := all.Next() p := all.Next()
// log.Info("pset filename FILENAME IS REAL?", p.Filename, pset.Name, pset.Comment) // log.Info("pset filename FILENAME IS REAL?", p.Filename, pset.Name, pset.Comment)
// basepath, filename := filepath.Split(p.Filename) basepath, filename := filepath.Split(p.Filename)
log.Info("pset p.Filename", p.Filename) repo := me.forge.FindByGoPath(basepath)
if repo == nil {
log.Info("can not apply patch! repo not found", basepath, filename)
continue
} }
if repo.DevelHash() != p.StartHash {
log.Info("can not apply patch! devel hash mismatch", basepath, filename)
continue
}
log.Info("start:", p.StartHash, "end:", p.CommitHash, "file:", basepath, filename, "devel version", repo.GetDevelVersion())
count += 1
}
log.Info("pset has", count, "patches")
return nil return nil
} }