##// 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 453 test-url.py
454 454 test-username-newline.t
455 455 test-verify.t
456 test-walkrepo.py
456 457 test-websub.t
457 458 test-win32text.t
458 459 test-wireproto-clientreactor.py
@@ -17,22 +17,22 b' walkrepos = scmutil.walkrepos'
17 17 checklink = util.checklink
18 18
19 19 u = uimod.ui.load()
20 sym = checklink('.')
20 sym = checklink(b'.')
21 21
22 hg.repository(u, 'top1', create=1)
23 mkdir('subdir')
24 chdir('subdir')
25 hg.repository(u, 'sub1', create=1)
26 mkdir('subsubdir')
27 chdir('subsubdir')
28 hg.repository(u, 'subsub1', create=1)
22 hg.repository(u, b'top1', create=1)
23 mkdir(b'subdir')
24 chdir(b'subdir')
25 hg.repository(u, b'sub1', create=1)
26 mkdir(b'subsubdir')
27 chdir(b'subsubdir')
28 hg.repository(u, b'subsub1', create=1)
29 29 chdir(os.path.pardir)
30 30 if sym:
31 os.symlink(os.path.pardir, 'circle')
32 os.symlink(pjoin('subsubdir', 'subsub1'), 'subsub1')
31 os.symlink(os.path.pardir, b'circle')
32 os.symlink(pjoin(b'subsubdir', b'subsub1'), b'subsub1')
33 33
34 34 def runtest():
35 reposet = frozenset(walkrepos('.', followsym=True))
35 reposet = frozenset(walkrepos(b'.', followsym=True))
36 36 if sym and (len(reposet) != 3):
37 37 print("reposet = %r" % (reposet,))
38 38 print(("Found %d repositories when I should have found 3"
@@ -41,19 +41,19 b' def runtest():'
41 41 print("reposet = %r" % (reposet,))
42 42 print(("Found %d repositories when I should have found 2"
43 43 % (len(reposet),)))
44 sub1set = frozenset((pjoin('.', 'sub1'),
45 pjoin('.', 'circle', 'subdir', 'sub1')))
44 sub1set = frozenset((pjoin(b'.', b'sub1'),
45 pjoin(b'.', b'circle', b'subdir', b'sub1')))
46 46 if len(sub1set & reposet) != 1:
47 47 print("sub1set = %r" % (sub1set,))
48 48 print("reposet = %r" % (reposet,))
49 49 print("sub1set and reposet should have exactly one path in common.")
50 sub2set = frozenset((pjoin('.', 'subsub1'),
51 pjoin('.', 'subsubdir', 'subsub1')))
50 sub2set = frozenset((pjoin(b'.', b'subsub1'),
51 pjoin(b'.', b'subsubdir', b'subsub1')))
52 52 if len(sub2set & reposet) != 1:
53 53 print("sub2set = %r" % (sub2set,))
54 54 print("reposet = %r" % (reposet,))
55 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 57 if sym and sub3 not in reposet:
58 58 print("reposet = %r" % (reposet,))
59 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