tests/mockblackbox.py
author Matt Harbison <matt_harbison@yahoo.com>
Mon, 27 Feb 2023 19:59:55 -0500
changeset 50380 806ca6bd0719
parent 48875 6000f5b25c9b
child 51690 493034cc3265
permissions -rw-r--r--
infinitepush: opt out of changegroup3 unless explicitly configured This is currently a no-op, as changegroup3 is disabled by default. But when it is enabled, it changes the hash names of the bundle files. As I don't use this extension, I have no idea if that's OK or not. So keep the current default behavior until we can get more info from actual users, while allowing them to opt-in for testing purposes.

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