Show More
@@ -0,0 +1,30 b'' | |||||
|
1 | #!/usr/bin/env python | |||
|
2 | # | |||
|
3 | # check-perf-code - (historical) portability checker for contrib/perf.py | |||
|
4 | ||||
|
5 | from __future__ import absolute_import | |||
|
6 | ||||
|
7 | import os | |||
|
8 | import sys | |||
|
9 | ||||
|
10 | # write static check patterns here | |||
|
11 | perfpypats = [ | |||
|
12 | [ | |||
|
13 | ], | |||
|
14 | # warnings | |||
|
15 | [ | |||
|
16 | ] | |||
|
17 | ] | |||
|
18 | ||||
|
19 | if __name__ == "__main__": | |||
|
20 | # import contrib/check-code.py as checkcode | |||
|
21 | assert 'RUNTESTDIR' in os.environ, "use check-perf-code.py in *.t script" | |||
|
22 | contribpath = os.path.join(os.environ['RUNTESTDIR'], '..', 'contrib') | |||
|
23 | sys.path.insert(0, contribpath) | |||
|
24 | checkcode = __import__('check-code') | |||
|
25 | ||||
|
26 | # register perf.py specific entry with "checks" in check-code.py | |||
|
27 | checkcode.checks.append(('perf.py', r'contrib/perf.py$', '', | |||
|
28 | checkcode.pyfilters, perfpypats)) | |||
|
29 | ||||
|
30 | sys.exit(checkcode.main()) |
@@ -1,150 +1,155 b'' | |||||
1 | #require test-repo |
|
1 | #require test-repo | |
2 |
|
2 | |||
3 | Set vars: |
|
3 | Set vars: | |
4 |
|
4 | |||
5 | $ . "$TESTDIR/helpers-testrepo.sh" |
|
5 | $ . "$TESTDIR/helpers-testrepo.sh" | |
6 | $ CONTRIBDIR="$TESTDIR/../contrib" |
|
6 | $ CONTRIBDIR="$TESTDIR/../contrib" | |
7 |
|
7 | |||
8 | Prepare repo: |
|
8 | Prepare repo: | |
9 |
|
9 | |||
10 | $ hg init |
|
10 | $ hg init | |
11 |
|
11 | |||
12 | $ echo this is file a > a |
|
12 | $ echo this is file a > a | |
13 | $ hg add a |
|
13 | $ hg add a | |
14 | $ hg commit -m first |
|
14 | $ hg commit -m first | |
15 |
|
15 | |||
16 | $ echo adding to file a >> a |
|
16 | $ echo adding to file a >> a | |
17 | $ hg commit -m second |
|
17 | $ hg commit -m second | |
18 |
|
18 | |||
19 | $ echo adding more to file a >> a |
|
19 | $ echo adding more to file a >> a | |
20 | $ hg commit -m third |
|
20 | $ hg commit -m third | |
21 |
|
21 | |||
22 | $ hg up -r 0 |
|
22 | $ hg up -r 0 | |
23 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
23 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
24 | $ echo merge-this >> a |
|
24 | $ echo merge-this >> a | |
25 | $ hg commit -m merge-able |
|
25 | $ hg commit -m merge-able | |
26 | created new head |
|
26 | created new head | |
27 |
|
27 | |||
28 | $ hg up -r 2 |
|
28 | $ hg up -r 2 | |
29 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
29 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
30 |
|
30 | |||
31 | perfstatus |
|
31 | perfstatus | |
32 |
|
32 | |||
33 | $ cat >> $HGRCPATH << EOF |
|
33 | $ cat >> $HGRCPATH << EOF | |
34 | > [extensions] |
|
34 | > [extensions] | |
35 | > perfstatusext=$CONTRIBDIR/perf.py |
|
35 | > perfstatusext=$CONTRIBDIR/perf.py | |
36 | > [perf] |
|
36 | > [perf] | |
37 | > presleep=0 |
|
37 | > presleep=0 | |
38 | > stub=on |
|
38 | > stub=on | |
39 | > parentscount=1 |
|
39 | > parentscount=1 | |
40 | > EOF |
|
40 | > EOF | |
41 | $ hg help perfstatusext |
|
41 | $ hg help perfstatusext | |
42 | perfstatusext extension - helper extension to measure performance |
|
42 | perfstatusext extension - helper extension to measure performance | |
43 |
|
43 | |||
44 | list of commands: |
|
44 | list of commands: | |
45 |
|
45 | |||
46 | perfaddremove |
|
46 | perfaddremove | |
47 | (no help text available) |
|
47 | (no help text available) | |
48 | perfancestors |
|
48 | perfancestors | |
49 | (no help text available) |
|
49 | (no help text available) | |
50 | perfancestorset |
|
50 | perfancestorset | |
51 | (no help text available) |
|
51 | (no help text available) | |
52 | perfannotate (no help text available) |
|
52 | perfannotate (no help text available) | |
53 | perfbranchmap |
|
53 | perfbranchmap | |
54 | benchmark the update of a branchmap |
|
54 | benchmark the update of a branchmap | |
55 | perfcca (no help text available) |
|
55 | perfcca (no help text available) | |
56 | perfchangeset |
|
56 | perfchangeset | |
57 | (no help text available) |
|
57 | (no help text available) | |
58 | perfctxfiles (no help text available) |
|
58 | perfctxfiles (no help text available) | |
59 | perfdiffwd Profile diff of working directory changes |
|
59 | perfdiffwd Profile diff of working directory changes | |
60 | perfdirfoldmap |
|
60 | perfdirfoldmap | |
61 | (no help text available) |
|
61 | (no help text available) | |
62 | perfdirs (no help text available) |
|
62 | perfdirs (no help text available) | |
63 | perfdirstate (no help text available) |
|
63 | perfdirstate (no help text available) | |
64 | perfdirstatedirs |
|
64 | perfdirstatedirs | |
65 | (no help text available) |
|
65 | (no help text available) | |
66 | perfdirstatefoldmap |
|
66 | perfdirstatefoldmap | |
67 | (no help text available) |
|
67 | (no help text available) | |
68 | perfdirstatewrite |
|
68 | perfdirstatewrite | |
69 | (no help text available) |
|
69 | (no help text available) | |
70 | perffncacheencode |
|
70 | perffncacheencode | |
71 | (no help text available) |
|
71 | (no help text available) | |
72 | perffncacheload |
|
72 | perffncacheload | |
73 | (no help text available) |
|
73 | (no help text available) | |
74 | perffncachewrite |
|
74 | perffncachewrite | |
75 | (no help text available) |
|
75 | (no help text available) | |
76 | perfheads (no help text available) |
|
76 | perfheads (no help text available) | |
77 | perfindex (no help text available) |
|
77 | perfindex (no help text available) | |
78 | perfloadmarkers |
|
78 | perfloadmarkers | |
79 | benchmark the time to parse the on-disk markers for a repo |
|
79 | benchmark the time to parse the on-disk markers for a repo | |
80 | perflog (no help text available) |
|
80 | perflog (no help text available) | |
81 | perflookup (no help text available) |
|
81 | perflookup (no help text available) | |
82 | perflrucachedict |
|
82 | perflrucachedict | |
83 | (no help text available) |
|
83 | (no help text available) | |
84 | perfmanifest (no help text available) |
|
84 | perfmanifest (no help text available) | |
85 | perfmergecalculate |
|
85 | perfmergecalculate | |
86 | (no help text available) |
|
86 | (no help text available) | |
87 | perfmoonwalk benchmark walking the changelog backwards |
|
87 | perfmoonwalk benchmark walking the changelog backwards | |
88 | perfnodelookup |
|
88 | perfnodelookup | |
89 | (no help text available) |
|
89 | (no help text available) | |
90 | perfparents (no help text available) |
|
90 | perfparents (no help text available) | |
91 | perfpathcopies |
|
91 | perfpathcopies | |
92 | (no help text available) |
|
92 | (no help text available) | |
93 | perfrawfiles (no help text available) |
|
93 | perfrawfiles (no help text available) | |
94 | perfrevlog Benchmark reading a series of revisions from a revlog. |
|
94 | perfrevlog Benchmark reading a series of revisions from a revlog. | |
95 | perfrevlogrevision |
|
95 | perfrevlogrevision | |
96 | Benchmark obtaining a revlog revision. |
|
96 | Benchmark obtaining a revlog revision. | |
97 | perfrevrange (no help text available) |
|
97 | perfrevrange (no help text available) | |
98 | perfrevset benchmark the execution time of a revset |
|
98 | perfrevset benchmark the execution time of a revset | |
99 | perfstartup (no help text available) |
|
99 | perfstartup (no help text available) | |
100 | perfstatus (no help text available) |
|
100 | perfstatus (no help text available) | |
101 | perftags (no help text available) |
|
101 | perftags (no help text available) | |
102 | perftemplating |
|
102 | perftemplating | |
103 | (no help text available) |
|
103 | (no help text available) | |
104 | perfvolatilesets |
|
104 | perfvolatilesets | |
105 | benchmark the computation of various volatile set |
|
105 | benchmark the computation of various volatile set | |
106 | perfwalk (no help text available) |
|
106 | perfwalk (no help text available) | |
107 |
|
107 | |||
108 | (use "hg help -v perfstatusext" to show built-in aliases and global options) |
|
108 | (use "hg help -v perfstatusext" to show built-in aliases and global options) | |
109 | $ hg perfaddremove |
|
109 | $ hg perfaddremove | |
110 | $ hg perfancestors |
|
110 | $ hg perfancestors | |
111 | $ hg perfancestorset 2 |
|
111 | $ hg perfancestorset 2 | |
112 | $ hg perfannotate a |
|
112 | $ hg perfannotate a | |
113 | $ hg perfbranchmap |
|
113 | $ hg perfbranchmap | |
114 | $ hg perfcca |
|
114 | $ hg perfcca | |
115 | $ hg perfchangeset 2 |
|
115 | $ hg perfchangeset 2 | |
116 | $ hg perfctxfiles 2 |
|
116 | $ hg perfctxfiles 2 | |
117 | $ hg perfdiffwd |
|
117 | $ hg perfdiffwd | |
118 | $ hg perfdirfoldmap |
|
118 | $ hg perfdirfoldmap | |
119 | $ hg perfdirs |
|
119 | $ hg perfdirs | |
120 | $ hg perfdirstate |
|
120 | $ hg perfdirstate | |
121 | $ hg perfdirstatedirs |
|
121 | $ hg perfdirstatedirs | |
122 | $ hg perfdirstatefoldmap |
|
122 | $ hg perfdirstatefoldmap | |
123 | $ hg perfdirstatewrite |
|
123 | $ hg perfdirstatewrite | |
124 | $ hg perffncacheencode |
|
124 | $ hg perffncacheencode | |
125 | $ hg perffncacheload |
|
125 | $ hg perffncacheload | |
126 | $ hg perffncachewrite |
|
126 | $ hg perffncachewrite | |
127 | $ hg perfheads |
|
127 | $ hg perfheads | |
128 | $ hg perfindex |
|
128 | $ hg perfindex | |
129 | $ hg perfloadmarkers |
|
129 | $ hg perfloadmarkers | |
130 | $ hg perflog |
|
130 | $ hg perflog | |
131 | $ hg perflookup 2 |
|
131 | $ hg perflookup 2 | |
132 | $ hg perflrucache |
|
132 | $ hg perflrucache | |
133 | $ hg perfmanifest 2 |
|
133 | $ hg perfmanifest 2 | |
134 | $ hg perfmergecalculate -r 3 |
|
134 | $ hg perfmergecalculate -r 3 | |
135 | $ hg perfmoonwalk |
|
135 | $ hg perfmoonwalk | |
136 | $ hg perfnodelookup 2 |
|
136 | $ hg perfnodelookup 2 | |
137 | $ hg perfpathcopies 1 2 |
|
137 | $ hg perfpathcopies 1 2 | |
138 | $ hg perfrawfiles 2 |
|
138 | $ hg perfrawfiles 2 | |
139 | $ hg perfrevlog .hg/store/data/a.i |
|
139 | $ hg perfrevlog .hg/store/data/a.i | |
140 | $ hg perfrevlogrevision -m 0 |
|
140 | $ hg perfrevlogrevision -m 0 | |
141 | $ hg perfrevrange |
|
141 | $ hg perfrevrange | |
142 | $ hg perfrevset 'all()' |
|
142 | $ hg perfrevset 'all()' | |
143 | $ hg perfstartup |
|
143 | $ hg perfstartup | |
144 | $ hg perfstatus |
|
144 | $ hg perfstatus | |
145 | $ hg perftags |
|
145 | $ hg perftags | |
146 | $ hg perftemplating |
|
146 | $ hg perftemplating | |
147 | $ hg perfvolatilesets |
|
147 | $ hg perfvolatilesets | |
148 | $ hg perfwalk |
|
148 | $ hg perfwalk | |
149 | $ hg perfparents |
|
149 | $ hg perfparents | |
150 |
|
150 | |||
|
151 | Check perf.py for historical portability | |||
|
152 | ||||
|
153 | $ cd "$TESTDIR/.." | |||
|
154 | ||||
|
155 | $ "$TESTDIR"/check-perf-code.py contrib/perf.py |
General Comments 0
You need to be logged in to leave comments.
Login now