comparison mercurial/changelog.py @ 23088:fe5f044b753d stable

changelog: use headrevsfiltered 2b5940f64750 introduced use of the new filtering headrevs C implementation. It caught TypeError to detect when to fall back to the implementation that was compatible with old extensions. That method was however not reliable. Instead, use the new headrevsfiltered function when passing a filter. It will reliably fail with AttributeError when an old extension that predates headrevsfiltered is used.
author Mads Kiilerich <madski@unity3d.com>
date Sun, 26 Oct 2014 12:14:12 +0100
parents 21c44c1aed87
children 7e97bf6ee2d6
comparison
equal deleted inserted replaced
23087:42342f9afe01 23088:fe5f044b753d
170 return False 170 return False
171 171
172 def headrevs(self): 172 def headrevs(self):
173 if self.filteredrevs: 173 if self.filteredrevs:
174 try: 174 try:
175 return self.index.headrevs(self.filteredrevs) 175 return self.index.headrevsfiltered(self.filteredrevs)
176 # AttributeError covers non-c-extension environments. 176 # AttributeError covers non-c-extension environments and
177 # TypeError allows us work with old c extensions. 177 # old c extensions without filter handling.
178 except (AttributeError, TypeError): 178 except AttributeError:
179 return self._headrevs() 179 return self._headrevs()
180 180
181 return super(changelog, self).headrevs() 181 return super(changelog, self).headrevs()
182 182
183 def strip(self, *args, **kwargs): 183 def strip(self, *args, **kwargs):