# HG changeset patch # User Patrick Mezard # Date 1191776316 -7200 # Node ID 190c234c8fa0708854a9cbc5aba939014948bcef # Parent 36794dbe66a3614b50dad7f2424f96153f71a008 hghave: reorder check functions and entries diff --git a/tests/hghave b/tests/hghave --- a/tests/hghave +++ b/tests/hghave @@ -21,18 +21,21 @@ def matchoutput(cmd, regexp, ignorestatu ret = fh.close() return (ignorestatus or ret is None) and r.search(s) -def has_symlink(): - return hasattr(os, "symlink") - -def has_fifo(): - return hasattr(os, "mkfifo") - def has_cvs(): return matchoutput('cvs --version 2>&1', r'Concurrent Versions System') def has_cvsps(): return matchoutput('cvsps -h -q 2>&1', r'cvsps version', True) +def has_eol_in_paths(): + try: + fd, path = tempfile.mkstemp(prefix=tempprefix, suffix='\n\r') + os.close(fd) + os.remove(path) + return True + except: + return False + def has_executablebit(): fd, path = tempfile.mkstemp(prefix=tempprefix) os.close(fd) @@ -43,14 +46,8 @@ def has_executablebit(): finally: os.remove(path) -def has_eol_in_paths(): - try: - fd, path = tempfile.mkstemp(prefix=tempprefix, suffix='\n\r') - os.close(fd) - os.remove(path) - return True - except: - return False +def has_fifo(): + return hasattr(os, "mkfifo") def has_hotshot(): try: @@ -82,13 +79,16 @@ def has_svn_bindings(): except ImportError: return False +def has_symlink(): + return hasattr(os, "symlink") + checks = { "cvs": (has_cvs, "cvs client"), "cvsps": (has_cvsps, "cvsps utility"), "eol-in-paths": (has_eol_in_paths, "end-of-lines in paths"), "execbit": (has_executablebit, "executable bit"), + "fifo": (has_fifo, "named pipes"), "git": (has_git, "git command line client"), - "fifo": (has_fifo, "named pipes"), "hotshot": (has_hotshot, "python hotshot module"), "lsprof": (has_lsprof, "python lsprof module"), "svn": (has_svn, "subversion client and admin tools"),