start reporting applied patches
This commit is contained in:
parent
893c88bbf5
commit
1087b39f9c
|
@ -38,8 +38,6 @@ func doMergeDevel() (*gitpb.Repos, error) {
|
|||
break
|
||||
}
|
||||
done.Append(repo)
|
||||
// only do one at a time. to debug this
|
||||
break
|
||||
}
|
||||
configSave = true
|
||||
return done, err
|
||||
|
|
|
@ -81,6 +81,15 @@ func doPatch() error {
|
|||
}
|
||||
me.forge.Patchsets.PrintTable()
|
||||
// return doPatchList()
|
||||
applied := findApplied()
|
||||
// for patch := range applied.IterAll() {
|
||||
// log.Info("SEND APPLIED: newhash:", patch.NewHash, "commithash:", patch.CommitHash, "patch", patch.Namespace)
|
||||
// }
|
||||
newpb, err := applied.HttpPostVerbose(myServer(), "applied")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
newpb.PrintTable()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -309,3 +309,34 @@ func findExpired() *forgepb.Patches {
|
|||
|
||||
return found
|
||||
}
|
||||
|
||||
func findApplied() *forgepb.Patches {
|
||||
var pset *forgepb.Patches
|
||||
for found := range me.forge.Patchsets.IterAll() {
|
||||
if found.Name == "forge auto commit" {
|
||||
pset = found.Patches
|
||||
}
|
||||
}
|
||||
|
||||
if pset == nil {
|
||||
log.Info("failed to find 'forge auto commit'")
|
||||
return pset
|
||||
}
|
||||
|
||||
found := forgepb.NewPatches()
|
||||
|
||||
for patch := range pset.IterAll() {
|
||||
cmd := []string{"git", "merge-base", "--is-ancestor", patch.CommitHash, "devel"}
|
||||
repo := me.forge.Repos.FindByNamespace(patch.Namespace)
|
||||
_, err := repo.RunStrict(cmd)
|
||||
if err != nil {
|
||||
// log.Info("NOT APPLIED", patch.Namespace, result, err)
|
||||
// log.Info("NOT APPLIED newhash:", patch.NewHash, "commithash:", patch.CommitHash, "patch", patch.Namespace)
|
||||
} else {
|
||||
// log.Info("APPLIED newhash:", patch.NewHash, "commithash:", patch.CommitHash, "patch", patch.Namespace)
|
||||
found.Append(patch)
|
||||
}
|
||||
}
|
||||
|
||||
return found
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue