comparison mercurial/hgweb/hgwebdir_mod.py @ 13538:d24e97fd52a9

test-doctest: handle unix/windows path discrepancies
author Patrick Mezard <pmezard@gmail.com>
date Sun, 06 Mar 2011 14:17:47 +0100
parents b391c0c9be61
children 8cbb59124e67
comparison
equal deleted inserted replaced
13537:37f487b9fbcc 13538:d24e97fd52a9
38 return repos 38 return repos
39 39
40 def urlrepos(prefix, roothead, paths): 40 def urlrepos(prefix, roothead, paths):
41 """yield url paths and filesystem paths from a list of repo paths 41 """yield url paths and filesystem paths from a list of repo paths
42 42
43 >>> list(urlrepos('hg', '/opt', ['/opt/r', '/opt/r/r', '/opt'])) 43 >>> conv = lambda seq: [(v, util.pconvert(p)) for v,p in seq]
44 >>> conv(urlrepos('hg', '/opt', ['/opt/r', '/opt/r/r', '/opt']))
44 [('hg/r', '/opt/r'), ('hg/r/r', '/opt/r/r'), ('hg', '/opt')] 45 [('hg/r', '/opt/r'), ('hg/r/r', '/opt/r/r'), ('hg', '/opt')]
45 >>> list(urlrepos('', '/opt', ['/opt/r', '/opt/r/r', '/opt'])) 46 >>> conv(urlrepos('', '/opt', ['/opt/r', '/opt/r/r', '/opt']))
46 [('r', '/opt/r'), ('r/r', '/opt/r/r'), ('', '/opt')] 47 [('r', '/opt/r'), ('r/r', '/opt/r/r'), ('', '/opt')]
47 """ 48 """
48 for path in paths: 49 for path in paths:
49 path = os.path.normpath(path) 50 path = os.path.normpath(path)
50 yield (prefix + '/' + 51 yield (prefix + '/' +