49 if cp.has_option('web', 'stripes'): |
49 if cp.has_option('web', 'stripes'): |
50 self.stripecount = int(cp.get('web', 'stripes')) |
50 self.stripecount = int(cp.get('web', 'stripes')) |
51 if cp.has_option('web', 'baseurl'): |
51 if cp.has_option('web', 'baseurl'): |
52 self._baseurl = cp.get('web', 'baseurl') |
52 self._baseurl = cp.get('web', 'baseurl') |
53 if cp.has_section('paths'): |
53 if cp.has_section('paths'): |
54 self.repos.extend(cleannames(cp.items('paths'))) |
54 paths = cleannames(cp.items('paths')) |
|
55 for prefix, root in paths: |
|
56 roothead, roottail = os.path.split(root) |
|
57 if roottail != '*': |
|
58 self.repos.append((prefix, root)) |
|
59 continue |
|
60 # "foo = /bar/*" makes every subrepo of /bar/ to be |
|
61 # mounted as foo/subrepo |
|
62 roothead = os.path.normpath(roothead) |
|
63 for path in util.walkrepos(roothead, followsym=True): |
|
64 path = os.path.normpath(path) |
|
65 name = util.pconvert(path[len(roothead):]).strip('/') |
|
66 if prefix: |
|
67 name = prefix + '/' + name |
|
68 self.repos.append((name, path)) |
55 if cp.has_section('collections'): |
69 if cp.has_section('collections'): |
56 for prefix, root in cp.items('collections'): |
70 for prefix, root in cp.items('collections'): |
57 for path in util.walkrepos(root, followsym=True): |
71 for path in util.walkrepos(root, followsym=True): |
58 repo = os.path.normpath(path) |
72 repo = os.path.normpath(path) |
59 name = repo |
73 name = repo |