'GET /api/repositories/updates
Return a dictionary with boolean values for whether there are updates available
for the repository revision, newer installable revisions available,
the revision is the latest installable revision, and if the repository is deprecated.
:param owner: owner of the repository
:type  owner: str
:param name: name of the repository
:type  name: str
:param changeset_revision: changeset of the repository
:type  changeset_revision: str
:param hexlify: flag whether to hexlify the response (for backward compatibility)
:type  changeset: boolean
:returns:   information about repository deprecations, updates, and upgrades
:rtype:     dict'

@expose_api_raw_anonymous_and_sessionless
def updates(self, trans, **kwd):

    name = kwd.get('name', None)
    owner = kwd.get('owner', None)
    changeset_revision = kwd.get('changeset_revision', None)
    hexlify_this = util.asbool(kwd.get('hexlify', True))
    repository = repository_util.get_repository_by_name_and_owner(trans.app, name, owner)
    if repository:
        repository_metadata = metadata_util.get_repository_metadata_by_changeset_revision(trans.app, trans.security.encode_id(repository.id), changeset_revision)
        repo = hg_util.get_repo_for_repository(trans.app, repository=repository, repo_path=None, create=False)
        tool_shed_status_dict = {}
        tool_shed_status_dict['repository_deprecated'] = str(repository.deprecated)
        if (changeset_revision == repository.tip(trans.app)):
            tool_shed_status_dict['latest_installable_revision'] = 'True'
        else:
            next_installable_revision = metadata_util.get_next_downloadable_changeset_revision(repository, repo, changeset_revision)
            if (repository_metadata is None):
                if (next_installable_revision and (next_installable_revision != changeset_revision)):
                    tool_shed_status_dict['latest_installable_revision'] = 'True'
                else:
                    tool_shed_status_dict['latest_installable_revision'] = 'False'
            elif (next_installable_revision and (next_installable_revision != changeset_revision)):
                tool_shed_status_dict['latest_installable_revision'] = 'False'
            else:
                tool_shed_status_dict['latest_installable_revision'] = 'True'
        if (changeset_revision == repository.tip(trans.app)):
            tool_shed_status_dict['revision_update'] = 'False'
        elif (repository_metadata is None):
            tool_shed_status_dict['revision_update'] = 'True'
        else:
            tool_shed_status_dict['revision_update'] = 'False'
        metadata_revisions = [revision[1] for revision in metadata_util.get_metadata_revisions(repository, repo)]
        num_metadata_revisions = len(metadata_revisions)
        for (index, metadata_revision) in enumerate(metadata_revisions):
            if (index == num_metadata_revisions):
                tool_shed_status_dict['revision_upgrade'] = 'False'
                break
            if (metadata_revision == changeset_revision):
                if ((num_metadata_revisions - index) > 1):
                    tool_shed_status_dict['revision_upgrade'] = 'True'
                else:
                    tool_shed_status_dict['revision_upgrade'] = 'False'
                break
        return (encoding_util.tool_shed_encode(tool_shed_status_dict) if hexlify_this else json.dumps(tool_shed_status_dict))
    return (encoding_util.tool_shed_encode({}) if hexlify_this else json.dumps({}))
