code moved to gitpb
This commit is contained in:
parent
e25095f2e7
commit
7f1f8d4028
|
@ -1,39 +1,39 @@
|
||||||
package forgepb
|
package forgepb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
|
|
||||||
"go.wit.com/lib/gui/repostatus"
|
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (f *Forge) GitPull() bool {
|
func (f *Forge) GitPull() bool {
|
||||||
var localonly int
|
f.Repos.RillGitPull(5, 5)
|
||||||
var badmap int
|
/*
|
||||||
|
|
||||||
log.Log(FORGEPBWARN, "running git pull everywhere")
|
var localonly int
|
||||||
var failed int = 0
|
var badmap int
|
||||||
loop := f.Repos.SortByGoPath()
|
|
||||||
for loop.Scan() {
|
log.Log(FORGEPBWARN, "running git pull everywhere")
|
||||||
repo := loop.Next()
|
var failed int = 0
|
||||||
if out, err := repo.GitPull(); err == nil {
|
for loop.Scan() {
|
||||||
log.Log(FORGEPBWARN, "Ran git pull ok", repo.GetGoPath(), out)
|
repo := loop.Next()
|
||||||
} else {
|
if out, err := repo.GitPull(); err == nil {
|
||||||
failed += 1
|
log.Log(FORGEPBWARN, "Ran git pull ok", repo.GetGoPath(), out)
|
||||||
// repo.DumpTags()
|
} else {
|
||||||
if errors.Is(repostatus.ErrorGitPullOnLocal, err) {
|
failed += 1
|
||||||
localonly += 1
|
// repo.DumpTags()
|
||||||
continue
|
if errors.Is(repostatus.ErrorGitPullOnLocal, err) {
|
||||||
|
localonly += 1
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
badmap += 1
|
||||||
|
log.Log(FORGEPBWARN, "bad unknown git error", repo.GetGoPath(), out, err)
|
||||||
}
|
}
|
||||||
badmap += 1
|
|
||||||
log.Log(FORGEPBWARN, "bad unknown git error", repo.GetGoPath(), out, err)
|
|
||||||
}
|
}
|
||||||
}
|
log.Log(FORGEPBWARN, "Ran git pull in all repos. failure count =", failed)
|
||||||
log.Log(FORGEPBWARN, "Ran git pull in all repos. failure count =", failed)
|
log.Log(FORGEPBWARN, "Ran git pull in all repos. bad errors =", badmap)
|
||||||
log.Log(FORGEPBWARN, "Ran git pull in all repos. bad errors =", badmap)
|
if localonly != 0 {
|
||||||
if localonly != 0 {
|
log.Log(FORGEPBWARN, "Ran git pull in all repos. ignored local only branches =", localonly)
|
||||||
log.Log(FORGEPBWARN, "Ran git pull in all repos. ignored local only branches =", localonly)
|
}
|
||||||
}
|
*/
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
25
goSrcScan.go
25
goSrcScan.go
|
@ -108,31 +108,6 @@ func IsGitDir(dir string) bool {
|
||||||
return info.IsDir()
|
return info.IsDir()
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
// rill is awesome. long live rill
|
|
||||||
func rillAddDirs(gopaths []string) {
|
|
||||||
// Convert a slice of user IDs into a channel
|
|
||||||
ids := rill.FromSlice(gopaths, nil)
|
|
||||||
|
|
||||||
// Read users from the API.
|
|
||||||
// Concurrency = 20
|
|
||||||
dirs := rill.Map(ids, 20, func(id string) (*repolist.RepoRow, error) {
|
|
||||||
return me.repos.View.FindByName(id), nil
|
|
||||||
})
|
|
||||||
|
|
||||||
// Activate users.
|
|
||||||
// Concurrency = 10
|
|
||||||
err := rill.ForEach(dirs, 10, func(repo *repolist.RepoRow) error {
|
|
||||||
fmt.Printf("Repo found : %s\n", repo.GoPath())
|
|
||||||
repo.Run([]string{"git", "pull"})
|
|
||||||
return nil
|
|
||||||
})
|
|
||||||
|
|
||||||
// Handle errors
|
|
||||||
fmt.Println("Error:", err)
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// rill is awesome. long live rill
|
// rill is awesome. long live rill
|
||||||
// attempt scan with rill
|
// attempt scan with rill
|
||||||
func (f *Forge) rillScanDirs(gopaths []string) (int, error) {
|
func (f *Forge) rillScanDirs(gopaths []string) (int, error) {
|
||||||
|
|
Loading…
Reference in New Issue