Show More
@@ -56,21 +56,33 b' class hgwebdir(object):' | |||
|
56 | 56 | return |
|
57 | 57 | |
|
58 | 58 | if self.baseui: |
|
59 |
|
|
|
59 | u = self.baseui.copy() | |
|
60 | 60 | else: |
|
61 |
|
|
|
62 |
|
|
|
63 |
|
|
|
61 | u = ui.ui() | |
|
62 | u.setconfig('ui', 'report_untrusted', 'off') | |
|
63 | u.setconfig('ui', 'interactive', 'off') | |
|
64 | 64 | |
|
65 | 65 | if not isinstance(self.conf, (dict, list, tuple)): |
|
66 | 66 | map = {'paths': 'hgweb-paths'} |
|
67 |
|
|
|
68 |
paths = |
|
|
67 | u.readconfig(self.conf, remap=map, trust=True) | |
|
68 | paths = u.configitems('hgweb-paths') | |
|
69 | 69 | elif isinstance(self.conf, (list, tuple)): |
|
70 | 70 | paths = self.conf |
|
71 | 71 | elif isinstance(self.conf, dict): |
|
72 | 72 | paths = self.conf.items() |
|
73 | 73 | |
|
74 | repos = findrepos(paths) | |
|
75 | for prefix, root in u.configitems('collections'): | |
|
76 | prefix = util.pconvert(prefix) | |
|
77 | for path in util.walkrepos(root, followsym=True): | |
|
78 | repo = os.path.normpath(path) | |
|
79 | name = util.pconvert(repo) | |
|
80 | if name.startswith(prefix): | |
|
81 | name = name[len(prefix):] | |
|
82 | repos.append((name.lstrip('/'), repo)) | |
|
83 | ||
|
84 | self.repos = repos | |
|
85 | self.ui = u | |
|
74 | 86 | encoding.encoding = self.ui.config('web', 'encoding', |
|
75 | 87 | encoding.encoding) |
|
76 | 88 | self.style = self.ui.config('web', 'style', 'paper') |
@@ -78,17 +90,6 b' class hgwebdir(object):' | |||
|
78 | 90 | if self.stripecount: |
|
79 | 91 | self.stripecount = int(self.stripecount) |
|
80 | 92 | self._baseurl = self.ui.config('web', 'baseurl') |
|
81 | ||
|
82 | self.repos = findrepos(paths) | |
|
83 | for prefix, root in self.ui.configitems('collections'): | |
|
84 | prefix = util.pconvert(prefix) | |
|
85 | for path in util.walkrepos(root, followsym=True): | |
|
86 | repo = os.path.normpath(path) | |
|
87 | name = util.pconvert(repo) | |
|
88 | if name.startswith(prefix): | |
|
89 | name = name[len(prefix):] | |
|
90 | self.repos.append((name.lstrip('/'), repo)) | |
|
91 | ||
|
92 | 93 | self.lastrefresh = time.time() |
|
93 | 94 | |
|
94 | 95 | def run(self): |
General Comments 0
You need to be logged in to leave comments.
Login now