diff options
Diffstat (limited to 'tests/test-walkrepo.py')
-rw-r--r-- | tests/test-walkrepo.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/test-walkrepo.py b/tests/test-walkrepo.py index bbeebd4..0cb3501 100644 --- a/tests/test-walkrepo.py +++ b/tests/test-walkrepo.py @@ -1,12 +1,11 @@ import os from mercurial import hg, ui from mercurial.scmutil import walkrepos -from mercurial.util import checklink from os import mkdir, chdir from os.path import join as pjoin u = ui.ui() -sym = checklink('.') +sym = hasattr(os, 'symlink') and hasattr(os.path, 'samestat') hg.repository(u, 'top1', create=1) mkdir('subdir') @@ -24,12 +23,10 @@ def runtest(): reposet = frozenset(walkrepos('.', followsym=True)) if sym and (len(reposet) != 3): print "reposet = %r" % (reposet,) - print ("Found %d repositories when I should have found 3" - % (len(reposet),)) + print "Found %d repositories when I should have found 3" % (len(reposet),) if (not sym) and (len(reposet) != 2): print "reposet = %r" % (reposet,) - print ("Found %d repositories when I should have found 2" - % (len(reposet),)) + print "Found %d repositories when I should have found 2" % (len(reposet),) sub1set = frozenset((pjoin('.', 'sub1'), pjoin('.', 'circle', 'subdir', 'sub1'))) if len(sub1set & reposet) != 1: @@ -43,7 +40,7 @@ def runtest(): print "reposet = %r" % (reposet,) print "sub1set and reposet should have exactly one path in common." sub3 = pjoin('.', 'circle', 'top1') - if sym and sub3 not in reposet: + if sym and not (sub3 in reposet): print "reposet = %r" % (reposet,) print "Symbolic links are supported and %s is not in reposet" % (sub3,) |