smarter IsReadOnly() logic
This commit is contained in:
parent
135f1e5f42
commit
0fa1ea471f
|
@ -107,7 +107,7 @@ func goodGodeps(repo *repolist.RepoRow) bool {
|
||||||
for deps.Scan() {
|
for deps.Scan() {
|
||||||
depRepo := deps.Next()
|
depRepo := deps.Next()
|
||||||
// log.Info("found dep", depRepo.GetGoPath())
|
// log.Info("found dep", depRepo.GetGoPath())
|
||||||
if me.forge.IsReadOnly(depRepo.GetGoPath()) {
|
if me.forge.Config.IsReadOnly(depRepo.GoPath) {
|
||||||
// log.Info("IsReadOnly = true", depRepo.GetGoPath())
|
// log.Info("IsReadOnly = true", depRepo.GetGoPath())
|
||||||
continue
|
continue
|
||||||
} else {
|
} else {
|
||||||
|
@ -156,7 +156,7 @@ func fixGodeps(check *gitpb.Repo) bool {
|
||||||
for deps.Scan() {
|
for deps.Scan() {
|
||||||
depRepo := deps.Next()
|
depRepo := deps.Next()
|
||||||
// log.Info("found dep", depRepo.GetGoPath())
|
// log.Info("found dep", depRepo.GetGoPath())
|
||||||
if me.forge.IsReadOnly(depRepo.GetGoPath()) {
|
if me.forge.Config.IsReadOnly(depRepo.GoPath) {
|
||||||
log.Info("IsReadOnly = true", depRepo.GetGoPath())
|
log.Info("IsReadOnly = true", depRepo.GetGoPath())
|
||||||
continue
|
continue
|
||||||
} else {
|
} else {
|
||||||
|
|
21
human.go
21
human.go
|
@ -25,7 +25,7 @@ func PrintReport(readonly string, onlydirty string, perfect string) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if repo.ReadOnly() {
|
if me.forge.Config.IsReadOnly(repo.GoPath()) {
|
||||||
if readonly == "true" {
|
if readonly == "true" {
|
||||||
log.Info(header + "readonly")
|
log.Info(header + "readonly")
|
||||||
}
|
}
|
||||||
|
@ -60,28 +60,21 @@ func PrintReleaseReport(readonly string, perfect string) {
|
||||||
|
|
||||||
log.Info(repolist.ReleaseReportHeader())
|
log.Info(repolist.ReleaseReportHeader())
|
||||||
|
|
||||||
loop := me.repos.View.ReposSortByName()
|
loop := me.forge.Repos.SortByGoPath()
|
||||||
for loop.Scan() {
|
for loop.Scan() {
|
||||||
repo := loop.Repo()
|
check := loop.Next()
|
||||||
|
if me.forge.IsReadOnly(check) {
|
||||||
if repo.ReadOnly() && (readonly == "true") {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if (repo.State() == "PERFECT") && (perfect == "true") {
|
if check.GetCurrentBranchVersion() == check.GetTargetVersion() {
|
||||||
continue
|
|
||||||
}
|
|
||||||
if repo.Status.IsReleased() {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
count += 1
|
count += 1
|
||||||
header := repo.StandardReleaseHeader()
|
|
||||||
log.Info(header)
|
|
||||||
check := me.forge.Repos.FindByGoPath(repo.GoPath())
|
|
||||||
if check == nil {
|
if check == nil {
|
||||||
log.Info("boo, you didn't git clone", repo.GoPath())
|
log.Info("boo, you didn't git clone", check.GoPath)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
log.Info(me.forge.StandardReleaseHeader(check, repo.State()))
|
log.Info(me.forge.StandardReleaseHeader(check, ""))
|
||||||
}
|
}
|
||||||
log.Info(fmt.Sprintf("total repo count = %d", count))
|
log.Info(fmt.Sprintf("total repo count = %d", count))
|
||||||
}
|
}
|
||||||
|
|
2
main.go
2
main.go
|
@ -110,7 +110,7 @@ func main() {
|
||||||
loop := me.repos.View.ReposSortByName()
|
loop := me.repos.View.ReposSortByName()
|
||||||
for loop.Scan() {
|
for loop.Scan() {
|
||||||
repo := loop.Repo()
|
repo := loop.Repo()
|
||||||
if me.forge.IsReadOnly(repo.GoPath()) {
|
if me.forge.Config.IsReadOnly(repo.GoPath()) {
|
||||||
repo.Status.SetReadOnly(true)
|
repo.Status.SetReadOnly(true)
|
||||||
} else {
|
} else {
|
||||||
repo.Status.SetReadOnly(false)
|
repo.Status.SetReadOnly(false)
|
||||||
|
|
|
@ -91,7 +91,6 @@ func makePrepareRelease() {
|
||||||
repo.Status.IncrementRevisionVersion("godeps changed")
|
repo.Status.IncrementRevisionVersion("godeps changed")
|
||||||
target := repo.Status.GetTargetVersion()
|
target := repo.Status.GetTargetVersion()
|
||||||
check.SetTargetVersion(target)
|
check.SetTargetVersion(target)
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue