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