mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
hgweb: avoid initialization race (issue4280)
This commit is contained in:
parent
2ec4f75e9f
commit
0257c423ac
@ -109,8 +109,6 @@ class hgweb(object):
|
||||
# compare changelog size in addition to mtime to catch
|
||||
# rollbacks made less than a second ago
|
||||
if st.st_mtime != self.mtime or st.st_size != self.size:
|
||||
self.mtime = st.st_mtime
|
||||
self.size = st.st_size
|
||||
r = hg.repository(self.repo.baseui, self.repo.root)
|
||||
self.repo = self._getview(r)
|
||||
self.maxchanges = int(self.config("web", "maxchanges", 10))
|
||||
@ -121,6 +119,9 @@ class hgweb(object):
|
||||
self.allowpull = self.configbool("web", "allowpull", True)
|
||||
encoding.encoding = self.config("web", "encoding",
|
||||
encoding.encoding)
|
||||
# update these last to avoid threads seeing empty settings
|
||||
self.mtime = st.st_mtime
|
||||
self.size = st.st_size
|
||||
if request:
|
||||
self.repo.ui.environ = request.env
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user