~jameinel/juju-core/api-registry-tracks-type

« back to all changes in this revision

Viewing changes to cmd/juju/publish.go

Merge trunk and resolve conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
        if err != nil {
118
118
                return fmt.Errorf("cannot obtain local digest: %v", err)
119
119
        }
120
 
        log.Infof("cmd/juju: local digest is %s", localDigest)
 
120
        log.Infof("local digest is %s", localDigest)
121
121
 
122
122
        ch, err := charm.ReadDir(branch.Location())
123
123
        if err != nil {
131
131
        if _, ok := err.(*charm.NotFoundError); ok {
132
132
                oldEvent, err = charm.Store.Event(curl, "")
133
133
                if _, ok := err.(*charm.NotFoundError); ok {
134
 
                        log.Infof("cmd/juju: charm %s is not yet in the store", curl)
 
134
                        log.Infof("charm %s is not yet in the store", curl)
135
135
                        err = nil
136
136
                }
137
137
        }
143
143
                return handleEvent(ctx, curl, oldEvent)
144
144
        }
145
145
 
146
 
        log.Infof("cmd/juju: sending charm to the charm store...")
 
146
        log.Infof("sending charm to the charm store...")
147
147
 
148
148
        err = branch.Push(&bzr.PushAttr{Location: pushLocation, Remember: true})
149
149
        if err != nil {
150
150
                return err
151
151
        }
152
 
        log.Infof("cmd/juju: charm sent; waiting for it to be published...")
 
152
        log.Infof("charm sent; waiting for it to be published...")
153
153
        for {
154
154
                time.Sleep(c.pollDelay)
155
155
                newEvent, err := charm.Store.Event(curl, "")
175
175
        switch event.Kind {
176
176
        case "published":
177
177
                curlRev := curl.WithRevision(event.Revision)
178
 
                log.Infof("cmd/juju: charm published at %s as %s", event.Time, curlRev)
 
178
                log.Infof("charm published at %s as %s", event.Time, curlRev)
179
179
                fmt.Fprintln(ctx.Stdout, curlRev)
180
180
        case "publish-error":
181
181
                return fmt.Errorf("charm could not be published: %s", strings.Join(event.Errors, "; "))