Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 2388:74d569332f8b
Cleanup: unifiy the coding style in the ui.py configitems forwarders.
No functional changes.
author | Markus F.X.J. Oberhumer <markus@oberhumer.com> |
---|---|
date | Thu, 01 Jun 2006 15:54:31 -0700 |
parents | af81d8770620 |
children | 8d31c71e8148 |
comparison
equal
deleted
inserted
replaced
2382:b429566d1994 | 2388:74d569332f8b |
---|---|
143 | 143 |
144 def extensions(self): | 144 def extensions(self): |
145 return self.configitems("extensions") | 145 return self.configitems("extensions") |
146 | 146 |
147 def hgignorefiles(self): | 147 def hgignorefiles(self): |
148 result = [] | 148 ret = [] |
149 cfgitems = self.configitems("ui") | 149 for k, v in self.configitems("ui"): |
150 for key, value in cfgitems: | 150 if k == 'ignore' or k.startswith('ignore.'): |
151 if key == 'ignore' or key.startswith('ignore.'): | 151 ret.append(os.path.expanduser(v)) |
152 path = os.path.expanduser(value) | 152 return ret |
153 result.append(path) | |
154 return result | |
155 | 153 |
156 def configrevlog(self): | 154 def configrevlog(self): |
157 ret = {} | 155 ret = {} |
158 for x in self.configitems("revlog"): | 156 for k, v in self.configitems("revlog"): |
159 k = x[0].lower() | 157 ret[k.lower()] = v |
160 ret[k] = x[1] | |
161 return ret | 158 return ret |
159 | |
162 def diffopts(self): | 160 def diffopts(self): |
163 if self.diffcache: | 161 if self.diffcache: |
164 return self.diffcache | 162 return self.diffcache |
165 ret = { 'showfunc' : True, 'ignorews' : False} | 163 ret = { 'showfunc' : True, 'ignorews' : False} |
166 for x in self.configitems("diff"): | 164 for k, v in self.configitems("diff"): |
167 k = x[0].lower() | |
168 v = x[1] | |
169 if v: | 165 if v: |
170 v = v.lower() | 166 v = v.lower() |
171 if v == 'true': | 167 if v == 'true': |
172 value = True | 168 v = True |
173 else: | 169 else: |
174 value = False | 170 v = False |
175 ret[k] = value | 171 ret[k.lower()] = v |
176 self.diffcache = ret | 172 self.diffcache = ret |
177 return ret | 173 return ret |
178 | 174 |
179 def username(self): | 175 def username(self): |
180 """Return default username to be used in commits. | 176 """Return default username to be used in commits. |