##// END OF EJS Templates
hgweb: create function to perform actions on new repo...
Gregory Szorc -
r26218:7d45ec47 default
parent child Browse files
Show More
@@ -209,7 +209,6 b' class hgweb(object):'
209 # we trust caller to give us a private copy
209 # we trust caller to give us a private copy
210 r = repo
210 r = repo
211
211
212 r = getwebview(r)
213 r.ui.setconfig('ui', 'report_untrusted', 'off', 'hgweb')
212 r.ui.setconfig('ui', 'report_untrusted', 'off', 'hgweb')
214 r.baseui.setconfig('ui', 'report_untrusted', 'off', 'hgweb')
213 r.baseui.setconfig('ui', 'report_untrusted', 'off', 'hgweb')
215 r.ui.setconfig('ui', 'nontty', 'true', 'hgweb')
214 r.ui.setconfig('ui', 'nontty', 'true', 'hgweb')
@@ -218,12 +217,17 b' class hgweb(object):'
218 # break some wsgi implementation.
217 # break some wsgi implementation.
219 r.ui.setconfig('progress', 'disable', 'true', 'hgweb')
218 r.ui.setconfig('progress', 'disable', 'true', 'hgweb')
220 r.baseui.setconfig('progress', 'disable', 'true', 'hgweb')
219 r.baseui.setconfig('progress', 'disable', 'true', 'hgweb')
221 self.repo = r
220 self.repo = self._webifyrepo(r)
222 hook.redirect(True)
221 hook.redirect(True)
223 self.repostate = None
222 self.repostate = None
224 self.mtime = -1
223 self.mtime = -1
225 self.reponame = name
224 self.reponame = name
226
225
226 def _webifyrepo(self, repo):
227 repo = getwebview(repo)
228 self.websubtable = webutil.getwebsubs(repo)
229 return repo
230
227 def refresh(self):
231 def refresh(self):
228 repostate = []
232 repostate = []
229 mtime = 0
233 mtime = 0
@@ -238,14 +242,12 b' class hgweb(object):'
238 # changes made less than a second ago
242 # changes made less than a second ago
239 if repostate != self.repostate:
243 if repostate != self.repostate:
240 r = hg.repository(self.repo.baseui, self.repo.url())
244 r = hg.repository(self.repo.baseui, self.repo.url())
241 self.repo = getwebview(r)
245 self.repo = self._webifyrepo(r)
242 # update these last to avoid threads seeing empty settings
246 # update these last to avoid threads seeing empty settings
243 self.repostate = repostate
247 self.repostate = repostate
244 # mtime is needed for ETag
248 # mtime is needed for ETag
245 self.mtime = mtime
249 self.mtime = mtime
246
250
247 self.websubtable = webutil.getwebsubs(r)
248
249 def run(self):
251 def run(self):
250 """Start a server from CGI environment.
252 """Start a server from CGI environment.
251
253
General Comments 0
You need to be logged in to leave comments. Login now