Mercurial > hg
annotate tests/crashgetbundler.py @ 49798:a51328ba33ca
ui: split the `default` arg out of **kwargs for the internal prompt method
This arg was required anyway, based on how it was accessed. Having it separate
allows it to be typed though, and this will simplify things for the callers- if
a non-None `default` is passed, the return can never be None. That can be
expressed with `@overload` when the arg can be typed, but that's not possible
when it is rolled up in **kwargs.
The default value is simply copied from the public `prompt()` above it.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 12 Dec 2022 14:17:05 -0500 |
parents | 6000f5b25c9b |
children |
rev | line source |
---|---|
30914
f3807a135e43
wireproto: properly report server Abort during 'getbundle'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
1 from mercurial.i18n import _ |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
30914
diff
changeset
|
2 from mercurial import changegroup, error, extensions |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
30914
diff
changeset
|
3 |
30914
f3807a135e43
wireproto: properly report server Abort during 'getbundle'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
4 |
f3807a135e43
wireproto: properly report server Abort during 'getbundle'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
5 def abort(orig, *args, **kwargs): |
f3807a135e43
wireproto: properly report server Abort during 'getbundle'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
6 raise error.Abort(_('this is an exercise')) |
f3807a135e43
wireproto: properly report server Abort during 'getbundle'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
7 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
30914
diff
changeset
|
8 |
30914
f3807a135e43
wireproto: properly report server Abort during 'getbundle'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
9 def uisetup(ui): |
f3807a135e43
wireproto: properly report server Abort during 'getbundle'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
10 extensions.wrapfunction(changegroup, 'getbundler', abort) |