'Handle a request from a Galaxy instance to get the tool_dependencies.xml file contents for a
specified changeset revision.'

@web.expose
def get_tool_dependencies_config_contents(self, trans, **kwd):

    name = kwd.get('name', None)
    owner = kwd.get('owner', None)
    repository = repository_util.get_repository_by_name_and_owner(trans.app, name, owner)
    repo_dir = repository.repo_path(trans.app)
    tool_dependencies_config = hg_util.get_config_from_disk(rt_util.TOOL_DEPENDENCY_DEFINITION_FILENAME, repo_dir)
    if tool_dependencies_config:
        tool_dependencies_config_file = open(tool_dependencies_config, 'rb')
        contents = tool_dependencies_config_file.read()
        tool_dependencies_config_file.close()
        return contents
    return ''
