annotate mercurial/templates/json/map @ 24589:30a737ae9b7d

json: implement {manifest} template Property naming was borrowed from `hg files -Tjson`. We omit branch because, again, representation of branches in this template is wonky.
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 01 Apr 2015 22:04:03 -0700
parents 0bf54479a9eb
children 0bb733dfcabe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24544
71e96b9fd3fd templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
1 mimetype = 'application/json'
71e96b9fd3fd templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
2 filerevision = '"not yet implemented"'
71e96b9fd3fd templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
3 search = '"not yet implemented"'
24588
0bf54479a9eb json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24564
diff changeset
4 # changelog and shortlog are the same web API but with different
0bf54479a9eb json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24564
diff changeset
5 # number of entries.
0bf54479a9eb json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24564
diff changeset
6 changelog = changelist.tmpl
0bf54479a9eb json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24564
diff changeset
7 shortlog = changelist.tmpl
0bf54479a9eb json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24564
diff changeset
8 changelistentry = '\{
0bf54479a9eb json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24564
diff changeset
9 "node": {node|json},
0bf54479a9eb json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24564
diff changeset
10 "date": {date|json},
0bf54479a9eb json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24564
diff changeset
11 "desc": {desc|json},
0bf54479a9eb json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24564
diff changeset
12 "bookmarks": [{join(bookmarks%changelistentryname, ", ")}],
0bf54479a9eb json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24564
diff changeset
13 "tags": [{join(tags%changelistentryname, ", ")}],
0bf54479a9eb json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24564
diff changeset
14 "user": {author|json}
0bf54479a9eb json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24564
diff changeset
15 }'
0bf54479a9eb json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24564
diff changeset
16 changelistentryname = '{name|json}'
24563
830280536946 json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24547
diff changeset
17 changeset = '\{
830280536946 json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24547
diff changeset
18 "node": {node|json},
830280536946 json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24547
diff changeset
19 "date": {date|json},
830280536946 json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24547
diff changeset
20 "desc": {desc|json},
830280536946 json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24547
diff changeset
21 "branch": {if(branch, branch%changesetbranch, "default"|json)},
830280536946 json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24547
diff changeset
22 "bookmarks": [{join(changesetbookmark, ", ")}],
830280536946 json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24547
diff changeset
23 "tags": [{join(changesettag, ", ")}],
830280536946 json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24547
diff changeset
24 "user": {author|json},
24564
5ec4bda3097a hgweb: add phase to {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24563
diff changeset
25 "parents": [{join(parent%changesetparent, ", ")}],
5ec4bda3097a hgweb: add phase to {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24563
diff changeset
26 "phase": {phase|json}
24563
830280536946 json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24547
diff changeset
27 }'
830280536946 json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24547
diff changeset
28 changesetbranch = '{name|json}'
830280536946 json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24547
diff changeset
29 changesetbookmark = '{bookmark|json}'
830280536946 json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24547
diff changeset
30 changesettag = '{tag|json}'
830280536946 json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24547
diff changeset
31 changesetparent = '{node|json}'
24589
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
32 manifest = '\{
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
33 "node": {node|json},
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
34 "abspath": {path|json},
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
35 "directories": [{join(dentries%direntry, ", ")}],
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
36 "files": [{join(fentries%fileentry, ", ")}],
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
37 "bookmarks": [{join(bookmarks%name, ", ")}],
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
38 "tags": [{join(tags%name, ", ")}]
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
39 }'
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
40 name = '{name|json}'
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
41 direntry = '\{
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
42 "abspath": {path|json},
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
43 "basename": {basename|json},
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
44 "emptydirs": {emptydirs|json}
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
45 }'
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
46 fileentry = '\{
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
47 "abspath": {file|json},
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
48 "basename": {basename|json},
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
49 "date": {date|json},
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
50 "size": {size|json},
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
51 "flags": {permissions|json}
30a737ae9b7d json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24588
diff changeset
52 }'
24545
9e0c67e84896 json: implement {tags} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24544
diff changeset
53 tags = '\{
9e0c67e84896 json: implement {tags} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24544
diff changeset
54 "node": {node|json},
9e0c67e84896 json: implement {tags} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24544
diff changeset
55 "tags": [{join(entriesnotip%tagentry, ", ")}]
9e0c67e84896 json: implement {tags} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24544
diff changeset
56 }'
9e0c67e84896 json: implement {tags} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24544
diff changeset
57 tagentry = '\{
9e0c67e84896 json: implement {tags} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24544
diff changeset
58 "tag": {tag|json},
9e0c67e84896 json: implement {tags} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24544
diff changeset
59 "node": {node|json},
9e0c67e84896 json: implement {tags} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24544
diff changeset
60 "date": {date|json}
9e0c67e84896 json: implement {tags} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24544
diff changeset
61 }'
24546
adfd808c123f json: implement {bookmarks} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24545
diff changeset
62 bookmarks = '\{
adfd808c123f json: implement {bookmarks} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24545
diff changeset
63 "node": {node|json},
adfd808c123f json: implement {bookmarks} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24545
diff changeset
64 "bookmarks": [{join(entries%bookmarkentry, ", ")}]
adfd808c123f json: implement {bookmarks} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24545
diff changeset
65 }'
adfd808c123f json: implement {bookmarks} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24545
diff changeset
66 bookmarkentry = '\{
adfd808c123f json: implement {bookmarks} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24545
diff changeset
67 "bookmark": {bookmark|json},
adfd808c123f json: implement {bookmarks} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24545
diff changeset
68 "node": {node|json},
adfd808c123f json: implement {bookmarks} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24545
diff changeset
69 "date": {date|json}
adfd808c123f json: implement {bookmarks} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24545
diff changeset
70 }'
24547
495f3e665b27 json: implement {branches} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24546
diff changeset
71 branches = '\{
495f3e665b27 json: implement {branches} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24546
diff changeset
72 "branches": [{join(entries%branchentry, ", ")}]
495f3e665b27 json: implement {branches} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24546
diff changeset
73 }'
495f3e665b27 json: implement {branches} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24546
diff changeset
74 branchentry = '\{
495f3e665b27 json: implement {branches} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24546
diff changeset
75 "branch": {branch|json},
495f3e665b27 json: implement {branches} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24546
diff changeset
76 "node": {node|json},
495f3e665b27 json: implement {branches} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24546
diff changeset
77 "date": {date|json},
495f3e665b27 json: implement {branches} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24546
diff changeset
78 "status": {status|json}
495f3e665b27 json: implement {branches} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24546
diff changeset
79 }'
24544
71e96b9fd3fd templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
80 summary = '"not yet implemented"'
71e96b9fd3fd templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
81 filediff = '"not yet implemented"'
71e96b9fd3fd templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
82 filecomparison = '"not yet implemented"'
71e96b9fd3fd templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
83 fileannotate = '"not yet implemented"'
71e96b9fd3fd templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
84 filelog = '"not yet implemented"'
71e96b9fd3fd templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
85 graph = '"not yet implemented"'
71e96b9fd3fd templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
86 helptopics = '"not yet implemented"'
71e96b9fd3fd templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
87 help = '"not yet implemented"'
71e96b9fd3fd templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
88 filenodelink = ''
71e96b9fd3fd templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
89 filenolink = ''