def versions(self, version=None):
        """
        List of Versions of this repository.

        :param version: Version index.
        :param rev: Commit sha or ref.

        :return: List of Version objects matching params.
        """
        try:
            versions = [Version(self, c) for c in self._commits()]
        except Exception, e:
            log.debug('No versions exist')
            return []
        if version is not None and versions:
            try:
                versions = versions[version]
            except __HOLE__:
                raise VersionError('Version %s does not exist' % version)
        return versions
dataset/ETHPy150Open rsgalloway/grit/grit/repo/local.py/Local.versions