view tests/mockblackbox.py @ 28109:b892e424f88c

hook: don't crash on syntax errors in python hooks We had some real-world cases where syntax errors in Python hooks would crash the whole process and leave it in an indeterminate state. Handle those better.
author Siddharth Agarwal <sid0@fb.com>
date Fri, 12 Feb 2016 14:50:10 -0800
parents ac49ecb2a897
children 417380aa5bbe
line wrap: on
line source

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