Mercurial > hg
comparison tests/test-hgweb-json.t @ 28709:94494031f659
hgweb: add parents to json-log (issue5074)
Entries prepared in webutil.changelistentry() skip showing parents in the
trivial case when there's only one parent and it's the previous revision. This
doesn't work well for the json-log template, which is supposed to just dump raw
data in an easy-to-parse format, so let's provide all parents as another
keyword: allparents.
Using a lambda function here means that the performance of templates that don't
use allparents won't be affected (see 41957e50e109).
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Thu, 31 Mar 2016 18:09:09 +0800 |
parents | 562a073a2a1b |
children | 06ae7a6daad0 |
comparison
equal
deleted
inserted
replaced
28708:ab06b5ef93f7 | 28709:94494031f659 |
---|---|
173 0.0, | 173 0.0, |
174 0 | 174 0 |
175 ], | 175 ], |
176 "desc": "merge test-branch into default", | 176 "desc": "merge test-branch into default", |
177 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7", | 177 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7", |
178 "parents": [ | |
179 "ceed296fe500c3fac9541e31dad860cb49c89e45", | |
180 "ed66c30e87eb65337c05a4229efaa5f1d5285a90" | |
181 ], | |
178 "tags": [ | 182 "tags": [ |
179 "tip" | 183 "tip" |
180 ], | 184 ], |
181 "user": "test" | 185 "user": "test" |
182 }, | 186 }, |
186 0.0, | 190 0.0, |
187 0 | 191 0 |
188 ], | 192 ], |
189 "desc": "another commit in test-branch", | 193 "desc": "another commit in test-branch", |
190 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90", | 194 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90", |
195 "parents": [ | |
196 "6ab967a8ab3489227a83f80e920faa039a71819f" | |
197 ], | |
191 "tags": [], | 198 "tags": [], |
192 "user": "test" | 199 "user": "test" |
193 }, | 200 }, |
194 { | 201 { |
195 "bookmarks": [], | 202 "bookmarks": [], |
197 0.0, | 204 0.0, |
198 0 | 205 0 |
199 ], | 206 ], |
200 "desc": "create test branch", | 207 "desc": "create test branch", |
201 "node": "6ab967a8ab3489227a83f80e920faa039a71819f", | 208 "node": "6ab967a8ab3489227a83f80e920faa039a71819f", |
209 "parents": [ | |
210 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e" | |
211 ], | |
202 "tags": [], | 212 "tags": [], |
203 "user": "test" | 213 "user": "test" |
204 }, | 214 }, |
205 { | 215 { |
206 "bookmarks": [ | 216 "bookmarks": [ |
210 0.0, | 220 0.0, |
211 0 | 221 0 |
212 ], | 222 ], |
213 "desc": "create tag2", | 223 "desc": "create tag2", |
214 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45", | 224 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45", |
225 "parents": [ | |
226 "f2890a05fea49bfaf9fb27ed5490894eba32da78" | |
227 ], | |
215 "tags": [], | 228 "tags": [], |
216 "user": "test" | 229 "user": "test" |
217 }, | 230 }, |
218 { | 231 { |
219 "bookmarks": [], | 232 "bookmarks": [], |
221 0.0, | 234 0.0, |
222 0 | 235 0 |
223 ], | 236 ], |
224 "desc": "another commit to da/foo", | 237 "desc": "another commit to da/foo", |
225 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78", | 238 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78", |
239 "parents": [ | |
240 "93a8ce14f89156426b7fa981af8042da53f03aa0" | |
241 ], | |
226 "tags": [ | 242 "tags": [ |
227 "tag2" | 243 "tag2" |
228 ], | 244 ], |
229 "user": "test" | 245 "user": "test" |
230 }, | 246 }, |
234 0.0, | 250 0.0, |
235 0 | 251 0 |
236 ], | 252 ], |
237 "desc": "create tag", | 253 "desc": "create tag", |
238 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0", | 254 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0", |
255 "parents": [ | |
256 "78896eb0e102174ce9278438a95e12543e4367a7" | |
257 ], | |
239 "tags": [], | 258 "tags": [], |
240 "user": "test" | 259 "user": "test" |
241 }, | 260 }, |
242 { | 261 { |
243 "bookmarks": [], | 262 "bookmarks": [], |
245 0.0, | 264 0.0, |
246 0 | 265 0 |
247 ], | 266 ], |
248 "desc": "move foo", | 267 "desc": "move foo", |
249 "node": "78896eb0e102174ce9278438a95e12543e4367a7", | 268 "node": "78896eb0e102174ce9278438a95e12543e4367a7", |
269 "parents": [ | |
270 "8d7c456572acf3557e8ed8a07286b10c408bcec5" | |
271 ], | |
250 "tags": [ | 272 "tags": [ |
251 "tag1" | 273 "tag1" |
252 ], | 274 ], |
253 "user": "test" | 275 "user": "test" |
254 }, | 276 }, |
260 0.0, | 282 0.0, |
261 0 | 283 0 |
262 ], | 284 ], |
263 "desc": "modify da/foo", | 285 "desc": "modify da/foo", |
264 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5", | 286 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5", |
287 "parents": [ | |
288 "f8bbb9024b10f93cdbb8d940337398291d40dea8" | |
289 ], | |
265 "tags": [], | 290 "tags": [], |
266 "user": "test" | 291 "user": "test" |
267 }, | 292 }, |
268 { | 293 { |
269 "bookmarks": [], | 294 "bookmarks": [], |
271 0.0, | 296 0.0, |
272 0 | 297 0 |
273 ], | 298 ], |
274 "desc": "modify foo", | 299 "desc": "modify foo", |
275 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8", | 300 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8", |
301 "parents": [ | |
302 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e" | |
303 ], | |
276 "tags": [], | 304 "tags": [], |
277 "user": "test" | 305 "user": "test" |
278 }, | 306 }, |
279 { | 307 { |
280 "bookmarks": [], | 308 "bookmarks": [], |
282 0.0, | 310 0.0, |
283 0 | 311 0 |
284 ], | 312 ], |
285 "desc": "initial", | 313 "desc": "initial", |
286 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e", | 314 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e", |
315 "parents": [], | |
287 "tags": [], | 316 "tags": [], |
288 "user": "test" | 317 "user": "test" |
289 } | 318 } |
290 ], | 319 ], |
291 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7" | 320 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7" |
305 0.0, | 334 0.0, |
306 0 | 335 0 |
307 ], | 336 ], |
308 "desc": "modify foo", | 337 "desc": "modify foo", |
309 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8", | 338 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8", |
339 "parents": [ | |
340 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e" | |
341 ], | |
310 "tags": [], | 342 "tags": [], |
311 "user": "test" | 343 "user": "test" |
312 }, | 344 }, |
313 { | 345 { |
314 "bookmarks": [], | 346 "bookmarks": [], |
316 0.0, | 348 0.0, |
317 0 | 349 0 |
318 ], | 350 ], |
319 "desc": "initial", | 351 "desc": "initial", |
320 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e", | 352 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e", |
353 "parents": [], | |
321 "tags": [], | 354 "tags": [], |
322 "user": "test" | 355 "user": "test" |
323 } | 356 } |
324 ], | 357 ], |
325 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8" | 358 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8" |
339 0.0, | 372 0.0, |
340 0 | 373 0 |
341 ], | 374 ], |
342 "desc": "merge test-branch into default", | 375 "desc": "merge test-branch into default", |
343 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7", | 376 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7", |
377 "parents": [ | |
378 "ceed296fe500c3fac9541e31dad860cb49c89e45", | |
379 "ed66c30e87eb65337c05a4229efaa5f1d5285a90" | |
380 ], | |
344 "tags": [ | 381 "tags": [ |
345 "tip" | 382 "tip" |
346 ], | 383 ], |
347 "user": "test" | 384 "user": "test" |
348 }, | 385 }, |
352 0.0, | 389 0.0, |
353 0 | 390 0 |
354 ], | 391 ], |
355 "desc": "another commit in test-branch", | 392 "desc": "another commit in test-branch", |
356 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90", | 393 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90", |
394 "parents": [ | |
395 "6ab967a8ab3489227a83f80e920faa039a71819f" | |
396 ], | |
357 "tags": [], | 397 "tags": [], |
358 "user": "test" | 398 "user": "test" |
359 }, | 399 }, |
360 { | 400 { |
361 "bookmarks": [], | 401 "bookmarks": [], |
363 0.0, | 403 0.0, |
364 0 | 404 0 |
365 ], | 405 ], |
366 "desc": "create test branch", | 406 "desc": "create test branch", |
367 "node": "6ab967a8ab3489227a83f80e920faa039a71819f", | 407 "node": "6ab967a8ab3489227a83f80e920faa039a71819f", |
408 "parents": [ | |
409 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e" | |
410 ], | |
368 "tags": [], | 411 "tags": [], |
369 "user": "test" | 412 "user": "test" |
370 }, | 413 }, |
371 { | 414 { |
372 "bookmarks": [ | 415 "bookmarks": [ |
376 0.0, | 419 0.0, |
377 0 | 420 0 |
378 ], | 421 ], |
379 "desc": "create tag2", | 422 "desc": "create tag2", |
380 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45", | 423 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45", |
424 "parents": [ | |
425 "f2890a05fea49bfaf9fb27ed5490894eba32da78" | |
426 ], | |
381 "tags": [], | 427 "tags": [], |
382 "user": "test" | 428 "user": "test" |
383 }, | 429 }, |
384 { | 430 { |
385 "bookmarks": [], | 431 "bookmarks": [], |
387 0.0, | 433 0.0, |
388 0 | 434 0 |
389 ], | 435 ], |
390 "desc": "another commit to da/foo", | 436 "desc": "another commit to da/foo", |
391 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78", | 437 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78", |
438 "parents": [ | |
439 "93a8ce14f89156426b7fa981af8042da53f03aa0" | |
440 ], | |
392 "tags": [ | 441 "tags": [ |
393 "tag2" | 442 "tag2" |
394 ], | 443 ], |
395 "user": "test" | 444 "user": "test" |
396 }, | 445 }, |
400 0.0, | 449 0.0, |
401 0 | 450 0 |
402 ], | 451 ], |
403 "desc": "create tag", | 452 "desc": "create tag", |
404 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0", | 453 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0", |
454 "parents": [ | |
455 "78896eb0e102174ce9278438a95e12543e4367a7" | |
456 ], | |
405 "tags": [], | 457 "tags": [], |
406 "user": "test" | 458 "user": "test" |
407 }, | 459 }, |
408 { | 460 { |
409 "bookmarks": [], | 461 "bookmarks": [], |
411 0.0, | 463 0.0, |
412 0 | 464 0 |
413 ], | 465 ], |
414 "desc": "move foo", | 466 "desc": "move foo", |
415 "node": "78896eb0e102174ce9278438a95e12543e4367a7", | 467 "node": "78896eb0e102174ce9278438a95e12543e4367a7", |
468 "parents": [ | |
469 "8d7c456572acf3557e8ed8a07286b10c408bcec5" | |
470 ], | |
416 "tags": [ | 471 "tags": [ |
417 "tag1" | 472 "tag1" |
418 ], | 473 ], |
419 "user": "test" | 474 "user": "test" |
420 }, | 475 }, |
426 0.0, | 481 0.0, |
427 0 | 482 0 |
428 ], | 483 ], |
429 "desc": "modify da/foo", | 484 "desc": "modify da/foo", |
430 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5", | 485 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5", |
486 "parents": [ | |
487 "f8bbb9024b10f93cdbb8d940337398291d40dea8" | |
488 ], | |
431 "tags": [], | 489 "tags": [], |
432 "user": "test" | 490 "user": "test" |
433 }, | 491 }, |
434 { | 492 { |
435 "bookmarks": [], | 493 "bookmarks": [], |
437 0.0, | 495 0.0, |
438 0 | 496 0 |
439 ], | 497 ], |
440 "desc": "modify foo", | 498 "desc": "modify foo", |
441 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8", | 499 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8", |
500 "parents": [ | |
501 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e" | |
502 ], | |
442 "tags": [], | 503 "tags": [], |
443 "user": "test" | 504 "user": "test" |
444 }, | 505 }, |
445 { | 506 { |
446 "bookmarks": [], | 507 "bookmarks": [], |
448 0.0, | 509 0.0, |
449 0 | 510 0 |
450 ], | 511 ], |
451 "desc": "initial", | 512 "desc": "initial", |
452 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e", | 513 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e", |
514 "parents": [], | |
453 "tags": [], | 515 "tags": [], |
454 "user": "test" | 516 "user": "test" |
455 } | 517 } |
456 ], | 518 ], |
457 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7" | 519 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7" |