func ReadVersion(r io.Reader) (string, error) {
	scanner := bufio.NewScanner(r)
	scanner.Scan()
	if err := scanner.Err(); err != nil {
		return "", errors.Annotate(err, "cannot read version file")
	}

	// bzr revision info starts with "revision-id: " so strip that.
	revLine := strings.TrimPrefix(scanner.Text(), "revision-id: ")
	return fmt.Sprintf("%.100s", revLine), nil
}
// ReadVersion extracts the VCS version from a charm's version file.
ReadVersion extracts the VCS version from a charm's version file.
// ReadVersion extracts the VCS version from a charm ' s version file .
func ReadVersion(r io.Reader) (string, error) {
	scanner := bufio.NewScanner(r)
	scanner.Scan()
	if err := scanner.Err(); err != nil {
		return "", errors.Annotate(err, "cannot read version file")
	}
	revLine := strings.TrimPrefix(scanner.Text(), "revision-id: ")
	return fmt.Sprintf("%.100s", revLine), nil
}
func ReadVersion ( r io . Reader ) ( string , error ) { scanner := bufio . NewScanner ( r ) scanner . Scan ( ) if err := scanner . Err ( ) ; err != nil { return " " , errors . Annotate ( err , " " ) } revLine := strings . TrimPrefix ( scanner . Text ( ) , " " ) return fmt . Sprintf ( " " , revLine ) , nil }
ReadVersion extracts the VCS version from a charm's version file.
ReadVersion extracts the VCS version from a charm ' s version file .
// bzr revision info starts with "revision-id: " so strip that.