changeset 5218:4fa0f2dff643

hghave: detect git availability
author Patrick Mezard <pmezard@gmail.com>
date Sun, 26 Aug 2007 15:35:57 +0200
parents 149742a628fd
children ceb6f242fb81
files tests/hghave
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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"),