Debian Codegraph @

tests/test-hgweb-json.t

raw
1 #require serve
2
3 $ request() {
4 > get-with-headers.py --json localhost:$HGPORT "$1"
5 > }
6
7 $ hg init test
8 $ cd test
9 $ mkdir da
10 $ echo foo > da/foo
11 $ echo foo > foo
12 $ hg -q ci -A -m initial
13 $ echo bar > foo
14 $ hg ci -m 'modify foo'
15 $ echo bar > da/foo
16 $ hg ci -m 'modify da/foo'
17 $ hg bookmark bookmark1
18 $ hg up default
19 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
20 (leaving bookmark bookmark1)
21 $ hg mv foo foo-new
22 $ hg commit -m 'move foo'
23 $ hg tag -m 'create tag' tag1
24 $ hg phase --public -r .
25 $ echo baz > da/foo
26 $ hg commit -m 'another commit to da/foo'
27 $ hg tag -m 'create tag2' tag2
28 $ hg bookmark bookmark2
29 $ hg -q up -r 0
30 $ hg -q branch test-branch
31 $ echo branch > foo
32 $ hg commit -m 'create test branch'
33 $ echo branch_commit_2 > foo
34 $ hg commit -m 'another commit in test-branch'
35 $ hg -q up default
36 $ hg merge --tool :local test-branch
37 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
38 (branch merge, don't forget to commit)
39 $ hg commit -m 'merge test-branch into default'
40
41 $ hg log -G
42 @ changeset: 9:cc725e08502a
43 |\ tag: tip
44 | | parent: 6:ceed296fe500
45 | | parent: 8:ed66c30e87eb
46 | | user: test
47 | | date: Thu Jan 01 00:00:00 1970 +0000
48 | | summary: merge test-branch into default
49 | |
50 | o changeset: 8:ed66c30e87eb
51 | | branch: test-branch
52 | | user: test
53 | | date: Thu Jan 01 00:00:00 1970 +0000
54 | | summary: another commit in test-branch
55 | |
56 | o changeset: 7:6ab967a8ab34
57 | | branch: test-branch
58 | | parent: 0:06e557f3edf6
59 | | user: test
60 | | date: Thu Jan 01 00:00:00 1970 +0000
61 | | summary: create test branch
62 | |
63 o | changeset: 6:ceed296fe500
64 | | bookmark: bookmark2
65 | | user: test
66 | | date: Thu Jan 01 00:00:00 1970 +0000
67 | | summary: create tag2
68 | |
69 o | changeset: 5:f2890a05fea4
70 | | tag: tag2
71 | | user: test
72 | | date: Thu Jan 01 00:00:00 1970 +0000
73 | | summary: another commit to da/foo
74 | |
75 o | changeset: 4:93a8ce14f891
76 | | user: test
77 | | date: Thu Jan 01 00:00:00 1970 +0000
78 | | summary: create tag
79 | |
80 o | changeset: 3:78896eb0e102
81 | | tag: tag1
82 | | user: test
83 | | date: Thu Jan 01 00:00:00 1970 +0000
84 | | summary: move foo
85 | |
86 o | changeset: 2:8d7c456572ac
87 | | bookmark: bookmark1
88 | | user: test
89 | | date: Thu Jan 01 00:00:00 1970 +0000
90 | | summary: modify da/foo
91 | |
92 o | changeset: 1:f8bbb9024b10
93 |/ user: test
94 | date: Thu Jan 01 00:00:00 1970 +0000
95 | summary: modify foo
96 |
97 o changeset: 0:06e557f3edf6
98 user: test
99 date: Thu Jan 01 00:00:00 1970 +0000
100 summary: initial
101
102
103 $ echo '[web]' >> .hg/hgrc
104 $ echo 'allow-archive = bz2' >> .hg/hgrc
105 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log
106 $ cat hg.pid >> $DAEMON_PIDS
107
108 (Try to keep these in roughly the order they are defined in webcommands.py)
109
110 (log is handled by filelog/ and changelog/ - ignore it)
111
112 (rawfile/ doesn't use templating - nothing to test)
113
114 file/{revision}/{path} shows file revision
115
116 $ request json-file/78896eb0e102/foo-new
117 200 Script output follows
118
119 {
120 "bookmarks": [],
121 "branch": "default",
122 "date": [
123 0.0,
124 0
125 ],
126 "desc": "move foo",
127 "lines": [
128 {
129 "line": "bar\n"
130 }
131 ],
132 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
133 "parents": [
134 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
135 ],
136 "path": "foo-new",
137 "phase": "public",
138 "tags": [
139 "tag1"
140 ],
141 "user": "test"
142 }
143
144 file/{revision} shows root directory info
145
146 $ request json-file/cc725e08502a
147 200 Script output follows
148
149 {
150 "abspath": "/",
151 "bookmarks": [],
152 "directories": [
153 {
154 "abspath": "/da",
155 "basename": "da",
156 "emptydirs": ""
157 }
158 ],
159 "files": [
160 {
161 "abspath": ".hgtags",
162 "basename": ".hgtags",
163 "date": [
164 0.0,
165 0
166 ],
167 "flags": "",
168 "size": 92
169 },
170 {
171 "abspath": "foo-new",
172 "basename": "foo-new",
173 "date": [
174 0.0,
175 0
176 ],
177 "flags": "",
178 "size": 4
179 }
180 ],
181 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
182 "tags": [
183 "tip"
184 ]
185 }
186
187 changelog/ shows information about several changesets
188
189 $ request json-changelog
190 200 Script output follows
191
192 {
193 "changeset_count": 10,
194 "changesets": [
195 {
196 "bookmarks": [],
197 "branch": "default",
198 "date": [
199 0.0,
200 0
201 ],
202 "desc": "merge test-branch into default",
203 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
204 "parents": [
205 "ceed296fe500c3fac9541e31dad860cb49c89e45",
206 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
207 ],
208 "phase": "draft",
209 "tags": [
210 "tip"
211 ],
212 "user": "test"
213 },
214 {
215 "bookmarks": [],
216 "branch": "test-branch",
217 "date": [
218 0.0,
219 0
220 ],
221 "desc": "another commit in test-branch",
222 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
223 "parents": [
224 "6ab967a8ab3489227a83f80e920faa039a71819f"
225 ],
226 "phase": "draft",
227 "tags": [],
228 "user": "test"
229 },
230 {
231 "bookmarks": [],
232 "branch": "test-branch",
233 "date": [
234 0.0,
235 0
236 ],
237 "desc": "create test branch",
238 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
239 "parents": [
240 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
241 ],
242 "phase": "draft",
243 "tags": [],
244 "user": "test"
245 },
246 {
247 "bookmarks": [
248 "bookmark2"
249 ],
250 "branch": "default",
251 "date": [
252 0.0,
253 0
254 ],
255 "desc": "create tag2",
256 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
257 "parents": [
258 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
259 ],
260 "phase": "draft",
261 "tags": [],
262 "user": "test"
263 },
264 {
265 "bookmarks": [],
266 "branch": "default",
267 "date": [
268 0.0,
269 0
270 ],
271 "desc": "another commit to da/foo",
272 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
273 "parents": [
274 "93a8ce14f89156426b7fa981af8042da53f03aa0"
275 ],
276 "phase": "draft",
277 "tags": [
278 "tag2"
279 ],
280 "user": "test"
281 },
282 {
283 "bookmarks": [],
284 "branch": "default",
285 "date": [
286 0.0,
287 0
288 ],
289 "desc": "create tag",
290 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
291 "parents": [
292 "78896eb0e102174ce9278438a95e12543e4367a7"
293 ],
294 "phase": "public",
295 "tags": [],
296 "user": "test"
297 },
298 {
299 "bookmarks": [],
300 "branch": "default",
301 "date": [
302 0.0,
303 0
304 ],
305 "desc": "move foo",
306 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
307 "parents": [
308 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
309 ],
310 "phase": "public",
311 "tags": [
312 "tag1"
313 ],
314 "user": "test"
315 },
316 {
317 "bookmarks": [
318 "bookmark1"
319 ],
320 "branch": "default",
321 "date": [
322 0.0,
323 0
324 ],
325 "desc": "modify da/foo",
326 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
327 "parents": [
328 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
329 ],
330 "phase": "public",
331 "tags": [],
332 "user": "test"
333 },
334 {
335 "bookmarks": [],
336 "branch": "default",
337 "date": [
338 0.0,
339 0
340 ],
341 "desc": "modify foo",
342 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
343 "parents": [
344 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
345 ],
346 "phase": "public",
347 "tags": [],
348 "user": "test"
349 },
350 {
351 "bookmarks": [],
352 "branch": "default",
353 "date": [
354 0.0,
355 0
356 ],
357 "desc": "initial",
358 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
359 "parents": [],
360 "phase": "public",
361 "tags": [],
362 "user": "test"
363 }
364 ],
365 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
366 }
367
368 changelog/{revision} shows information starting at a specific changeset
369
370 $ request json-changelog/f8bbb9024b10
371 200 Script output follows
372
373 {
374 "changeset_count": 10,
375 "changesets": [
376 {
377 "bookmarks": [],
378 "branch": "default",
379 "date": [
380 0.0,
381 0
382 ],
383 "desc": "modify foo",
384 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
385 "parents": [
386 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
387 ],
388 "phase": "public",
389 "tags": [],
390 "user": "test"
391 },
392 {
393 "bookmarks": [],
394 "branch": "default",
395 "date": [
396 0.0,
397 0
398 ],
399 "desc": "initial",
400 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
401 "parents": [],
402 "phase": "public",
403 "tags": [],
404 "user": "test"
405 }
406 ],
407 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8"
408 }
409
410 shortlog/ shows information about a set of changesets
411
412 $ request json-shortlog
413 200 Script output follows
414
415 {
416 "changeset_count": 10,
417 "changesets": [
418 {
419 "bookmarks": [],
420 "branch": "default",
421 "date": [
422 0.0,
423 0
424 ],
425 "desc": "merge test-branch into default",
426 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
427 "parents": [
428 "ceed296fe500c3fac9541e31dad860cb49c89e45",
429 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
430 ],
431 "phase": "draft",
432 "tags": [
433 "tip"
434 ],
435 "user": "test"
436 },
437 {
438 "bookmarks": [],
439 "branch": "test-branch",
440 "date": [
441 0.0,
442 0
443 ],
444 "desc": "another commit in test-branch",
445 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
446 "parents": [
447 "6ab967a8ab3489227a83f80e920faa039a71819f"
448 ],
449 "phase": "draft",
450 "tags": [],
451 "user": "test"
452 },
453 {
454 "bookmarks": [],
455 "branch": "test-branch",
456 "date": [
457 0.0,
458 0
459 ],
460 "desc": "create test branch",
461 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
462 "parents": [
463 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
464 ],
465 "phase": "draft",
466 "tags": [],
467 "user": "test"
468 },
469 {
470 "bookmarks": [
471 "bookmark2"
472 ],
473 "branch": "default",
474 "date": [
475 0.0,
476 0
477 ],
478 "desc": "create tag2",
479 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
480 "parents": [
481 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
482 ],
483 "phase": "draft",
484 "tags": [],
485 "user": "test"
486 },
487 {
488 "bookmarks": [],
489 "branch": "default",
490 "date": [
491 0.0,
492 0
493 ],
494 "desc": "another commit to da/foo",
495 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
496 "parents": [
497 "93a8ce14f89156426b7fa981af8042da53f03aa0"
498 ],
499 "phase": "draft",
500 "tags": [
501 "tag2"
502 ],
503 "user": "test"
504 },
505 {
506 "bookmarks": [],
507 "branch": "default",
508 "date": [
509 0.0,
510 0
511 ],
512 "desc": "create tag",
513 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
514 "parents": [
515 "78896eb0e102174ce9278438a95e12543e4367a7"
516 ],
517 "phase": "public",
518 "tags": [],
519 "user": "test"
520 },
521 {
522 "bookmarks": [],
523 "branch": "default",
524 "date": [
525 0.0,
526 0
527 ],
528 "desc": "move foo",
529 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
530 "parents": [
531 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
532 ],
533 "phase": "public",
534 "tags": [
535 "tag1"
536 ],
537 "user": "test"
538 },
539 {
540 "bookmarks": [
541 "bookmark1"
542 ],
543 "branch": "default",
544 "date": [
545 0.0,
546 0
547 ],
548 "desc": "modify da/foo",
549 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
550 "parents": [
551 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
552 ],
553 "phase": "public",
554 "tags": [],
555 "user": "test"
556 },
557 {
558 "bookmarks": [],
559 "branch": "default",
560 "date": [
561 0.0,
562 0
563 ],
564 "desc": "modify foo",
565 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
566 "parents": [
567 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
568 ],
569 "phase": "public",
570 "tags": [],
571 "user": "test"
572 },
573 {
574 "bookmarks": [],
575 "branch": "default",
576 "date": [
577 0.0,
578 0
579 ],
580 "desc": "initial",
581 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
582 "parents": [],
583 "phase": "public",
584 "tags": [],
585 "user": "test"
586 }
587 ],
588 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
589 }
590
591 shortlog is displayed by default (issue5978)
592
593 $ request '?style=json'
594 200 Script output follows
595
596 {
597 "changeset_count": 10,
598 "changesets": [
599 {
600 "bookmarks": [],
601 "branch": "default",
602 "date": [
603 0.0,
604 0
605 ],
606 "desc": "merge test-branch into default",
607 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
608 "parents": [
609 "ceed296fe500c3fac9541e31dad860cb49c89e45",
610 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
611 ],
612 "phase": "draft",
613 "tags": [
614 "tip"
615 ],
616 "user": "test"
617 },
618 {
619 "bookmarks": [],
620 "branch": "test-branch",
621 "date": [
622 0.0,
623 0
624 ],
625 "desc": "another commit in test-branch",
626 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
627 "parents": [
628 "6ab967a8ab3489227a83f80e920faa039a71819f"
629 ],
630 "phase": "draft",
631 "tags": [],
632 "user": "test"
633 },
634 {
635 "bookmarks": [],
636 "branch": "test-branch",
637 "date": [
638 0.0,
639 0
640 ],
641 "desc": "create test branch",
642 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
643 "parents": [
644 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
645 ],
646 "phase": "draft",
647 "tags": [],
648 "user": "test"
649 },
650 {
651 "bookmarks": [
652 "bookmark2"
653 ],
654 "branch": "default",
655 "date": [
656 0.0,
657 0
658 ],
659 "desc": "create tag2",
660 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
661 "parents": [
662 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
663 ],
664 "phase": "draft",
665 "tags": [],
666 "user": "test"
667 },
668 {
669 "bookmarks": [],
670 "branch": "default",
671 "date": [
672 0.0,
673 0
674 ],
675 "desc": "another commit to da/foo",
676 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
677 "parents": [
678 "93a8ce14f89156426b7fa981af8042da53f03aa0"
679 ],
680 "phase": "draft",
681 "tags": [
682 "tag2"
683 ],
684 "user": "test"
685 },
686 {
687 "bookmarks": [],
688 "branch": "default",
689 "date": [
690 0.0,
691 0
692 ],
693 "desc": "create tag",
694 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
695 "parents": [
696 "78896eb0e102174ce9278438a95e12543e4367a7"
697 ],
698 "phase": "public",
699 "tags": [],
700 "user": "test"
701 },
702 {
703 "bookmarks": [],
704 "branch": "default",
705 "date": [
706 0.0,
707 0
708 ],
709 "desc": "move foo",
710 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
711 "parents": [
712 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
713 ],
714 "phase": "public",
715 "tags": [
716 "tag1"
717 ],
718 "user": "test"
719 },
720 {
721 "bookmarks": [
722 "bookmark1"
723 ],
724 "branch": "default",
725 "date": [
726 0.0,
727 0
728 ],
729 "desc": "modify da/foo",
730 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
731 "parents": [
732 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
733 ],
734 "phase": "public",
735 "tags": [],
736 "user": "test"
737 },
738 {
739 "bookmarks": [],
740 "branch": "default",
741 "date": [
742 0.0,
743 0
744 ],
745 "desc": "modify foo",
746 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
747 "parents": [
748 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
749 ],
750 "phase": "public",
751 "tags": [],
752 "user": "test"
753 },
754 {
755 "bookmarks": [],
756 "branch": "default",
757 "date": [
758 0.0,
759 0
760 ],
761 "desc": "initial",
762 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
763 "parents": [],
764 "phase": "public",
765 "tags": [],
766 "user": "test"
767 }
768 ],
769 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
770 }
771
772 changeset/ renders the tip changeset
773
774 $ request json-rev
775 200 Script output follows
776
777 {
778 "bookmarks": [],
779 "branch": "default",
780 "children": [],
781 "date": [
782 0.0,
783 0
784 ],
785 "desc": "merge test-branch into default",
786 "diff": [],
787 "files": [
788 {
789 "file": "foo-new",
790 "status": "modified"
791 }
792 ],
793 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
794 "parents": [
795 "ceed296fe500c3fac9541e31dad860cb49c89e45",
796 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
797 ],
798 "phase": "draft",
799 "tags": [
800 "tip"
801 ],
802 "user": "test"
803 }
804
805 changeset/{revision} shows tags
806
807 $ request json-rev/78896eb0e102
808 200 Script output follows
809
810 {
811 "bookmarks": [],
812 "branch": "default",
813 "children": [
814 "93a8ce14f89156426b7fa981af8042da53f03aa0"
815 ],
816 "date": [
817 0.0,
818 0
819 ],
820 "desc": "move foo",
821 "diff": [
822 {
823 "blockno": 1,
824 "lines": [
825 {
826 "l": "--- a/foo\tThu Jan 01 00:00:00 1970 +0000\n",
827 "n": 1,
828 "t": "-"
829 },
830 {
831 "l": "+++ /dev/null\tThu Jan 01 00:00:00 1970 +0000\n",
832 "n": 2,
833 "t": "+"
834 },
835 {
836 "l": "@@ -1,1 +0,0 @@\n",
837 "n": 3,
838 "t": "@"
839 },
840 {
841 "l": "-bar\n",
842 "n": 4,
843 "t": "-"
844 }
845 ]
846 },
847 {
848 "blockno": 2,
849 "lines": [
850 {
851 "l": "--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n",
852 "n": 1,
853 "t": "-"
854 },
855 {
856 "l": "+++ b/foo-new\tThu Jan 01 00:00:00 1970 +0000\n",
857 "n": 2,
858 "t": "+"
859 },
860 {
861 "l": "@@ -0,0 +1,1 @@\n",
862 "n": 3,
863 "t": "@"
864 },
865 {
866 "l": "+bar\n",
867 "n": 4,
868 "t": "+"
869 }
870 ]
871 }
872 ],
873 "files": [
874 {
875 "file": "foo",
876 "status": "removed"
877 },
878 {
879 "file": "foo-new",
880 "status": "added"
881 }
882 ],
883 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
884 "parents": [
885 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
886 ],
887 "phase": "public",
888 "tags": [
889 "tag1"
890 ],
891 "user": "test"
892 }
893
894 changeset/{revision} shows bookmarks
895
896 $ request json-rev/8d7c456572ac
897 200 Script output follows
898
899 {
900 "bookmarks": [
901 "bookmark1"
902 ],
903 "branch": "default",
904 "children": [
905 "78896eb0e102174ce9278438a95e12543e4367a7"
906 ],
907 "date": [
908 0.0,
909 0
910 ],
911 "desc": "modify da/foo",
912 "diff": [
913 {
914 "blockno": 1,
915 "lines": [
916 {
917 "l": "--- a/da/foo\tThu Jan 01 00:00:00 1970 +0000\n",
918 "n": 1,
919 "t": "-"
920 },
921 {
922 "l": "+++ b/da/foo\tThu Jan 01 00:00:00 1970 +0000\n",
923 "n": 2,
924 "t": "+"
925 },
926 {
927 "l": "@@ -1,1 +1,1 @@\n",
928 "n": 3,
929 "t": "@"
930 },
931 {
932 "l": "-foo\n",
933 "n": 4,
934 "t": "-"
935 },
936 {
937 "l": "+bar\n",
938 "n": 5,
939 "t": "+"
940 }
941 ]
942 }
943 ],
944 "files": [
945 {
946 "file": "da/foo",
947 "status": "modified"
948 }
949 ],
950 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
951 "parents": [
952 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
953 ],
954 "phase": "public",
955 "tags": [],
956 "user": "test"
957 }
958
959 changeset/{revision} shows branches
960
961 $ request json-rev/6ab967a8ab34
962 200 Script output follows
963
964 {
965 "bookmarks": [],
966 "branch": "test-branch",
967 "children": [
968 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
969 ],
970 "date": [
971 0.0,
972 0
973 ],
974 "desc": "create test branch",
975 "diff": [
976 {
977 "blockno": 1,
978 "lines": [
979 {
980 "l": "--- a/foo\tThu Jan 01 00:00:00 1970 +0000\n",
981 "n": 1,
982 "t": "-"
983 },
984 {
985 "l": "+++ b/foo\tThu Jan 01 00:00:00 1970 +0000\n",
986 "n": 2,
987 "t": "+"
988 },
989 {
990 "l": "@@ -1,1 +1,1 @@\n",
991 "n": 3,
992 "t": "@"
993 },
994 {
995 "l": "-foo\n",
996 "n": 4,
997 "t": "-"
998 },
999 {
1000 "l": "+branch\n",
1001 "n": 5,
1002 "t": "+"
1003 }
1004 ]
1005 }
1006 ],
1007 "files": [
1008 {
1009 "file": "foo",
1010 "status": "modified"
1011 }
1012 ],
1013 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
1014 "parents": [
1015 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1016 ],
1017 "phase": "draft",
1018 "tags": [],
1019 "user": "test"
1020 }
1021
1022 manifest/{revision}/{path} shows info about a directory at a revision
1023
1024 $ request json-manifest/06e557f3edf6/
1025 200 Script output follows
1026
1027 {
1028 "abspath": "/",
1029 "bookmarks": [],
1030 "directories": [
1031 {
1032 "abspath": "/da",
1033 "basename": "da",
1034 "emptydirs": ""
1035 }
1036 ],
1037 "files": [
1038 {
1039 "abspath": "foo",
1040 "basename": "foo",
1041 "date": [
1042 0.0,
1043 0
1044 ],
1045 "flags": "",
1046 "size": 4
1047 }
1048 ],
1049 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
1050 "tags": []
1051 }
1052
1053 tags/ shows tags info
1054
1055 $ request json-tags
1056 200 Script output follows
1057
1058 {
1059 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
1060 "tags": [
1061 {
1062 "date": [
1063 0.0,
1064 0
1065 ],
1066 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
1067 "tag": "tag2"
1068 },
1069 {
1070 "date": [
1071 0.0,
1072 0
1073 ],
1074 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
1075 "tag": "tag1"
1076 }
1077 ]
1078 }
1079
1080 bookmarks/ shows bookmarks info
1081
1082 $ request json-bookmarks
1083 200 Script output follows
1084
1085 {
1086 "bookmarks": [
1087 {
1088 "bookmark": "bookmark2",
1089 "date": [
1090 0.0,
1091 0
1092 ],
1093 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45"
1094 },
1095 {
1096 "bookmark": "bookmark1",
1097 "date": [
1098 0.0,
1099 0
1100 ],
1101 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5"
1102 }
1103 ],
1104 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
1105 }
1106
1107 branches/ shows branches info
1108
1109 $ request json-branches
1110 200 Script output follows
1111
1112 {
1113 "branches": [
1114 {
1115 "branch": "default",
1116 "date": [
1117 0.0,
1118 0
1119 ],
1120 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
1121 "status": "open"
1122 },
1123 {
1124 "branch": "test-branch",
1125 "date": [
1126 0.0,
1127 0
1128 ],
1129 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
1130 "status": "inactive"
1131 }
1132 ]
1133 }
1134
1135 summary/ shows a summary of repository state
1136
1137 $ request json-summary
1138 200 Script output follows
1139
1140 {
1141 "archives": [
1142 {
1143 "extension": ".tar.bz2",
1144 "node": "tip",
1145 "type": "bz2",
1146 "url": "http://*:$HGPORT/archive/tip.tar.bz2" (glob)
1147 }
1148 ],
1149 "bookmarks": [
1150 {
1151 "bookmark": "bookmark2",
1152 "date": [
1153 0.0,
1154 0
1155 ],
1156 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45"
1157 },
1158 {
1159 "bookmark": "bookmark1",
1160 "date": [
1161 0.0,
1162 0
1163 ],
1164 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5"
1165 }
1166 ],
1167 "branches": [
1168 {
1169 "branch": "default",
1170 "date": [
1171 0.0,
1172 0
1173 ],
1174 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
1175 "status": "open"
1176 },
1177 {
1178 "branch": "test-branch",
1179 "date": [
1180 0.0,
1181 0
1182 ],
1183 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
1184 "status": "inactive"
1185 }
1186 ],
1187 "labels": [],
1188 "lastchange": [
1189 0.0,
1190 0
1191 ],
1192 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
1193 "shortlog": [
1194 {
1195 "bookmarks": [],
1196 "branch": "default",
1197 "date": [
1198 0.0,
1199 0
1200 ],
1201 "desc": "merge test-branch into default",
1202 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
1203 "parents": [
1204 "ceed296fe500c3fac9541e31dad860cb49c89e45",
1205 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
1206 ],
1207 "phase": "draft",
1208 "tags": [
1209 "tip"
1210 ],
1211 "user": "test"
1212 },
1213 {
1214 "bookmarks": [],
1215 "branch": "test-branch",
1216 "date": [
1217 0.0,
1218 0
1219 ],
1220 "desc": "another commit in test-branch",
1221 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
1222 "parents": [
1223 "6ab967a8ab3489227a83f80e920faa039a71819f"
1224 ],
1225 "phase": "draft",
1226 "tags": [],
1227 "user": "test"
1228 },
1229 {
1230 "bookmarks": [],
1231 "branch": "test-branch",
1232 "date": [
1233 0.0,
1234 0
1235 ],
1236 "desc": "create test branch",
1237 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
1238 "parents": [
1239 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1240 ],
1241 "phase": "draft",
1242 "tags": [],
1243 "user": "test"
1244 },
1245 {
1246 "bookmarks": [
1247 "bookmark2"
1248 ],
1249 "branch": "default",
1250 "date": [
1251 0.0,
1252 0
1253 ],
1254 "desc": "create tag2",
1255 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
1256 "parents": [
1257 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
1258 ],
1259 "phase": "draft",
1260 "tags": [],
1261 "user": "test"
1262 },
1263 {
1264 "bookmarks": [],
1265 "branch": "default",
1266 "date": [
1267 0.0,
1268 0
1269 ],
1270 "desc": "another commit to da/foo",
1271 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
1272 "parents": [
1273 "93a8ce14f89156426b7fa981af8042da53f03aa0"
1274 ],
1275 "phase": "draft",
1276 "tags": [
1277 "tag2"
1278 ],
1279 "user": "test"
1280 },
1281 {
1282 "bookmarks": [],
1283 "branch": "default",
1284 "date": [
1285 0.0,
1286 0
1287 ],
1288 "desc": "create tag",
1289 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
1290 "parents": [
1291 "78896eb0e102174ce9278438a95e12543e4367a7"
1292 ],
1293 "phase": "public",
1294 "tags": [],
1295 "user": "test"
1296 },
1297 {
1298 "bookmarks": [],
1299 "branch": "default",
1300 "date": [
1301 0.0,
1302 0
1303 ],
1304 "desc": "move foo",
1305 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
1306 "parents": [
1307 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
1308 ],
1309 "phase": "public",
1310 "tags": [
1311 "tag1"
1312 ],
1313 "user": "test"
1314 },
1315 {
1316 "bookmarks": [
1317 "bookmark1"
1318 ],
1319 "branch": "default",
1320 "date": [
1321 0.0,
1322 0
1323 ],
1324 "desc": "modify da/foo",
1325 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
1326 "parents": [
1327 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
1328 ],
1329 "phase": "public",
1330 "tags": [],
1331 "user": "test"
1332 },
1333 {
1334 "bookmarks": [],
1335 "branch": "default",
1336 "date": [
1337 0.0,
1338 0
1339 ],
1340 "desc": "modify foo",
1341 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1342 "parents": [
1343 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1344 ],
1345 "phase": "public",
1346 "tags": [],
1347 "user": "test"
1348 },
1349 {
1350 "bookmarks": [],
1351 "branch": "default",
1352 "date": [
1353 0.0,
1354 0
1355 ],
1356 "desc": "initial",
1357 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
1358 "parents": [],
1359 "phase": "public",
1360 "tags": [],
1361 "user": "test"
1362 }
1363 ],
1364 "tags": [
1365 {
1366 "date": [
1367 0.0,
1368 0
1369 ],
1370 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
1371 "tag": "tag2"
1372 },
1373 {
1374 "date": [
1375 0.0,
1376 0
1377 ],
1378 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
1379 "tag": "tag1"
1380 }
1381 ]
1382 }
1383
1384 $ request json-changelog?rev=create
1385 200 Script output follows
1386
1387 {
1388 "entries": [
1389 {
1390 "bookmarks": [],
1391 "branch": "test-branch",
1392 "date": [
1393 0.0,
1394 0
1395 ],
1396 "desc": "create test branch",
1397 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
1398 "parents": [
1399 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1400 ],
1401 "phase": "draft",
1402 "tags": [],
1403 "user": "test"
1404 },
1405 {
1406 "bookmarks": [
1407 "bookmark2"
1408 ],
1409 "branch": "default",
1410 "date": [
1411 0.0,
1412 0
1413 ],
1414 "desc": "create tag2",
1415 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
1416 "parents": [
1417 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
1418 ],
1419 "phase": "draft",
1420 "tags": [],
1421 "user": "test"
1422 },
1423 {
1424 "bookmarks": [],
1425 "branch": "default",
1426 "date": [
1427 0.0,
1428 0
1429 ],
1430 "desc": "create tag",
1431 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
1432 "parents": [
1433 "78896eb0e102174ce9278438a95e12543e4367a7"
1434 ],
1435 "phase": "public",
1436 "tags": [],
1437 "user": "test"
1438 }
1439 ],
1440 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
1441 "query": "create"
1442 }
1443
1444 filediff/{revision}/{path} shows changes to a file in a revision
1445
1446 $ request json-diff/f8bbb9024b10/foo
1447 200 Script output follows
1448
1449 {
1450 "author": "test",
1451 "children": [],
1452 "date": [
1453 0.0,
1454 0
1455 ],
1456 "desc": "modify foo",
1457 "diff": [
1458 {
1459 "blockno": 1,
1460 "lines": [
1461 {
1462 "l": "--- a/foo\tThu Jan 01 00:00:00 1970 +0000\n",
1463 "n": 1,
1464 "t": "-"
1465 },
1466 {
1467 "l": "+++ b/foo\tThu Jan 01 00:00:00 1970 +0000\n",
1468 "n": 2,
1469 "t": "+"
1470 },
1471 {
1472 "l": "@@ -1,1 +1,1 @@\n",
1473 "n": 3,
1474 "t": "@"
1475 },
1476 {
1477 "l": "-foo\n",
1478 "n": 4,
1479 "t": "-"
1480 },
1481 {
1482 "l": "+bar\n",
1483 "n": 5,
1484 "t": "+"
1485 }
1486 ]
1487 }
1488 ],
1489 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1490 "parents": [
1491 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1492 ],
1493 "path": "foo"
1494 }
1495
1496 comparison/{revision}/{path} shows information about before and after for a file
1497
1498 $ request json-comparison/f8bbb9024b10/foo
1499 200 Script output follows
1500
1501 {
1502 "author": "test",
1503 "children": [],
1504 "comparison": [
1505 {
1506 "lines": [
1507 {
1508 "ll": "foo",
1509 "ln": 1,
1510 "rl": "bar",
1511 "rn": 1,
1512 "t": "replace"
1513 }
1514 ]
1515 }
1516 ],
1517 "date": [
1518 0.0,
1519 0
1520 ],
1521 "desc": "modify foo",
1522 "leftnode": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
1523 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1524 "parents": [
1525 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1526 ],
1527 "path": "foo",
1528 "rightnode": "f8bbb9024b10f93cdbb8d940337398291d40dea8"
1529 }
1530
1531 annotate/{revision}/{path} shows annotations for each line
1532
1533 $ request json-annotate/f8bbb9024b10/foo
1534 200 Script output follows
1535
1536 {
1537 "abspath": "foo",
1538 "annotate": [
1539 {
1540 "abspath": "foo",
1541 "author": "test",
1542 "desc": "modify foo",
1543 "line": "bar\n",
1544 "lineno": 1,
1545 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1546 "revdate": [
1547 0.0,
1548 0
1549 ],
1550 "targetline": 1
1551 }
1552 ],
1553 "author": "test",
1554 "children": [],
1555 "date": [
1556 0.0,
1557 0
1558 ],
1559 "desc": "modify foo",
1560 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1561 "parents": [
1562 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1563 ],
1564 "permissions": ""
1565 }
1566
1567 filelog/{revision}/{path} shows history of a single file
1568
1569 $ request json-filelog/f8bbb9024b10/foo
1570 200 Script output follows
1571
1572 {
1573 "entries": [
1574 {
1575 "bookmarks": [],
1576 "branch": "default",
1577 "date": [
1578 0.0,
1579 0
1580 ],
1581 "desc": "modify foo",
1582 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1583 "parents": [
1584 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1585 ],
1586 "phase": "public",
1587 "tags": [],
1588 "user": "test"
1589 },
1590 {
1591 "bookmarks": [],
1592 "branch": "default",
1593 "date": [
1594 0.0,
1595 0
1596 ],
1597 "desc": "initial",
1598 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
1599 "parents": [],
1600 "phase": "public",
1601 "tags": [],
1602 "user": "test"
1603 }
1604 ]
1605 }
1606
1607 $ request json-filelog/cc725e08502a/da/foo
1608 200 Script output follows
1609
1610 {
1611 "entries": [
1612 {
1613 "bookmarks": [],
1614 "branch": "default",
1615 "date": [
1616 0.0,
1617 0
1618 ],
1619 "desc": "another commit to da/foo",
1620 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
1621 "parents": [
1622 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
1623 ],
1624 "phase": "draft",
1625 "tags": [
1626 "tag2"
1627 ],
1628 "user": "test"
1629 },
1630 {
1631 "bookmarks": [
1632 "bookmark1"
1633 ],
1634 "branch": "default",
1635 "date": [
1636 0.0,
1637 0
1638 ],
1639 "desc": "modify da/foo",
1640 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
1641 "parents": [
1642 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1643 ],
1644 "phase": "public",
1645 "tags": [],
1646 "user": "test"
1647 },
1648 {
1649 "bookmarks": [],
1650 "branch": "default",
1651 "date": [
1652 0.0,
1653 0
1654 ],
1655 "desc": "initial",
1656 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
1657 "parents": [],
1658 "phase": "public",
1659 "tags": [],
1660 "user": "test"
1661 }
1662 ]
1663 }
1664
1665 (archive/ doesn't use templating, so ignore it)
1666
1667 (static/ doesn't use templating, so ignore it)
1668
1669 graph/ shows information that can be used to render a graph of the DAG
1670
1671 $ request json-graph
1672 200 Script output follows
1673
1674 {
1675 "changeset_count": 10,
1676 "changesets": [
1677 {
1678 "bookmarks": [],
1679 "branch": "default",
1680 "col": 0,
1681 "color": 1,
1682 "date": [
1683 0.0,
1684 0
1685 ],
1686 "desc": "merge test-branch into default",
1687 "edges": [
1688 {
1689 "bcolor": "",
1690 "col": 0,
1691 "color": 1,
1692 "nextcol": 0,
1693 "width": -1
1694 },
1695 {
1696 "bcolor": "",
1697 "col": 0,
1698 "color": 1,
1699 "nextcol": 1,
1700 "width": -1
1701 }
1702 ],
1703 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
1704 "parents": [
1705 "ceed296fe500c3fac9541e31dad860cb49c89e45",
1706 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
1707 ],
1708 "phase": "draft",
1709 "row": 0,
1710 "tags": [
1711 "tip"
1712 ],
1713 "user": "test"
1714 },
1715 {
1716 "bookmarks": [],
1717 "branch": "test-branch",
1718 "col": 1,
1719 "color": 2,
1720 "date": [
1721 0.0,
1722 0
1723 ],
1724 "desc": "another commit in test-branch",
1725 "edges": [
1726 {
1727 "bcolor": "",
1728 "col": 0,
1729 "color": 1,
1730 "nextcol": 0,
1731 "width": -1
1732 },
1733 {
1734 "bcolor": "",
1735 "col": 1,
1736 "color": 2,
1737 "nextcol": 1,
1738 "width": -1
1739 }
1740 ],
1741 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
1742 "parents": [
1743 "6ab967a8ab3489227a83f80e920faa039a71819f"
1744 ],
1745 "phase": "draft",
1746 "row": 1,
1747 "tags": [],
1748 "user": "test"
1749 },
1750 {
1751 "bookmarks": [],
1752 "branch": "test-branch",
1753 "col": 1,
1754 "color": 2,
1755 "date": [
1756 0.0,
1757 0
1758 ],
1759 "desc": "create test branch",
1760 "edges": [
1761 {
1762 "bcolor": "",
1763 "col": 0,
1764 "color": 1,
1765 "nextcol": 0,
1766 "width": -1
1767 },
1768 {
1769 "bcolor": "",
1770 "col": 1,
1771 "color": 2,
1772 "nextcol": 1,
1773 "width": -1
1774 }
1775 ],
1776 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
1777 "parents": [
1778 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1779 ],
1780 "phase": "draft",
1781 "row": 2,
1782 "tags": [],
1783 "user": "test"
1784 },
1785 {
1786 "bookmarks": [
1787 "bookmark2"
1788 ],
1789 "branch": "default",
1790 "col": 0,
1791 "color": 1,
1792 "date": [
1793 0.0,
1794 0
1795 ],
1796 "desc": "create tag2",
1797 "edges": [
1798 {
1799 "bcolor": "",
1800 "col": 0,
1801 "color": 1,
1802 "nextcol": 0,
1803 "width": -1
1804 },
1805 {
1806 "bcolor": "",
1807 "col": 1,
1808 "color": 2,
1809 "nextcol": 1,
1810 "width": -1
1811 }
1812 ],
1813 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
1814 "parents": [
1815 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
1816 ],
1817 "phase": "draft",
1818 "row": 3,
1819 "tags": [],
1820 "user": "test"
1821 },
1822 {
1823 "bookmarks": [],
1824 "branch": "default",
1825 "col": 0,
1826 "color": 1,
1827 "date": [
1828 0.0,
1829 0
1830 ],
1831 "desc": "another commit to da/foo",
1832 "edges": [
1833 {
1834 "bcolor": "",
1835 "col": 0,
1836 "color": 1,
1837 "nextcol": 0,
1838 "width": -1
1839 },
1840 {
1841 "bcolor": "",
1842 "col": 1,
1843 "color": 2,
1844 "nextcol": 1,
1845 "width": -1
1846 }
1847 ],
1848 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
1849 "parents": [
1850 "93a8ce14f89156426b7fa981af8042da53f03aa0"
1851 ],
1852 "phase": "draft",
1853 "row": 4,
1854 "tags": [
1855 "tag2"
1856 ],
1857 "user": "test"
1858 },
1859 {
1860 "bookmarks": [],
1861 "branch": "default",
1862 "col": 0,
1863 "color": 1,
1864 "date": [
1865 0.0,
1866 0
1867 ],
1868 "desc": "create tag",
1869 "edges": [
1870 {
1871 "bcolor": "",
1872 "col": 0,
1873 "color": 1,
1874 "nextcol": 0,
1875 "width": -1
1876 },
1877 {
1878 "bcolor": "",
1879 "col": 1,
1880 "color": 2,
1881 "nextcol": 1,
1882 "width": -1
1883 }
1884 ],
1885 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
1886 "parents": [
1887 "78896eb0e102174ce9278438a95e12543e4367a7"
1888 ],
1889 "phase": "public",
1890 "row": 5,
1891 "tags": [],
1892 "user": "test"
1893 },
1894 {
1895 "bookmarks": [],
1896 "branch": "default",
1897 "col": 0,
1898 "color": 1,
1899 "date": [
1900 0.0,
1901 0
1902 ],
1903 "desc": "move foo",
1904 "edges": [
1905 {
1906 "bcolor": "",
1907 "col": 0,
1908 "color": 1,
1909 "nextcol": 0,
1910 "width": -1
1911 },
1912 {
1913 "bcolor": "",
1914 "col": 1,
1915 "color": 2,
1916 "nextcol": 1,
1917 "width": -1
1918 }
1919 ],
1920 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
1921 "parents": [
1922 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
1923 ],
1924 "phase": "public",
1925 "row": 6,
1926 "tags": [
1927 "tag1"
1928 ],
1929 "user": "test"
1930 },
1931 {
1932 "bookmarks": [
1933 "bookmark1"
1934 ],
1935 "branch": "default",
1936 "col": 0,
1937 "color": 1,
1938 "date": [
1939 0.0,
1940 0
1941 ],
1942 "desc": "modify da/foo",
1943 "edges": [
1944 {
1945 "bcolor": "",
1946 "col": 0,
1947 "color": 1,
1948 "nextcol": 0,
1949 "width": -1
1950 },
1951 {
1952 "bcolor": "",
1953 "col": 1,
1954 "color": 2,
1955 "nextcol": 1,
1956 "width": -1
1957 }
1958 ],
1959 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
1960 "parents": [
1961 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
1962 ],
1963 "phase": "public",
1964 "row": 7,
1965 "tags": [],
1966 "user": "test"
1967 },
1968 {
1969 "bookmarks": [],
1970 "branch": "default",
1971 "col": 0,
1972 "color": 1,
1973 "date": [
1974 0.0,
1975 0
1976 ],
1977 "desc": "modify foo",
1978 "edges": [
1979 {
1980 "bcolor": "",
1981 "col": 0,
1982 "color": 1,
1983 "nextcol": 0,
1984 "width": -1
1985 },
1986 {
1987 "bcolor": "",
1988 "col": 1,
1989 "color": 2,
1990 "nextcol": 0,
1991 "width": -1
1992 }
1993 ],
1994 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1995 "parents": [
1996 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1997 ],
1998 "phase": "public",
1999 "row": 8,
2000 "tags": [],
2001 "user": "test"
2002 },
2003 {
2004 "bookmarks": [],
2005 "branch": "default",
2006 "col": 0,
2007 "color": 2,
2008 "date": [
2009 0.0,
2010 0
2011 ],
2012 "desc": "initial",
2013 "edges": [],
2014 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
2015 "parents": [],
2016 "phase": "public",
2017 "row": 9,
2018 "tags": [],
2019 "user": "test"
2020 }
2021 ],
2022 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
2023 }
2024
2025 help/ shows help topics
2026
2027 $ request json-help
2028 200 Script output follows
2029
2030 {
2031 "earlycommands": [
2032 {
2033 "summary": "abort an unfinished operation (EXPERIMENTAL)",
2034 "topic": "abort"
2035 },
2036 {
2037 "summary": "add the specified files on the next commit",
2038 "topic": "add"
2039 },
2040 {
2041 "summary": "pull and update to a given revision, no matter what, (EXPERIMENTAL)",
2042 "topic": "admin::chainsaw-update"
2043 },
2044 {
2045 "summary": "show changeset information by line for each file",
2046 "topic": "annotate"
2047 },
2048 {
2049 "summary": "make a copy of an existing repository",
2050 "topic": "clone"
2051 },
2052 {
2053 "summary": "commit the specified files or all outstanding changes",
2054 "topic": "commit"
2055 },
2056 {
2057 "summary": "resumes an interrupted operation (EXPERIMENTAL)",
2058 "topic": "continue"
2059 },
2060 {
2061 "summary": "diff repository (or selected files)",
2062 "topic": "diff"
2063 },
2064 {
2065 "summary": "dump the header and diffs for one or more changesets",
2066 "topic": "export"
2067 },
2068 {
2069 "summary": "forget the specified files on the next commit",
2070 "topic": "forget"
2071 },
2072 {
2073 "summary": "create a new repository in the given directory",
2074 "topic": "init"
2075 },
2076 {
2077 "summary": "show revision history of entire repository or files",
2078 "topic": "log"
2079 },
2080 {
2081 "summary": "merge another revision into working directory",
2082 "topic": "merge"
2083 },
2084 {
2085 "summary": "pull changes from the specified source",
2086 "topic": "pull"
2087 },
2088 {
2089 "summary": "push changes to the specified destination",
2090 "topic": "push"
2091 },
2092 {
2093 "summary": "remove the specified files on the next commit",
2094 "topic": "remove"
2095 },
2096 {
2097 "summary": "start stand-alone webserver",
2098 "topic": "serve"
2099 },
2100 {
2101 "summary": "show changed files in the working directory",
2102 "topic": "status"
2103 },
2104 {
2105 "summary": "summarize working directory state",
2106 "topic": "summary"
2107 },
2108 {
2109 "summary": "update working directory (or switch revisions)",
2110 "topic": "update"
2111 }
2112 ],
2113 "othercommands": [
2114 {
2115 "summary": "add all new files, delete all missing files",
2116 "topic": "addremove"
2117 },
2118 {
2119 "summary": "Narrow-related client administration utils. (EXPERIMENTAL)",
2120 "topic": "admin::narrow-client"
2121 },
2122 {
2123 "summary": "Narrow-related server administration utils. (EXPERIMENTAL)",
2124 "topic": "admin::narrow-server"
2125 },
2126 {
2127 "summary": "verify the integrity of the repository",
2128 "topic": "admin::verify"
2129 },
2130 {
2131 "summary": "create an unversioned archive of a repository revision",
2132 "topic": "archive"
2133 },
2134 {
2135 "summary": "reverse effect of earlier changeset",
2136 "topic": "backout"
2137 },
2138 {
2139 "summary": "subdivision search of changesets",
2140 "topic": "bisect"
2141 },
2142 {
2143 "summary": "create a new bookmark or list existing bookmarks",
2144 "topic": "bookmarks"
2145 },
2146 {
2147 "summary": "set or show the current branch name",
2148 "topic": "branch"
2149 },
2150 {
2151 "summary": "list repository named branches",
2152 "topic": "branches"
2153 },
2154 {
2155 "summary": "create a bundle file",
2156 "topic": "bundle"
2157 },
2158 {
2159 "summary": "output the current or given revision of files",
2160 "topic": "cat"
2161 },
2162 {
2163 "summary": "show combined config settings from all hgrc files",
2164 "topic": "config"
2165 },
2166 {
2167 "summary": "mark files as copied for the next commit",
2168 "topic": "copy"
2169 },
2170 {
2171 "summary": "list tracked files",
2172 "topic": "files"
2173 },
2174 {
2175 "summary": "copy changes from other branches onto the current branch",
2176 "topic": "graft"
2177 },
2178 {
2179 "summary": "search for a pattern in specified files",
2180 "topic": "grep"
2181 },
2182 {
2183 "summary": "show branch heads",
2184 "topic": "heads"
2185 },
2186 {
2187 "summary": "show help for a given topic or a help overview",
2188 "topic": "help"
2189 },
2190 {
2191 "summary": "identify the working directory or specified revision",
2192 "topic": "identify"
2193 },
2194 {
2195 "summary": "import an ordered set of patches",
2196 "topic": "import"
2197 },
2198 {
2199 "summary": "show new changesets found in source",
2200 "topic": "incoming"
2201 },
2202 {
2203 "summary": "output the current or given revision of the project manifest",
2204 "topic": "manifest"
2205 },
2206 {
2207 "summary": "show changesets not found in the destination",
2208 "topic": "outgoing"
2209 },
2210 {
2211 "summary": "show aliases for remote repositories",
2212 "topic": "paths"
2213 },
2214 {
2215 "summary": "set or show the current phase name",
2216 "topic": "phase"
2217 },
2218 {
2219 "summary": "removes files not tracked by Mercurial",
2220 "topic": "purge"
2221 },
2222 {
2223 "summary": "roll back an interrupted transaction",
2224 "topic": "recover"
2225 },
2226 {
2227 "summary": "rename files; equivalent of copy + remove",
2228 "topic": "rename"
2229 },
2230 {
2231 "summary": "redo merges or set/view the merge status of files",
2232 "topic": "resolve"
2233 },
2234 {
2235 "summary": "restore files to their checkout state",
2236 "topic": "revert"
2237 },
2238 {
2239 "summary": "print the root (top) of the current working directory",
2240 "topic": "root"
2241 },
2242 {
2243 "summary": "save and set aside changes from the working directory",
2244 "topic": "shelve"
2245 },
2246 {
2247 "summary": "add one or more tags for the current or given revision",
2248 "topic": "tag"
2249 },
2250 {
2251 "summary": "list repository tags",
2252 "topic": "tags"
2253 },
2254 {
2255 "summary": "apply one or more bundle files",
2256 "topic": "unbundle"
2257 },
2258 {
2259 "summary": "restore a shelved change to the working directory",
2260 "topic": "unshelve"
2261 },
2262 {
2263 "summary": "verify the integrity of the repository",
2264 "topic": "verify"
2265 },
2266 {
2267 "summary": "output version and copyright information",
2268 "topic": "version"
2269 }
2270 ],
2271 "topics": [
2272 {
2273 "summary": "Bundle File Formats",
2274 "topic": "bundlespec"
2275 },
2276 {
2277 "summary": "Colorizing Outputs",
2278 "topic": "color"
2279 },
2280 {
2281 "summary": "Configuration Files",
2282 "topic": "config"
2283 },
2284 {
2285 "summary": "Date Formats",
2286 "topic": "dates"
2287 },
2288 {
2289 "summary": "Deprecated Features",
2290 "topic": "deprecated"
2291 },
2292 {
2293 "summary": "Diff Formats",
2294 "topic": "diffs"
2295 },
2296 {
2297 "summary": "Environment Variables",
2298 "topic": "environment"
2299 },
2300 {
2301 "summary": "Safely rewriting history (EXPERIMENTAL)",
2302 "topic": "evolution"
2303 },
2304 {
2305 "summary": "Using Additional Features",
2306 "topic": "extensions"
2307 },
2308 {
2309 "summary": "Specifying File Sets",
2310 "topic": "filesets"
2311 },
2312 {
2313 "summary": "Command-line flags",
2314 "topic": "flags"
2315 },
2316 {
2317 "summary": "Glossary",
2318 "topic": "glossary"
2319 },
2320 {
2321 "summary": "Syntax for Mercurial Ignore Files",
2322 "topic": "hgignore"
2323 },
2324 {
2325 "summary": "Configuring hgweb",
2326 "topic": "hgweb"
2327 },
2328 {
2329 "summary": "Technical implementation topics",
2330 "topic": "internals"
2331 },
2332 {
2333 "summary": "Merge Tools",
2334 "topic": "merge-tools"
2335 },
2336 {
2337 "summary": "Pager Support",
2338 "topic": "pager"
2339 },
2340 {
2341 "summary": "File Name Patterns",
2342 "topic": "patterns"
2343 },
2344 {
2345 "summary": "Working with Phases",
2346 "topic": "phases"
2347 },
2348 {
2349 "summary": "Specifying Revisions",
2350 "topic": "revisions"
2351 },
2352 {
2353 "summary": "Rust in Mercurial",
2354 "topic": "rust"
2355 },
2356 {
2357 "summary": "Using Mercurial from scripts and automation",
2358 "topic": "scripting"
2359 },
2360 {
2361 "summary": "Subrepositories",
2362 "topic": "subrepos"
2363 },
2364 {
2365 "summary": "Template Usage",
2366 "topic": "templating"
2367 },
2368 {
2369 "summary": "URL Paths",
2370 "topic": "urls"
2371 }
2372 ]
2373 }
2374
2375 help/{topic} shows an individual help topic
2376
2377 $ request json-help/phases
2378 200 Script output follows
2379
2380 {
2381 "rawdoc": "Working with Phases\n*", (glob)
2382 "topic": "phases"
2383 }
2384
2385 Error page shouldn't crash
2386
2387 $ request json-changeset/deadbeef
2388 404 Not Found
2389
2390 {
2391 "error": "unknown revision 'deadbeef'"
2392 }
2393 [1]
2394
2395 Commit message with Japanese Kanji 'Noh', which ends with '\x5c'
2396
2397 $ echo foo >> da/foo
2398 >>> open('msg', 'wb').write(b'\x94\x5c\x0a') and None
2399 $ HGENCODING=cp932 hg ci -l msg
2400
2401 Commit message with null character
2402
2403 $ echo foo >> da/foo
2404 >>> open('msg', 'wb').write(b'commit with null character: \0\n') and None
2405 $ hg ci -l msg
2406 $ rm msg
2407
2408 Stop and restart with HGENCODING=cp932
2409
2410 $ killdaemons.py
2411 $ HGENCODING=cp932 hg serve -p $HGPORT -d --pid-file=hg.pid \
2412 > -A access.log -E error.log
2413 $ cat hg.pid >> $DAEMON_PIDS
2414
2415 Test json escape of multibyte characters
2416
2417 $ request json-filelog/tip/da/foo?revcount=2 | grep '"desc":'
2418 "desc": "commit with null character: \u0000",
2419 "desc": "\u80fd",