hghave: detect git availability
authorPatrick Mezard <pmezard@gmail.com>
Sun, 26 Aug 2007 15:35:57 +0200
changeset 5218 4fa0f2dff643
parent 5217 149742a628fd
child 5219 ceb6f242fb81
hghave: detect git availability
tests/hghave
--- a/tests/hghave	Sun Aug 26 14:51:27 2007 +0200
+++ b/tests/hghave	Sun Aug 26 15:35:57 2007 +0200
@@ -51,9 +51,16 @@
     except ImportError:
         return False
 
+def has_git():
+    fh = os.popen('git --version 2>&1')
+    s = fh.read()
+    ret = fh.close()
+    return ret is None and s.startswith('git version')
+
 checks = {
     "eol-in-paths": (has_eol_in_paths, "end-of-lines in paths"),
     "execbit": (has_executablebit, "executable bit"),
+    "git": (has_git, "git command line client"),
     "fifo": (has_fifo, "named pipes"),
     "hotshot": (has_hotshot, "python hotshot module"),
     "lsprof": (has_lsprof, "python lsprof module"),