comparison tests/run-tests.py @ 14018:7ba2c728cf32

run-tests: add iolock to vlog
author Matt Mackall <mpm@selenic.com>
date Mon, 25 Apr 2011 16:17:08 -0500
parents a395575691a6
children fbbd5f91d5e1
comparison
equal deleted inserted replaced
14017:19a7b48446e3 14018:7ba2c728cf32
201 if options.jobs > 1 or options.child is not None: 201 if options.jobs > 1 or options.child is not None:
202 pid = "[%d]" % os.getpid() 202 pid = "[%d]" % os.getpid()
203 else: 203 else:
204 pid = None 204 pid = None
205 def vlog(*msg): 205 def vlog(*msg):
206 iolock.acquire()
206 if pid: 207 if pid:
207 print pid, 208 print pid,
208 for m in msg: 209 for m in msg:
209 print m, 210 print m,
210 print 211 print
211 sys.stdout.flush() 212 sys.stdout.flush()
213 iolock.release()
212 else: 214 else:
213 vlog = lambda *msg: None 215 vlog = lambda *msg: None
214 216
215 if options.tmpdir: 217 if options.tmpdir:
216 options.tmpdir = os.path.expanduser(options.tmpdir) 218 options.tmpdir = os.path.expanduser(options.tmpdir)