more cleanups to fix forgepb values
This commit is contained in:
parent
a71305ea52
commit
0e84f2f1c1
3
cobol.go
3
cobol.go
|
@ -109,9 +109,6 @@ func verifyPrint(repo *gitpb.Repo) {
|
|||
}
|
||||
|
||||
func verify(repo *gitpb.Repo, s map[string]string) bool {
|
||||
if !repo.IsValid() {
|
||||
// return false
|
||||
}
|
||||
s["gopath"] = repo.GetGoPath()
|
||||
s["rtype"] = repo.RepoType()
|
||||
|
||||
|
|
23
doCommon.go
23
doCommon.go
|
@ -53,29 +53,6 @@ func doGitReset() {
|
|||
}
|
||||
}
|
||||
|
||||
func doFix() {
|
||||
all := me.found.SortByGoPath()
|
||||
for all.Scan() {
|
||||
repo := all.Next()
|
||||
if !repo.IsValid() {
|
||||
log.Printf("%10s %-50s", "old?\n", repo.GoPath)
|
||||
me.forge.Repos.DeleteByGoPath(repo.GoPath)
|
||||
configSave = true
|
||||
continue
|
||||
}
|
||||
log.Printf("running on: %-50s\n", repo.GetGoPath())
|
||||
cmd := []string{"ls"}
|
||||
repo.Run(cmd)
|
||||
if err := checkoutBranches(repo); err != nil {
|
||||
badExit(err)
|
||||
}
|
||||
}
|
||||
if configSave {
|
||||
me.forge.Repos.ConfigSave()
|
||||
okExit("config saved")
|
||||
}
|
||||
}
|
||||
|
||||
func checkoutBranches(repo *gitpb.Repo) error {
|
||||
dname := repo.GetDevelBranchName()
|
||||
if dname == "" {
|
||||
|
|
41
doDelete.go
41
doDelete.go
|
@ -1,41 +0,0 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"go.wit.com/lib/protobuf/gitpb"
|
||||
"go.wit.com/log"
|
||||
)
|
||||
|
||||
func Delete(repo *gitpb.Repo, s map[string]string) bool {
|
||||
if repo.Published == nil {
|
||||
log.Info("published is nil", repo.Published)
|
||||
} else {
|
||||
log.Info("published len", repo.Published.Len())
|
||||
}
|
||||
|
||||
// add a new one here
|
||||
newr := gitpb.Repo{
|
||||
FullPath: repo.FullPath,
|
||||
GoPath: repo.GoPath,
|
||||
URL: repo.URL,
|
||||
Tags: repo.Tags,
|
||||
LastPull: repo.LastPull,
|
||||
MasterBranchName: repo.MasterBranchName,
|
||||
DevelBranchName: repo.DevelBranchName,
|
||||
UserBranchName: repo.UserBranchName,
|
||||
GoLibrary: repo.GoLibrary,
|
||||
GoBinary: repo.GoBinary,
|
||||
GoPrimitive: repo.GoPrimitive,
|
||||
GoPlugin: repo.GoPlugin,
|
||||
GoDeps: repo.GoDeps,
|
||||
LastGoDep: repo.LastGoDep,
|
||||
Dirty: repo.Dirty,
|
||||
Published: repo.Published,
|
||||
TargetVersion: repo.TargetVersion,
|
||||
ReadOnly: repo.ReadOnly,
|
||||
GoProtobuf: repo.GoProtobuf,
|
||||
}
|
||||
if argv.Fix {
|
||||
me.forge.Repos.AppendUniqueGoPath(&newr)
|
||||
}
|
||||
return true
|
||||
}
|
11
main.go
11
main.go
|
@ -29,6 +29,10 @@ func main() {
|
|||
me.forge = forgepb.Init()
|
||||
me.found = new(gitpb.Repos)
|
||||
|
||||
if argv.Fix {
|
||||
okExit("")
|
||||
}
|
||||
|
||||
// first find the repos or gopaths to operate on
|
||||
if argv.Config {
|
||||
if findConfig() {
|
||||
|
@ -38,6 +42,7 @@ func main() {
|
|||
} else {
|
||||
findRepos()
|
||||
}
|
||||
// okExit("")
|
||||
|
||||
log.Info("found", me.found.Len(), "repos. found", len(me.foundPaths), "paths from .config/forge")
|
||||
|
||||
|
@ -69,12 +74,6 @@ func main() {
|
|||
done = true
|
||||
}
|
||||
|
||||
if argv.Fix {
|
||||
// print out the repos
|
||||
doFix()
|
||||
done = true
|
||||
}
|
||||
|
||||
if argv.DoPatchSet {
|
||||
sendDevelDiff()
|
||||
// sendMasterDiff()
|
||||
|
|
Loading…
Reference in New Issue