##// END OF EJS Templates
hgweb: avoid initialization race (issue3953)
Matt Mackall -
r20168:d4be314b stable
parent child Browse files
Show More
@@ -59,15 +59,16 b' class hgweb(object):'
59 u = baseui.copy()
59 u = baseui.copy()
60 else:
60 else:
61 u = ui.ui()
61 u = ui.ui()
62 self.repo = hg.repository(u, repo)
62 r = hg.repository(u, repo)
63 else:
63 else:
64 self.repo = repo
64 r = repo
65
65
66 self.repo = self._getview(self.repo)
66 r = self._getview(r)
67 self.repo.ui.setconfig('ui', 'report_untrusted', 'off')
67 r.ui.setconfig('ui', 'report_untrusted', 'off')
68 self.repo.baseui.setconfig('ui', 'report_untrusted', 'off')
68 r.baseui.setconfig('ui', 'report_untrusted', 'off')
69 self.repo.ui.setconfig('ui', 'nontty', 'true')
69 r.ui.setconfig('ui', 'nontty', 'true')
70 self.repo.baseui.setconfig('ui', 'nontty', 'true')
70 r.baseui.setconfig('ui', 'nontty', 'true')
71 self.repo = r
71 hook.redirect(True)
72 hook.redirect(True)
72 self.mtime = -1
73 self.mtime = -1
73 self.size = -1
74 self.size = -1
@@ -94,7 +95,8 b' class hgweb(object):'
94 untrusted=untrusted)
95 untrusted=untrusted)
95
96
96 def _getview(self, repo):
97 def _getview(self, repo):
97 viewconfig = self.config('web', 'view', 'served')
98 viewconfig = repo.ui.config('web', 'view', 'served',
99 untrusted=True)
98 if viewconfig == 'all':
100 if viewconfig == 'all':
99 return repo.unfiltered()
101 return repo.unfiltered()
100 elif viewconfig in repoview.filtertable:
102 elif viewconfig in repoview.filtertable:
General Comments 0
You need to be logged in to leave comments. Login now