'Handle a request from a Galaxy instance where the changeset_revision defined for a repository
in a dependency definition file is older than the changeset_revision associated with the installed
repository.'

@web.expose
def next_installable_changeset_revision(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)
    repo = hg_util.get_repo_for_repository(trans.app, repository=repository, repo_path=None, create=False)
    next_changeset_revision = metadata_util.get_next_downloadable_changeset_revision(repository, repo, changeset_revision)
    if (next_changeset_revision and (next_changeset_revision != changeset_revision)):
        return next_changeset_revision
    return ''
