mercurial/templates/json/map
author Anton Shestakov <av6@dwimlabs.net>
Sat, 27 Feb 2016 19:53:18 +0800
changeset 28268 3643b66d7f71
parent 28212 d4419c01532b
child 28709 94494031f659
permissions -rw-r--r--
hgweb: add index template to json/map This template allows showing the list of all repos in an hgweb instance (in hgwebdir mode) as json. The test has "lastchange" globbed because hgweb uses here file modification time and not the last commit time.
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'
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},
28212
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
    11
  "desc": {desc|utf8|json},
24588
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, ", ")}],
28212
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
    14
  "user": {author|utf8|json}
24588
0bf54479a9eb json: implement {shortlog} and {changelog} templates
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24564
diff changeset
    15
  }'
28212
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
    16
changelistentryname = '{name|utf8|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},
28212
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
    20
  "desc": {desc|utf8|json},
24563
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, ", ")}],
28212
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
    24
  "user": {author|utf8|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
  }'
28212
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
    28
changesetbranch = '{name|utf8|json}'
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
    29
changesetbookmark = '{bookmark|utf8|json}'
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
    30
changesettag = '{tag|utf8|json}'
24563
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
  }'
28212
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
    40
name = '{name|utf8|json}'
24589
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 = '\{
28212
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
    58
  "tag": {tag|utf8|json},
24545
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 = '\{
28212
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
    67
  "bookmark": {bookmark|utf8|json},
24546
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 = '\{
28212
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
    75
  "branch": {branch|utf8|json},
24547
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"'
24713
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
    81
filediff = '\{
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
    82
  "path": {file|json},
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
    83
  "node": {node|json},
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
    84
  "date": {date|json},
28212
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
    85
  "desc": {desc|utf8|json},
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
    86
  "author": {author|utf8|json},
24713
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
    87
  "parents": [{join(parent%changesetparent, ", ")}],
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
    88
  "children": [{join(child%changesetparent, ", ")}],
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
    89
  "diff": [{join(diff%diffblock, ", ")}]
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
    90
  }'
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
    91
diffblock = '\{
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
    92
  "blockno": {blockno|json},
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
    93
  "lines": [{join(lines, ", ")}]
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
    94
  }'
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
    95
difflineplus = '\{
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
    96
  "t": "+",
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
    97
  "n": {lineno|json},
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
    98
  "l": {line|json}
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
    99
  }'
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
   100
difflineminus = '\{
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
   101
  "t": "-",
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
   102
  "n": {lineno|json},
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
   103
  "l": {line|json}
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
   104
  }'
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
   105
difflineat = '\{
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
   106
  "t": "@",
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
   107
  "n": {lineno|json},
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
   108
  "l": {line|json}
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
   109
  }'
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
   110
diffline = '\{
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
   111
  "t": "",
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
   112
  "n": {lineno|json},
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
   113
  "l": {line|json}
2f43f8cf8219 json: implement {filediff} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24591
diff changeset
   114
  }'
24714
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   115
filecomparison = '\{
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   116
  "path": {file|json},
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   117
  "node": {node|json},
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   118
  "date": {date|json},
28212
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
   119
  "desc": {desc|utf8|json},
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
   120
  "author": {author|utf8|json},
24714
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   121
  "parents": [{join(parent%changesetparent, ", ")}],
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   122
  "children": [{join(child%changesetparent, ", ")}],
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   123
  "leftnode": {leftnode|json},
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   124
  "rightnode": {rightnode|json},
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   125
  "comparison": [{join(comparison, ", ")}]
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   126
  }'
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   127
comparisonblock = '\{
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   128
  "lines": [{join(lines, ", ")}]
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   129
  }'
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   130
comparisonline = '\{
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   131
  "t": {type|json},
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   132
  "ln": {leftlineno|json},
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   133
  "ll": {leftline|json},
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   134
  "rn": {rightlineno|json},
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   135
  "rl": {rightline|json}
84859415a4c9 json: implement {comparison} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24713
diff changeset
   136
  }'
24715
1439bacf0ec7 json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24714
diff changeset
   137
fileannotate = '\{
1439bacf0ec7 json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24714
diff changeset
   138
  "abspath": {file|json},
1439bacf0ec7 json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24714
diff changeset
   139
  "node": {node|json},
28212
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
   140
  "author": {author|utf8|json},
24715
1439bacf0ec7 json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24714
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},
24715
1439bacf0ec7 json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24714
diff changeset
   143
  "parents": [{join(parent%changesetparent, ", ")}],
1439bacf0ec7 json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24714
diff changeset
   144
  "children": [{join(child%changesetparent, ", ")}],
