tests/mockblackbox.py
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Wed, 02 Dec 2015 03:12:08 +0900
changeset 27195 84de71ec5c61
parent 24705 0ead0a07ed9c
child 28028 ac49ecb2a897
permissions -rw-r--r--
commands: execute checkunfinished and bailifchanged inside wlock scope Before this patch, "hg import" executes below before acquisition of wlock: - cmdutil.checkunfinished() - cmdutil.bailifchanged() It may cause unintentional result, if another command runs parallelly (see also issue4368). To avoid this issue, this patch executes 'cmdutil.checkunfinished()' and 'cmdutil.bailifchanged()' inside wlock scope of "hg import".
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24705
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     1
from mercurial import util
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     2
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     3
def makedate():
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     4
    return 0, 0
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     5
def getuser():
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     6
    return 'bob'
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     7
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     8
# mock the date and user apis so the output is always the same
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     9
def uisetup(ui):
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    10
    util.makedate = makedate
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    11
    util.getuser = getuser