# HG changeset patch # User Augie Fackler # Date 1439319962 14400 # Node ID ce77436162a5bb3f3f35d1cd04e149dafae59872 # Parent 2c03e521a0c5defd1798bdbb0707d736db2e31fd changelog: trust C implementation of reachableroots more There are no remaining codepaths in reachableroots where it will return None, so just trust it completely and simplify this method. Result by revset ================ Revision: 0) Revision 1c75249e159b: style: adjust whitespaces in webutil.py 1) Revision d1d91b8090c6: changelog: trust C implementation of reachableroots more revset #0: 0::tip plain 0) 0.067684 1) 0.006622 9% revset #1: 0::@ plain 0) 0.068249 1) 0.009394 13% IOW this is a 10x speedup in my repo for hg itself for 0::tip and similar revsets now that the C code is correctly wired up. diff -r 2c03e521a0c5 -r ce77436162a5 mercurial/changelog.py --- a/mercurial/changelog.py Tue Aug 11 14:53:47 2015 -0400 +++ b/mercurial/changelog.py Tue Aug 11 15:06:02 2015 -0400 @@ -186,14 +186,8 @@ return self._nodecache def reachableroots(self, minroot, heads, roots, includepath=False): - reachable = self.index.reachableroots(minroot, heads, roots, - includepath) - if reachable is None: - # The C code hasn't been able to initialize a list, something went - # really wrong, let's rely on the pure implementation in that case - raise AttributeError() - else: - return revset.baseset(sorted(reachable)) + return revset.baseset(sorted( + self.index.reachableroots(minroot, heads, roots, includepath))) def headrevs(self): if self.filteredrevs: