hgmo: Cap at 500 revisions in automationrelevancewebcommand (bug 1303904) draft
authorWes Kocher <wkocher@mozilla.com>
Mon, 06 Mar 2017 17:46:49 -0800
changeset 10465 04ab3745b1ee08b2ba4ea1a247ad7dac370a1da7
parent 10464 af22feb5fc62144402688776cfdd6ec5e50d2dda
push id1551
push userkwierso@gmail.com
push dateTue, 07 Mar 2017 01:46:57 +0000
bugs1303904
hgmo: Cap at 500 revisions in automationrelevancewebcommand (bug 1303904) MozReview-Commit-ID: P9oIAxzYKX
hgext/hgmo/__init__.py
--- 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())