'Given a repository and changeset_revision, return the correct ctx.rev() value.'

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

    repository_name = kwd['name']
    repository_owner = kwd['owner']
    changeset_revision = kwd['changeset_revision']
    repository = repository_util.get_repository_by_name_and_owner(trans.app, repository_name, repository_owner)
    repo = hg_util.get_repo_for_repository(trans.app, repository=repository, repo_path=None, create=False)
    ctx = hg_util.get_changectx_for_changeset(repo, changeset_revision)
    if ctx:
        return str(ctx.rev())
    return ''
