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 + '/' + |