Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 36983:a82fc3922446
hgweb: convert an assert to a ProgrammingError
Because assert may get optimized away.
Differential Revision: https://phab.mercurial-scm.org/D2882
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 16 Mar 2018 12:10:15 -0700 |
parents | 4daa22071d5d |
children | c97b936d8bb5 |
comparison
equal
deleted
inserted
replaced
36982:a4a95bd7158d | 36983:a82fc3922446 |
---|---|
1193 | 1193 |
1194 if encoding: | 1194 if encoding: |
1195 web.res.headers['Content-Encoding'] = encoding | 1195 web.res.headers['Content-Encoding'] = encoding |
1196 | 1196 |
1197 web.res.setbodywillwrite() | 1197 web.res.setbodywillwrite() |
1198 assert list(web.res.sendresponse()) == [] | 1198 if list(web.res.sendresponse()): |
1199 raise error.ProgrammingError('sendresponse() should not emit data ' | |
1200 'if writing later') | |
1199 | 1201 |
1200 bodyfh = web.res.getbodyfile() | 1202 bodyfh = web.res.getbodyfile() |
1201 | 1203 |
1202 archival.archive(web.repo, bodyfh, cnode, artype, prefix=name, | 1204 archival.archive(web.repo, bodyfh, cnode, artype, prefix=name, |
1203 matchfn=match, | 1205 matchfn=match, |