--- a/hgext/hgmo/__init__.py
+++ b/hgext/hgmo/__init__.py
@@ -371,16 +371,21 @@ def automationrelevancewebcommand(web, r
entry = webutil.changelistentry(web, ctx, tmpl)
# Some items in changelistentry are generators, which json.dumps()
# can't handle. So we expand them.
for k, v in entry.items():
# "files" is a generator that attempts to call a template.
# Don't even bother and just repopulate it.
if k == 'files':
entry['files'] = sorted(ctx.files())
+ # These aren't interesting to us, so prune them. The
+ # original impetus for this was because "changelogtag"
+ # isn't part of the json template and adding it is non-trivial.
+ elif k in ('bookmarks', 'branches', 'changelogtag', 'child', 'inbranch', 'tags'):
+ del entry[k]
elif isinstance(v, types.GeneratorType):
entry[k] = list(v)
csets.append(entry)
req.respond(HTTP_OK, 'application/json')
return json.dumps({'changesets': csets}, indent=2, sort_keys=True)
--- a/hgext/hgmo/tests/test-automationrelevant.t
+++ b/hgext/hgmo/tests/test-automationrelevant.t
@@ -107,128 +107,176 @@ Previous push base to draft should add i
1 push 1 commit 1
2 push 1 commit 2
3 push 2 commit 1
4 push 2 commit 2
5 push 2 commit 3
web command for exposing automation relevance works
- $ http http://localhost:$HGPORT/json-automationrelevance/3 --header content-type
+ $ http http://localhost:$HGPORT/json-automationrelevance/tip --header content-type
200
content-type: application/json
{
"changesets": [
{
"author": "test",
"backsoutnodes": [],
- "bookmarks": [],
- "branches": [],
"bugs": [],
- "changelogtag": [],
- "child": [],
"date": [
0.0,
0
],
"desc": "push 1 commit 1",
"extra": {
"branch": "default"
},
"files": [
"foo"
],
- "inbranch": [],
"node": "0a971221ac36075c184743cba0490681eadca983",
"parent": [],
"pushdate": [
\d+, (re)
0
],
"pushhead": "cb5c79007e91b09a4ba7ebe9210311491d09e96e",
"pushid": 2,
"pushnodes": [
"0a971221ac36075c184743cba0490681eadca983",
"cb5c79007e91b09a4ba7ebe9210311491d09e96e"
],
"pushuser": "testuser",
"rev": 1,
- "reviewers": [],
- "tags": []
+ "reviewers": []
},
{
"author": "test",
"backsoutnodes": [],
- "bookmarks": [],
- "branches": [],
"bugs": [],
- "changelogtag": [],
- "child": [],
"date": [
0.0,
0
],
"desc": "push 1 commit 2",
"extra": {
"branch": "default"
},
"files": [
"foo"
],
- "inbranch": [],
"node": "cb5c79007e91b09a4ba7ebe9210311491d09e96e",
"parent": [],
"pushdate": [
\d+, (re)
0
],
"pushhead": "cb5c79007e91b09a4ba7ebe9210311491d09e96e",
"pushid": 2,
"pushnodes": [
"0a971221ac36075c184743cba0490681eadca983",
"cb5c79007e91b09a4ba7ebe9210311491d09e96e"
],
"pushuser": "testuser",
"rev": 2,
- "reviewers": [],
- "tags": []
+ "reviewers": []
},
{
"author": "test",
"backsoutnodes": [],
- "bookmarks": [],
- "branches": [],
"bugs": [],
- "changelogtag": [],
- "child": [],
"date": [
0.0,
0
],
"desc": "push 2 commit 1",
"extra": {
"branch": "default"
},
"files": [
"foo"
],
- "inbranch": [],
"node": "13855aae8fb3291c663ff46a8510c0e3fa673a4c",
"parent": [],
"pushdate": [
\d+, (re)
0
],
"pushhead": "5d04c4fd236c19e241d1587e120b39840344eee8",
"pushid": 3,
"pushnodes": [
"13855aae8fb3291c663ff46a8510c0e3fa673a4c",
"66a66c6c6ae312ec88240754300468a6cea8f71d",
"5d04c4fd236c19e241d1587e120b39840344eee8"
],
"pushuser": "testuser",
"rev": 3,
- "reviewers": [],
- "tags": []
+ "reviewers": []
+ },
+ {
+ "author": "test",
+ "backsoutnodes": [],
+ "bugs": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "push 2 commit 2",
+ "extra": {
+ "branch": "default"
+ },
+ "files": [
+ "foo"
+ ],
+ "node": "66a66c6c6ae312ec88240754300468a6cea8f71d",
+ "parent": [],
+ "pushdate": [
+ \d+, (re)
+ 0
+ ],
+ "pushhead": "5d04c4fd236c19e241d1587e120b39840344eee8",
+ "pushid": 3,
+ "pushnodes": [
+ "13855aae8fb3291c663ff46a8510c0e3fa673a4c",
+ "66a66c6c6ae312ec88240754300468a6cea8f71d",
+ "5d04c4fd236c19e241d1587e120b39840344eee8"
+ ],
+ "pushuser": "testuser",
+ "rev": 4,
+ "reviewers": []
+ },
+ {
+ "author": "test",
+ "backsoutnodes": [],
+ "bugs": [],
+ "date": [
+ 0.0,
+ 0
+ ],
+ "desc": "push 2 commit 3",
+ "extra": {
+ "branch": "default"
+ },
+ "files": [
+ "foo"
+ ],
+ "node": "5d04c4fd236c19e241d1587e120b39840344eee8",
+ "parent": [],
+ "pushdate": [
+ \d+, (re)
+ 0
+ ],
+ "pushhead": "5d04c4fd236c19e241d1587e120b39840344eee8",
+ "pushid": 3,
+ "pushnodes": [
+ "13855aae8fb3291c663ff46a8510c0e3fa673a4c",
+ "66a66c6c6ae312ec88240754300468a6cea8f71d",
+ "5d04c4fd236c19e241d1587e120b39840344eee8"
+ ],
+ "pushuser": "testuser",
+ "rev": 5,
+ "reviewers": []
}
]
}
+
+ $ cat error.log