diff --git a/applyPatch.go b/applyPatch.go index d4eec08..e08bc6c 100644 --- a/applyPatch.go +++ b/applyPatch.go @@ -16,13 +16,28 @@ func dumpPatchset(pset *forgepb.Patchs) error { 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 all := pset.SortByFilename() for all.Scan() { p := all.Next() // log.Info("pset filename FILENAME IS REAL?", p.Filename, pset.Name, pset.Comment) - // basepath, filename := filepath.Split(p.Filename) - log.Info("pset p.Filename", p.Filename) + 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) + 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 }