tests/hghave
changeset 1021 4ecaec765d76
parent 1014 58b7f58ae08c
child 1027 f8c2547c8f16
equal deleted inserted replaced
1020:5dc5c899428a 1021:4ecaec765d76
   159 
   159 
   160 def has_p4():
   160 def has_p4():
   161     return matchoutput('p4 -V', r'Rev\. P4/') and matchoutput('p4d -V', r'Rev\. P4D/')
   161     return matchoutput('p4 -V', r'Rev\. P4/') and matchoutput('p4d -V', r'Rev\. P4D/')
   162 
   162 
   163 def has_symlink():
   163 def has_symlink():
   164     return hasattr(os, "symlink")
   164     return hasattr(os, "symlink") # FIXME: should also check file system and os
   165 
   165 
   166 def has_tla():
   166 def has_tla():
   167     return matchoutput('tla --version 2>&1', r'The GNU Arch Revision')
   167     return matchoutput('tla --version 2>&1', r'The GNU Arch Revision')
   168 
   168 
   169 def has_gpg():
   169 def has_gpg():
   206         import OpenSSL
   206         import OpenSSL
   207         OpenSSL.SSL.Context
   207         OpenSSL.SSL.Context
   208         return True
   208         return True
   209     except ImportError:
   209     except ImportError:
   210         return False
   210         return False
       
   211 
       
   212 def has_windows():
       
   213     return os.name == 'nt'
       
   214 
       
   215 def has_system_sh():
       
   216     return os.name != 'nt'
       
   217 
       
   218 def has_serve():
       
   219     return os.name != 'nt' # gross approximation
   211 
   220 
   212 checks = {
   221 checks = {
   213     "baz": (has_baz, "GNU Arch baz client"),
   222     "baz": (has_baz, "GNU Arch baz client"),
   214     "bzr": (has_bzr, "Canonical's Bazaar client"),
   223     "bzr": (has_bzr, "Canonical's Bazaar client"),
   215     "bzr114": (has_bzr114, "Canonical's Bazaar client >= 1.14"),
   224     "bzr114": (has_bzr114, "Canonical's Bazaar client >= 1.14"),
   229     "mtn": (has_mtn, "monotone client (>= 1.0)"),
   238     "mtn": (has_mtn, "monotone client (>= 1.0)"),
   230     "outer-repo": (has_outer_repo, "outer repo"),
   239     "outer-repo": (has_outer_repo, "outer repo"),
   231     "p4": (has_p4, "Perforce server and client"),
   240     "p4": (has_p4, "Perforce server and client"),
   232     "pyflakes": (has_pyflakes, "Pyflakes python linter"),
   241     "pyflakes": (has_pyflakes, "Pyflakes python linter"),
   233     "pygments": (has_pygments, "Pygments source highlighting library"),
   242     "pygments": (has_pygments, "Pygments source highlighting library"),
       
   243     "serve": (has_serve, "platform and python can manage 'hg serve -d'"),
   234     "ssl": (has_ssl, "python >= 2.6 ssl module and python OpenSSL"),
   244     "ssl": (has_ssl, "python >= 2.6 ssl module and python OpenSSL"),
   235     "svn": (has_svn, "subversion client and admin tools"),
   245     "svn": (has_svn, "subversion client and admin tools"),
   236     "svn13": (has_svn13, "subversion client and admin tools >= 1.3"),
   246     "svn13": (has_svn13, "subversion client and admin tools >= 1.3"),
   237     "svn15": (has_svn15, "subversion client and admin tools >= 1.5"),
   247     "svn15": (has_svn15, "subversion client and admin tools >= 1.5"),
   238     "svn-bindings": (has_svn_bindings, "subversion python bindings"),
   248     "svn-bindings": (has_svn_bindings, "subversion python bindings"),
   239     "symlink": (has_symlink, "symbolic links"),
   249     "symlink": (has_symlink, "symbolic links"),
       
   250     "system-sh": (has_system_sh, "system() uses sh"),
   240     "tla": (has_tla, "GNU Arch tla client"),
   251     "tla": (has_tla, "GNU Arch tla client"),
   241     "unix-permissions": (has_unix_permissions, "unix-style permissions"),
   252     "unix-permissions": (has_unix_permissions, "unix-style permissions"),
       
   253     "windows": (has_windows, "Windows"),
   242 }
   254 }
   243 
   255 
   244 def list_features():
   256 def list_features():
   245     for name, feature in checks.iteritems():
   257     for name, feature in checks.iteritems():
   246         desc = feature[1]
   258         desc = feature[1]