changeset 7061:8b874f8cd29f

tests: check for bzr support by importing bzrlib This is better than starting bzr --version, because it works correctly when running tests with a non-default Python (version).
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Thu, 02 Oct 2008 16:22:02 +0200
parents 972cce34f345
children efc579fdaf69
files tests/hghave
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/hghave	Thu Oct 02 15:48:57 2008 +0200
+++ b/tests/hghave	Thu Oct 02 16:22:02 2008 +0200
@@ -25,7 +25,11 @@
     return matchoutput('baz --version 2>&1', r'baz Bazaar version')
 
 def has_bzr():
-    return matchoutput('bzr --version 2>&1', r'Bazaar \(bzr\)')
+    try:
+        import bzrlib
+        return True
+    except ImportError:
+        return False
 
 def has_cvs():
     re = r'Concurrent Versions System.*?server'