Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/ui.py @ 3342:4eeb79b4da30
ui.py: make walkconfig use configitems
Also make it sort the available config sections while we're at it.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Tue, 10 Oct 2006 18:43:20 -0300 |
parents | a7cec14c9b40 |
children | ab406cfa1b99 |
comparison
equal
deleted
inserted
replaced
3341:a7cec14c9b40 | 3342:4eeb79b4da30 |
---|---|
140 if seen is None: | 140 if seen is None: |
141 seen = {} | 141 seen = {} |
142 for (section, name), value in self.overlay.iteritems(): | 142 for (section, name), value in self.overlay.iteritems(): |
143 yield section, name, value | 143 yield section, name, value |
144 seen[section, name] = 1 | 144 seen[section, name] = 1 |
145 for section in self.cdata.sections(): | 145 sections = self.cdata.sections() |
146 try: | 146 sections.sort() |
147 for name, value in self.cdata.items(section): | 147 for section in sections: |
148 if (section, name) in seen: continue | 148 for name, value in self.configitems(section): |
149 yield section, name, value.replace('\n', '\\n') | 149 if (section, name) in seen: continue |
150 seen[section, name] = 1 | 150 yield section, name, value.replace('\n', '\\n') |
151 except ConfigParser.InterpolationError, inst: | 151 seen[section, name] = 1 |
152 raise util.Abort(_("Error in configuration section [%s]:\n%s") | |
153 % (section, inst)) | |
154 if self.parentui is not None: | 152 if self.parentui is not None: |
155 for parent in self.parentui.walkconfig(seen): | 153 for parent in self.parentui.walkconfig(seen): |
156 yield parent | 154 yield parent |
157 | 155 |
158 def extensions(self): | 156 def extensions(self): |