make a test checkout devel function
This commit is contained in:
parent
625dfe2f68
commit
0e05b773cf
45
branches.go
45
branches.go
|
@ -204,6 +204,51 @@ func (f *Forge) makeUserBranches() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func testReload(repo *gitpb.Repo) error {
|
||||
if !repo.DidRepoChange() {
|
||||
return nil
|
||||
}
|
||||
repo.Reload()
|
||||
return log.Errorf("repo changed")
|
||||
}
|
||||
|
||||
func (f *Forge) DoAllCheckoutDevelNew(force bool) error {
|
||||
f.makeDevelBranches()
|
||||
|
||||
// first run git checkout
|
||||
stats := f.RillFuncError(rillCheckoutDevel)
|
||||
for path, stat := range stats {
|
||||
dur := stat.End.Sub(stat.Start)
|
||||
if dur > 1*time.Second {
|
||||
log.Infof("%s git checkout took a long time (%s)\n", path, shell.FormatDuration(dur))
|
||||
}
|
||||
if stat.Err == nil {
|
||||
// there was no error
|
||||
continue
|
||||
}
|
||||
// didn't change to devel
|
||||
}
|
||||
|
||||
var counter int
|
||||
// recreate the repo protobuf
|
||||
stats = f.RillFuncError(testReload)
|
||||
for path, stat := range stats {
|
||||
dur := stat.End.Sub(stat.Start)
|
||||
if dur > 1*time.Second {
|
||||
log.Infof("%s # Reload took a long time (%s)\n", path, shell.FormatDuration(dur))
|
||||
}
|
||||
if stat.Err == nil {
|
||||
// repo didn't reload
|
||||
continue
|
||||
}
|
||||
// repo reloaded
|
||||
counter += 1
|
||||
}
|
||||
log.Info("reloaded", counter, "repos")
|
||||
f.configSave = true
|
||||
return nil
|
||||
}
|
||||
|
||||
// is every repo on the devel branch?
|
||||
func (f *Forge) DoAllCheckoutDevel(force bool) error {
|
||||
now := time.Now()
|
||||
|
|
Loading…
Reference in New Issue