Show More
@@ -33,14 +33,25 b' def findrepos(paths):' | |||
|
33 | 33 | repos.append((prefix, root)) |
|
34 | 34 | continue |
|
35 | 35 | roothead = os.path.normpath(os.path.abspath(roothead)) |
|
36 |
|
|
|
37 | path = os.path.normpath(path) | |
|
38 | name = util.pconvert(path[len(roothead):]).strip('/') | |
|
39 | if prefix: | |
|
40 | name = prefix + '/' + name | |
|
41 | repos.append((name, path)) | |
|
36 | paths = util.walkrepos(roothead, followsym=True, recurse=recurse) | |
|
37 | repos.extend(urlrepos(prefix, roothead, paths)) | |
|
42 | 38 | return repos |
|
43 | 39 | |
|
40 | def urlrepos(prefix, roothead, paths): | |
|
41 | """yield url paths and filesystem paths from a list of repo paths | |
|
42 | ||
|
43 | >>> list(urlrepos('hg', '/opt', ['/opt/r', '/opt/r/r', '/opt'])) | |
|
44 | [('hg/r', '/opt/r'), ('hg/r/r', '/opt/r/r'), ('hg/', '/opt')] | |
|
45 | >>> list(urlrepos('', '/opt', ['/opt/r', '/opt/r/r', '/opt'])) | |
|
46 | [('r', '/opt/r'), ('r/r', '/opt/r/r'), ('', '/opt')] | |
|
47 | """ | |
|
48 | for path in paths: | |
|
49 | path = os.path.normpath(path) | |
|
50 | name = util.pconvert(path[len(roothead):]).strip('/') | |
|
51 | if prefix: | |
|
52 | name = prefix + '/' + name | |
|
53 | yield name, path | |
|
54 | ||
|
44 | 55 | class hgwebdir(object): |
|
45 | 56 | refreshinterval = 20 |
|
46 | 57 |
General Comments 0
You need to be logged in to leave comments.
Login now