start reporting applied patches
This commit is contained in:
parent
893c88bbf5
commit
1087b39f9c
|
@ -38,8 +38,6 @@ func doMergeDevel() (*gitpb.Repos, error) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
done.Append(repo)
|
done.Append(repo)
|
||||||
// only do one at a time. to debug this
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
configSave = true
|
configSave = true
|
||||||
return done, err
|
return done, err
|
||||||
|
|
|
@ -81,6 +81,15 @@ func doPatch() error {
|
||||||
}
|
}
|
||||||
me.forge.Patchsets.PrintTable()
|
me.forge.Patchsets.PrintTable()
|
||||||
// return doPatchList()
|
// 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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -309,3 +309,34 @@ func findExpired() *forgepb.Patches {
|
||||||
|
|
||||||
return found
|
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