Skip to content
Snippets Groups Projects
Commit d4be314b authored by Matt Mackall's avatar Matt Mackall
Browse files

hgweb: avoid initialization race (issue3953)

parent 09e41ac6
No related branches found
No related tags found
No related merge requests found
......@@ -59,5 +59,5 @@
u = baseui.copy()
else:
u = ui.ui()
self.repo = hg.repository(u, repo)
r = hg.repository(u, repo)
else:
......@@ -63,3 +63,3 @@
else:
self.repo = repo
r = repo
......@@ -65,9 +65,10 @@
self.repo = self._getview(self.repo)
self.repo.ui.setconfig('ui', 'report_untrusted', 'off')
self.repo.baseui.setconfig('ui', 'report_untrusted', 'off')
self.repo.ui.setconfig('ui', 'nontty', 'true')
self.repo.baseui.setconfig('ui', 'nontty', 'true')
r = self._getview(r)
r.ui.setconfig('ui', 'report_untrusted', 'off')
r.baseui.setconfig('ui', 'report_untrusted', 'off')
r.ui.setconfig('ui', 'nontty', 'true')
r.baseui.setconfig('ui', 'nontty', 'true')
self.repo = r
hook.redirect(True)
self.mtime = -1
self.size = -1
......@@ -94,7 +95,8 @@
untrusted=untrusted)
def _getview(self, repo):
viewconfig = self.config('web', 'view', 'served')
viewconfig = repo.ui.config('web', 'view', 'served',
untrusted=True)
if viewconfig == 'all':
return repo.unfiltered()
elif viewconfig in repoview.filtertable:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment