mypy: Amend hg integration to simplify error handling/typing.
This commit is contained in:
parent
d26e44ebb2
commit
55df1886cc
|
@ -106,12 +106,13 @@ def send_zulip(email, api_key, site, stream, subject, content):
|
||||||
client.send_message(message_data)
|
client.send_message(message_data)
|
||||||
|
|
||||||
def get_config(ui, item):
|
def get_config(ui, item):
|
||||||
# type: (ui, str) -> Optional[str]
|
# type: (ui, str) -> str
|
||||||
try:
|
try:
|
||||||
# configlist returns everything in lists.
|
# configlist returns everything in lists.
|
||||||
return ui.configlist('zulip', item)[0]
|
return ui.configlist('zulip', item)[0]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
return None
|
ui.warn("Zulip: Could not find required item {} in hg config.".format(item))
|
||||||
|
exit(1)
|
||||||
|
|
||||||
def hook(ui, repo, **kwargs):
|
def hook(ui, repo, **kwargs):
|
||||||
# type: (ui, repo, **Text) -> None
|
# type: (ui, repo, **Text) -> None
|
||||||
|
|
Loading…
Reference in a new issue