Mercurial > hg
annotate mercurial/templates/json/map @ 51718:45828bc3c3d6
typing: add type hints to `mercurial.verify._normpath()`
Since 10db46e128d4, pytype almost figured this out, going from `Any` -> `_T0`,
but the intent is obvious.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Thu, 18 Jul 2024 20:34:35 -0400 |
parents | c0fbd63d66a7 |
children |
rev | line source |
---|---|
39468
6772cf74ff6f
hgweb: show shortlog by default in json output (issue5978)
Yuya Nishihara <yuya@tcha.org>
parents:
37402
diff
changeset
|
1 default = 'shortlog' |
24544
71e96b9fd3fd
templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
2 mimetype = 'application/json' |
39468
6772cf74ff6f
hgweb: show shortlog by default in json output (issue5978)
Yuya Nishihara <yuya@tcha.org>
parents:
37402
diff
changeset
|
3 |
29381
8bfe44494a0d
templates: add support for filerevision webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29380
diff
changeset
|
4 filerevision = '\{ |
8bfe44494a0d
templates: add support for filerevision webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29380
diff
changeset
|
5 "node": {node|json}, |
8bfe44494a0d
templates: add support for filerevision webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29380
diff
changeset
|
6 "path": {file|json}, |
8bfe44494a0d
templates: add support for filerevision webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29380
diff
changeset
|
7 "date": {date|json}, |
8bfe44494a0d
templates: add support for filerevision webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29380
diff
changeset
|
8 "desc": {desc|utf8|json}, |
8bfe44494a0d
templates: add support for filerevision webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29380
diff
changeset
|
9 "branch": {if(branch, branch%changesetbranch, "default"|json)}, |
8bfe44494a0d
templates: add support for filerevision webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29380
diff
changeset
|
10 "bookmarks": [{join(bookmarks%changelistentryname, ", ")}], |
8bfe44494a0d
templates: add support for filerevision webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29380
diff
changeset
|
11 "tags": [{join(tags%changelistentryname, ", ")}], |
8bfe44494a0d
templates: add support for filerevision webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29380
diff
changeset
|
12 "user": {author|utf8|json}, |
8bfe44494a0d
templates: add support for filerevision webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29380
diff
changeset
|
13 "parents": [{join(parent%changesetparent, ", ")}], |
8bfe44494a0d
templates: add support for filerevision webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29380
diff
changeset
|
14 "phase": {phase|json}, |
8bfe44494a0d
templates: add support for filerevision webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29380
diff
changeset
|
15 "lines": [{join(text%lineentry, ", ")}] |
8bfe44494a0d
templates: add support for filerevision webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29380
diff
changeset
|
16 }' |
8bfe44494a0d
templates: add support for filerevision webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29380
diff
changeset
|
17 lineentry = '\{ |
8bfe44494a0d
templates: add support for filerevision webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29380
diff
changeset
|
18 "line": {line|json} |
8bfe44494a0d
templates: add support for filerevision webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29380
diff
changeset
|
19 }' |
29383
f3dca85bd2d1
templates: add support for search webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29382
diff
changeset
|
20 search = '\{ |
f3dca85bd2d1
templates: add support for search webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29382
diff
changeset
|
21 "node": {node|json}, |
f3dca85bd2d1
templates: add support for search webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29382
diff
changeset
|
22 "query": {query|json}, |
37400
47aea60d114d
hgweb: fix search {entries} to not return results of template expansion
Yuya Nishihara <yuya@tcha.org>
parents:
35389
diff
changeset
|
23 "entries": [{join(entries%changelistentry, ", ")}] |
29383
f3dca85bd2d1
templates: add support for search webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29382
diff
changeset
|
24 }' |
24588
0bf54479a9eb
json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24564
diff
changeset
|
25 # 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
|
26 # number of entries. |
0bf54479a9eb
json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24564
diff
changeset
|
27 changelog = changelist.tmpl |
0bf54479a9eb
json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24564
diff
changeset
|
28 shortlog = changelist.tmpl |
35389
b963750b125f
hgweb: implement json-graph
Anton Shestakov <av6@dwimlabs.net>
parents:
29471
diff
changeset
|
29 graph = graph.tmpl |
24588
0bf54479a9eb
json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24564
diff
changeset
|
30 changelistentry = '\{ |
0bf54479a9eb
json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24564
diff
changeset
|
31 "node": {node|json}, |
0bf54479a9eb
json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24564
diff
changeset
|
32 "date": {date|json}, |
28212
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
33 "desc": {desc|utf8|json}, |
29380
c1b526f55116
templates: add support for filelog webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
28709
diff
changeset
|
34 "branch": {if(branch, branch%changesetbranch, "default"|json)}, |
24588
0bf54479a9eb
json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24564
diff
changeset
|
35 "bookmarks": [{join(bookmarks%changelistentryname, ", ")}], |
0bf54479a9eb
json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24564
diff
changeset
|
36 "tags": [{join(tags%changelistentryname, ", ")}], |
28709
94494031f659
hgweb: add parents to json-log (issue5074)
Anton Shestakov <av6@dwimlabs.net>
parents:
28268
diff
changeset
|
37 "user": {author|utf8|json}, |
29380
c1b526f55116
templates: add support for filelog webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
28709
diff
changeset
|
38 "phase": {phase|json}, |
c1b526f55116
templates: add support for filelog webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
28709
diff
changeset
|
39 "parents": [{if(allparents, join(allparents%changesetparent, ", "), |
c1b526f55116
templates: add support for filelog webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
28709
diff
changeset
|
40 join(parent%changesetparent, ", "))}] |
24588
0bf54479a9eb
json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24564
diff
changeset
|
41 }' |
35389
b963750b125f
hgweb: implement json-graph
Anton Shestakov <av6@dwimlabs.net>
parents:
29471
diff
changeset
|
42 graphentry = '\{ |
b963750b125f
hgweb: implement json-graph
Anton Shestakov <av6@dwimlabs.net>
parents:
29471
diff
changeset
|
43 "node": {node|json}, |
b963750b125f
hgweb: implement json-graph
Anton Shestakov <av6@dwimlabs.net>
parents:
29471
diff
changeset
|
44 "date": {date|json}, |
b963750b125f
hgweb: implement json-graph
Anton Shestakov <av6@dwimlabs.net>
parents:
29471
diff
changeset
|
45 "desc": {desc|utf8|json}, |
b963750b125f
hgweb: implement json-graph
Anton Shestakov <av6@dwimlabs.net>
parents:
29471
diff
changeset
|
46 "branch": {if(branch, branch%changesetbranch, "default"|json)}, |
b963750b125f
hgweb: implement json-graph
Anton Shestakov <av6@dwimlabs.net>
parents:
29471
diff
changeset
|
47 "bookmarks": [{join(bookmarks%changelistentryname, ", ")}], |
b963750b125f
hgweb: implement json-graph
Anton Shestakov <av6@dwimlabs.net>
parents:
29471
diff
changeset
|
48 "tags": [{join(tags%changelistentryname, ", ")}], |
b963750b125f
hgweb: implement json-graph
Anton Shestakov <av6@dwimlabs.net>
parents:
29471
diff
changeset
|
49 "user": {author|utf8|json}, |
b963750b125f
hgweb: implement json-graph
Anton Shestakov <av6@dwimlabs.net>
parents:
29471
diff
changeset
|
50 "phase": {phase|json}, |
b963750b125f
hgweb: implement json-graph
Anton Shestakov <av6@dwimlabs.net>
parents:
29471
diff
changeset
|
51 "col": {col|json}, |
b963750b125f
hgweb: implement json-graph
Anton Shestakov <av6@dwimlabs.net>
parents:
29471
diff
changeset
|
52 "row": {row|json}, |
b963750b125f
hgweb: implement json-graph
Anton Shestakov <av6@dwimlabs.net>
parents:
29471
diff
changeset
|
53 "color": {color|json}, |
b963750b125f
hgweb: implement json-graph
Anton Shestakov <av6@dwimlabs.net>
parents:
29471
diff
changeset
|
54 "edges": {edges|json}, |
b963750b125f
hgweb: implement json-graph
Anton Shestakov <av6@dwimlabs.net>
parents:
29471
diff
changeset
|
55 "parents": [{if(allparents, join(allparents%changesetparent, ", "), |
b963750b125f
hgweb: implement json-graph
Anton Shestakov <av6@dwimlabs.net>
parents:
29471
diff
changeset
|
56 join(parent%changesetparent, ", "))}] |
b963750b125f
hgweb: implement json-graph
Anton Shestakov <av6@dwimlabs.net>
parents:
29471
diff
changeset
|
57 }' |
28212
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
58 changelistentryname = '{name|utf8|json}' |
24563
830280536946
json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24547
diff
changeset
|
59 changeset = '\{ |
830280536946
json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24547
diff
changeset
|
60 "node": {node|json}, |
830280536946
json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24547
diff
changeset
|
61 "date": {date|json}, |
28212
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
62 "desc": {desc|utf8|json}, |
24563
830280536946
json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24547
diff
changeset
|
63 "branch": {if(branch, branch%changesetbranch, "default"|json)}, |
830280536946
json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24547
diff
changeset
|
64 "bookmarks": [{join(changesetbookmark, ", ")}], |
830280536946
json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24547
diff
changeset
|
65 "tags": [{join(changesettag, ", ")}], |
28212
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
66 "user": {author|utf8|json}, |
24564
5ec4bda3097a
hgweb: add phase to {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24563
diff
changeset
|
67 "parents": [{join(parent%changesetparent, ", ")}], |
50405
c0fbd63d66a7
hgweb: add "children" into the JSON template for a changeset
Manuel Jacob <me@manueljacob.de>
parents:
43718
diff
changeset
|
68 "children": [{join(child%changesetparent, ", ")}], |
43717
6feaee05bac5
hgweb: add files to the json changeset template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
39469
diff
changeset
|
69 "files": [{join(files, ", ")}], |
43718
d155bf11cf22
hgweb: add diffs to the json changeset template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
43717
diff
changeset
|
70 "diff": [{join(diff, ", ")}], |
24564
5ec4bda3097a
hgweb: add phase to {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24563
diff
changeset
|
71 "phase": {phase|json} |
24563
830280536946
json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24547
diff
changeset
|
72 }' |
28212
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
73 changesetbranch = '{name|utf8|json}' |
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
74 changesetbookmark = '{bookmark|utf8|json}' |
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
75 changesettag = '{tag|utf8|json}' |
24563
830280536946
json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24547
diff
changeset
|
76 changesetparent = '{node|json}' |
24589
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
77 manifest = '\{ |
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
78 "node": {node|json}, |
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
79 "abspath": {path|json}, |
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
80 "directories": [{join(dentries%direntry, ", ")}], |
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
81 "files": [{join(fentries%fileentry, ", ")}], |
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
82 "bookmarks": [{join(bookmarks%name, ", ")}], |
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
83 "tags": [{join(tags%name, ", ")}] |
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
84 }' |
28212
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
85 name = '{name|utf8|json}' |
24589
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
86 direntry = '\{ |
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
87 "abspath": {path|json}, |
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
88 "basename": {basename|json}, |
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
89 "emptydirs": {emptydirs|json} |
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
90 }' |
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
91 fileentry = '\{ |
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
92 "abspath": {file|json}, |
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
93 "basename": {basename|json}, |
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
94 "date": {date|json}, |
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
95 "size": {size|json}, |
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
96 "flags": {permissions|json} |
30a737ae9b7d
json: implement {manifest} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24588
diff
changeset
|
97 }' |
24545
9e0c67e84896
json: implement {tags} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24544
diff
changeset
|
98 tags = '\{ |
9e0c67e84896
json: implement {tags} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24544
diff
changeset
|
99 "node": {node|json}, |
9e0c67e84896
json: implement {tags} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24544
diff
changeset
|
100 "tags": [{join(entriesnotip%tagentry, ", ")}] |
9e0c67e84896
json: implement {tags} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24544
diff
changeset
|
101 }' |
9e0c67e84896
json: implement {tags} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24544
diff
changeset
|
102 tagentry = '\{ |
28212
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
103 "tag": {tag|utf8|json}, |
24545
9e0c67e84896
json: implement {tags} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24544
diff
changeset
|
104 "node": {node|json}, |
9e0c67e84896
json: implement {tags} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24544
diff
changeset
|
105 "date": {date|json} |
9e0c67e84896
json: implement {tags} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24544
diff
changeset
|
106 }' |
24546
adfd808c123f
json: implement {bookmarks} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24545
diff
changeset
|
107 bookmarks = '\{ |
adfd808c123f
json: implement {bookmarks} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24545
diff
changeset
|
108 "node": {node|json}, |
adfd808c123f
json: implement {bookmarks} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24545
diff
changeset
|
109 "bookmarks": [{join(entries%bookmarkentry, ", ")}] |
adfd808c123f
json: implement {bookmarks} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24545
diff
changeset
|
110 }' |
adfd808c123f
json: implement {bookmarks} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24545
diff
changeset
|
111 bookmarkentry = '\{ |
28212
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
112 "bookmark": {bookmark|utf8|json}, |
24546
adfd808c123f
json: implement {bookmarks} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24545
diff
changeset
|
113 "node": {node|json}, |
adfd808c123f
json: implement {bookmarks} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24545
diff
changeset
|
114 "date": {date|json} |
adfd808c123f
json: implement {bookmarks} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24545
diff
changeset
|
115 }' |
24547
495f3e665b27
json: implement {branches} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24546
diff
changeset
|
116 branches = '\{ |
495f3e665b27
json: implement {branches} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24546
diff
changeset
|
117 "branches": [{join(entries%branchentry, ", ")}] |
495f3e665b27
json: implement {branches} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24546
diff
changeset
|
118 }' |
495f3e665b27
json: implement {branches} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24546
diff
changeset
|
119 branchentry = '\{ |
28212
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
120 "branch": {branch|utf8|json}, |
24547
495f3e665b27
json: implement {branches} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24546
diff
changeset
|
121 "node": {node|json}, |
495f3e665b27
json: implement {branches} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24546
diff
changeset
|
122 "date": {date|json}, |
495f3e665b27
json: implement {branches} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24546
diff
changeset
|
123 "status": {status|json} |
495f3e665b27
json: implement {branches} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24546
diff
changeset
|
124 }' |
29382
e4b777fe1576
templates: add support for summary webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29381
diff
changeset
|
125 shortlogentry = '{changelistentry}' |
e4b777fe1576
templates: add support for summary webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29381
diff
changeset
|
126 summary = '\{ |
e4b777fe1576
templates: add support for summary webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29381
diff
changeset
|
127 "node": {node|json}, |
e4b777fe1576
templates: add support for summary webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29381
diff
changeset
|
128 "lastchange": {lastchange|json}, |
e4b777fe1576
templates: add support for summary webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29381
diff
changeset
|
129 "bookmarks": [{join(bookmarks%bookmarkentry, ", ")}], |
e4b777fe1576
templates: add support for summary webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29381
diff
changeset
|
130 "branches": [{join(branches%branchentry, ", ")}], |
e4b777fe1576
templates: add support for summary webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29381
diff
changeset
|
131 "shortlog": [{join(shortlog%shortlogentry, ", ")}], |
e4b777fe1576
templates: add support for summary webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29381
diff
changeset
|
132 "tags": [{join(tags%tagentry, ", ")}], |
29471
c4fc33c477da
hgweb: expose list of per-repo labels to templates
Gregory Szorc <gregory.szorc@gmail.com>
parents:
29458
diff
changeset
|
133 "archives": [{join(archives%archiveentry, ", ")}], |
c4fc33c477da
hgweb: expose list of per-repo labels to templates
Gregory Szorc <gregory.szorc@gmail.com>
parents:
29458
diff
changeset
|
134 "labels": {labels|json} |
29382
e4b777fe1576
templates: add support for summary webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29381
diff
changeset
|
135 }' |
e4b777fe1576
templates: add support for summary webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29381
diff
changeset
|
136 archiveentry = '\{ |
e4b777fe1576
templates: add support for summary webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29381
diff
changeset
|
137 "node": {node|json}, |
e4b777fe1576
templates: add support for summary webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29381
diff
changeset
|
138 "extension": {extension|json}, |
29458
59058549a611
hgweb: add absolute urls for archives in json-summary
Anton Shestakov <av6@dwimlabs.net>
parents:
29383
diff
changeset
|
139 "type": {type|json}, |
59058549a611
hgweb: add absolute urls for archives in json-summary
Anton Shestakov <av6@dwimlabs.net>
parents:
29383
diff
changeset
|
140 "url": {"{urlbase}{url}archive/{node}{extension}"|json} |
29382
e4b777fe1576
templates: add support for summary webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
29381
diff
changeset
|
141 }' |
24713
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
142 filediff = '\{ |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
143 "path": {file|json}, |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
144 "node": {node|json}, |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
145 "date": {date|json}, |
28212
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
146 "desc": {desc|utf8|json}, |
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
147 "author": {author|utf8|json}, |
24713
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
148 "parents": [{join(parent%changesetparent, ", ")}], |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
149 "children": [{join(child%changesetparent, ", ")}], |
37402
546dc42c3bc4
hgweb: fix {diff} expansion in JSON template
Yuya Nishihara <yuya@tcha.org>
parents:
37400
diff
changeset
|
150 "diff": [{join(diff, ", ")}] |
24713
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
151 }' |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
152 diffblock = '\{ |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
153 "blockno": {blockno|json}, |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
154 "lines": [{join(lines, ", ")}] |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
155 }' |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
156 difflineplus = '\{ |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
157 "t": "+", |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
158 "n": {lineno|json}, |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
159 "l": {line|json} |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
160 }' |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
161 difflineminus = '\{ |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
162 "t": "-", |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
163 "n": {lineno|json}, |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
164 "l": {line|json} |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
165 }' |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
166 difflineat = '\{ |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
167 "t": "@", |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
168 "n": {lineno|json}, |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
169 "l": {line|json} |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
170 }' |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
171 diffline = '\{ |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
172 "t": "", |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
173 "n": {lineno|json}, |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
174 "l": {line|json} |
2f43f8cf8219
json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24591
diff
changeset
|
175 }' |
24714
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
176 filecomparison = '\{ |
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
177 "path": {file|json}, |
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
178 "node": {node|json}, |
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
179 "date": {date|json}, |
28212
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
180 "desc": {desc|utf8|json}, |
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
181 "author": {author|utf8|json}, |
24714
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
182 "parents": [{join(parent%changesetparent, ", ")}], |
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
183 "children": [{join(child%changesetparent, ", ")}], |
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
184 "leftnode": {leftnode|json}, |
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
185 "rightnode": {rightnode|json}, |
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
186 "comparison": [{join(comparison, ", ")}] |
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
187 }' |
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
188 comparisonblock = '\{ |
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
189 "lines": [{join(lines, ", ")}] |
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
190 }' |
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
191 comparisonline = '\{ |
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
192 "t": {type|json}, |
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
193 "ln": {leftlineno|json}, |
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
194 "ll": {leftline|json}, |
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
195 "rn": {rightlineno|json}, |
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
196 "rl": {rightline|json} |
84859415a4c9
json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24713
diff
changeset
|
197 }' |
24715
1439bacf0ec7
json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24714
diff
changeset
|
198 fileannotate = '\{ |
1439bacf0ec7
json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24714
diff
changeset
|
199 "abspath": {file|json}, |
1439bacf0ec7
json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24714
diff
changeset
|
200 "node": {node|json}, |
28212
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
201 "author": {author|utf8|json}, |
24715
1439bacf0ec7
json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24714
diff
changeset
|
202 "date": {date|json}, |
28212
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
203 "desc": {desc|utf8|json}, |
24715
1439bacf0ec7
json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24714
diff
changeset
|
204 "parents": [{join(parent%changesetparent, ", ")}], |
1439bacf0ec7
json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24714
diff
changeset
|
205 "children": [{join(child%changesetparent, ", ")}], |
1439bacf0ec7
json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24714
diff
changeset
|
206 "permissions": {permissions|json}, |
1439bacf0ec7
json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24714
diff
changeset
|
207 "annotate": [{join(annotate%fileannotation, ", ")}] |
1439bacf0ec7
json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24714
diff
changeset
|
208 }' |
1439bacf0ec7
json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24714
diff
changeset
|
209 fileannotation = '\{ |
1439bacf0ec7
json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24714
diff
changeset
|
210 "node": {node|json}, |
28212
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
211 "author": {author|utf8|json}, |
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
212 "desc": {desc|utf8|json}, |
24715
1439bacf0ec7
json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24714
diff
changeset
|
213 "abspath": {file|json}, |
1439bacf0ec7
json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24714
diff
changeset
|
214 "targetline": {targetline|json}, |
1439bacf0ec7
json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24714
diff
changeset
|
215 "line": {line|json}, |
1439bacf0ec7
json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24714
diff
changeset
|
216 "lineno": {lineno|json}, |
1439bacf0ec7
json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24714
diff
changeset
|
217 "revdate": {revdate|json} |
1439bacf0ec7
json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24714
diff
changeset
|
218 }' |
29380
c1b526f55116
templates: add support for filelog webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
28709
diff
changeset
|
219 filelog = '\{ |
c1b526f55116
templates: add support for filelog webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
28709
diff
changeset
|
220 "entries": [{join(entries%changelistentry, ", ")}] |
c1b526f55116
templates: add support for filelog webcommand in json style
Laura Médioni <laura.medioni@logilab.fr>
parents:
28709
diff
changeset
|
221 }' |
24590
0bb733dfcabe
json: implement {helptopics} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24589
diff
changeset
|
222 helptopics = '\{ |
0bb733dfcabe
json: implement {helptopics} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24589
diff
changeset
|
223 "topics": [{join(topics%helptopicentry, ", ")}], |
0bb733dfcabe
json: implement {helptopics} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24589
diff
changeset
|
224 "earlycommands": [{join(earlycommands%helptopicentry, ", ")}], |
0bb733dfcabe
json: implement {helptopics} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24589
diff
changeset
|
225 "othercommands": [{join(othercommands%helptopicentry, ", ")}] |
0bb733dfcabe
json: implement {helptopics} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24589
diff
changeset
|
226 }' |
0bb733dfcabe
json: implement {helptopics} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24589
diff
changeset
|
227 helptopicentry = '\{ |
28212
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
228 "topic": {topic|utf8|json}, |
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
229 "summary": {summary|utf8|json} |
24590
0bb733dfcabe
json: implement {helptopics} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24589
diff
changeset
|
230 }' |
24591
517f3e190a5d
json: implement {help} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24590
diff
changeset
|
231 help = '\{ |
28212
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
232 "topic": {topic|utf8|json}, |
d4419c01532b
templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents:
24715
diff
changeset
|
233 "rawdoc": {doc|utf8|json} |
24591
517f3e190a5d
json: implement {help} template
Gregory Szorc <gregory.szorc@gmail.com>
parents:
24590
diff
changeset
|
234 }' |
43717
6feaee05bac5
hgweb: add files to the json changeset template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
39469
diff
changeset
|
235 filenodelink = '\{ |
6feaee05bac5
hgweb: add files to the json changeset template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
39469
diff
changeset
|
236 "file": {file|json}, |
6feaee05bac5
hgweb: add files to the json changeset template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
39469
diff
changeset
|
237 "status": {status|json} |
6feaee05bac5
hgweb: add files to the json changeset template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
39469
diff
changeset
|
238 }' |
6feaee05bac5
hgweb: add files to the json changeset template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
39469
diff
changeset
|
239 filenolink = '{filenodelink}' |
28268
3643b66d7f71
hgweb: add index template to json/map
Anton Shestakov <av6@dwimlabs.net>
parents:
28212
diff
changeset
|
240 index = '\{ |
3643b66d7f71
hgweb: add index template to json/map
Anton Shestakov <av6@dwimlabs.net>
parents:
28212
diff
changeset
|
241 "entries": [{join(entries%indexentry, ", ")}] |
3643b66d7f71
hgweb: add index template to json/map
Anton Shestakov <av6@dwimlabs.net>
parents:
28212
diff
changeset
|
242 }' |
3643b66d7f71
hgweb: add index template to json/map
Anton Shestakov <av6@dwimlabs.net>
parents:
28212
diff
changeset
|
243 indexentry = '\{ |
3643b66d7f71
hgweb: add index template to json/map
Anton Shestakov <av6@dwimlabs.net>
parents:
28212
diff
changeset
|
244 "name": {name|utf8|json}, |
3643b66d7f71
hgweb: add index template to json/map
Anton Shestakov <av6@dwimlabs.net>
parents:
28212
diff
changeset
|
245 "description": {description|utf8|json}, |
3643b66d7f71
hgweb: add index template to json/map
Anton Shestakov <av6@dwimlabs.net>
parents:
28212
diff
changeset
|
246 "contact": {contact|utf8|json}, |
29471
c4fc33c477da
hgweb: expose list of per-repo labels to templates
Gregory Szorc <gregory.szorc@gmail.com>
parents:
29458
diff
changeset
|
247 "lastchange": {lastchange|json}, |
c4fc33c477da
hgweb: expose list of per-repo labels to templates
Gregory Szorc <gregory.szorc@gmail.com>
parents:
29458
diff
changeset
|
248 "labels": {labels|json} |
28268
3643b66d7f71
hgweb: add index template to json/map
Anton Shestakov <av6@dwimlabs.net>
parents:
28212
diff
changeset
|
249 }' |
39469
1a786fe069b8
hgweb: add error template to json so it won't crash
Yuya Nishihara <yuya@tcha.org>
parents:
39468
diff
changeset
|
250 error = '\{ |
1a786fe069b8
hgweb: add error template to json so it won't crash
Yuya Nishihara <yuya@tcha.org>
parents:
39468
diff
changeset
|
251 "error": {error|utf8|json} |
1a786fe069b8
hgweb: add error template to json so it won't crash
Yuya Nishihara <yuya@tcha.org>
parents:
39468
diff
changeset
|
252 }' |