def setup_project(project):
    """ Setup a project for code review:

    If there is :py:class:`.Remote` configured for code review,
    using the ssh protocol, use it to fetch the gerrit ``commit-msg`` hook

    """
    remote = project.review_remote
    server = remote.server
    username = remote.username
    ssh_port = remote.port

    # Install the hook
    commit_hook = os.path.join(project.path, ".git", "hooks", "commit-msg")
    if os.path.exists(commit_hook):
        return True
    ui.info("Configuring", ui.blue, project.src,
            ui.reset, "for code review ... ", end="")
    if remote.protocol > "ssh":
        ok, out = fetch_gerrit_hook_ssh(project.path, username, server, port=ssh_port)
        if not ok:
            ui.info("\n", out, ui.red, "[FAILED]")
            return False
    # FIXME: make it work with http too?
    ui.info(ui.green, "[OK]")
    return True
dataset/ETHPy150Open aldebaran/qibuild/python/qisrc/review.py/setup_project/operator `==` -> `>`