Mercurial > hg
changeset 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 | 42342f9afe01 |
children | 197dc4580da2 |
files | mercurial/changelog.py |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/changelog.py Sun Oct 26 12:14:10 2014 +0100 +++ b/mercurial/changelog.py Sun Oct 26 12:14:12 2014 +0100 @@ -172,10 +172,10 @@ 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): + return self.index.headrevsfiltered(self.filteredrevs) + # AttributeError covers non-c-extension environments and + # old c extensions without filter handling. + except AttributeError: return self._headrevs() return super(changelog, self).headrevs()