tests/mockblackbox.py
author Pulkit Goyal <pulkit@yandex-team.ru>
Sat, 27 Apr 2019 14:43:43 +0300
changeset 42216 d0e773ad9077
parent 37120 a8a902d7176e
child 43076 2372284d9457
permissions -rw-r--r--
discovery: only calculate closed branches if required The number of new closed branches is required for printing in error message. So let's only calculate them if we need to print error about new branches. Differential Revision: https://phab.mercurial-scm.org/D6314

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