##// END OF EJS Templates
repoview: avoid wrapping changelog if there's nothing to filter...
Martin von Zweigbergk -
r43759:c8e5b309 default
parent child Browse files
Show More
@@ -26,7 +26,6 b' from . import ('
26 26 obsolete,
27 27 phases,
28 28 pycompat,
29 revlog,
30 29 tags as tagsmod,
31 30 util,
32 31 )
@@ -241,9 +240,6 b' def wrapchangelog(unfichangelog, filtere'
241 240
242 241 def __iter__(self):
243 242 """filtered version of revlog.__iter__"""
244 if len(self.filteredrevs) == 0:
245 return revlog.revlog.__iter__(self)
246
247 243
248 244 def filterediter():
249 245 for i in pycompat.xrange(len(self)):
@@ -280,7 +276,7 b' def wrapchangelog(unfichangelog, filtere'
280 276 return revs
281 277
282 278 def headrevs(self, revs=None):
283 if revs is None and self.filteredrevs:
279 if revs is None:
284 280 try:
285 281 return self.index.headrevsfiltered(self.filteredrevs)
286 282 # AttributeError covers non-c-extension environments and
@@ -288,8 +284,7 b' def wrapchangelog(unfichangelog, filtere'
288 284 except AttributeError:
289 285 return self._headrevs()
290 286
291 if self.filteredrevs:
292 revs = self._checknofilteredinrevs(revs)
287 revs = self._checknofilteredinrevs(revs)
293 288 return super(filteredchangelog, self).headrevs(revs)
294 289
295 290 def strip(self, *args, **kwargs):
@@ -404,7 +399,8 b' class repoview(object):'
404 399 cl = None
405 400 # could have been made None by the previous if
406 401 if cl is None:
407 cl = wrapchangelog(unfichangelog, revs)
402 # Only filter if there's something to filter
403 cl = wrapchangelog(unfichangelog, revs) if revs else unfichangelog
408 404 object.__setattr__(self, r'_clcache', cl)
409 405 object.__setattr__(self, r'_clcachekey', newkey)
410 406 return cl
General Comments 0
You need to be logged in to leave comments. Login now