1439bacf0ec7 json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24714
diff changeset
   145
  "permissions": {permissions|json},
1439bacf0ec7 json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24714
diff changeset
   146
  "annotate": [{join(annotate%fileannotation, ", ")}]
1439bacf0ec7 json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24714
diff changeset
   147
  }'
1439bacf0ec7 json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24714
diff changeset
   148
fileannotation = '\{
1439bacf0ec7 json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24714
diff changeset
   149
  "node": {node|json},
28212
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
   150
  "author": {author|utf8|json},
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
   151
  "desc": {desc|utf8|json},
24715
1439bacf0ec7 json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24714
diff changeset
   152
  "abspath": {file|json},
1439bacf0ec7 json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24714
diff changeset
   153
  "targetline": {targetline|json},
1439bacf0ec7 json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24714
diff changeset
   154
  "line": {line|json},
1439bacf0ec7 json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24714
diff changeset
   155
  "lineno": {lineno|json},
1439bacf0ec7 json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24714
diff changeset
   156
  "revdate": {revdate|json}
1439bacf0ec7 json: implement {fileannotate} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24714
diff changeset
   157
  }'
24544
71e96b9fd3fd templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   158
filelog = '"not yet implemented"'
71e96b9fd3fd templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   159
graph = '"not yet implemented"'
24590
0bb733dfcabe json: implement {helptopics} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24589
diff changeset
   160
helptopics = '\{
0bb733dfcabe json: implement {helptopics} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24589
diff changeset
   161
  "topics": [{join(topics%helptopicentry, ", ")}],
0bb733dfcabe json: implement {helptopics} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24589
diff changeset
   162
  "earlycommands": [{join(earlycommands%helptopicentry, ", ")}],
0bb733dfcabe json: implement {helptopics} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24589
diff changeset
   163
  "othercommands": [{join(othercommands%helptopicentry, ", ")}]
0bb733dfcabe json: implement {helptopics} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24589
diff changeset
   164
  }'
0bb733dfcabe json: implement {helptopics} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24589
diff changeset
   165
helptopicentry = '\{
28212
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
   166
  "topic": {topic|utf8|json},
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
   167
  "summary": {summary|utf8|json}
24590
0bb733dfcabe json: implement {helptopics} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24589
diff changeset
   168
  }'
24591
517f3e190a5d json: implement {help} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24590
diff changeset
   169
help = '\{
28212
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
   170
  "topic": {topic|utf8|json},
d4419c01532b templatefilters: make json filter be byte-transparent (BC) (issue4926)
Yuya Nishihara <yuya@tcha.org>
parents: 24715
diff changeset
   171
  "rawdoc": {doc|utf8|json}
24591
517f3e190a5d json: implement {help} template
Gregory Szorc <gregory.szorc@gmail.com>
parents: 24590
diff changeset
   172
  }'
24544
71e96b9fd3fd templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   173
filenodelink = ''
71e96b9fd3fd templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   174
filenolink = ''
28268
3643b66d7f71 hgweb: add index template to json/map
Anton Shestakov <av6@dwimlabs.net>
parents: 28212
diff changeset
   175
index = '\{
3643b66d7f71 hgweb: add index template to json/map
Anton Shestakov <av6@dwimlabs.net>
parents: 28212
diff changeset
   176
  "entries": [{join(entries%indexentry, ", ")}]
3643b66d7f71 hgweb: add index template to json/map
Anton Shestakov <av6@dwimlabs.net>
parents: 28212
diff changeset
   177
  }'
3643b66d7f71 hgweb: add index template to json/map
Anton Shestakov <av6@dwimlabs.net>
parents: 28212
diff changeset
   178
indexentry = '\{
3643b66d7f71 hgweb: add index template to json/map
Anton Shestakov <av6@dwimlabs.net>
parents: 28212
diff changeset
   179
  "name": {name|utf8|json},
3643b66d7f71 hgweb: add index template to json/map
Anton Shestakov <av6@dwimlabs.net>
parents: 28212
diff changeset
   180
  "description": {description|utf8|json},
3643b66d7f71 hgweb: add index template to json/map
Anton Shestakov <av6@dwimlabs.net>
parents: 28212
diff changeset
   181
  "contact": {contact|utf8|json},
3643b66d7f71 hgweb: add index template to json/map
Anton Shestakov <av6@dwimlabs.net>
parents: 28212
diff changeset
   182
  "lastchange": {lastchange|json}
3643b66d7f71 hgweb: add index template to json/map
Anton Shestakov <av6@dwimlabs.net>
parents: 28212
diff changeset
   183
  }'