def get_remote_user(repo):
    """Return remote user name, or `None`

    within Heptapod, the absence of a remote user means that `hg` is invoked
    from the command line, or directly by a server-side process, such as
    the Rails application performing a merge.

    Hence `None` implies to skip all permission checks.
    """
    return repo.ui.environ.get('REMOTE_USER', None)
