tests/mockblackbox.py
author Denis Laxalde <denis.laxalde@logilab.fr>
Tue, 17 Jan 2017 17:25:48 +0100
changeset 31099 abb92b3d370e
parent 28943 417380aa5bbe
child 32450 043948c84647
permissions -rw-r--r--
hgweb: explictly pass basectx in webutil.diffs There's only one case where `basectx` parameter is None (over two usages), so it's probably not worth handling the special case as it makes code-reading harder. Along the way, use ctx.p1() instead of checking for ctx.parents() being empty which should not occur.

from __future__ import absolute_import
from mercurial import (
    util,
)

def makedate():
    return 0, 0
def getuser():
    return 'bob'
def getpid():
    return 5000

# mock the date and user apis so the output is always the same
def uisetup(ui):
    util.makedate = makedate
    util.getuser = getuser
    util.getpid = getpid