summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--argv.go9
-rw-r--r--doPull.go16
2 files changed, 21 insertions, 4 deletions
diff --git a/argv.go b/argv.go
index 524c91f..324855c 100644
--- a/argv.go
+++ b/argv.go
@@ -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...)
}
diff --git a/doPull.go b/doPull.go
index 80405ff..ad9d3ef 100644
--- a/doPull.go
+++ b/doPull.go
@@ -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")