tests/mockblackbox.py
author Martin von Zweigbergk <martinvonz@google.com>
Wed, 28 Feb 2018 10:21:43 -0800
changeset 36494 3f0af89e008d
parent 36143 f49c3ee5b02f
child 37123 a8a902d7176e
permissions -rw-r--r--
narrow: move requirement constant to core My short-term goal is to move narrowrepo.narrowmatch() onto localrepo and this is a necessary step for that. I put the constant in changegroup.py, unlike REVLOGV2_REQUIREMENT, which is in localrepo.py, since we'll need to access it from the changegroup module eventually. Differential Revision: https://phab.mercurial-scm.org/D2487

from __future__ import absolute_import
from mercurial import (
    util,
)

# 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):
    util.getuser = getuser
    util.getpid = getpid