Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/hgwebdir_mod.py @ 22087:af62f0280a76 stable
hgweb: avoid config object race with hgwebdir (issue4326)
Turns out hgwebdir passes full repo objects to each hgweb request
instance, but with a shared baseui. We explicitly break the sharing.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 10 Aug 2014 13:53:36 -0500 |
parents | 49f2d5644f04 |
children | e48a5d3996c2 |
comparison
equal
deleted
inserted
replaced
22086:68f2f8bfe9ae | 22087:af62f0280a76 |
---|---|
212 while virtualrepo: | 212 while virtualrepo: |
213 real = repos.get(virtualrepo) | 213 real = repos.get(virtualrepo) |
214 if real: | 214 if real: |
215 req.env['REPO_NAME'] = virtualrepo | 215 req.env['REPO_NAME'] = virtualrepo |
216 try: | 216 try: |
217 repo = hg.repository(self.ui, real) | 217 # ensure caller gets private copy of ui |
218 repo = hg.repository(self.ui.copy(), real) | |
218 return hgweb(repo).run_wsgi(req) | 219 return hgweb(repo).run_wsgi(req) |
219 except IOError, inst: | 220 except IOError, inst: |
220 msg = inst.strerror | 221 msg = inst.strerror |
221 raise ErrorResponse(HTTP_SERVER_ERROR, msg) | 222 raise ErrorResponse(HTTP_SERVER_ERROR, msg) |
222 except error.RepoError, inst: | 223 except error.RepoError, inst: |