Mercurial > hg
diff mercurial/templates/json/map @ 24589:30a737ae9b7d
json: implement {manifest} template
Property naming was borrowed from `hg files -Tjson`.
We omit branch because, again, representation of branches in this
template is wonky.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 01 Apr 2015 22:04:03 -0700 |
parents | 0bf54479a9eb |
children | 0bb733dfcabe |
line wrap: on
line diff
--- a/mercurial/templates/json/map Tue Mar 31 22:53:48 2015 -0700 +++ b/mercurial/templates/json/map Wed Apr 01 22:04:03 2015 -0700 @@ -29,7 +29,27 @@ changesetbookmark = '{bookmark|json}' changesettag = '{tag|json}' changesetparent = '{node|json}' -manifest = '"not yet implemented"' +manifest = '\{ + "node": {node|json}, + "abspath": {path|json}, + "directories": [{join(dentries%direntry, ", ")}], + "files": [{join(fentries%fileentry, ", ")}], + "bookmarks": [{join(bookmarks%name, ", ")}], + "tags": [{join(tags%name, ", ")}] + }' +name = '{name|json}' +direntry = '\{ + "abspath": {path|json}, + "basename": {basename|json}, + "emptydirs": {emptydirs|json} + }' +fileentry = '\{ + "abspath": {file|json}, + "basename": {basename|json}, + "date": {date|json}, + "size": {size|json}, + "flags": {permissions|json} + }' tags = '\{ "node": {node|json}, "tags": [{join(entriesnotip%tagentry, ", ")}]