'Return an encoded dictionary of all repositories upon which the contents of the received repository
depends.'

@web.json
def get_repository_dependencies(self, trans, **kwd):

    name = kwd.get('name', None)
    owner = kwd.get('owner', None)
    changeset_revision = kwd.get('changeset_revision', None)
    repository = repository_util.get_repository_by_name_and_owner(trans.app, name, owner)
    dependencies = repository.get_repository_dependencies(trans.app, changeset_revision, web.url_for('/', qualified=True))
    if dependencies:
        return encoding_util.tool_shed_encode(dependencies)
    return ''
