##// END OF EJS Templates
json: implement {filediff} template...
Gregory Szorc -
r24713:2f43f8cf default
parent child Browse files
Show More
@@ -1,100 +1,133
1 1 mimetype = 'application/json'
2 2 filerevision = '"not yet implemented"'
3 3 search = '"not yet implemented"'
4 4 # changelog and shortlog are the same web API but with different
5 5 # number of entries.
6 6 changelog = changelist.tmpl
7 7 shortlog = changelist.tmpl
8 8 changelistentry = '\{
9 9 "node": {node|json},
10 10 "date": {date|json},
11 11 "desc": {desc|json},
12 12 "bookmarks": [{join(bookmarks%changelistentryname, ", ")}],
13 13 "tags": [{join(tags%changelistentryname, ", ")}],
14 14 "user": {author|json}
15 15 }'
16 16 changelistentryname = '{name|json}'
17 17 changeset = '\{
18 18 "node": {node|json},
19 19 "date": {date|json},
20 20 "desc": {desc|json},
21 21 "branch": {if(branch, branch%changesetbranch, "default"|json)},
22 22 "bookmarks": [{join(changesetbookmark, ", ")}],
23 23 "tags": [{join(changesettag, ", ")}],
24 24 "user": {author|json},
25 25 "parents": [{join(parent%changesetparent, ", ")}],
26 26 "phase": {phase|json}
27 27 }'
28 28 changesetbranch = '{name|json}'
29 29 changesetbookmark = '{bookmark|json}'
30 30 changesettag = '{tag|json}'
31 31 changesetparent = '{node|json}'
32 32 manifest = '\{
33 33 "node": {node|json},
34 34 "abspath": {path|json},
35 35 "directories": [{join(dentries%direntry, ", ")}],
36 36 "files": [{join(fentries%fileentry, ", ")}],
37 37 "bookmarks": [{join(bookmarks%name, ", ")}],
38 38 "tags": [{join(tags%name, ", ")}]
39 39 }'
40 40 name = '{name|json}'
41 41 direntry = '\{
42 42 "abspath": {path|json},
43 43 "basename": {basename|json},
44 44 "emptydirs": {emptydirs|json}
45 45 }'
46 46 fileentry = '\{
47 47 "abspath": {file|json},
48 48 "basename": {basename|json},
49 49 "date": {date|json},
50 50 "size": {size|json},
51 51 "flags": {permissions|json}
52 52 }'
53 53 tags = '\{
54 54 "node": {node|json},
55 55 "tags": [{join(entriesnotip%tagentry, ", ")}]
56 56 }'
57 57 tagentry = '\{
58 58 "tag": {tag|json},
59 59 "node": {node|json},
60 60 "date": {date|json}
61 61 }'
62 62 bookmarks = '\{
63 63 "node": {node|json},
64 64 "bookmarks": [{join(entries%bookmarkentry, ", ")}]
65 65 }'
66 66 bookmarkentry = '\{
67 67 "bookmark": {bookmark|json},
68 68 "node": {node|json},
69 69 "date": {date|json}
70 70 }'
71 71 branches = '\{
72 72 "branches": [{join(entries%branchentry, ", ")}]
73 73 }'
74 74 branchentry = '\{
75 75 "branch": {branch|json},
76 76 "node": {node|json},
77 77 "date": {date|json},
78 78 "status": {status|json}
79 79 }'
80 80 summary = '"not yet implemented"'
81 filediff = '"not yet implemented"'
81 filediff = '\{
82 "path": {file|json},
83 "node": {node|json},
84 "date": {date|json},
85 "desc": {desc|json},
86 "author": {author|json},
87 "parents": [{join(parent%changesetparent, ", ")}],
88 "children": [{join(child%changesetparent, ", ")}],
89 "diff": [{join(diff%diffblock, ", ")}]
90 }'
91 diffblock = '\{
92 "blockno": {blockno|json},
93 "lines": [{join(lines, ", ")}]
94 }'
95 difflineplus = '\{
96 "t": "+",
97 "n": {lineno|json},
98 "l": {line|json}
99 }'
100 difflineminus = '\{
101 "t": "-",
102 "n": {lineno|json},
103 "l": {line|json}
104 }'
105 difflineat = '\{
106 "t": "@",
107 "n": {lineno|json},
108 "l": {line|json}
109 }'
110 diffline = '\{
111 "t": "",
112 "n": {lineno|json},
113 "l": {line|json}
114 }'
82 115 filecomparison = '"not yet implemented"'
83 116 fileannotate = '"not yet implemented"'
84 117 filelog = '"not yet implemented"'
85 118 graph = '"not yet implemented"'
86 119 helptopics = '\{
87 120 "topics": [{join(topics%helptopicentry, ", ")}],
88 121 "earlycommands": [{join(earlycommands%helptopicentry, ", ")}],
89 122 "othercommands": [{join(othercommands%helptopicentry, ", ")}]
90 123 }'
91 124 helptopicentry = '\{
92 125 "topic": {topic|json},
93 126 "summary": {summary|json}
94 127 }'
95 128 help = '\{
96 129 "topic": {topic|json},
97 130 "rawdoc": {doc|json}
98 131 }'
99 132 filenodelink = ''
100 133 filenolink = ''
@@ -1,1009 +1,1054
1 1 #require json
2 2 #require serve
3 3
4 4 $ request() {
5 5 > $TESTDIR/get-with-headers.py --json localhost:$HGPORT "$1"
6 6 > }
7 7
8 8 $ hg init test
9 9 $ cd test
10 10 $ mkdir da
11 11 $ echo foo > da/foo
12 12 $ echo foo > foo
13 13 $ hg -q ci -A -m initial
14 14 $ echo bar > foo
15 15 $ hg ci -m 'modify foo'
16 16 $ echo bar > da/foo
17 17 $ hg ci -m 'modify da/foo'
18 18 $ hg bookmark bookmark1
19 19 $ hg up default
20 20 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
21 21 (leaving bookmark bookmark1)
22 22 $ hg mv foo foo-new
23 23 $ hg commit -m 'move foo'
24 24 $ hg tag -m 'create tag' tag1
25 25 $ hg phase --public -r .
26 26 $ echo baz > da/foo
27 27 $ hg commit -m 'another commit to da/foo'
28 28 $ hg tag -m 'create tag2' tag2
29 29 $ hg bookmark bookmark2
30 30 $ hg -q up -r 0
31 31 $ hg -q branch test-branch
32 32 $ echo branch > foo
33 33 $ hg commit -m 'create test branch'
34 34 $ echo branch_commit_2 > foo
35 35 $ hg commit -m 'another commit in test-branch'
36 36 $ hg -q up default
37 37 $ hg merge --tool :local test-branch
38 38 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
39 39 (branch merge, don't forget to commit)
40 40 $ hg commit -m 'merge test-branch into default'
41 41
42 42 $ hg log -G
43 43 @ changeset: 9:cc725e08502a
44 44 |\ tag: tip
45 45 | | parent: 6:ceed296fe500
46 46 | | parent: 8:ed66c30e87eb
47 47 | | user: test
48 48 | | date: Thu Jan 01 00:00:00 1970 +0000
49 49 | | summary: merge test-branch into default
50 50 | |
51 51 | o changeset: 8:ed66c30e87eb
52 52 | | branch: test-branch
53 53 | | user: test
54 54 | | date: Thu Jan 01 00:00:00 1970 +0000
55 55 | | summary: another commit in test-branch
56 56 | |
57 57 | o changeset: 7:6ab967a8ab34
58 58 | | branch: test-branch
59 59 | | parent: 0:06e557f3edf6
60 60 | | user: test
61 61 | | date: Thu Jan 01 00:00:00 1970 +0000
62 62 | | summary: create test branch
63 63 | |
64 64 o | changeset: 6:ceed296fe500
65 65 | | bookmark: bookmark2
66 66 | | user: test
67 67 | | date: Thu Jan 01 00:00:00 1970 +0000
68 68 | | summary: create tag2
69 69 | |
70 70 o | changeset: 5:f2890a05fea4
71 71 | | tag: tag2
72 72 | | user: test
73 73 | | date: Thu Jan 01 00:00:00 1970 +0000
74 74 | | summary: another commit to da/foo
75 75 | |
76 76 o | changeset: 4:93a8ce14f891
77 77 | | user: test
78 78 | | date: Thu Jan 01 00:00:00 1970 +0000
79 79 | | summary: create tag
80 80 | |
81 81 o | changeset: 3:78896eb0e102
82 82 | | tag: tag1
83 83 | | user: test
84 84 | | date: Thu Jan 01 00:00:00 1970 +0000
85 85 | | summary: move foo
86 86 | |
87 87 o | changeset: 2:8d7c456572ac
88 88 | | bookmark: bookmark1
89 89 | | user: test
90 90 | | date: Thu Jan 01 00:00:00 1970 +0000
91 91 | | summary: modify da/foo
92 92 | |
93 93 o | changeset: 1:f8bbb9024b10
94 94 |/ user: test
95 95 | date: Thu Jan 01 00:00:00 1970 +0000
96 96 | summary: modify foo
97 97 |
98 98 o changeset: 0:06e557f3edf6
99 99 user: test
100 100 date: Thu Jan 01 00:00:00 1970 +0000
101 101 summary: initial
102 102
103 103
104 104 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log
105 105 $ cat hg.pid >> $DAEMON_PIDS
106 106
107 107 (Try to keep these in roughly the order they are defined in webcommands.py)
108 108
109 109 (log is handled by filelog/ and changelog/ - ignore it)
110 110
111 111 (rawfile/ doesn't use templating - nothing to test)
112 112
113 113 file/{revision}/{path} shows file revision
114 114
115 115 $ request json-file/06e557f3edf6/foo
116 116 200 Script output follows
117 117
118 118 "not yet implemented"
119 119
120 120 file/{revision} shows root directory info
121 121
122 122 $ request json-file/cc725e08502a
123 123 200 Script output follows
124 124
125 125 {
126 126 "abspath": "/",
127 127 "bookmarks": [],
128 128 "directories": [
129 129 {
130 130 "abspath": "/da",
131 131 "basename": "da",
132 132 "emptydirs": ""
133 133 }
134 134 ],
135 135 "files": [
136 136 {
137 137 "abspath": ".hgtags",
138 138 "basename": ".hgtags",
139 139 "date": [
140 140 0.0,
141 141 0
142 142 ],
143 143 "flags": "",
144 144 "size": 92
145 145 },
146 146 {
147 147 "abspath": "foo-new",
148 148 "basename": "foo-new",
149 149 "date": [
150 150 0.0,
151 151 0
152 152 ],
153 153 "flags": "",
154 154 "size": 4
155 155 }
156 156 ],
157 157 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
158 158 "tags": [
159 159 "tip"
160 160 ]
161 161 }
162 162
163 163 changelog/ shows information about several changesets
164 164
165 165 $ request json-changelog
166 166 200 Script output follows
167 167
168 168 {
169 169 "changeset_count": 10,
170 170 "changesets": [
171 171 {
172 172 "bookmarks": [],
173 173 "date": [
174 174 0.0,
175 175 0
176 176 ],
177 177 "desc": "merge test-branch into default",
178 178 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
179 179 "tags": [
180 180 "tip"
181 181 ],
182 182 "user": "test"
183 183 },
184 184 {
185 185 "bookmarks": [],
186 186 "date": [
187 187 0.0,
188 188 0
189 189 ],
190 190 "desc": "another commit in test-branch",
191 191 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
192 192 "tags": [],
193 193 "user": "test"
194 194 },
195 195 {
196 196 "bookmarks": [],
197 197 "date": [
198 198 0.0,
199 199 0
200 200 ],
201 201 "desc": "create test branch",
202 202 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
203 203 "tags": [],
204 204 "user": "test"
205 205 },
206 206 {
207 207 "bookmarks": [
208 208 "bookmark2"
209 209 ],
210 210 "date": [
211 211 0.0,
212 212 0
213 213 ],
214 214 "desc": "create tag2",
215 215 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
216 216 "tags": [],
217 217 "user": "test"
218 218 },
219 219 {
220 220 "bookmarks": [],
221 221 "date": [
222 222 0.0,
223 223 0
224 224 ],
225 225 "desc": "another commit to da/foo",
226 226 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
227 227 "tags": [
228 228 "tag2"
229 229 ],
230 230 "user": "test"
231 231 },
232 232 {
233 233 "bookmarks": [],
234 234 "date": [
235 235 0.0,
236 236 0
237 237 ],
238 238 "desc": "create tag",
239 239 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
240 240 "tags": [],
241 241 "user": "test"
242 242 },
243 243 {
244 244 "bookmarks": [],
245 245 "date": [
246 246 0.0,
247 247 0
248 248 ],
249 249 "desc": "move foo",
250 250 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
251 251 "tags": [
252 252 "tag1"
253 253 ],
254 254 "user": "test"
255 255 },
256 256 {
257 257 "bookmarks": [
258 258 "bookmark1"
259 259 ],
260 260 "date": [
261 261 0.0,
262 262 0
263 263 ],
264 264 "desc": "modify da/foo",
265 265 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
266 266 "tags": [],
267 267 "user": "test"
268 268 },
269 269 {
270 270 "bookmarks": [],
271 271 "date": [
272 272 0.0,
273 273 0
274 274 ],
275 275 "desc": "modify foo",
276 276 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
277 277 "tags": [],
278 278 "user": "test"
279 279 },
280 280 {
281 281 "bookmarks": [],
282 282 "date": [
283 283 0.0,
284 284 0
285 285 ],
286 286 "desc": "initial",
287 287 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
288 288 "tags": [],
289 289 "user": "test"
290 290 }
291 291 ],
292 292 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
293 293 }
294 294
295 295 changelog/{revision} shows information starting at a specific changeset
296 296
297 297 $ request json-changelog/f8bbb9024b10
298 298 200 Script output follows
299 299
300 300 {
301 301 "changeset_count": 10,
302 302 "changesets": [
303 303 {
304 304 "bookmarks": [],
305 305 "date": [
306 306 0.0,
307 307 0
308 308 ],
309 309 "desc": "modify foo",
310 310 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
311 311 "tags": [],
312 312 "user": "test"
313 313 },
314 314 {
315 315 "bookmarks": [],
316 316 "date": [
317 317 0.0,
318 318 0
319 319 ],
320 320 "desc": "initial",
321 321 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
322 322 "tags": [],
323 323 "user": "test"
324 324 }
325 325 ],
326 326 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8"
327 327 }
328 328
329 329 shortlog/ shows information about a set of changesets
330 330
331 331 $ request json-shortlog
332 332 200 Script output follows
333 333
334 334 {
335 335 "changeset_count": 10,
336 336 "changesets": [
337 337 {
338 338 "bookmarks": [],
339 339 "date": [
340 340 0.0,
341 341 0
342 342 ],
343 343 "desc": "merge test-branch into default",
344 344 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
345 345 "tags": [
346 346 "tip"
347 347 ],
348 348 "user": "test"
349 349 },
350 350 {
351 351 "bookmarks": [],
352 352 "date": [
353 353 0.0,
354 354 0
355 355 ],
356 356 "desc": "another commit in test-branch",
357 357 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
358 358 "tags": [],
359 359 "user": "test"
360 360 },
361 361 {
362 362 "bookmarks": [],
363 363 "date": [
364 364 0.0,
365 365 0
366 366 ],
367 367 "desc": "create test branch",
368 368 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
369 369 "tags": [],
370 370 "user": "test"
371 371 },
372 372 {
373 373 "bookmarks": [
374 374 "bookmark2"
375 375 ],
376 376 "date": [
377 377 0.0,
378 378 0
379 379 ],
380 380 "desc": "create tag2",
381 381 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
382 382 "tags": [],
383 383 "user": "test"
384 384 },
385 385 {
386 386 "bookmarks": [],
387 387 "date": [
388 388 0.0,
389 389 0
390 390 ],
391 391 "desc": "another commit to da/foo",
392 392 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
393 393 "tags": [
394 394 "tag2"
395 395 ],
396 396 "user": "test"
397 397 },
398 398 {
399 399 "bookmarks": [],
400 400 "date": [
401 401 0.0,
402 402 0
403 403 ],
404 404 "desc": "create tag",
405 405 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
406 406 "tags": [],
407 407 "user": "test"
408 408 },
409 409 {
410 410 "bookmarks": [],
411 411 "date": [
412 412 0.0,
413 413 0
414 414 ],
415 415 "desc": "move foo",
416 416 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
417 417 "tags": [
418 418 "tag1"
419 419 ],
420 420 "user": "test"
421 421 },
422 422 {
423 423 "bookmarks": [
424 424 "bookmark1"
425 425 ],
426 426 "date": [
427 427 0.0,
428 428 0
429 429 ],
430 430 "desc": "modify da/foo",
431 431 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
432 432 "tags": [],
433 433 "user": "test"
434 434 },
435 435 {
436 436 "bookmarks": [],
437 437 "date": [
438 438 0.0,
439 439 0
440 440 ],
441 441 "desc": "modify foo",
442 442 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
443 443 "tags": [],
444 444 "user": "test"
445 445 },
446 446 {
447 447 "bookmarks": [],
448 448 "date": [
449 449 0.0,
450 450 0
451 451 ],
452 452 "desc": "initial",
453 453 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
454 454 "tags": [],
455 455 "user": "test"
456 456 }
457 457 ],
458 458 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
459 459 }
460 460
461 461 changeset/ renders the tip changeset
462 462
463 463 $ request json-rev
464 464 200 Script output follows
465 465
466 466 {
467 467 "bookmarks": [],
468 468 "branch": "default",
469 469 "date": [
470 470 0.0,
471 471 0
472 472 ],
473 473 "desc": "merge test-branch into default",
474 474 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
475 475 "parents": [
476 476 "ceed296fe500c3fac9541e31dad860cb49c89e45",
477 477 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
478 478 ],
479 479 "phase": "draft",
480 480 "tags": [
481 481 "tip"
482 482 ],
483 483 "user": "test"
484 484 }
485 485
486 486 changeset/{revision} shows tags
487 487
488 488 $ request json-rev/78896eb0e102
489 489 200 Script output follows
490 490
491 491 {
492 492 "bookmarks": [],
493 493 "branch": "default",
494 494 "date": [
495 495 0.0,
496 496 0
497 497 ],
498 498 "desc": "move foo",
499 499 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
500 500 "parents": [
501 501 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
502 502 ],
503 503 "phase": "public",
504 504 "tags": [
505 505 "tag1"
506 506 ],
507 507 "user": "test"
508 508 }
509 509
510 510 changeset/{revision} shows bookmarks
511 511
512 512 $ request json-rev/8d7c456572ac
513 513 200 Script output follows
514 514
515 515 {
516 516 "bookmarks": [
517 517 "bookmark1"
518 518 ],
519 519 "branch": "default",
520 520 "date": [
521 521 0.0,
522 522 0
523 523 ],
524 524 "desc": "modify da/foo",
525 525 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
526 526 "parents": [
527 527 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
528 528 ],
529 529 "phase": "public",
530 530 "tags": [],
531 531 "user": "test"
532 532 }
533 533
534 534 changeset/{revision} shows branches
535 535
536 536 $ request json-rev/6ab967a8ab34
537 537 200 Script output follows
538 538
539 539 {
540 540 "bookmarks": [],
541 541 "branch": "test-branch",
542 542 "date": [
543 543 0.0,
544 544 0
545 545 ],
546 546 "desc": "create test branch",
547 547 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
548 548 "parents": [
549 549 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
550 550 ],
551 551 "phase": "draft",
552 552 "tags": [],
553 553 "user": "test"
554 554 }
555 555
556 556 manifest/{revision}/{path} shows info about a directory at a revision
557 557
558 558 $ request json-manifest/06e557f3edf6/
559 559 200 Script output follows
560 560
561 561 {
562 562 "abspath": "/",
563 563 "bookmarks": [],
564 564 "directories": [
565 565 {
566 566 "abspath": "/da",
567 567 "basename": "da",
568 568 "emptydirs": ""
569 569 }
570 570 ],
571 571 "files": [
572 572 {
573 573 "abspath": "foo",
574 574 "basename": "foo",
575 575 "date": [
576 576 0.0,
577 577 0
578 578 ],
579 579 "flags": "",
580 580 "size": 4
581 581 }
582 582 ],
583 583 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
584 584 "tags": []
585 585 }
586 586
587 587 tags/ shows tags info
588 588
589 589 $ request json-tags
590 590 200 Script output follows
591 591
592 592 {
593 593 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
594 594 "tags": [
595 595 {
596 596 "date": [
597 597 0.0,
598 598 0
599 599 ],
600 600 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
601 601 "tag": "tag2"
602 602 },
603 603 {
604 604 "date": [
605 605 0.0,
606 606 0
607 607 ],
608 608 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
609 609 "tag": "tag1"
610 610 }
611 611 ]
612 612 }
613 613
614 614 bookmarks/ shows bookmarks info
615 615
616 616 $ request json-bookmarks
617 617 200 Script output follows
618 618
619 619 {
620 620 "bookmarks": [
621 621 {
622 622 "bookmark": "bookmark1",
623 623 "date": [
624 624 0.0,
625 625 0
626 626 ],
627 627 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5"
628 628 },
629 629 {
630 630 "bookmark": "bookmark2",
631 631 "date": [
632 632 0.0,
633 633 0
634 634 ],
635 635 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45"
636 636 }
637 637 ],
638 638 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
639 639 }
640 640
641 641 branches/ shows branches info
642 642
643 643 $ request json-branches
644 644 200 Script output follows
645 645
646 646 {
647 647 "branches": [
648 648 {
649 649 "branch": "default",
650 650 "date": [
651 651 0.0,
652 652 0
653 653 ],
654 654 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
655 655 "status": "open"
656 656 },
657 657 {
658 658 "branch": "test-branch",
659 659 "date": [
660 660 0.0,
661 661 0
662 662 ],
663 663 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
664 664 "status": "inactive"
665 665 }
666 666 ]
667 667 }
668 668
669 669 summary/ shows a summary of repository state
670 670
671 671 $ request json-summary
672 672 200 Script output follows
673 673
674 674 "not yet implemented"
675 675
676 676 filediff/{revision}/{path} shows changes to a file in a revision
677 677
678 678 $ request json-diff/f8bbb9024b10/foo
679 679 200 Script output follows
680 680
681 "not yet implemented"
681 {
682 "author": "test",
683 "children": [],
684 "date": [
685 0.0,
686 0
687 ],
688 "desc": "modify foo",
689 "diff": [
690 {
691 "blockno": 1,
692 "lines": [
693 {
694 "l": "--- a/foo\tThu Jan 01 00:00:00 1970 +0000\n",
695 "n": 1,
696 "t": "-"
697 },
698 {
699 "l": "+++ b/foo\tThu Jan 01 00:00:00 1970 +0000\n",
700 "n": 2,
701 "t": "+"
702 },
703 {
704 "l": "@@ -1,1 +1,1 @@\n",
705 "n": 3,
706 "t": "@"
707 },
708 {
709 "l": "-foo\n",
710 "n": 4,
711 "t": "-"
712 },
713 {
714 "l": "+bar\n",
715 "n": 5,
716 "t": "+"
717 }
718 ]
719 }
720 ],
721 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
722 "parents": [
723 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
724 ],
725 "path": "foo"
726 }
682 727
683 728 comparison/{revision}/{path} shows information about before and after for a file
684 729
685 730 $ request json-comparison/f8bbb9024b10/foo
686 731 200 Script output follows
687 732
688 733 "not yet implemented"
689 734
690 735 annotate/{revision}/{path} shows annotations for each line
691 736
692 737 $ request json-annotate/f8bbb9024b10/foo
693 738 200 Script output follows
694 739
695 740 "not yet implemented"
696 741
697 742 filelog/{revision}/{path} shows history of a single file
698 743
699 744 $ request json-filelog/f8bbb9024b10/foo
700 745 200 Script output follows
701 746
702 747 "not yet implemented"
703 748
704 749 (archive/ doesn't use templating, so ignore it)
705 750
706 751 (static/ doesn't use templating, so ignore it)
707 752
708 753 graph/ shows information that can be used to render a graph of the DAG
709 754
710 755 $ request json-graph
711 756 200 Script output follows
712 757
713 758 "not yet implemented"
714 759
715 760 help/ shows help topics
716 761
717 762 $ request json-help
718 763 200 Script output follows
719 764
720 765 {
721 766 "earlycommands": [
722 767 {
723 768 "summary": "add the specified files on the next commit",
724 769 "topic": "add"
725 770 },
726 771 {
727 772 "summary": "show changeset information by line for each file",
728 773 "topic": "annotate"
729 774 },
730 775 {
731 776 "summary": "make a copy of an existing repository",
732 777 "topic": "clone"
733 778 },
734 779 {
735 780 "summary": "commit the specified files or all outstanding changes",
736 781 "topic": "commit"
737 782 },
738 783 {
739 784 "summary": "diff repository (or selected files)",
740 785 "topic": "diff"
741 786 },
742 787 {
743 788 "summary": "dump the header and diffs for one or more changesets",
744 789 "topic": "export"
745 790 },
746 791 {
747 792 "summary": "forget the specified files on the next commit",
748 793 "topic": "forget"
749 794 },
750 795 {
751 796 "summary": "create a new repository in the given directory",
752 797 "topic": "init"
753 798 },
754 799 {
755 800 "summary": "show revision history of entire repository or files",
756 801 "topic": "log"
757 802 },
758 803 {
759 804 "summary": "merge another revision into working directory",
760 805 "topic": "merge"
761 806 },
762 807 {
763 808 "summary": "pull changes from the specified source",
764 809 "topic": "pull"
765 810 },
766 811 {
767 812 "summary": "push changes to the specified destination",
768 813 "topic": "push"
769 814 },
770 815 {
771 816 "summary": "remove the specified files on the next commit",
772 817 "topic": "remove"
773 818 },
774 819 {
775 820 "summary": "start stand-alone webserver",
776 821 "topic": "serve"
777 822 },
778 823 {
779 824 "summary": "show changed files in the working directory",
780 825 "topic": "status"
781 826 },
782 827 {
783 828 "summary": "summarize working directory state",
784 829 "topic": "summary"
785 830 },
786 831 {
787 832 "summary": "update working directory (or switch revisions)",
788 833 "topic": "update"
789 834 }
790 835 ],
791 836 "othercommands": [
792 837 {
793 838 "summary": "add all new files, delete all missing files",
794 839 "topic": "addremove"
795 840 },
796 841 {
797 842 "summary": "create an unversioned archive of a repository revision",
798 843 "topic": "archive"
799 844 },
800 845 {
801 846 "summary": "reverse effect of earlier changeset",
802 847 "topic": "backout"
803 848 },
804 849 {
805 850 "summary": "subdivision search of changesets",
806 851 "topic": "bisect"
807 852 },
808 853 {
809 854 "summary": "create a new bookmark or list existing bookmarks",
810 855 "topic": "bookmarks"
811 856 },
812 857 {
813 858 "summary": "set or show the current branch name",
814 859 "topic": "branch"
815 860 },
816 861 {
817 862 "summary": "list repository named branches",
818 863 "topic": "branches"
819 864 },
820 865 {
821 866 "summary": "create a changegroup file",
822 867 "topic": "bundle"
823 868 },
824 869 {
825 870 "summary": "output the current or given revision of files",
826 871 "topic": "cat"
827 872 },
828 873 {
829 874 "summary": "show combined config settings from all hgrc files",
830 875 "topic": "config"
831 876 },
832 877 {
833 878 "summary": "mark files as copied for the next commit",
834 879 "topic": "copy"
835 880 },
836 881 {
837 882 "summary": "list tracked files",
838 883 "topic": "files"
839 884 },
840 885 {
841 886 "summary": "copy changes from other branches onto the current branch",
842 887 "topic": "graft"
843 888 },
844 889 {
845 890 "summary": "search for a pattern in specified files and revisions",
846 891 "topic": "grep"
847 892 },
848 893 {
849 894 "summary": "show branch heads",
850 895 "topic": "heads"
851 896 },
852 897 {
853 898 "summary": "show help for a given topic or a help overview",
854 899 "topic": "help"
855 900 },
856 901 {
857 902 "summary": "identify the working directory or specified revision",
858 903 "topic": "identify"
859 904 },
860 905 {
861 906 "summary": "import an ordered set of patches",
862 907 "topic": "import"
863 908 },
864 909 {
865 910 "summary": "show new changesets found in source",
866 911 "topic": "incoming"
867 912 },
868 913 {
869 914 "summary": "output the current or given revision of the project manifest",
870 915 "topic": "manifest"
871 916 },
872 917 {
873 918 "summary": "show changesets not found in the destination",
874 919 "topic": "outgoing"
875 920 },
876 921 {
877 922 "summary": "show aliases for remote repositories",
878 923 "topic": "paths"
879 924 },
880 925 {
881 926 "summary": "set or show the current phase name",
882 927 "topic": "phase"
883 928 },
884 929 {
885 930 "summary": "roll back an interrupted transaction",
886 931 "topic": "recover"
887 932 },
888 933 {
889 934 "summary": "rename files; equivalent of copy + remove",
890 935 "topic": "rename"
891 936 },
892 937 {
893 938 "summary": "redo merges or set/view the merge status of files",
894 939 "topic": "resolve"
895 940 },
896 941 {
897 942 "summary": "restore files to their checkout state",
898 943 "topic": "revert"
899 944 },
900 945 {
901 946 "summary": "print the root (top) of the current working directory",
902 947 "topic": "root"
903 948 },
904 949 {
905 950 "summary": "add one or more tags for the current or given revision",
906 951 "topic": "tag"
907 952 },
908 953 {
909 954 "summary": "list repository tags",
910 955 "topic": "tags"
911 956 },
912 957 {
913 958 "summary": "apply one or more changegroup files",
914 959 "topic": "unbundle"
915 960 },
916 961 {
917 962 "summary": "verify the integrity of the repository",
918 963 "topic": "verify"
919 964 },
920 965 {
921 966 "summary": "output version and copyright information",
922 967 "topic": "version"
923 968 }
924 969 ],
925 970 "topics": [
926 971 {
927 972 "summary": "Configuration Files",
928 973 "topic": "config"
929 974 },
930 975 {
931 976 "summary": "Date Formats",
932 977 "topic": "dates"
933 978 },
934 979 {
935 980 "summary": "Diff Formats",
936 981 "topic": "diffs"
937 982 },
938 983 {
939 984 "summary": "Environment Variables",
940 985 "topic": "environment"
941 986 },
942 987 {
943 988 "summary": "Using Additional Features",
944 989 "topic": "extensions"
945 990 },
946 991 {
947 992 "summary": "Specifying File Sets",
948 993 "topic": "filesets"
949 994 },
950 995 {
951 996 "summary": "Glossary",
952 997 "topic": "glossary"
953 998 },
954 999 {
955 1000 "summary": "Syntax for Mercurial Ignore Files",
956 1001 "topic": "hgignore"
957 1002 },
958 1003 {
959 1004 "summary": "Configuring hgweb",
960 1005 "topic": "hgweb"
961 1006 },
962 1007 {
963 1008 "summary": "Merge Tools",
964 1009 "topic": "merge-tools"
965 1010 },
966 1011 {
967 1012 "summary": "Specifying Multiple Revisions",
968 1013 "topic": "multirevs"
969 1014 },
970 1015 {
971 1016 "summary": "File Name Patterns",
972 1017 "topic": "patterns"
973 1018 },
974 1019 {
975 1020 "summary": "Working with Phases",
976 1021 "topic": "phases"
977 1022 },
978 1023 {
979 1024 "summary": "Specifying Single Revisions",
980 1025 "topic": "revisions"
981 1026 },
982 1027 {
983 1028 "summary": "Specifying Revision Sets",
984 1029 "topic": "revsets"
985 1030 },
986 1031 {
987 1032 "summary": "Subrepositories",
988 1033 "topic": "subrepos"
989 1034 },
990 1035 {
991 1036 "summary": "Template Usage",
992 1037 "topic": "templating"
993 1038 },
994 1039 {
995 1040 "summary": "URL Paths",
996 1041 "topic": "urls"
997 1042 }
998 1043 ]
999 1044 }
1000 1045
1001 1046 help/{topic} shows an individual help topic
1002 1047
1003 1048 $ request json-help/phases
1004 1049 200 Script output follows
1005 1050
1006 1051 {
1007 1052 "rawdoc": "Working with Phases\n*", (glob)
1008 1053 "topic": "phases"
1009 1054 }
General Comments 0
You need to be logged in to leave comments. Login now