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