func (c *Client) UploadCharmWithRevision(id *charm.URL, ch charm.Charm, promulgatedRevision int) error {
	if id.Revision == -1 {
		return errgo.Newf("revision not specified in %q", id)
	}
	r, hash, size, err := openArchive(ch)
	if err != nil {
		return errgo.Notef(err, "cannot open charm archive")
	}
	defer r.Close()
	_, err = c.UploadArchive(id, r, hash, size, promulgatedRevision, nil)
	return errgo.Mask(err, isAPIError)
}
// UploadCharmWithRevision uploads the given charm to the
// given id in the charm store, which must contain a revision.
// If promulgatedRevision is not -1, it specifies that the charm
// should be marked as promulgated with that revision.
//
// This method is provided only for testing and should not
// generally be used otherwise.
UploadCharmWithRevision uploads the given charm to the
given id in the charm store, which must contain a revision.
If promulgatedRevision is not -1, it specifies that the charm
should be marked as promulgated with that revision.

This method is provided only for testing and should not
generally be used otherwise.
// UploadCharmWithRevision uploads the given charm to the // given id in the charm store which must contain a revision . // If promulgatedRevision is not - 1 it specifies that the charm // should be marked as promulgated with that revision . // // This method is provided only for testing and should not // generally be used otherwise .
func (c *Client) UploadCharmWithRevision(id *charm.URL, ch charm.Charm, promulgatedRevision int) error {
	if id.Revision == -1 {
		return errgo.Newf("revision not specified in %q", id)
	}
	r, hash, size, err := openArchive(ch)
	if err != nil {
		return errgo.Notef(err, "cannot open charm archive")
	}
	defer r.Close()
	_, err = c.UploadArchive(id, r, hash, size, promulgatedRevision, nil)
	return errgo.Mask(err, isAPIError)
}
func ( c * Client ) UploadCharmWithRevision ( id * charm . URL , ch charm . Charm , promulgatedRevision int ) error { if id . Revision == - 1 { return errgo . Newf ( " " , id ) } r , hash , size , err := openArchive ( ch ) if err != nil { return errgo . Notef ( err , " " ) } defer r . Close ( ) _ , err = c . UploadArchive ( id , r , hash , size , promulgatedRevision , nil ) return errgo . Mask ( err , isAPIError ) }
UploadCharmWithRevision uploads the given charm to the
given id in the charm store, which must contain a revision.
UploadCharmWithRevision uploads the given charm to the given id in the charm store which must contain a revision .