contrib/perf.py
changeset 41615 328ca3b9e545
parent 41565 bf7fb97aecf1
child 41652 6a447a3d1bd0
equal deleted inserted replaced
41612:fbd4ce55bcbd 41615:328ca3b9e545
  2374         """generate a benchmark function for the filtername"""
  2374         """generate a benchmark function for the filtername"""
  2375         if filtername is None:
  2375         if filtername is None:
  2376             view = repo
  2376             view = repo
  2377         else:
  2377         else:
  2378             view = repo.filtered(filtername)
  2378             view = repo.filtered(filtername)
       
  2379         if util.safehasattr(view._branchcaches, '_per_filter'):
       
  2380             filtered = view._branchcaches._per_filter
       
  2381         else:
       
  2382             # older versions
       
  2383             filtered = view._branchcaches
  2379         def d():
  2384         def d():
  2380             if clear_revbranch:
  2385             if clear_revbranch:
  2381                 repo.revbranchcache()._clear()
  2386                 repo.revbranchcache()._clear()
  2382             if full:
  2387             if full:
  2383                 view._branchcaches.clear()
  2388                 view._branchcaches.clear()
  2384             else:
  2389             else:
  2385                 view._branchcaches.pop(filtername, None)
  2390                 filtered.pop(filtername, None)
  2386             view.branchmap()
  2391             view.branchmap()
  2387         return d
  2392         return d
  2388     # add filter in smaller subset to bigger subset
  2393     # add filter in smaller subset to bigger subset
  2389     possiblefilters = set(repoview.filtertable)
  2394     possiblefilters = set(repoview.filtertable)
  2390     if filternames:
  2395     if filternames: