hghave: be more tolerant to rst2html output
authorPatrick Mezard <pmezard@gmail.com>
Tue, 10 Nov 2009 11:57:03 +0100
changeset 9817 912ce84eebae
parent 9816 ea26ac58bbe3
child 9818 72d670c43f6e
hghave: be more tolerant to rst2html output On Windows, rst2html.bat calls rst2html.py, printing something like: "rst2html.py (Docutils" (notice the extra ".py")
tests/hghave
--- a/tests/hghave	Tue Nov 10 21:55:59 2009 +0100
+++ b/tests/hghave	Tue Nov 10 11:57:03 2009 +0100
@@ -121,8 +121,11 @@
     return matchoutput('git --version 2>&1', r'^git version')
 
 def has_rst2html():
-    return matchoutput('rst2html --version 2>&1', r'^rst2html \(Docutils') or \
-        matchoutput('rst2html.py --version 2>&1', r'^rst2html.py \(Docutils')
+    for name in ('rst2html', 'rst2html.py'):
+        name = name + ' --version 2>&1'
+        if matchoutput(name, r'^rst2html(?:\.py)? \(Docutils'):
+            return True
+    return False
 
 def has_svn():
     #return matchoutput('svn --version 2>&1', r'^svn, version') and \