2021-04-22 09:29:04 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import(
|
|
|
|
"log"
|
|
|
|
)
|
|
|
|
|
|
|
|
func cmdHead(config configCollect) {
|
|
|
|
rc := NewRepoCommits(config)
|
|
|
|
|
|
|
|
rc.CollectDescs()
|
|
|
|
log.Println("Repo contains", len(rc.CommitDesc), "commits")
|
|
|
|
|
|
|
|
rc.CollectContent()
|
|
|
|
rc.BuildGraph()
|
2021-04-22 10:38:52 +00:00
|
|
|
log.Println("Repo has", len(rc.Root), "sources")
|
2021-04-22 14:15:54 +00:00
|
|
|
if len(rc.Root) > 1 {
|
|
|
|
for cn, _ := range rc.Root {
|
|
|
|
log.Println("Commit "+cn.Id+"\n"+cn.Content.String())
|
|
|
|
}
|
|
|
|
}
|
2021-04-22 10:38:52 +00:00
|
|
|
|
2021-04-22 09:29:04 +00:00
|
|
|
rc.FindLeafs()
|
2021-04-22 10:38:52 +00:00
|
|
|
log.Println("Repo has", len(rc.Leafs), "sinks")
|
2021-04-22 09:29:04 +00:00
|
|
|
|
|
|
|
rc.ChooseHead()
|
|
|
|
log.Println("Proposing following HEAD:\n"+rc.Head.Content.String())
|
|
|
|
}
|
2021-04-22 20:43:44 +00:00
|
|
|
|
2021-04-23 10:18:38 +00:00
|
|
|
func cmdLs(config *configCollect) {
|
2021-04-22 20:43:44 +00:00
|
|
|
rf := NewRepoFs(config)
|
2021-04-23 10:18:38 +00:00
|
|
|
log.Println(rf.EntryNode.String())
|
2021-04-22 20:43:44 +00:00
|
|
|
}
|