mirror of
https://github.com/facebook/sapling.git
synced 2025-01-07 14:10:42 +03:00
43b1ef004c
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.
15 lines
317 B
Python
15 lines
317 B
Python
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)
|