From 1c320cce178864b5a8f8ec7684029194379379ef Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 4 Dec 2013 16:15:49 -0500 Subject: [PATCH] api: Add support for setting site in mercurial integration. (imported from commit 697f4697af27be6f4eddd6ddbf7affbc8739cffe) --- integrations/hg/zulip-changegroup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/integrations/hg/zulip-changegroup.py b/integrations/hg/zulip-changegroup.py index 4dcc27f..32095be 100755 --- a/integrations/hg/zulip-changegroup.py +++ b/integrations/hg/zulip-changegroup.py @@ -80,12 +80,13 @@ def format_commit_lines(web_url, repo, base, tip): return "\n".join(summary for summary in commit_summaries) -def send_zulip(email, api_key, stream, subject, content): +def send_zulip(email, api_key, site, stream, subject, content): """ Send a message to Zulip using the provided credentials, which should be for a bot in most cases. """ client = zulip.Client(email=email, api_key=api_key, + site=site, client="mercurial " + VERSION) message_data = { @@ -144,6 +145,7 @@ def hook(ui, repo, **kwargs): email = get_config(ui, "email") api_key = get_config(ui, "api_key") + site = get_config(ui, "site") if not (email and api_key): ui.warn("Zulip: missing email or api_key configurations\n") @@ -165,4 +167,4 @@ def hook(ui, repo, **kwargs): ui.debug("Sending to Zulip:\n") ui.debug(content + "\n") - send_zulip(email, api_key, stream, subject, content) + send_zulip(email, api_key, site, stream, subject, content)