comparison tests/check-perf-code.py @ 30144:14031d183048

perf: get subsettable from appropriate module for Mercurial earlier than 2.9 Before this patch, using branchmap.subsettable prevents perfbranchmap from measuring performance of Mercurial earlier than 2.9 (or 175c6fd8cacc), because 175c6fd8cacc moved subsettable from repoview.py to branchmap.py, even though there are some code paths for Mercurial earlier than 2.9 in perf.py. For example, setting "_prereadsize" attribute in perfindex() and perfnodelookup() is effective only with hg earlier than 1.8 (or 61c9bc3da402). To get subsettable from appropriate module, this patch examines existence of subsettable in branchmap and repoview. This patch also adds check-perf-code.py an extra check entry to detect direct usage of subsettable attribute in perf.py.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sun, 09 Oct 2016 01:03:17 +0900
parents d1a7d9c279bb
children 148ccd1d9f2f
comparison
equal deleted inserted replaced
30143:2d858c771760 30144:14031d183048
8 import sys 8 import sys
9 9
10 # write static check patterns here 10 # write static check patterns here
11 perfpypats = [ 11 perfpypats = [
12 [ 12 [
13 (r'(branchmap|repoview)\.subsettable',
14 "use getbranchmapsubsettable() for early Mercurial"),
13 ], 15 ],
14 # warnings 16 # warnings
15 [ 17 [
16 ] 18 ]
17 ] 19 ]