##// END OF EJS Templates
json: implement {comparison} template...
Gregory Szorc -
r24714:84859415 default
parent child Browse files
Show More
@@ -1,133 +1,154
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 81 filediff = '\{
82 82 "path": {file|json},
83 83 "node": {node|json},
84 84 "date": {date|json},
85 85 "desc": {desc|json},
86 86 "author": {author|json},
87 87 "parents": [{join(parent%changesetparent, ", ")}],
88 88 "children": [{join(child%changesetparent, ", ")}],
89 89 "diff": [{join(diff%diffblock, ", ")}]
90 90 }'
91 91 diffblock = '\{
92 92 "blockno": {blockno|json},
93 93 "lines": [{join(lines, ", ")}]
94 94 }'
95 95 difflineplus = '\{
96 96 "t": "+",
97 97 "n": {lineno|json},
98 98 "l": {line|json}
99 99 }'
100 100 difflineminus = '\{
101 101 "t": "-",
102 102 "n": {lineno|json},
103 103 "l": {line|json}
104 104 }'
105 105 difflineat = '\{
106 106 "t": "@",
107 107 "n": {lineno|json},
108 108 "l": {line|json}
109 109 }'
110 110 diffline = '\{
111 111 "t": "",
112 112 "n": {lineno|json},
113 113 "l": {line|json}
114 114 }'
115 filecomparison = '"not yet implemented"'
115 filecomparison = '\{
116 "path": {file|json},
117 "node": {node|json},
118 "date": {date|json},
119 "desc": {desc|json},
120 "author": {author|json},
121 "parents": [{join(parent%changesetparent, ", ")}],
122 "children": [{join(child%changesetparent, ", ")}],
123 "leftnode": {leftnode|json},
124 "rightnode": {rightnode|json},
125 "comparison": [{join(comparison, ", ")}]
126 }'
127 comparisonblock = '\{
128 "lines": [{join(lines, ", ")}]
129 }'
130 comparisonline = '\{
131 "t": {type|json},
132 "ln": {leftlineno|json},
133 "ll": {leftline|json},
134 "rn": {rightlineno|json},
135 "rl": {rightline|json}
136 }'
116 137 fileannotate = '"not yet implemented"'
117 138 filelog = '"not yet implemented"'
118 139 graph = '"not yet implemented"'
119 140 helptopics = '\{
120 141 "topics": [{join(topics%helptopicentry, ", ")}],
121 142 "earlycommands": [{join(earlycommands%helptopicentry, ", ")}],
122 143 "othercommands": [{join(othercommands%helptopicentry, ", ")}]
123 144 }'
124 145 helptopicentry = '\{
125 146 "topic": {topic|json},
126 147 "summary": {summary|json}
127 148 }'
128 149 help = '\{
129 150 "topic": {topic|json},
130 151 "rawdoc": {doc|json}
131 152 }'
132 153 filenodelink = ''
133 154 filenolink = ''
@@ -1,1054 +1,1082
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 681 {
682 682 "author": "test",
683 683 "children": [],
684 684 "date": [
685 685 0.0,
686 686 0
687 687 ],
688 688 "desc": "modify foo",
689 689 "diff": [
690 690 {
691 691 "blockno": 1,
692 692 "lines": [
693 693 {
694 694 "l": "--- a/foo\tThu Jan 01 00:00:00 1970 +0000\n",
695 695 "n": 1,
696 696 "t": "-"
697 697 },
698 698 {
699 699 "l": "+++ b/foo\tThu Jan 01 00:00:00 1970 +0000\n",
700 700 "n": 2,
701 701 "t": "+"
702 702 },
703 703 {
704 704 "l": "@@ -1,1 +1,1 @@\n",
705 705 "n": 3,
706 706 "t": "@"
707 707 },
708 708 {
709 709 "l": "-foo\n",
710 710 "n": 4,
711 711 "t": "-"
712 712 },
713 713 {
714 714 "l": "+bar\n",
715 715 "n": 5,
716 716 "t": "+"
717 717 }
718 718 ]
719 719 }
720 720 ],
721 721 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
722 722 "parents": [
723 723 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
724 724 ],
725 725 "path": "foo"
726 726 }
727 727
728 728 comparison/{revision}/{path} shows information about before and after for a file
729 729
730 730 $ request json-comparison/f8bbb9024b10/foo
731 731 200 Script output follows
732 732
733 "not yet implemented"
733 {
734 "author": "test",
735 "children": [],
736 "comparison": [
737 {
738 "lines": [
739 {
740 "ll": "foo",
741 "ln": 1,
742 "rl": "bar",
743 "rn": 1,
744 "t": "replace"
745 }
746 ]
747 }
748 ],
749 "date": [
750 0.0,
751 0
752 ],
753 "desc": "modify foo",
754 "leftnode": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
755 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
756 "parents": [
757 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
758 ],
759 "path": "foo",
760 "rightnode": "f8bbb9024b10f93cdbb8d940337398291d40dea8"
761 }
734 762
735 763 annotate/{revision}/{path} shows annotations for each line
736 764
737 765 $ request json-annotate/f8bbb9024b10/foo
738 766 200 Script output follows
739 767
740 768 "not yet implemented"
741 769
742 770 filelog/{revision}/{path} shows history of a single file
743 771
744 772 $ request json-filelog/f8bbb9024b10/foo
745 773 200 Script output follows
746 774
747 775 "not yet implemented"
748 776
749 777 (archive/ doesn't use templating, so ignore it)
750 778
751 779 (static/ doesn't use templating, so ignore it)
752 780
753 781 graph/ shows information that can be used to render a graph of the DAG
754 782
755 783 $ request json-graph
756 784 200 Script output follows
757 785
758 786 "not yet implemented"
759 787
760 788 help/ shows help topics
761 789
762 790 $ request json-help
763 791 200 Script output follows
764 792
765 793 {
766 794 "earlycommands": [
767 795 {
768 796 "summary": "add the specified files on the next commit",
769 797 "topic": "add"
770 798 },
771 799 {
772 800 "summary": "show changeset information by line for each file",
773 801 "topic": "annotate"
774 802 },
775 803 {
776 804 "summary": "make a copy of an existing repository",
777 805 "topic": "clone"
778 806 },
779 807 {
780 808 "summary": "commit the specified files or all outstanding changes",
781 809 "topic": "commit"
782 810 },
783 811 {
784 812 "summary": "diff repository (or selected files)",
785 813 "topic": "diff"
786 814 },
787 815 {
788 816 "summary": "dump the header and diffs for one or more changesets",
789 817 "topic": "export"
790 818 },
791 819 {
792 820 "summary": "forget the specified files on the next commit",
793 821 "topic": "forget"
794 822 },
795 823 {
796 824 "summary": "create a new repository in the given directory",
797 825 "topic": "init"
798 826 },
799 827 {
800 828 "summary": "show revision history of entire repository or files",
801 829 "topic": "log"
802 830 },
803 831 {
804 832 "summary": "merge another revision into working directory",
805 833 "topic": "merge"
806 834 },
807 835 {
808 836 "summary": "pull changes from the specified source",
809 837 "topic": "pull"
810 838 },
811 839 {
812 840 "summary": "push changes to the specified destination",
813 841 "topic": "push"
814 842 },
815 843 {
816 844 "summary": "remove the specified files on the next commit",
817 845 "topic": "remove"
818 846 },
819 847 {
820 848 "summary": "start stand-alone webserver",
821 849 "topic": "serve"
822 850 },
823 851 {
824 852 "summary": "show changed files in the working directory",
825 853 "topic": "status"
826 854 },
827 855 {
828 856 "summary": "summarize working directory state",
829 857 "topic": "summary"
830 858 },
831 859 {
832 860 "summary": "update working directory (or switch revisions)",
833 861 "topic": "update"
834 862 }
835 863 ],
836 864 "othercommands": [
837 865 {
838 866 "summary": "add all new files, delete all missing files",
839 867 "topic": "addremove"
840 868 },
841 869 {
842 870 "summary": "create an unversioned archive of a repository revision",
843 871 "topic": "archive"
844 872 },
845 873 {
846 874 "summary": "reverse effect of earlier changeset",
847 875 "topic": "backout"
848 876 },
849 877 {
850 878 "summary": "subdivision search of changesets",
851 879 "topic": "bisect"
852 880 },
853 881 {
854 882 "summary": "create a new bookmark or list existing bookmarks",
855 883 "topic": "bookmarks"
856 884 },
857 885 {
858 886 "summary": "set or show the current branch name",
859 887 "topic": "branch"
860 888 },
861 889 {
862 890 "summary": "list repository named branches",
863 891 "topic": "branches"
864 892 },
865 893 {
866 894 "summary": "create a changegroup file",
867 895 "topic": "bundle"
868 896 },
869 897 {
870 898 "summary": "output the current or given revision of files",
871 899 "topic": "cat"
872 900 },
873 901 {
874 902 "summary": "show combined config settings from all hgrc files",
875 903 "topic": "config"
876 904 },
877 905 {
878 906 "summary": "mark files as copied for the next commit",
879 907 "topic": "copy"
880 908 },
881 909 {
882 910 "summary": "list tracked files",
883 911 "topic": "files"
884 912 },
885 913 {
886 914 "summary": "copy changes from other branches onto the current branch",
887 915 "topic": "graft"
888 916 },
889 917 {
890 918 "summary": "search for a pattern in specified files and revisions",
891 919 "topic": "grep"
892 920 },
893 921 {
894 922 "summary": "show branch heads",
895 923 "topic": "heads"
896 924 },
897 925 {
898 926 "summary": "show help for a given topic or a help overview",
899 927 "topic": "help"
900 928 },
901 929 {
902 930 "summary": "identify the working directory or specified revision",
903 931 "topic": "identify"
904 932 },
905 933 {
906 934 "summary": "import an ordered set of patches",
907 935 "topic": "import"
908 936 },
909 937 {
910 938 "summary": "show new changesets found in source",
911 939 "topic": "incoming"
912 940 },
913 941 {
914 942 "summary": "output the current or given revision of the project manifest",
915 943 "topic": "manifest"
916 944 },
917 945 {
918 946 "summary": "show changesets not found in the destination",
919 947 "topic": "outgoing"
920 948 },
921 949 {
922 950 "summary": "show aliases for remote repositories",
923 951 "topic": "paths"
924 952 },
925 953 {
926 954 "summary": "set or show the current phase name",
927 955 "topic": "phase"
928 956 },
929 957 {
930 958 "summary": "roll back an interrupted transaction",
931 959 "topic": "recover"
932 960 },
933 961 {
934 962 "summary": "rename files; equivalent of copy + remove",
935 963 "topic": "rename"
936 964 },
937 965 {
938 966 "summary": "redo merges or set/view the merge status of files",
939 967 "topic": "resolve"
940 968 },
941 969 {
942 970 "summary": "restore files to their checkout state",
943 971 "topic": "revert"
944 972 },
945 973 {
946 974 "summary": "print the root (top) of the current working directory",
947 975 "topic": "root"
948 976 },
949 977 {
950 978 "summary": "add one or more tags for the current or given revision",
951 979 "topic": "tag"
952 980 },
953 981 {
954 982 "summary": "list repository tags",
955 983 "topic": "tags"
956 984 },
957 985 {
958 986 "summary": "apply one or more changegroup files",
959 987 "topic": "unbundle"
960 988 },
961 989 {
962 990 "summary": "verify the integrity of the repository",
963 991 "topic": "verify"
964 992 },
965 993 {
966 994 "summary": "output version and copyright information",
967 995 "topic": "version"
968 996 }
969 997 ],
970 998 "topics": [
971 999 {
972 1000 "summary": "Configuration Files",
973 1001 "topic": "config"
974 1002 },
975 1003 {
976 1004 "summary": "Date Formats",
977 1005 "topic": "dates"
978 1006 },
979 1007 {
980 1008 "summary": "Diff Formats",
981 1009 "topic": "diffs"
982 1010 },
983 1011 {
984 1012 "summary": "Environment Variables",
985 1013 "topic": "environment"
986 1014 },
987 1015 {
988 1016 "summary": "Using Additional Features",
989 1017 "topic": "extensions"
990 1018 },
991 1019 {
992 1020 "summary": "Specifying File Sets",
993 1021 "topic": "filesets"
994 1022 },
995 1023 {
996 1024 "summary": "Glossary",
997 1025 "topic": "glossary"
998 1026 },
999 1027 {
1000 1028 "summary": "Syntax for Mercurial Ignore Files",
1001 1029 "topic": "hgignore"
1002 1030 },
1003 1031 {
1004 1032 "summary": "Configuring hgweb",
1005 1033 "topic": "hgweb"
1006 1034 },
1007 1035 {
1008 1036 "summary": "Merge Tools",
1009 1037 "topic": "merge-tools"
1010 1038 },
1011 1039 {
1012 1040 "summary": "Specifying Multiple Revisions",
1013 1041 "topic": "multirevs"
1014 1042 },
1015 1043 {
1016 1044 "summary": "File Name Patterns",
1017 1045 "topic": "patterns"
1018 1046 },
1019 1047 {
1020 1048 "summary": "Working with Phases",
1021 1049 "topic": "phases"
1022 1050 },
1023 1051 {
1024 1052 "summary": "Specifying Single Revisions",
1025 1053 "topic": "revisions"
1026 1054 },
1027 1055 {
1028 1056 "summary": "Specifying Revision Sets",
1029 1057 "topic": "revsets"
1030 1058 },
1031 1059 {
1032 1060 "summary": "Subrepositories",
1033 1061 "topic": "subrepos"
1034 1062 },
1035 1063 {
1036 1064 "summary": "Template Usage",
1037 1065 "topic": "templating"
1038 1066 },
1039 1067 {
1040 1068 "summary": "URL Paths",
1041 1069 "topic": "urls"
1042 1070 }
1043 1071 ]
1044 1072 }
1045 1073
1046 1074 help/{topic} shows an individual help topic
1047 1075
1048 1076 $ request json-help/phases
1049 1077 200 Script output follows
1050 1078
1051 1079 {
1052 1080 "rawdoc": "Working with Phases\n*", (glob)
1053 1081 "topic": "phases"
1054 1082 }
General Comments 0
You need to be logged in to leave comments. Login now