diff options
| -rw-r--r-- | argv.go | 11 | ||||
| -rw-r--r-- | doRepos.go | 15 |
2 files changed, 21 insertions, 5 deletions
@@ -39,11 +39,12 @@ type PatchCmd struct { } type ReposCmd struct { - List *EmptyCmd `arg:"subcommand:list" help:"list the repos"` - Pull *EmptyCmd `arg:"subcommand:pull" help:"'git pull' on the repos"` - Scan *EmptyCmd `arg:"subcommand:scan" help:"scan the forged repo dir"` - Fix *EmptyCmd `arg:"subcommand:fix" help:"try to fix the repo PB"` - Devel *EmptyCmd `arg:"subcommand:devel" help:"list repos with devel branches"` + List *EmptyCmd `arg:"subcommand:list" help:"list the repos"` + Pull *EmptyCmd `arg:"subcommand:pull" help:"'git pull' on the repos"` + Scan *EmptyCmd `arg:"subcommand:scan" help:"scan the forged repo dir"` + Fix *EmptyCmd `arg:"subcommand:fix" help:"try to fix the repo PB"` + Devel *EmptyCmd `arg:"subcommand:devel" help:"list repos with devel branches"` + Reload *EmptyCmd `arg:"subcommand:reload" help:"gitpb.Reload() each repo"` // Reload *EmptyCmd `arg:"subcommand:reload" help:"do Reload() on each git repo"` // Clean *EmptyCmd `arg:"subcommand:clean" help:"clean the repos"` // Merge *EmptyCmd `arg:"subcommand:merge" help:"merge in new patchsets"` @@ -19,6 +19,7 @@ func doRepos() error { // return doReposList() return nil } + if argv.Repos.Devel != nil { found := gitpb.NewRepos() for repo := range me.forge.Repos.IterAll() { @@ -31,6 +32,20 @@ func doRepos() error { return nil } + if argv.Repos.Reload != nil { + var count int + for repo := range me.forge.Repos.IterAll() { + if err := repo.ReloadCheck(); err != nil { + count += 1 + } + } + log.Info("repos reloaded:", count) + if count > 0 { + me.forge.SaveRepos() + } + return nil + } + if argv.Repos.Scan != nil { log.Infof("start repos scan repos.Len()=%d %s\n", me.forge.Repos.Len(), me.forge.Config.ReposDir) _, err := scanForgedDir(me.forge.Config.ReposDir) |
