'GET /api/repository_revisions/{encoded repository_metadata id}/repository_dependencies
Returns a list of dictionaries that each define a specific downloadable revision of a
repository in the Tool Shed.  This method returns dictionaries with more information in
them than other methods in this controller.  The information about repository_metdata is
enhanced to include information about the repository (e.g., name, owner, etc) associated
with the repository_metadata record.
:param id: the encoded id of the `RepositoryMetadata` object'

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

    repository_dependencies_dicts = []
    repository_metadata = metadata_util.get_repository_metadata_by_id(trans.app, id)
    if (repository_metadata is None):
        log.debug(('Invalid    repository_metadata    id    received:    %s' % str(id)))
        return repository_dependencies_dicts
    metadata = repository_metadata.metadata
    if (metadata is None):
        log.debug(('The    repository_metadata    record    with    id    %s    has    no    metadata.' % str(id)))
        return repository_dependencies_dicts
    if ('repository_dependencies' in metadata):
        rd_tups = metadata['repository_dependencies']['repository_dependencies']
        for rd_tup in rd_tups:
            (tool_shed, name, owner, changeset_revision) = rd_tup[0:4]
            repository_dependency = repository_util.get_repository_by_name_and_owner(trans.app, name, owner)
            if (repository_dependency is None):
                log.dbug(('Cannot    locate    repository    dependency    %s    owned    by    %s.' % (name, owner)))
                continue
            repository_dependency_id = trans.security.encode_id(repository_dependency.id)
            repository_dependency_repository_metadata = metadata_util.get_repository_metadata_by_changeset_revision(trans.app, repository_dependency_id, changeset_revision)
            if (repository_dependency_repository_metadata is None):
                repo = hg_util.get_repo_for_repository(trans.app, repository=repository_dependency, repo_path=None, create=False)
                new_changeset_revision = metadata_util.get_next_downloadable_changeset_revision(repository_dependency, repo, changeset_revision)
                if (new_changeset_revision != changeset_revision):
                    repository_dependency_repository_metadata = metadata_util.get_repository_metadata_by_changeset_revision(trans.app, repository_dependency_id, new_changeset_revision)
                    changeset_revision = new_changeset_revision
                else:
                    decoded_repository_dependency_id = trans.security.decode_id(repository_dependency_id)
                    debug_msg = ('Cannot    locate    repository_metadata    with    id    %d    for    repository    dependency    %s    owned    by    %s    ' % (decoded_repository_dependency_id, str(name), str(owner)))
                    debug_msg += ('using    either    of    these    changeset_revisions:    %s,    %s.' % (str(changeset_revision), str(new_changeset_revision)))
                    log.debug(debug_msg)
                    continue
            repository_dependency_metadata_dict = repository_dependency_repository_metadata.to_dict(view='element', value_mapper=self.__get_value_mapper(trans))
            repository_dependency_dict = repository_dependency.to_dict(view='element', value_mapper=self.__get_value_mapper(trans))
            for (k, v) in repository_dependency_dict.items():
                if (k not in repository_dependency_metadata_dict):
                    repository_dependency_metadata_dict[k] = v
            repository_dependency_metadata_dict['url'] = web.url_for(controller='repositories', action='show', id=repository_dependency_id)
            repository_dependencies_dicts.append(repository_dependency_metadata_dict)
    return repository_dependencies_dicts
