equal
deleted
inserted
replaced
144 |
144 |
145 # shared read-only environment |
145 # shared read-only environment |
146 self.environ = encoding.environ |
146 self.environ = encoding.environ |
147 |
147 |
148 self.httppasswordmgrdb = urlreq.httppasswordmgrwithdefaultrealm() |
148 self.httppasswordmgrdb = urlreq.httppasswordmgrwithdefaultrealm() |
|
149 |
|
150 allowed = self.configlist('experimental', 'exportableenviron') |
|
151 if '*' in allowed: |
|
152 self._exportableenviron = self.environ |
|
153 else: |
|
154 self._exportableenviron = {} |
|
155 for k in allowed: |
|
156 if k in self.environ: |
|
157 self._exportableenviron[k] = self.environ[k] |
149 |
158 |
150 @classmethod |
159 @classmethod |
151 def load(cls): |
160 def load(cls): |
152 """Create a ui and load global and user configs""" |
161 """Create a ui and load global and user configs""" |
153 u = cls() |
162 u = cls() |
1209 return |
1218 return |
1210 msg += ("\n(compatibility will be dropped after Mercurial-%s," |
1219 msg += ("\n(compatibility will be dropped after Mercurial-%s," |
1211 " update your code.)") % version |
1220 " update your code.)") % version |
1212 self.develwarn(msg, stacklevel=2, config='deprec-warn') |
1221 self.develwarn(msg, stacklevel=2, config='deprec-warn') |
1213 |
1222 |
|
1223 def exportableenviron(self): |
|
1224 """The environment variables that are safe to export, e.g. through |
|
1225 hgweb. |
|
1226 """ |
|
1227 return self._exportableenviron |
|
1228 |
1214 @contextlib.contextmanager |
1229 @contextlib.contextmanager |
1215 def configoverride(self, overrides, source=""): |
1230 def configoverride(self, overrides, source=""): |
1216 """Context manager for temporary config overrides |
1231 """Context manager for temporary config overrides |
1217 `overrides` must be a dict of the following structure: |
1232 `overrides` must be a dict of the following structure: |
1218 {(section, name) : value}""" |
1233 {(section, name) : value}""" |