Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/ui.py @ 13576:edd06611a7c6
ui: yield unchanged values in walkconfig
Ever since walkconfig was introduced back in 25e7ea0f2cff, the values
yielded has been mutated by replacing "\n" with "\\n". This makes
walkconfig less useful than it could and there is no other way to
iterate over all config sections.
The third-party reposettings extension used ui.walkconfig but did not
take the replacement into account -- this change will actually fix a
bug in the extension when a value contains a newline.
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Thu, 10 Mar 2011 16:49:37 +0100 |
parents | 95b0d4c1c9e1 |
children | 1ce0e80799c0 |
comparison
equal
deleted
inserted
replaced
13572:1bb2a56a9d73 | 13576:edd06611a7c6 |
---|---|
271 | 271 |
272 def walkconfig(self, untrusted=False): | 272 def walkconfig(self, untrusted=False): |
273 cfg = self._data(untrusted) | 273 cfg = self._data(untrusted) |
274 for section in cfg.sections(): | 274 for section in cfg.sections(): |
275 for name, value in self.configitems(section, untrusted): | 275 for name, value in self.configitems(section, untrusted): |
276 yield section, name, str(value).replace('\n', '\\n') | 276 yield section, name, value |
277 | 277 |
278 def plain(self): | 278 def plain(self): |
279 '''is plain mode active? | 279 '''is plain mode active? |
280 | 280 |
281 Plain mode means that all configuration variables which affect the | 281 Plain mode means that all configuration variables which affect the |