Mercurial > public > mercurial-scm > hg
comparison tests/run-tests.py @ 8673:a8066f2fd1aa
run-tests: fix _checkhglib() so it's correct when using --with-hg.
Since this makes the warning less likely, upgrade it to a "real"
warning to stderr.
author | Greg Ward <greg-hg@gerg.ca> |
---|---|
date | Fri, 29 May 2009 22:18:16 -0400 |
parents | d6b243731763 |
children | 0941ee76489e |
comparison
equal
deleted
inserted
replaced
8672:d6b243731763 | 8673:a8066f2fd1aa |
---|---|
501 pipe.close() | 501 pipe.close() |
502 return _hgpath | 502 return _hgpath |
503 | 503 |
504 def _checkhglib(verb): | 504 def _checkhglib(verb): |
505 """Ensure that the 'mercurial' package imported by python is | 505 """Ensure that the 'mercurial' package imported by python is |
506 the one we expect it to be. If not, print a message to stdout.""" | 506 the one we expect it to be. If not, print a warning to stderr.""" |
507 expecthg = os.path.join(HGTMP, 'install', 'lib', 'python', 'mercurial') | 507 expecthg = os.path.join(PYTHONDIR, 'mercurial') |
508 actualhg = _gethgpath() | 508 actualhg = _gethgpath() |
509 if actualhg != expecthg: | 509 if actualhg != expecthg: |
510 print '# %s unexpected mercurial: %s' % (verb, actualhg) | 510 sys.stderr.write('warning: %s with unexpected mercurial lib: %s\n' |
511 ' (expected %s)\n' | |
512 % (verb, actualhg, expecthg)) | |
511 | 513 |
512 def runchildren(options, tests): | 514 def runchildren(options, tests): |
513 if not options.with_hg: | 515 if not options.with_hg: |
514 installhg(options) | 516 installhg(options) |
515 _checkhglib("Testing") | 517 _checkhglib("Testing") |