92 lines
2.1 KiB
Go
92 lines
2.1 KiB
Go
package repolist
|
|
|
|
/*
|
|
func (rl *RepoList) ArgGitPull() bool {
|
|
var localonly int
|
|
var badmap int
|
|
|
|
log.Log(REPOWARN, "running git pull everywhere")
|
|
var failed int = 0
|
|
loop := rl.ReposSortByName()
|
|
for loop.Scan() {
|
|
repo := loop.Repo()
|
|
if out, err := repo.Status.GitPull(); err == nil {
|
|
log.Log(REPOWARN, "Ran git pull ok", repo.Status.Path(), out)
|
|
} else {
|
|
failed += 1
|
|
repo.Status.DumpTags()
|
|
if errors.Is(repostatus.ErrorGitPullOnLocal, err) {
|
|
localonly += 1
|
|
continue
|
|
}
|
|
badmap += 1
|
|
log.Log(REPOWARN, "bad unknown git error", repo.Status.Path(), out, err)
|
|
}
|
|
}
|
|
log.Log(REPOWARN, "Ran git pull in all repos. failure count =", failed)
|
|
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)
|
|
}
|
|
return true
|
|
}
|
|
|
|
func (rl *RepoList) ArgCheckoutDevel() bool {
|
|
log.Log(REPOWARN, "running git checkout devel everwhere")
|
|
var failed int = 0
|
|
var count int = 0
|
|
loop := rl.ReposSortByName()
|
|
for loop.Scan() {
|
|
repo := loop.Repo()
|
|
count += 1
|
|
if repo.Status.CheckoutDevel() {
|
|
// checkout ok
|
|
} else {
|
|
failed += 1
|
|
}
|
|
}
|
|
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
|
|
loop := rl.ReposSortByName()
|
|
for loop.Scan() {
|
|
repo := loop.Repo()
|
|
count += 1
|
|
if repo.Status.CheckoutMaster() {
|
|
// checkout ok
|
|
} else {
|
|
failed += 1
|
|
}
|
|
}
|
|
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
|
|
loop := rl.ReposSortByName()
|
|
for loop.Scan() {
|
|
repo := loop.Repo()
|
|
count += 1
|
|
if repo.Status.CheckoutUser() {
|
|
// checkout ok
|
|
} else {
|
|
failed += 1
|
|
}
|
|
}
|
|
log.Log(REPOWARN, "Ran git checkout in", count, "repos. failure count =", failed)
|
|
return true
|
|
}
|
|
|
|
func (rl *RepoList) Cfgfile() string {
|
|
return rl.cfgfile
|
|
}
|
|
*/
|