repolist/configfile.go

92 lines
2.1 KiB
Go
Raw Normal View History

2024-02-22 21:12:35 -06:00
package repolist
/*
2024-02-23 07:02:31 -06:00
func (rl *RepoList) ArgGitPull() bool {
var localonly int
var badmap int
2024-02-23 11:01:23 -06:00
log.Log(REPOWARN, "running git pull everywhere")
2024-02-23 07:02:31 -06:00
var failed int = 0
2024-11-14 21:48:00 -06:00
loop := rl.ReposSortByName()
for loop.Scan() {
repo := loop.Repo()
2024-02-29 19:51:56 -06:00
if out, err := repo.Status.GitPull(); err == nil {
log.Log(REPOWARN, "Ran git pull ok", repo.Status.Path(), out)
2024-02-23 07:02:31 -06:00
} else {
failed += 1
repo.Status.DumpTags()
2024-02-29 19:51:56 -06:00
if errors.Is(repostatus.ErrorGitPullOnLocal, err) {
localonly += 1
continue
}
2024-02-29 19:51:56 -06:00
badmap += 1
log.Log(REPOWARN, "bad unknown git error", repo.Status.Path(), out, err)
2024-02-23 07:02:31 -06:00
}
}
2024-02-23 11:01:23 -06:00
log.Log(REPOWARN, "Ran git pull in all repos. failure count =", failed)
2024-02-29 19:51:56 -06:00
log.Log(REPOWARN, "Ran git pull in all repos. bad errors =", badmap)
if localonly != 0 {
log.Log(REPOWARN, "Ran git pull in all repos. ignored local only branches =", localonly)
}
2024-02-23 07:02:31 -06:00
return true
}
func (rl *RepoList) ArgCheckoutDevel() bool {
2024-02-23 11:01:23 -06:00
log.Log(REPOWARN, "running git checkout devel everwhere")
2024-02-23 07:02:31 -06:00
var failed int = 0
2024-02-25 13:10:23 -06:00
var count int = 0
2024-11-14 21:48:00 -06:00
loop := rl.ReposSortByName()
for loop.Scan() {
repo := loop.Repo()
2024-02-25 13:10:23 -06:00
count += 1
if repo.Status.CheckoutDevel() {
// checkout ok
} else {
failed += 1
2024-02-23 07:02:31 -06:00
}
2024-02-25 13:10:23 -06:00
}
log.Log(REPOWARN, "Ran git checkout in", count, "repos. failure count =", failed)
return true
}
func (rl *RepoList) ArgCheckoutMaster() bool {
log.Log(REPOWARN, "running git checkout master everwhere")
var failed int = 0
var count int = 0
2024-11-14 21:48:00 -06:00
loop := rl.ReposSortByName()
for loop.Scan() {
repo := loop.Repo()
2024-02-25 13:10:23 -06:00
count += 1
if repo.Status.CheckoutMaster() {
// checkout ok
} else {
failed += 1
2024-02-23 07:02:31 -06:00
}
2024-02-25 13:10:23 -06:00
}
log.Log(REPOWARN, "Ran git checkout in", count, "repos. failure count =", failed)
return true
}
func (rl *RepoList) ArgCheckoutUser() bool {
log.Log(REPOWARN, "running git checkout master everwhere")
var failed int = 0
var count int = 0
2024-11-14 21:48:00 -06:00
loop := rl.ReposSortByName()
for loop.Scan() {
repo := loop.Repo()
2024-02-25 13:10:23 -06:00
count += 1
if repo.Status.CheckoutUser() {
// checkout ok
2024-02-23 07:02:31 -06:00
} else {
failed += 1
}
}
2024-02-25 13:10:23 -06:00
log.Log(REPOWARN, "Ran git checkout in", count, "repos. failure count =", failed)
2024-02-23 07:02:31 -06:00
return true
}
2024-03-01 18:03:17 -06:00
func (rl *RepoList) Cfgfile() string {
return rl.cfgfile
}
2024-12-03 00:34:39 -06:00
*/