hgmo: Cap at 500 revisions in automationrelevancewebcommand (
bug 1303904)
MozReview-Commit-ID: P9oIAxzYKX
--- a/hgext/hgmo/__init__.py
+++ b/hgext/hgmo/__init__.py
@@ -428,16 +428,18 @@ def automationrelevancewebcommand(web, r
])
csets = []
# Query an unfiltered repo because sometimes automation wants to run against
# changesets that have since become hidden. The response exposes whether the
# requested node is visible, so consumers can make intelligent decisions
# about what to do if the changeset isn't visible.
for ctx in repo.unfiltered().set('automationrelevant(%r)', req.form['node'][0]):
+ if len(csets) > 500:
+ break;
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())