equal
deleted
inserted
replaced
380 |
380 |
381 def run_wsgi(self, req, res): |
381 def run_wsgi(self, req, res): |
382 profile = self.ui.configbool(b'profiling', b'enabled') |
382 profile = self.ui.configbool(b'profiling', b'enabled') |
383 with profiling.profile(self.ui, enabled=profile): |
383 with profiling.profile(self.ui, enabled=profile): |
384 try: |
384 try: |
385 for r in self._runwsgi(req, res): |
385 yield from self._runwsgi(req, res) |
386 yield r |
|
387 finally: |
386 finally: |
388 # There are known cycles in localrepository that prevent |
387 # There are known cycles in localrepository that prevent |
389 # those objects (and tons of held references) from being |
388 # those objects (and tons of held references) from being |
390 # collected through normal refcounting. |
389 # collected through normal refcounting. |
391 # In some cases, the resulting memory consumption can |
390 # In some cases, the resulting memory consumption can |
450 return self.makeindex(req, res, tmpl, subdir) |
449 return self.makeindex(req, res, tmpl, subdir) |
451 |
450 |
452 def _virtualdirs(): |
451 def _virtualdirs(): |
453 # Check the full virtual path, and each parent |
452 # Check the full virtual path, and each parent |
454 yield virtual |
453 yield virtual |
455 for p in pathutil.finddirs(virtual): |
454 yield from pathutil.finddirs(virtual) |
456 yield p |
|
457 |
455 |
458 for virtualrepo in _virtualdirs(): |
456 for virtualrepo in _virtualdirs(): |
459 real = repos.get(virtualrepo) |
457 real = repos.get(virtualrepo) |
460 if real: |
458 if real: |
461 # Re-parse the WSGI environment to take into account our |
459 # Re-parse the WSGI environment to take into account our |