diff options
| -rw-r--r-- | argv.go | 9 | ||||
| -rw-r--r-- | doPull.go | 16 |
2 files changed, 21 insertions, 4 deletions
@@ -114,9 +114,10 @@ type SubmitCmd struct { } type PullCmd struct { - Force bool `arg:"--force" help:"try to strong-arm things"` - List *EmptyCmd `arg:"subcommand:list" help:"list repo versions"` - Check *EmptyCmd `arg:"subcommand:check" help:"check for repo changes"` + Force bool `arg:"--force" help:"try to strong-arm things"` + List *EmptyCmd `arg:"subcommand:list" help:"list repo versions"` + Check *EmptyCmd `arg:"subcommand:check" help:"check for repo changes"` + Update *EmptyCmd `arg:"subcommand:update" help:"report updates"` } type TagCmd struct { @@ -205,7 +206,7 @@ func (args) Appname() string { func (a args) DoAutoComplete(pb *prep.Auto) { if pb.Cmd == "" { - pb.Autocomplete3([]string{"checkout", "reset", "commit", "config", "gui", "merge", "normal", "patch", "pull", "show"}) + pb.Autocomplete3([]string{"checkout", "reset", "commit", "config", "gui", "merge", "normal", "patch", "pull", "show", "--version"}) } else { pb.SubCommand(pb.Argv...) } @@ -50,6 +50,22 @@ func needToUpdateRepo(repo *gitpb.Repo) (*gitpb.Repo, error) { // is every repo on the devel branch? func doPull() error { + if argv.Pull.Update != nil { + submit := me.forge.PrepareCheckRepos() + updatepb, regPB, err := submit.HttpPost(myServer(), "updateURL") + if err != nil { + log.Info("err =", err) + } + if regPB == nil { + log.Info("regPB==nil") + } + if updatepb == nil { + log.Info("server sent nil back") + return err + } + log.Infof("pull update pb.Len()=%d\n", updatepb.Len()) + return nil + } if argv.Pull.Check != nil { submit := me.forge.PrepareCheckRepos() updatepb, regPB, err := submit.HttpPost(myServer(), "check") |
