Bug 1251652 - Add pushdate, pushid and pushuser in json-changeset; r?gps
MozReview-Commit-ID: HBGHhSm2HIk
new file mode 100644
--- /dev/null
+++ b/hgext/hgmo/tests/test-json-changeset.t
@@ -0,0 +1,55 @@
+ $ export USER=hguser
+ $ . $TESTDIR/hgext/hgmo/tests/helpers.sh
+ $ startserver
+
+ $ hg -q clone http://localhost:$HGPORT client
+ $ cd client
+
+ $ echo initial > foo
+ $ hg -q commit -A -m 'Bug 271; r=calixte'
+ $ hg -q push
+ $ echo second > foo
+ $ cat > message << EOF
+ > Bug 828 - Do foo; r=calixte
+ >
+ > This is related to bug 182.
+ > EOF
+ $ hg commit -l message
+ $ hg -q push
+
+ $ echo third > foo
+ $ hg commit -m 'NO BUG'
+
+ $ hg -q push
+
+Last changeset
+
+ $ http http://localhost:$HGPORT/json-changeset/tip --header content-type --body-file body
+ 200
+ content-type: application/json
+
+ $ python -m json.tool < body
+ {
+ "bookmarks": [],
+ "branch": "default",
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "NO BUG",
+ "node": "c761ad6d27c96f72f7e4637789e967c3f9730255",
+ "parents": [
+ "ef0e7ae3b607356f580e6d7671abea63db849cc2"
+ ],
+ "phase": "public",
+ "pushdate": [
+ \d+, (re)
+ \d+ (re)
+ ],
+ "pushid": 3,
+ "pushuser": "hguser",
+ "tags": [
+ "tip"
+ ],
+ "user": "test"
+ }
--- a/hgtemplates/json/map
+++ b/hgtemplates/json/map
@@ -46,17 +46,20 @@ changeset = '\{
"node": {node|json},
"date": {date|json},
"desc": {desc|json},
"branch": {if(branch, branch%changesetbranch, "default"|json)},
"bookmarks": [{join(changesetbookmark, ", ")}],
"tags": [{join(changesettag, ", ")}],
"user": {author|json},
"parents": [{join(parent%changesetparent, ", ")}],
- "phase": {phase|json}
+ "phase": {phase|json},
+ "pushid": {pushid|json},
+ "pushdate": {pushdate|json},
+ "pushuser": {pushuser|json}
}'
changesetbranch = '{name|json}'
changesetbookmark = '{bookmark|json}'
changesettag = '{tag|json}'
changesetparent = '{node|json}'
manifest = '\{
"node": {node|json},
"abspath": {path|json},