##// END OF EJS Templates
tests: port test-walkrepo.py to Python 3...
Augie Fackler -
r37895:fa2423ac default
parent child Browse files
Show More
@@ -453,6 +453,7 b' test-url-rev.t'
453 test-url.py
453 test-url.py
454 test-username-newline.t
454 test-username-newline.t
455 test-verify.t
455 test-verify.t
456 test-walkrepo.py
456 test-websub.t
457 test-websub.t
457 test-win32text.t
458 test-win32text.t
458 test-wireproto-clientreactor.py
459 test-wireproto-clientreactor.py
@@ -17,22 +17,22 b' walkrepos = scmutil.walkrepos'
17 checklink = util.checklink
17 checklink = util.checklink
18
18
19 u = uimod.ui.load()
19 u = uimod.ui.load()
20 sym = checklink('.')
20 sym = checklink(b'.')
21
21
22 hg.repository(u, 'top1', create=1)
22 hg.repository(u, b'top1', create=1)
23 mkdir('subdir')
23 mkdir(b'subdir')
24 chdir('subdir')
24 chdir(b'subdir')
25 hg.repository(u, 'sub1', create=1)
25 hg.repository(u, b'sub1', create=1)
26 mkdir('subsubdir')
26 mkdir(b'subsubdir')
27 chdir('subsubdir')
27 chdir(b'subsubdir')
28 hg.repository(u, 'subsub1', create=1)
28 hg.repository(u, b'subsub1', create=1)
29 chdir(os.path.pardir)
29 chdir(os.path.pardir)
30 if sym:
30 if sym:
31 os.symlink(os.path.pardir, 'circle')
31 os.symlink(os.path.pardir, b'circle')
32 os.symlink(pjoin('subsubdir', 'subsub1'), 'subsub1')
32 os.symlink(pjoin(b'subsubdir', b'subsub1'), b'subsub1')
33
33
34 def runtest():
34 def runtest():
35 reposet = frozenset(walkrepos('.', followsym=True))
35 reposet = frozenset(walkrepos(b'.', followsym=True))
36 if sym and (len(reposet) != 3):
36 if sym and (len(reposet) != 3):
37 print("reposet = %r" % (reposet,))
37 print("reposet = %r" % (reposet,))
38 print(("Found %d repositories when I should have found 3"
38 print(("Found %d repositories when I should have found 3"
@@ -41,19 +41,19 b' def runtest():'
41 print("reposet = %r" % (reposet,))
41 print("reposet = %r" % (reposet,))
42 print(("Found %d repositories when I should have found 2"
42 print(("Found %d repositories when I should have found 2"
43 % (len(reposet),)))
43 % (len(reposet),)))
44 sub1set = frozenset((pjoin('.', 'sub1'),
44 sub1set = frozenset((pjoin(b'.', b'sub1'),
45 pjoin('.', 'circle', 'subdir', 'sub1')))
45 pjoin(b'.', b'circle', b'subdir', b'sub1')))
46 if len(sub1set & reposet) != 1:
46 if len(sub1set & reposet) != 1:
47 print("sub1set = %r" % (sub1set,))
47 print("sub1set = %r" % (sub1set,))
48 print("reposet = %r" % (reposet,))
48 print("reposet = %r" % (reposet,))
49 print("sub1set and reposet should have exactly one path in common.")
49 print("sub1set and reposet should have exactly one path in common.")
50 sub2set = frozenset((pjoin('.', 'subsub1'),
50 sub2set = frozenset((pjoin(b'.', b'subsub1'),
51 pjoin('.', 'subsubdir', 'subsub1')))
51 pjoin(b'.', b'subsubdir', b'subsub1')))
52 if len(sub2set & reposet) != 1:
52 if len(sub2set & reposet) != 1:
53 print("sub2set = %r" % (sub2set,))
53 print("sub2set = %r" % (sub2set,))
54 print("reposet = %r" % (reposet,))
54 print("reposet = %r" % (reposet,))
55 print("sub2set and reposet should have exactly one path in common.")
55 print("sub2set and reposet should have exactly one path in common.")
56 sub3 = pjoin('.', 'circle', 'top1')
56 sub3 = pjoin(b'.', b'circle', b'top1')
57 if sym and sub3 not in reposet:
57 if sym and sub3 not in reposet:
58 print("reposet = %r" % (reposet,))
58 print("reposet = %r" % (reposet,))
59 print("Symbolic links are supported and %s is not in reposet" % (sub3,))
59 print("Symbolic links are supported and %s is not in reposet" % (sub3,))
General Comments 0
You need to be logged in to leave comments. Login now