Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

wconfig: don't remember access to unknown section

Follows behavior of Mercurial's config.config.

Changeset c53a2fa929ed

Parent 8106b9e458f9

by Yuya Nishihara

Changes to 2 files · Browse files at c53a2fa929ed Showing diff from parent 8106b9e458f9 Diff from another changeset...

 
87
88
89
 
 
 
 
 
 
 
 
90
91
92
 
87
88
89
90
91
92
93
94
95
96
97
98
99
100
@@ -87,6 +87,14 @@
  assert not c.get('unknown', 'bar')    @with_both +def check_set_followed_by_getitem_empty(): + c = newwconfig() + c['unknown'] + c.set('unknown', 'foo', 'bar') + assert_equals('bar', c.get('unknown', 'foo')) + assert_equals('bar', c['unknown']['foo']) + +@with_both  def check_dict_contains():   c = newwconfig({'foo.bar': 'x'})   assert 'bar' in c['foo']
 
134
135
136
137
138
 
 
 
 
 
139
140
141
 
134
135
136
 
 
137
138
139
140
141
142
143
144
@@ -134,8 +134,11 @@
  try:   return self._sections[section]   except KeyError: - self._sections[section] = _wsortdict(self._config[section]) - return self._sections[section] + if self._config[section]: + self._sections[section] = _wsortdict(self._config[section]) + return self._sections[section] + else: + return {}     def __iter__(self):   return iter(self._config)