tests/mockblackbox.py
author Charles Chamberlain <cchamberlain@janestreet.com>
Fri, 09 Apr 2021 17:41:48 -0400
changeset 46902 631001150e13
parent 43076 2372284d9457
child 48875 6000f5b25c9b
permissions -rw-r--r--
narrow: add capabilities for local repos, not just remote peers This fixes the bug where running `hg clone --narrow ./local-repo` fails with abort: server does not support narrow clones even when the server has narrow enabled. Differential Revision: https://phab.mercurial-scm.org/D10357

from __future__ import absolute_import
from mercurial.utils import procutil

# XXX: we should probably offer a devel option to do this in blackbox directly
def getuser():
    return b'bob'


def getpid():
    return 5000


# mock the date and user apis so the output is always the same
def uisetup(ui):
    procutil.getuser = getuser
    procutil.getpid = getpid