work on patch tracking
This commit is contained in:
parent
817107dc16
commit
822fe38eee
|
@ -363,3 +363,29 @@ func (psets *Patchsets) PrintTable() {
|
||||||
}
|
}
|
||||||
log.Infof("Total Contents (%d) Parts (%d)\n", countCONTENTS, countPARTS)
|
log.Infof("Total Contents (%d) Parts (%d)\n", countCONTENTS, countPARTS)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (patches *Patches) PrintTable() {
|
||||||
|
if patches == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
log.DaemonMode(true)
|
||||||
|
|
||||||
|
// print the header
|
||||||
|
args := []string{"commit hash", "new hash", "", "", "name", "Repo Namespace", "", "", "", "", ""}
|
||||||
|
sizes := []int{12, 12, 3, 3, 40, 80, 2, 2, 2, 2}
|
||||||
|
log.Info(cobol.TerminalChomp(cobol.StandardTableSize10(sizes, args)))
|
||||||
|
|
||||||
|
var countPARTS int
|
||||||
|
for x, p := range patches.GetPatches() {
|
||||||
|
var args []string
|
||||||
|
partId := log.Sprintf("%d", x)
|
||||||
|
|
||||||
|
_, fname := filepath.Split(p.GetFilename())
|
||||||
|
args = []string{p.CommitHash, p.NewHash, partId, fname, p.GetNamespace(), "", "", "", "", ""}
|
||||||
|
|
||||||
|
start := cobol.StandardTableSize10(sizes, args)
|
||||||
|
log.Info(cobol.TerminalChomp(start))
|
||||||
|
countPARTS += 1
|
||||||
|
}
|
||||||
|
log.Infof("Total Patches (%d)\n", countPARTS)
|
||||||
|
}
|
||||||
|
|
|
@ -189,5 +189,10 @@ func (f *Forge) findPatch(newpatch *Patch) bool {
|
||||||
|
|
||||||
func (f *Forge) IsPatchApplied(newpatch *Patch) (*gitpb.Repo, bool) {
|
func (f *Forge) IsPatchApplied(newpatch *Patch) (*gitpb.Repo, bool) {
|
||||||
log.Info("todo: find namespace and repo for patch", newpatch.Filename)
|
log.Info("todo: find namespace and repo for patch", newpatch.Filename)
|
||||||
|
if f.findPatch(newpatch) {
|
||||||
|
log.Info("\tfindPatch() patch was found")
|
||||||
|
} else {
|
||||||
|
log.Info("\tfindPatch() patch was not found")
|
||||||
|
}
|
||||||
return nil, false
|
return nil, false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue