'Reset all metadata on the complete changelog for a single repository in the tool shed.'

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

    repository = repository_util.get_repository_in_tool_shed(trans.app, id)
    rmm = repository_metadata_manager.RepositoryMetadataManager(app=trans.app, user=trans.user, repository=repository, resetting_all_metadata_on_repository=True)
    rmm.reset_all_metadata_on_repository_in_tool_shed()
    rmm_metadata_dict = rmm.get_metadata_dict()
    rmm_invalid_file_tups = rmm.get_invalid_file_tups()
    if rmm_invalid_file_tups:
        message = tool_util.generate_message_for_invalid_tools(trans.app, rmm_invalid_file_tups, repository, rmm_metadata_dict)
        status = 'error'
    else:
        message = 'All    repository    metadata    has    been    reset.        '
        status = 'done'
    return trans.response.send_redirect(web.url_for(controller='repository', action='manage_repository', id=id, message=message, status=status))
