[PATCH] changelog: only use filtering headrevs C extension when it is available

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri Oct 24 08:35:46 CDT 2014



On 10/24/2014 03:31 PM, Mads Kiilerich wrote:
> On 10/24/2014 03:21 PM, Pierre-Yves David wrote:
>> On 10/24/2014 02:39 AM, Mads Kiilerich wrote:
>>> @@ -172,11 +172,13 @@ class changelog(revlog.revlog):
>>>       def headrevs(self):
>>>           if self.filteredrevs:
>>>               try:
>>> -                return self.index.headrevs(self.filteredrevs)
>>> -            # AttributeError covers non-c-extension environments.
>>> -            # TypeError allows us work with old c extensions.
>>> -            except (AttributeError, TypeError):
>>> +                # Throw AttributeError in non-c-extension environments.
>>> +                f = self.index.headrevs
>>> +                # Throw AttributeError if C extension too old.
>>> +                parsers.asciilower
>>> +            except AttributeError:
>>>                   return self._headrevs()
>>> +            return f(self.filteredrevs)
>>
>> Actually, I now remind that the TypeError is here to catch the fact we
>> (read, durham) added a the filtered revs argument to headrevs. I
>> assume that your parser.asciilower access try to detect this but it is
>> far from obvious.
>
> It is not obvious that we use asciilower to catch the situation that the
> extension is too old?

It is not obvious that "too old" means:

  "headrevs does not take argument".


-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list