##// END OF EJS Templates
test-hgweb-annotate-whitespace: make test compatible with chg...
Saurabh Singh -
r34793:3b4b3813 default
parent child Browse files
Show More
@@ -1,788 +1,788 b''
1 #require serve
1 #require serve
2
2
3 Create a repo with whitespace only changes
3 Create a repo with whitespace only changes
4
4
5 $ hg init repo-with-whitespace
5 $ hg init repo-with-whitespace
6 $ cd repo-with-whitespace
6 $ cd repo-with-whitespace
7 $ cat > foo << EOF
7 $ cat > foo << EOF
8 > line 0
8 > line 0
9 > line 1
9 > line 1
10 > line 2
10 > line 2
11 > line 3
11 > line 3
12 > EOF
12 > EOF
13 $ hg -q commit -A -m 'commit 0'
13 $ hg -q commit -A -m 'commit 0'
14 $ cat > foo << EOF
14 $ cat > foo << EOF
15 > line 0
15 > line 0
16 > line 1 modified by 1
16 > line 1 modified by 1
17 > line 2
17 > line 2
18 > line 3
18 > line 3
19 > EOF
19 > EOF
20 $ hg commit -m 'commit 1'
20 $ hg commit -m 'commit 1'
21 $ cat > foo << EOF
21 $ cat > foo << EOF
22 > line 0
22 > line 0
23 > line 1 modified by 1
23 > line 1 modified by 1
24 > line 2
24 > line 2
25 > line 3
25 > line 3
26 > EOF
26 > EOF
27 $ hg commit -m 'commit 2 (leading whitespace on line 2)'
27 $ hg commit -m 'commit 2 (leading whitespace on line 2)'
28 $ cat > foo << EOF
28 $ cat > foo << EOF
29 > line 0
29 > line 0
30 > line 1 modified by 1
30 > line 1 modified by 1
31 > line 2
31 > line 2
32 > EOF
32 > EOF
33 Need to use printf to avoid check-code complaining about trailing whitespace.
33 Need to use printf to avoid check-code complaining about trailing whitespace.
34 $ printf 'line 3 \n' >> foo
34 $ printf 'line 3 \n' >> foo
35 $ hg commit -m 'commit 3 (trailing whitespace on line 3)'
35 $ hg commit -m 'commit 3 (trailing whitespace on line 3)'
36 $ cat > foo << EOF
36 $ cat > foo << EOF
37 > line 0
37 > line 0
38 > line 1 modified by 1
38 > line 1 modified by 1
39 > line 2
39 > line 2
40 > EOF
40 > EOF
41 $ printf 'line 3 \n' >> foo
41 $ printf 'line 3 \n' >> foo
42 $ hg commit -m 'commit 4 (intra whitespace on line 0)'
42 $ hg commit -m 'commit 4 (intra whitespace on line 0)'
43 $ cat > foo << EOF
43 $ cat > foo << EOF
44 > line 0
44 > line 0
45 >
45 >
46 > line 1 modified by 1
46 > line 1 modified by 1
47 > line 2
47 > line 2
48 > EOF
48 > EOF
49 $ printf 'line 3 \n' >> foo
49 $ printf 'line 3 \n' >> foo
50 $ hg commit -m 'commit 5 (add blank line between line 0 and 1)'
50 $ hg commit -m 'commit 5 (add blank line between line 0 and 1)'
51 $ cat > foo << EOF
51 $ cat > foo << EOF
52 > line 0
52 > line 0
53 >
53 >
54 >
54 >
55 > line 1 modified by 1
55 > line 1 modified by 1
56 > line 2
56 > line 2
57 > EOF
57 > EOF
58 $ printf 'line 3 \n' >> foo
58 $ printf 'line 3 \n' >> foo
59 $ hg commit -m 'commit 6 (add another blank line between line 0 and 1)'
59 $ hg commit -m 'commit 6 (add another blank line between line 0 and 1)'
60
60
61 $ hg log -G -T '{rev}:{node|short} {desc}'
61 $ hg log -G -T '{rev}:{node|short} {desc}'
62 @ 6:9d1b2c7db017 commit 6 (add another blank line between line 0 and 1)
62 @ 6:9d1b2c7db017 commit 6 (add another blank line between line 0 and 1)
63 |
63 |
64 o 5:400ef1d40470 commit 5 (add blank line between line 0 and 1)
64 o 5:400ef1d40470 commit 5 (add blank line between line 0 and 1)
65 |
65 |
66 o 4:08adbe269f24 commit 4 (intra whitespace on line 0)
66 o 4:08adbe269f24 commit 4 (intra whitespace on line 0)
67 |
67 |
68 o 3:dcb62cfbfc9b commit 3 (trailing whitespace on line 3)
68 o 3:dcb62cfbfc9b commit 3 (trailing whitespace on line 3)
69 |
69 |
70 o 2:6bdb694e7b8c commit 2 (leading whitespace on line 2)
70 o 2:6bdb694e7b8c commit 2 (leading whitespace on line 2)
71 |
71 |
72 o 1:23e1e37387dc commit 1
72 o 1:23e1e37387dc commit 1
73 |
73 |
74 o 0:b9c578134d72 commit 0
74 o 0:b9c578134d72 commit 0
75
75
76
76
77 $ hg serve -p $HGPORT -d --pid-file hg.pid
77 $ hg serve -p $HGPORT -d --pid-file hg.pid
78 $ cat hg.pid >> $DAEMON_PIDS
78 $ cat hg.pid >> $DAEMON_PIDS
79 $ hg --config annotate.ignorews=true serve -p $HGPORT1 -d --pid-file hg.pid
79 $ hg serve --config annotate.ignorews=true -p $HGPORT1 -d --pid-file hg.pid
80 $ cat hg.pid >> $DAEMON_PIDS
80 $ cat hg.pid >> $DAEMON_PIDS
81 $ cd ..
81 $ cd ..
82
82
83 Annotate works
83 Annotate works
84
84
85 $ get-with-headers.py --json $LOCALIP:$HGPORT 'json-annotate/9d1b2c7db017/foo'
85 $ get-with-headers.py --json $LOCALIP:$HGPORT 'json-annotate/9d1b2c7db017/foo'
86 200 Script output follows
86 200 Script output follows
87
87
88 {
88 {
89 "abspath": "foo",
89 "abspath": "foo",
90 "annotate": [
90 "annotate": [
91 {
91 {
92 "abspath": "foo",
92 "abspath": "foo",
93 "author": "test",
93 "author": "test",
94 "desc": "commit 4 (intra whitespace on line 0)",
94 "desc": "commit 4 (intra whitespace on line 0)",
95 "line": "line 0\n",
95 "line": "line 0\n",
96 "lineno": 1,
96 "lineno": 1,
97 "node": "08adbe269f24cf22d975eadeec16790c5b22f558",
97 "node": "08adbe269f24cf22d975eadeec16790c5b22f558",
98 "revdate": [
98 "revdate": [
99 0.0,
99 0.0,
100 0
100 0
101 ],
101 ],
102 "targetline": 1
102 "targetline": 1
103 },
103 },
104 {
104 {
105 "abspath": "foo",
105 "abspath": "foo",
106 "author": "test",
106 "author": "test",
107 "desc": "commit 5 (add blank line between line 0 and 1)",
107 "desc": "commit 5 (add blank line between line 0 and 1)",
108 "line": "\n",
108 "line": "\n",
109 "lineno": 2,
109 "lineno": 2,
110 "node": "400ef1d404706cfb48afd2b78ce6addf641ced25",
110 "node": "400ef1d404706cfb48afd2b78ce6addf641ced25",
111 "revdate": [
111 "revdate": [
112 0.0,
112 0.0,
113 0
113 0
114 ],
114 ],
115 "targetline": 2
115 "targetline": 2
116 },
116 },
117 {
117 {
118 "abspath": "foo",
118 "abspath": "foo",
119 "author": "test",
119 "author": "test",
120 "desc": "commit 6 (add another blank line between line 0 and 1)",
120 "desc": "commit 6 (add another blank line between line 0 and 1)",
121 "line": "\n",
121 "line": "\n",
122 "lineno": 3,
122 "lineno": 3,
123 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
123 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
124 "revdate": [
124 "revdate": [
125 0.0,
125 0.0,
126 0
126 0
127 ],
127 ],
128 "targetline": 3
128 "targetline": 3
129 },
129 },
130 {
130 {
131 "abspath": "foo",
131 "abspath": "foo",
132 "author": "test",
132 "author": "test",
133 "desc": "commit 1",
133 "desc": "commit 1",
134 "line": "line 1 modified by 1\n",
134 "line": "line 1 modified by 1\n",
135 "lineno": 4,
135 "lineno": 4,
136 "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a",
136 "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a",
137 "revdate": [
137 "revdate": [
138 0.0,
138 0.0,
139 0
139 0
140 ],
140 ],
141 "targetline": 2
141 "targetline": 2
142 },
142 },
143 {
143 {
144 "abspath": "foo",
144 "abspath": "foo",
145 "author": "test",
145 "author": "test",
146 "desc": "commit 2 (leading whitespace on line 2)",
146 "desc": "commit 2 (leading whitespace on line 2)",
147 "line": " line 2\n",
147 "line": " line 2\n",
148 "lineno": 5,
148 "lineno": 5,
149 "node": "6bdb694e7b8cebb68d5b6b27b4bcc2a49d62c602",
149 "node": "6bdb694e7b8cebb68d5b6b27b4bcc2a49d62c602",
150 "revdate": [
150 "revdate": [
151 0.0,
151 0.0,
152 0
152 0
153 ],
153 ],
154 "targetline": 3
154 "targetline": 3
155 },
155 },
156 {
156 {
157 "abspath": "foo",
157 "abspath": "foo",
158 "author": "test",
158 "author": "test",
159 "desc": "commit 3 (trailing whitespace on line 3)",
159 "desc": "commit 3 (trailing whitespace on line 3)",
160 "line": "line 3 \n",
160 "line": "line 3 \n",
161 "lineno": 6,
161 "lineno": 6,
162 "node": "dcb62cfbfc9b3ab995a5cbbaff6e1971c3e4f865",
162 "node": "dcb62cfbfc9b3ab995a5cbbaff6e1971c3e4f865",
163 "revdate": [
163 "revdate": [
164 0.0,
164 0.0,
165 0
165 0
166 ],
166 ],
167 "targetline": 4
167 "targetline": 4
168 }
168 }
169 ],
169 ],
170 "author": "test",
170 "author": "test",
171 "children": [],
171 "children": [],
172 "date": [
172 "date": [
173 0.0,
173 0.0,
174 0
174 0
175 ],
175 ],
176 "desc": "commit 6 (add another blank line between line 0 and 1)",
176 "desc": "commit 6 (add another blank line between line 0 and 1)",
177 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
177 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
178 "parents": [
178 "parents": [
179 "400ef1d404706cfb48afd2b78ce6addf641ced25"
179 "400ef1d404706cfb48afd2b78ce6addf641ced25"
180 ],
180 ],
181 "permissions": ""
181 "permissions": ""
182 }
182 }
183
183
184 annotate.ignorews=1 config option is honored
184 annotate.ignorews=1 config option is honored
185
185
186 $ get-with-headers.py --json $LOCALIP:$HGPORT1 'json-annotate/9d1b2c7db017/foo'
186 $ get-with-headers.py --json $LOCALIP:$HGPORT1 'json-annotate/9d1b2c7db017/foo'
187 200 Script output follows
187 200 Script output follows
188
188
189 {
189 {
190 "abspath": "foo",
190 "abspath": "foo",
191 "annotate": [
191 "annotate": [
192 {
192 {
193 "abspath": "foo",
193 "abspath": "foo",
194 "author": "test",
194 "author": "test",
195 "desc": "commit 0",
195 "desc": "commit 0",
196 "line": "line 0\n",
196 "line": "line 0\n",
197 "lineno": 1,
197 "lineno": 1,
198 "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc",
198 "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc",
199 "revdate": [
199 "revdate": [
200 0.0,
200 0.0,
201 0
201 0
202 ],
202 ],
203 "targetline": 1
203 "targetline": 1
204 },
204 },
205 {
205 {
206 "abspath": "foo",
206 "abspath": "foo",
207 "author": "test",
207 "author": "test",
208 "desc": "commit 5 (add blank line between line 0 and 1)",
208 "desc": "commit 5 (add blank line between line 0 and 1)",
209 "line": "\n",
209 "line": "\n",
210 "lineno": 2,
210 "lineno": 2,
211 "node": "400ef1d404706cfb48afd2b78ce6addf641ced25",
211 "node": "400ef1d404706cfb48afd2b78ce6addf641ced25",
212 "revdate": [
212 "revdate": [
213 0.0,
213 0.0,
214 0
214 0
215 ],
215 ],
216 "targetline": 2
216 "targetline": 2
217 },
217 },
218 {
218 {
219 "abspath": "foo",
219 "abspath": "foo",
220 "author": "test",
220 "author": "test",
221 "desc": "commit 6 (add another blank line between line 0 and 1)",
221 "desc": "commit 6 (add another blank line between line 0 and 1)",
222 "line": "\n",
222 "line": "\n",
223 "lineno": 3,
223 "lineno": 3,
224 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
224 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
225 "revdate": [
225 "revdate": [
226 0.0,
226 0.0,
227 0
227 0
228 ],
228 ],
229 "targetline": 3
229 "targetline": 3
230 },
230 },
231 {
231 {
232 "abspath": "foo",
232 "abspath": "foo",
233 "author": "test",
233 "author": "test",
234 "desc": "commit 1",
234 "desc": "commit 1",
235 "line": "line 1 modified by 1\n",
235 "line": "line 1 modified by 1\n",
236 "lineno": 4,
236 "lineno": 4,
237 "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a",
237 "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a",
238 "revdate": [
238 "revdate": [
239 0.0,
239 0.0,
240 0
240 0
241 ],
241 ],
242 "targetline": 2
242 "targetline": 2
243 },
243 },
244 {
244 {
245 "abspath": "foo",
245 "abspath": "foo",
246 "author": "test",
246 "author": "test",
247 "desc": "commit 0",
247 "desc": "commit 0",
248 "line": " line 2\n",
248 "line": " line 2\n",
249 "lineno": 5,
249 "lineno": 5,
250 "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc",
250 "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc",
251 "revdate": [
251 "revdate": [
252 0.0,
252 0.0,
253 0
253 0
254 ],
254 ],
255 "targetline": 3
255 "targetline": 3
256 },
256 },
257 {
257 {
258 "abspath": "foo",
258 "abspath": "foo",
259 "author": "test",
259 "author": "test",
260 "desc": "commit 0",
260 "desc": "commit 0",
261 "line": "line 3 \n",
261 "line": "line 3 \n",
262 "lineno": 6,
262 "lineno": 6,
263 "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc",
263 "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc",
264 "revdate": [
264 "revdate": [
265 0.0,
265 0.0,
266 0
266 0
267 ],
267 ],
268 "targetline": 4
268 "targetline": 4
269 }
269 }
270 ],
270 ],
271 "author": "test",
271 "author": "test",
272 "children": [],
272 "children": [],
273 "date": [
273 "date": [
274 0.0,
274 0.0,
275 0
275 0
276 ],
276 ],
277 "desc": "commit 6 (add another blank line between line 0 and 1)",
277 "desc": "commit 6 (add another blank line between line 0 and 1)",
278 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
278 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
279 "parents": [
279 "parents": [
280 "400ef1d404706cfb48afd2b78ce6addf641ced25"
280 "400ef1d404706cfb48afd2b78ce6addf641ced25"
281 ],
281 ],
282 "permissions": ""
282 "permissions": ""
283 }
283 }
284
284
285 ignorews=1 query string argument enables whitespace skipping
285 ignorews=1 query string argument enables whitespace skipping
286
286
287 $ get-with-headers.py --json $LOCALIP:$HGPORT 'json-annotate/9d1b2c7db017/foo?ignorews=1'
287 $ get-with-headers.py --json $LOCALIP:$HGPORT 'json-annotate/9d1b2c7db017/foo?ignorews=1'
288 200 Script output follows
288 200 Script output follows
289
289
290 {
290 {
291 "abspath": "foo",
291 "abspath": "foo",
292 "annotate": [
292 "annotate": [
293 {
293 {
294 "abspath": "foo",
294 "abspath": "foo",
295 "author": "test",
295 "author": "test",
296 "desc": "commit 0",
296 "desc": "commit 0",
297 "line": "line 0\n",
297 "line": "line 0\n",
298 "lineno": 1,
298 "lineno": 1,
299 "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc",
299 "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc",
300 "revdate": [
300 "revdate": [
301 0.0,
301 0.0,
302 0
302 0
303 ],
303 ],
304 "targetline": 1
304 "targetline": 1
305 },
305 },
306 {
306 {
307 "abspath": "foo",
307 "abspath": "foo",
308 "author": "test",
308 "author": "test",
309 "desc": "commit 5 (add blank line between line 0 and 1)",
309 "desc": "commit 5 (add blank line between line 0 and 1)",
310 "line": "\n",
310 "line": "\n",
311 "lineno": 2,
311 "lineno": 2,
312 "node": "400ef1d404706cfb48afd2b78ce6addf641ced25",
312 "node": "400ef1d404706cfb48afd2b78ce6addf641ced25",
313 "revdate": [
313 "revdate": [
314 0.0,
314 0.0,
315 0
315 0
316 ],
316 ],
317 "targetline": 2
317 "targetline": 2
318 },
318 },
319 {
319 {
320 "abspath": "foo",
320 "abspath": "foo",
321 "author": "test",
321 "author": "test",
322 "desc": "commit 6 (add another blank line between line 0 and 1)",
322 "desc": "commit 6 (add another blank line between line 0 and 1)",
323 "line": "\n",
323 "line": "\n",
324 "lineno": 3,
324 "lineno": 3,
325 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
325 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
326 "revdate": [
326 "revdate": [
327 0.0,
327 0.0,
328 0
328 0
329 ],
329 ],
330 "targetline": 3
330 "targetline": 3
331 },
331 },
332 {
332 {
333 "abspath": "foo",
333 "abspath": "foo",
334 "author": "test",
334 "author": "test",
335 "desc": "commit 1",
335 "desc": "commit 1",
336 "line": "line 1 modified by 1\n",
336 "line": "line 1 modified by 1\n",
337 "lineno": 4,
337 "lineno": 4,
338 "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a",
338 "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a",
339 "revdate": [
339 "revdate": [
340 0.0,
340 0.0,
341 0
341 0
342 ],
342 ],
343 "targetline": 2
343 "targetline": 2
344 },
344 },
345 {
345 {
346 "abspath": "foo",
346 "abspath": "foo",
347 "author": "test",
347 "author": "test",
348 "desc": "commit 0",
348 "desc": "commit 0",
349 "line": " line 2\n",
349 "line": " line 2\n",
350 "lineno": 5,
350 "lineno": 5,
351 "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc",
351 "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc",
352 "revdate": [
352 "revdate": [
353 0.0,
353 0.0,
354 0
354 0
355 ],
355 ],
356 "targetline": 3
356 "targetline": 3
357 },
357 },
358 {
358 {
359 "abspath": "foo",
359 "abspath": "foo",
360 "author": "test",
360 "author": "test",
361 "desc": "commit 0",
361 "desc": "commit 0",
362 "line": "line 3 \n",
362 "line": "line 3 \n",
363 "lineno": 6,
363 "lineno": 6,
364 "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc",
364 "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc",
365 "revdate": [
365 "revdate": [
366 0.0,
366 0.0,
367 0
367 0
368 ],
368 ],
369 "targetline": 4
369 "targetline": 4
370 }
370 }
371 ],
371 ],
372 "author": "test",
372 "author": "test",
373 "children": [],
373 "children": [],
374 "date": [
374 "date": [
375 0.0,
375 0.0,
376 0
376 0
377 ],
377 ],
378 "desc": "commit 6 (add another blank line between line 0 and 1)",
378 "desc": "commit 6 (add another blank line between line 0 and 1)",
379 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
379 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
380 "parents": [
380 "parents": [
381 "400ef1d404706cfb48afd2b78ce6addf641ced25"
381 "400ef1d404706cfb48afd2b78ce6addf641ced25"
382 ],
382 ],
383 "permissions": ""
383 "permissions": ""
384 }
384 }
385
385
386 ignorews=0 query string argument disables when config defaults to enabled
386 ignorews=0 query string argument disables when config defaults to enabled
387
387
388 $ get-with-headers.py --json $LOCALIP:$HGPORT1 'json-annotate/9d1b2c7db017/foo?ignorews=0'
388 $ get-with-headers.py --json $LOCALIP:$HGPORT1 'json-annotate/9d1b2c7db017/foo?ignorews=0'
389 200 Script output follows
389 200 Script output follows
390
390
391 {
391 {
392 "abspath": "foo",
392 "abspath": "foo",
393 "annotate": [
393 "annotate": [
394 {
394 {
395 "abspath": "foo",
395 "abspath": "foo",
396 "author": "test",
396 "author": "test",
397 "desc": "commit 4 (intra whitespace on line 0)",
397 "desc": "commit 4 (intra whitespace on line 0)",
398 "line": "line 0\n",
398 "line": "line 0\n",
399 "lineno": 1,
399 "lineno": 1,
400 "node": "08adbe269f24cf22d975eadeec16790c5b22f558",
400 "node": "08adbe269f24cf22d975eadeec16790c5b22f558",
401 "revdate": [
401 "revdate": [
402 0.0,
402 0.0,
403 0
403 0
404 ],
404 ],
405 "targetline": 1
405 "targetline": 1
406 },
406 },
407 {
407 {
408 "abspath": "foo",
408 "abspath": "foo",
409 "author": "test",
409 "author": "test",
410 "desc": "commit 5 (add blank line between line 0 and 1)",
410 "desc": "commit 5 (add blank line between line 0 and 1)",
411 "line": "\n",
411 "line": "\n",
412 "lineno": 2,
412 "lineno": 2,
413 "node": "400ef1d404706cfb48afd2b78ce6addf641ced25",
413 "node": "400ef1d404706cfb48afd2b78ce6addf641ced25",
414 "revdate": [
414 "revdate": [
415 0.0,
415 0.0,
416 0
416 0
417 ],
417 ],
418 "targetline": 2
418 "targetline": 2
419 },
419 },
420 {
420 {
421 "abspath": "foo",
421 "abspath": "foo",
422 "author": "test",
422 "author": "test",
423 "desc": "commit 6 (add another blank line between line 0 and 1)",
423 "desc": "commit 6 (add another blank line between line 0 and 1)",
424 "line": "\n",
424 "line": "\n",
425 "lineno": 3,
425 "lineno": 3,
426 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
426 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
427 "revdate": [
427 "revdate": [
428 0.0,
428 0.0,
429 0
429 0
430 ],
430 ],
431 "targetline": 3
431 "targetline": 3
432 },
432 },
433 {
433 {
434 "abspath": "foo",
434 "abspath": "foo",
435 "author": "test",
435 "author": "test",
436 "desc": "commit 1",
436 "desc": "commit 1",
437 "line": "line 1 modified by 1\n",
437 "line": "line 1 modified by 1\n",
438 "lineno": 4,
438 "lineno": 4,
439 "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a",
439 "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a",
440 "revdate": [
440 "revdate": [
441 0.0,
441 0.0,
442 0
442 0
443 ],
443 ],
444 "targetline": 2
444 "targetline": 2
445 },
445 },
446 {
446 {
447 "abspath": "foo",
447 "abspath": "foo",
448 "author": "test",
448 "author": "test",
449 "desc": "commit 2 (leading whitespace on line 2)",
449 "desc": "commit 2 (leading whitespace on line 2)",
450 "line": " line 2\n",
450 "line": " line 2\n",
451 "lineno": 5,
451 "lineno": 5,
452 "node": "6bdb694e7b8cebb68d5b6b27b4bcc2a49d62c602",
452 "node": "6bdb694e7b8cebb68d5b6b27b4bcc2a49d62c602",
453 "revdate": [
453 "revdate": [
454 0.0,
454 0.0,
455 0
455 0
456 ],
456 ],
457 "targetline": 3
457 "targetline": 3
458 },
458 },
459 {
459 {
460 "abspath": "foo",
460 "abspath": "foo",
461 "author": "test",
461 "author": "test",
462 "desc": "commit 3 (trailing whitespace on line 3)",
462 "desc": "commit 3 (trailing whitespace on line 3)",
463 "line": "line 3 \n",
463 "line": "line 3 \n",
464 "lineno": 6,
464 "lineno": 6,
465 "node": "dcb62cfbfc9b3ab995a5cbbaff6e1971c3e4f865",
465 "node": "dcb62cfbfc9b3ab995a5cbbaff6e1971c3e4f865",
466 "revdate": [
466 "revdate": [
467 0.0,
467 0.0,
468 0
468 0
469 ],
469 ],
470 "targetline": 4
470 "targetline": 4
471 }
471 }
472 ],
472 ],
473 "author": "test",
473 "author": "test",
474 "children": [],
474 "children": [],
475 "date": [
475 "date": [
476 0.0,
476 0.0,
477 0
477 0
478 ],
478 ],
479 "desc": "commit 6 (add another blank line between line 0 and 1)",
479 "desc": "commit 6 (add another blank line between line 0 and 1)",
480 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
480 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
481 "parents": [
481 "parents": [
482 "400ef1d404706cfb48afd2b78ce6addf641ced25"
482 "400ef1d404706cfb48afd2b78ce6addf641ced25"
483 ],
483 ],
484 "permissions": ""
484 "permissions": ""
485 }
485 }
486
486
487 ignorewsamount=1 query string enables whitespace amount skipping
487 ignorewsamount=1 query string enables whitespace amount skipping
488
488
489 $ get-with-headers.py --json $LOCALIP:$HGPORT 'json-annotate/9d1b2c7db017/foo?ignorewsamount=1'
489 $ get-with-headers.py --json $LOCALIP:$HGPORT 'json-annotate/9d1b2c7db017/foo?ignorewsamount=1'
490 200 Script output follows
490 200 Script output follows
491
491
492 {
492 {
493 "abspath": "foo",
493 "abspath": "foo",
494 "annotate": [
494 "annotate": [
495 {
495 {
496 "abspath": "foo",
496 "abspath": "foo",
497 "author": "test",
497 "author": "test",
498 "desc": "commit 0",
498 "desc": "commit 0",
499 "line": "line 0\n",
499 "line": "line 0\n",
500 "lineno": 1,
500 "lineno": 1,
501 "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc",
501 "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc",
502 "revdate": [
502 "revdate": [
503 0.0,
503 0.0,
504 0
504 0
505 ],
505 ],
506 "targetline": 1
506 "targetline": 1
507 },
507 },
508 {
508 {
509 "abspath": "foo",
509 "abspath": "foo",
510 "author": "test",
510 "author": "test",
511 "desc": "commit 5 (add blank line between line 0 and 1)",
511 "desc": "commit 5 (add blank line between line 0 and 1)",
512 "line": "\n",
512 "line": "\n",
513 "lineno": 2,
513 "lineno": 2,
514 "node": "400ef1d404706cfb48afd2b78ce6addf641ced25",
514 "node": "400ef1d404706cfb48afd2b78ce6addf641ced25",
515 "revdate": [
515 "revdate": [
516 0.0,
516 0.0,
517 0
517 0
518 ],
518 ],
519 "targetline": 2
519 "targetline": 2
520 },
520 },
521 {
521 {
522 "abspath": "foo",
522 "abspath": "foo",
523 "author": "test",
523 "author": "test",
524 "desc": "commit 6 (add another blank line between line 0 and 1)",
524 "desc": "commit 6 (add another blank line between line 0 and 1)",
525 "line": "\n",
525 "line": "\n",
526 "lineno": 3,
526 "lineno": 3,
527 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
527 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
528 "revdate": [
528 "revdate": [
529 0.0,
529 0.0,
530 0
530 0
531 ],
531 ],
532 "targetline": 3
532 "targetline": 3
533 },
533 },
534 {
534 {
535 "abspath": "foo",
535 "abspath": "foo",
536 "author": "test",
536 "author": "test",
537 "desc": "commit 1",
537 "desc": "commit 1",
538 "line": "line 1 modified by 1\n",
538 "line": "line 1 modified by 1\n",
539 "lineno": 4,
539 "lineno": 4,
540 "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a",
540 "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a",
541 "revdate": [
541 "revdate": [
542 0.0,
542 0.0,
543 0
543 0
544 ],
544 ],
545 "targetline": 2
545 "targetline": 2
546 },
546 },
547 {
547 {
548 "abspath": "foo",
548 "abspath": "foo",
549 "author": "test",
549 "author": "test",
550 "desc": "commit 2 (leading whitespace on line 2)",
550 "desc": "commit 2 (leading whitespace on line 2)",
551 "line": " line 2\n",
551 "line": " line 2\n",
552 "lineno": 5,
552 "lineno": 5,
553 "node": "6bdb694e7b8cebb68d5b6b27b4bcc2a49d62c602",
553 "node": "6bdb694e7b8cebb68d5b6b27b4bcc2a49d62c602",
554 "revdate": [
554 "revdate": [
555 0.0,
555 0.0,
556 0
556 0
557 ],
557 ],
558 "targetline": 3
558 "targetline": 3
559 },
559 },
560 {
560 {
561 "abspath": "foo",
561 "abspath": "foo",
562 "author": "test",
562 "author": "test",
563 "desc": "commit 0",
563 "desc": "commit 0",
564 "line": "line 3 \n",
564 "line": "line 3 \n",
565 "lineno": 6,
565 "lineno": 6,
566 "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc",
566 "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc",
567 "revdate": [
567 "revdate": [
568 0.0,
568 0.0,
569 0
569 0
570 ],
570 ],
571 "targetline": 4
571 "targetline": 4
572 }
572 }
573 ],
573 ],
574 "author": "test",
574 "author": "test",
575 "children": [],
575 "children": [],
576 "date": [
576 "date": [
577 0.0,
577 0.0,
578 0
578 0
579 ],
579 ],
580 "desc": "commit 6 (add another blank line between line 0 and 1)",
580 "desc": "commit 6 (add another blank line between line 0 and 1)",
581 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
581 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
582 "parents": [
582 "parents": [
583 "400ef1d404706cfb48afd2b78ce6addf641ced25"
583 "400ef1d404706cfb48afd2b78ce6addf641ced25"
584 ],
584 ],
585 "permissions": ""
585 "permissions": ""
586 }
586 }
587
587
588 ignorewseol=1 query string enables whitespace end of line skipping
588 ignorewseol=1 query string enables whitespace end of line skipping
589
589
590 $ get-with-headers.py --json $LOCALIP:$HGPORT 'json-annotate/9d1b2c7db017/foo?ignorewseol=1'
590 $ get-with-headers.py --json $LOCALIP:$HGPORT 'json-annotate/9d1b2c7db017/foo?ignorewseol=1'
591 200 Script output follows
591 200 Script output follows
592
592
593 {
593 {
594 "abspath": "foo",
594 "abspath": "foo",
595 "annotate": [
595 "annotate": [
596 {
596 {
597 "abspath": "foo",
597 "abspath": "foo",
598 "author": "test",
598 "author": "test",
599 "desc": "commit 4 (intra whitespace on line 0)",
599 "desc": "commit 4 (intra whitespace on line 0)",
600 "line": "line 0\n",
600 "line": "line 0\n",
601 "lineno": 1,
601 "lineno": 1,
602 "node": "08adbe269f24cf22d975eadeec16790c5b22f558",
602 "node": "08adbe269f24cf22d975eadeec16790c5b22f558",
603 "revdate": [
603 "revdate": [
604 0.0,
604 0.0,
605 0
605 0
606 ],
606 ],
607 "targetline": 1
607 "targetline": 1
608 },
608 },
609 {
609 {
610 "abspath": "foo",
610 "abspath": "foo",
611 "author": "test",
611 "author": "test",
612 "desc": "commit 5 (add blank line between line 0 and 1)",
612 "desc": "commit 5 (add blank line between line 0 and 1)",
613 "line": "\n",
613 "line": "\n",
614 "lineno": 2,
614 "lineno": 2,
615 "node": "400ef1d404706cfb48afd2b78ce6addf641ced25",
615 "node": "400ef1d404706cfb48afd2b78ce6addf641ced25",
616 "revdate": [
616 "revdate": [
617 0.0,
617 0.0,
618 0
618 0
619 ],
619 ],
620 "targetline": 2
620 "targetline": 2
621 },
621 },
622 {
622 {
623 "abspath": "foo",
623 "abspath": "foo",
624 "author": "test",
624 "author": "test",
625 "desc": "commit 6 (add another blank line between line 0 and 1)",
625 "desc": "commit 6 (add another blank line between line 0 and 1)",
626 "line": "\n",
626 "line": "\n",
627 "lineno": 3,
627 "lineno": 3,
628 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
628 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
629 "revdate": [
629 "revdate": [
630 0.0,
630 0.0,
631 0
631 0
632 ],
632 ],
633 "targetline": 3
633 "targetline": 3
634 },
634 },
635 {
635 {
636 "abspath": "foo",
636 "abspath": "foo",
637 "author": "test",
637 "author": "test",
638 "desc": "commit 1",
638 "desc": "commit 1",
639 "line": "line 1 modified by 1\n",
639 "line": "line 1 modified by 1\n",
640 "lineno": 4,
640 "lineno": 4,
641 "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a",
641 "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a",
642 "revdate": [
642 "revdate": [
643 0.0,
643 0.0,
644 0
644 0
645 ],
645 ],
646 "targetline": 2
646 "targetline": 2
647 },
647 },
648 {
648 {
649 "abspath": "foo",
649 "abspath": "foo",
650 "author": "test",
650 "author": "test",
651 "desc": "commit 2 (leading whitespace on line 2)",
651 "desc": "commit 2 (leading whitespace on line 2)",
652 "line": " line 2\n",
652 "line": " line 2\n",
653 "lineno": 5,
653 "lineno": 5,
654 "node": "6bdb694e7b8cebb68d5b6b27b4bcc2a49d62c602",
654 "node": "6bdb694e7b8cebb68d5b6b27b4bcc2a49d62c602",
655 "revdate": [
655 "revdate": [
656 0.0,
656 0.0,
657 0
657 0
658 ],
658 ],
659 "targetline": 3
659 "targetline": 3
660 },
660 },
661 {
661 {
662 "abspath": "foo",
662 "abspath": "foo",
663 "author": "test",
663 "author": "test",
664 "desc": "commit 0",
664 "desc": "commit 0",
665 "line": "line 3 \n",
665 "line": "line 3 \n",
666 "lineno": 6,
666 "lineno": 6,
667 "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc",
667 "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc",
668 "revdate": [
668 "revdate": [
669 0.0,
669 0.0,
670 0
670 0
671 ],
671 ],
672 "targetline": 4
672 "targetline": 4
673 }
673 }
674 ],
674 ],
675 "author": "test",
675 "author": "test",
676 "children": [],
676 "children": [],
677 "date": [
677 "date": [
678 0.0,
678 0.0,
679 0
679 0
680 ],
680 ],
681 "desc": "commit 6 (add another blank line between line 0 and 1)",
681 "desc": "commit 6 (add another blank line between line 0 and 1)",
682 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
682 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
683 "parents": [
683 "parents": [
684 "400ef1d404706cfb48afd2b78ce6addf641ced25"
684 "400ef1d404706cfb48afd2b78ce6addf641ced25"
685 ],
685 ],
686 "permissions": ""
686 "permissions": ""
687 }
687 }
688
688
689 ignoreblanklines=1 query string enables whitespace blank line skipping
689 ignoreblanklines=1 query string enables whitespace blank line skipping
690
690
691 $ get-with-headers.py --json $LOCALIP:$HGPORT 'json-annotate/9d1b2c7db017/foo?ignoreblanklines=1'
691 $ get-with-headers.py --json $LOCALIP:$HGPORT 'json-annotate/9d1b2c7db017/foo?ignoreblanklines=1'
692 200 Script output follows
692 200 Script output follows
693
693
694 {
694 {
695 "abspath": "foo",
695 "abspath": "foo",
696 "annotate": [
696 "annotate": [
697 {
697 {
698 "abspath": "foo",
698 "abspath": "foo",
699 "author": "test",
699 "author": "test",
700 "desc": "commit 4 (intra whitespace on line 0)",
700 "desc": "commit 4 (intra whitespace on line 0)",
701 "line": "line 0\n",
701 "line": "line 0\n",
702 "lineno": 1,
702 "lineno": 1,
703 "node": "08adbe269f24cf22d975eadeec16790c5b22f558",
703 "node": "08adbe269f24cf22d975eadeec16790c5b22f558",
704 "revdate": [
704 "revdate": [
705 0.0,
705 0.0,
706 0
706 0
707 ],
707 ],
708 "targetline": 1
708 "targetline": 1
709 },
709 },
710 {
710 {
711 "abspath": "foo",
711 "abspath": "foo",
712 "author": "test",
712 "author": "test",
713 "desc": "commit 5 (add blank line between line 0 and 1)",
713 "desc": "commit 5 (add blank line between line 0 and 1)",
714 "line": "\n",
714 "line": "\n",
715 "lineno": 2,
715 "lineno": 2,
716 "node": "400ef1d404706cfb48afd2b78ce6addf641ced25",
716 "node": "400ef1d404706cfb48afd2b78ce6addf641ced25",
717 "revdate": [
717 "revdate": [
718 0.0,
718 0.0,
719 0
719 0
720 ],
720 ],
721 "targetline": 2
721 "targetline": 2
722 },
722 },
723 {
723 {
724 "abspath": "foo",
724 "abspath": "foo",
725 "author": "test",
725 "author": "test",
726 "desc": "commit 6 (add another blank line between line 0 and 1)",
726 "desc": "commit 6 (add another blank line between line 0 and 1)",
727 "line": "\n",
727 "line": "\n",
728 "lineno": 3,
728 "lineno": 3,
729 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
729 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
730 "revdate": [
730 "revdate": [
731 0.0,
731 0.0,
732 0
732 0
733 ],
733 ],
734 "targetline": 3
734 "targetline": 3
735 },
735 },
736 {
736 {
737 "abspath": "foo",
737 "abspath": "foo",
738 "author": "test",
738 "author": "test",
739 "desc": "commit 1",
739 "desc": "commit 1",
740 "line": "line 1 modified by 1\n",
740 "line": "line 1 modified by 1\n",
741 "lineno": 4,
741 "lineno": 4,
742 "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a",
742 "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a",
743 "revdate": [
743 "revdate": [
744 0.0,
744 0.0,
745 0
745 0
746 ],
746 ],
747 "targetline": 2
747 "targetline": 2
748 },
748 },
749 {
749 {
750 "abspath": "foo",
750 "abspath": "foo",
751 "author": "test",
751 "author": "test",
752 "desc": "commit 2 (leading whitespace on line 2)",
752 "desc": "commit 2 (leading whitespace on line 2)",
753 "line": " line 2\n",
753 "line": " line 2\n",
754 "lineno": 5,
754 "lineno": 5,
755 "node": "6bdb694e7b8cebb68d5b6b27b4bcc2a49d62c602",
755 "node": "6bdb694e7b8cebb68d5b6b27b4bcc2a49d62c602",
756 "revdate": [
756 "revdate": [
757 0.0,
757 0.0,
758 0
758 0
759 ],
759 ],
760 "targetline": 3
760 "targetline": 3
761 },
761 },
762 {
762 {
763 "abspath": "foo",
763 "abspath": "foo",
764 "author": "test",
764 "author": "test",
765 "desc": "commit 3 (trailing whitespace on line 3)",
765 "desc": "commit 3 (trailing whitespace on line 3)",
766 "line": "line 3 \n",
766 "line": "line 3 \n",
767 "lineno": 6,
767 "lineno": 6,
768 "node": "dcb62cfbfc9b3ab995a5cbbaff6e1971c3e4f865",
768 "node": "dcb62cfbfc9b3ab995a5cbbaff6e1971c3e4f865",
769 "revdate": [
769 "revdate": [
770 0.0,
770 0.0,
771 0
771 0
772 ],
772 ],
773 "targetline": 4
773 "targetline": 4
774 }
774 }
775 ],
775 ],
776 "author": "test",
776 "author": "test",
777 "children": [],
777 "children": [],
778 "date": [
778 "date": [
779 0.0,
779 0.0,
780 0
780 0
781 ],
781 ],
782 "desc": "commit 6 (add another blank line between line 0 and 1)",
782 "desc": "commit 6 (add another blank line between line 0 and 1)",
783 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
783 "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5",
784 "parents": [
784 "parents": [
785 "400ef1d404706cfb48afd2b78ce6addf641ced25"
785 "400ef1d404706cfb48afd2b78ce6addf641ced25"
786 ],
786 ],
787 "permissions": ""
787 "permissions": ""
788 }
788 }
General Comments 0
You need to be logged in to leave comments. Login now