Mercurial > hg
comparison tests/test-hgweb-json.t @ 24588:0bf54479a9eb
json: implement {shortlog} and {changelog} templates
These are the same dispatch function under the hood. The only difference
is the default number of entries to render and the template to use. So
it makes sense to use a shared template.
Format for {changelistentry} is similar to {changeset}. However, there
are differences to argument names and their values preventing us from
(easily) using the same template. (Perhaps there is room to consolidate
the templates as a follow-up.)
We're currently not recording some data in {changelistentry} that exists
in {changeset}. This includes the branch name. This should be added in
a follow-up. For now, something is better than nothing.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 31 Mar 2015 22:53:48 -0700 |
parents | 5ec4bda3097a |
children | 30a737ae9b7d |
comparison
equal
deleted
inserted
replaced
24587:76c0b4cfa039 | 24588:0bf54479a9eb |
---|---|
127 changelog/ shows information about several changesets | 127 changelog/ shows information about several changesets |
128 | 128 |
129 $ request json-changelog | 129 $ request json-changelog |
130 200 Script output follows | 130 200 Script output follows |
131 | 131 |
132 "not yet implemented" | 132 { |
133 | 133 "changeset_count": 10, |
134 changelog/{revision} shows information about a single changeset | 134 "changesets": [ |
135 | 135 { |
136 $ request json-changelog/06e557f3edf6 | 136 "bookmarks": [], |
137 200 Script output follows | 137 "date": [ |
138 | 138 0.0, |
139 "not yet implemented" | 139 0 |
140 ], | |
141 "desc": "merge test-branch into default", | |
142 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7", | |
143 "tags": [ | |
144 "tip" | |
145 ], | |
146 "user": "test" | |
147 }, | |
148 { | |
149 "bookmarks": [], | |
150 "date": [ | |
151 0.0, | |
152 0 | |
153 ], | |
154 "desc": "another commit in test-branch", | |
155 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90", | |
156 "tags": [], | |
157 "user": "test" | |
158 }, | |
159 { | |
160 "bookmarks": [], | |
161 "date": [ | |
162 0.0, | |
163 0 | |
164 ], | |
165 "desc": "create test branch", | |
166 "node": "6ab967a8ab3489227a83f80e920faa039a71819f", | |
167 "tags": [], | |
168 "user": "test" | |
169 }, | |
170 { | |
171 "bookmarks": [ | |
172 "bookmark2" | |
173 ], | |
174 "date": [ | |
175 0.0, | |
176 0 | |
177 ], | |
178 "desc": "create tag2", | |
179 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45", | |
180 "tags": [], | |
181 "user": "test" | |
182 }, | |
183 { | |
184 "bookmarks": [], | |
185 "date": [ | |
186 0.0, | |
187 0 | |
188 ], | |
189 "desc": "another commit to da/foo", | |
190 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78", | |
191 "tags": [ | |
192 "tag2" | |
193 ], | |
194 "user": "test" | |
195 }, | |
196 { | |
197 "bookmarks": [], | |
198 "date": [ | |
199 0.0, | |
200 0 | |
201 ], | |
202 "desc": "create tag", | |
203 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0", | |
204 "tags": [], | |
205 "user": "test" | |
206 }, | |
207 { | |
208 "bookmarks": [], | |
209 "date": [ | |
210 0.0, | |
211 0 | |
212 ], | |
213 "desc": "move foo", | |
214 "node": "78896eb0e102174ce9278438a95e12543e4367a7", | |
215 "tags": [ | |
216 "tag1" | |
217 ], | |
218 "user": "test" | |
219 }, | |
220 { | |
221 "bookmarks": [ | |
222 "bookmark1" | |
223 ], | |
224 "date": [ | |
225 0.0, | |
226 0 | |
227 ], | |
228 "desc": "modify da/foo", | |
229 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5", | |
230 "tags": [], | |
231 "user": "test" | |
232 }, | |
233 { | |
234 "bookmarks": [], | |
235 "date": [ | |
236 0.0, | |
237 0 | |
238 ], | |
239 "desc": "modify foo", | |
240 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8", | |
241 "tags": [], | |
242 "user": "test" | |
243 }, | |
244 { | |
245 "bookmarks": [], | |
246 "date": [ | |
247 0.0, | |
248 0 | |
249 ], | |
250 "desc": "initial", | |
251 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e", | |
252 "tags": [], | |
253 "user": "test" | |
254 } | |
255 ], | |
256 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7" | |
257 } | |
258 | |
259 changelog/{revision} shows information starting at a specific changeset | |
260 | |
261 $ request json-changelog/f8bbb9024b10 | |
262 200 Script output follows | |
263 | |
264 { | |
265 "changeset_count": 10, | |
266 "changesets": [ | |
267 { | |
268 "bookmarks": [], | |
269 "date": [ | |
270 0.0, | |
271 0 | |
272 ], | |
273 "desc": "modify foo", | |
274 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8", | |
275 "tags": [], | |
276 "user": "test" | |
277 }, | |
278 { | |
279 "bookmarks": [], | |
280 "date": [ | |
281 0.0, | |
282 0 | |
283 ], | |
284 "desc": "initial", | |
285 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e", | |
286 "tags": [], | |
287 "user": "test" | |
288 } | |
289 ], | |
290 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8" | |
291 } | |
140 | 292 |
141 shortlog/ shows information about a set of changesets | 293 shortlog/ shows information about a set of changesets |
142 | 294 |
143 $ request json-shortlog | 295 $ request json-shortlog |
144 200 Script output follows | 296 200 Script output follows |
145 | 297 |
146 "not yet implemented" | 298 { |
299 "changeset_count": 10, | |
300 "changesets": [ | |
301 { | |
302 "bookmarks": [], | |
303 "date": [ | |
304 0.0, | |
305 0 | |
306 ], | |
307 "desc": "merge test-branch into default", | |
308 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7", | |
309 "tags": [ | |
310 "tip" | |
311 ], | |
312 "user": "test" | |
313 }, | |
314 { | |
315 "bookmarks": [], | |
316 "date": [ | |
317 0.0, | |
318 0 | |
319 ], | |
320 "desc": "another commit in test-branch", | |
321 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90", | |
322 "tags": [], | |
323 "user": "test" | |
324 }, | |
325 { | |
326 "bookmarks": [], | |
327 "date": [ | |
328 0.0, | |
329 0 | |
330 ], | |
331 "desc": "create test branch", | |
332 "node": "6ab967a8ab3489227a83f80e920faa039a71819f", | |
333 "tags": [], | |
334 "user": "test" | |
335 }, | |
336 { | |
337 "bookmarks": [ | |
338 "bookmark2" | |
339 ], | |
340 "date": [ | |
341 0.0, | |
342 0 | |
343 ], | |
344 "desc": "create tag2", | |
345 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45", | |
346 "tags": [], | |
347 "user": "test" | |
348 }, | |
349 { | |
350 "bookmarks": [], | |
351 "date": [ | |
352 0.0, | |
353 0 | |
354 ], | |
355 "desc": "another commit to da/foo", | |
356 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78", | |
357 "tags": [ | |
358 "tag2" | |
359 ], | |
360 "user": "test" | |
361 }, | |
362 { | |
363 "bookmarks": [], | |
364 "date": [ | |
365 0.0, | |
366 0 | |
367 ], | |
368 "desc": "create tag", | |
369 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0", | |
370 "tags": [], | |
371 "user": "test" | |
372 }, | |
373 { | |
374 "bookmarks": [], | |
375 "date": [ | |
376 0.0, | |
377 0 | |
378 ], | |
379 "desc": "move foo", | |
380 "node": "78896eb0e102174ce9278438a95e12543e4367a7", | |
381 "tags": [ | |
382 "tag1" | |
383 ], | |
384 "user": "test" | |
385 }, | |
386 { | |
387 "bookmarks": [ | |
388 "bookmark1" | |
389 ], | |
390 "date": [ | |
391 0.0, | |
392 0 | |
393 ], | |
394 "desc": "modify da/foo", | |
395 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5", | |
396 "tags": [], | |
397 "user": "test" | |
398 }, | |
399 { | |
400 "bookmarks": [], | |
401 "date": [ | |
402 0.0, | |
403 0 | |
404 ], | |
405 "desc": "modify foo", | |
406 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8", | |
407 "tags": [], | |
408 "user": "test" | |
409 }, | |
410 { | |
411 "bookmarks": [], | |
412 "date": [ | |
413 0.0, | |
414 0 | |
415 ], | |
416 "desc": "initial", | |
417 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e", | |
418 "tags": [], | |
419 "user": "test" | |
420 } | |
421 ], | |
422 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7" | |
423 } | |
147 | 424 |
148 changeset/ renders the tip changeset | 425 changeset/ renders the tip changeset |
149 | 426 |
150 $ request json-rev | 427 $ request json-rev |
151 200 Script output follows | 428 200 Script output follows |