'GET /api/repository_revisions
Displays a collection (list) of repository revisions.'

@web.expose_api_anonymous
def index(self, trans, **kwd):

    repository_metadata_dicts = []
    clause_list = []
    downloadable = kwd.get('downloadable', None)
    if (downloadable is not None):
        clause_list.append((trans.model.RepositoryMetadata.table.c.downloadable == util.asbool(downloadable)))
    malicious = kwd.get('malicious', None)
    if (malicious is not None):
        clause_list.append((trans.model.RepositoryMetadata.table.c.malicious == util.asbool(malicious)))
    missing_test_components = kwd.get('missing_test_components', None)
    if (missing_test_components is not None):
        clause_list.append((trans.model.RepositoryMetadata.table.c.missing_test_components == util.asbool(missing_test_components)))
    includes_tools = kwd.get('includes_tools', None)
    if (includes_tools is not None):
        clause_list.append((trans.model.RepositoryMetadata.table.c.includes_tools == util.asbool(includes_tools)))
    for repository_metadata in trans.sa_session.query(trans.app.model.RepositoryMetadata).filter(and_(*clause_list)).order_by(trans.app.model.RepositoryMetadata.table.c.repository_id.desc()):
        repository_metadata_dict = repository_metadata.to_dict(view='collection', value_mapper=self.__get_value_mapper(trans))
        repository_metadata_dict['url'] = web.url_for(controller='repository_revisions', action='show', id=trans.security.encode_id(repository_metadata.id))
        repository_metadata_dicts.append(repository_metadata_dict)
    return repository_metadata_dicts
