# HG changeset patch # User Matt Mackall # Date 2014-08-10 18:53:36 # Node ID af62f0280a76d15a1bbc7c07817b73952b23117c # Parent 68f2f8bfe9ae7e36c68d588adad26d3df23e3601 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. diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -61,6 +61,7 @@ class hgweb(object): u = ui.ui() r = hg.repository(u, repo) else: + # we trust caller to give us a private copy r = repo r = self._getview(r) diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py +++ b/mercurial/hgweb/hgwebdir_mod.py @@ -214,7 +214,8 @@ class hgwebdir(object): if real: req.env['REPO_NAME'] = virtualrepo try: - repo = hg.repository(self.ui, real) + # ensure caller gets private copy of ui + repo = hg.repository(self.ui.copy(), real) return hgweb(repo).run_wsgi(req) except IOError, inst: msg = inst.strerror