tests/mockblackbox.py
author Pierre-Yves David <pierre-yves.david@octobus.net>
Tue, 07 Mar 2023 03:42:40 +0100
branchstable
changeset 50291 862969b6c359
parent 48966 6000f5b25c9b
permissions -rw-r--r--
undo-files: cleanup legacy files when applicable The "journal" code is much more compact in 6.4, and so is the "undo" files as a result. However the previous version were much noisier, so let us cleanup undo files from older version too.

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