# HG changeset patch # User Matt Mackall # Date 2012-03-31 15:44:31 # Node ID ac0da5caebec1537b72f6530cf941607d4e2f580 # Parent 80a6a68906bf7bdde30d13cbd56faf7dbb523dd5 tests: teach hghave to actually test for symlink support diff --git a/tests/hghave b/tests/hghave --- a/tests/hghave +++ b/tests/hghave @@ -161,6 +161,15 @@ def has_p4(): return matchoutput('p4 -V', r'Rev\. P4/') and matchoutput('p4d -V', r'Rev\. P4D/') def has_symlink(): + if not hasattr(os, "symlink"): + return False + name = tempfile.mktemp(dir=".", prefix='hg-checklink-') + try: + os.symlink(".", name) + os.unlink(name) + return True + except (OSError, AttributeError): + return False return hasattr(os, "symlink") # FIXME: should also check file system and os def has_tla():