diff tests/crashgetbundler.py @ 30876:f3807a135e43 stable

wireproto: properly report server Abort during 'getbundle' Previously Abort raised during 'getbundle' call poorly reported (HTTP-500 for http, some scary messages for ssh). Abort error have been properly reported for "push" for a long time, there is not reason to be different for 'getbundle'. We properly catch such error and report them back the best way available. For bundle, we issue a valid bundle2 reply (as expected by the client) with an 'error:abort' part. With bundle1 we do as best as we can depending of http or ssh.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Fri, 10 Feb 2017 18:20:58 +0100
parents
children 2372284d9457
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/crashgetbundler.py	Fri Feb 10 18:20:58 2017 +0100
@@ -0,0 +1,14 @@
+from __future__ import absolute_import
+
+from mercurial.i18n import _
+from mercurial import (
+        changegroup,
+        error,
+        extensions
+    )
+
+def abort(orig, *args, **kwargs):
+    raise error.Abort(_('this is an exercise'))
+
+def uisetup(ui):
+    extensions.wrapfunction(changegroup, 'getbundler', abort)