Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/ui.py @ 9887:38170eeed18c
ui: add environ property to access os.environ or wsgirequest.environ
The property returns os.environ by default, and is propagated by ui.copy.
During hgweb processing, ui.environ is set to the proper WSGI-request
environment, as contained in wsgirequest.environ. For CGI, this is the
same as os.environ.
The property is meant to be read-only, as with os.environ (generally).
author | Sune Foldager <cryo@cyanite.org> |
---|---|
date | Thu, 19 Nov 2009 10:32:33 +0100 |
parents | 9e7b2c49d25d |
children | 89617aacb495 |
comparison
equal
deleted
inserted
replaced
9886:56af3f240a22 | 9887:38170eeed18c |
---|---|
27 self._tcfg = src._tcfg.copy() | 27 self._tcfg = src._tcfg.copy() |
28 self._ucfg = src._ucfg.copy() | 28 self._ucfg = src._ucfg.copy() |
29 self._ocfg = src._ocfg.copy() | 29 self._ocfg = src._ocfg.copy() |
30 self._trustusers = src._trustusers.copy() | 30 self._trustusers = src._trustusers.copy() |
31 self._trustgroups = src._trustgroups.copy() | 31 self._trustgroups = src._trustgroups.copy() |
32 self.environ = src.environ | |
32 self.fixconfig() | 33 self.fixconfig() |
33 else: | 34 else: |
35 # shared read-only environment | |
36 self.environ = os.environ | |
34 # we always trust global config files | 37 # we always trust global config files |
35 for f in util.rcpath(): | 38 for f in util.rcpath(): |
36 self.readconfig(f, trust=True) | 39 self.readconfig(f, trust=True) |
37 | 40 |
38 def copy(self): | 41 def copy(self): |