view tests/mockblackbox.py @ 48970:890db1c97218

revlog: fix index_fast_rank (wip) As far as I can tell, rank is stored as a 32-bit big endian value, I'm not sure how grabbing the first byte can possibly work. I assume there's no test coverage here? cc @pacien Fixes: https://www.mercurial-scm.org/repo/hg/rev/e633e660158f Differential Revision: https://phab.mercurial-scm.org/D12376
author Julien Cristau <jcristau@debian.org>
date Tue, 15 Mar 2022 10:36:28 +0100
parents 6000f5b25c9b
children 493034cc3265
line wrap: on
line source

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