Rename default branch to ‘main’
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
285a946a1f
commit
53e59c8c09
13 changed files with 39 additions and 39 deletions
|
@ -38,7 +38,7 @@ class IRCBot(irc.bot.SingleServerIRCBot):
|
|||
|
||||
def connect(self, *args: Any, **kwargs: Any) -> None:
|
||||
# Taken from
|
||||
# https://github.com/jaraco/irc/blob/master/irc/client_aio.py,
|
||||
# https://github.com/jaraco/irc/blob/main/irc/client_aio.py,
|
||||
# in particular the method of AioSimpleIRCClient
|
||||
self.c = self.reactor.loop.run_until_complete(self.connection.connect(*args, **kwargs))
|
||||
print("Listening now. Please send an IRC message to verify operation")
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
# stdin in the form
|
||||
# <oldrev> <newrev> <refname>
|
||||
# For example:
|
||||
# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master
|
||||
# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/main
|
||||
|
||||
import os
|
||||
import os.path
|
||||
|
|
|
@ -19,12 +19,12 @@ ZULIP_API_KEY = "0123456789abcdef0123456789abcdef"
|
|||
# Returns a dictionary encoding the stream and subject to send the
|
||||
# notification to (or None to send no notification).
|
||||
#
|
||||
# The default code below will send every commit pushed to "master" to
|
||||
# The default code below will send every commit pushed to "main" to
|
||||
# * stream "commits"
|
||||
# * topic "master"
|
||||
# * topic "main"
|
||||
# And similarly for branch "test-post-receive" (for use when testing).
|
||||
def commit_notice_destination(repo: str, branch: str, commit: str) -> Optional[Dict[str, str]]:
|
||||
if branch in ["master", "test-post-receive"]:
|
||||
if branch in ["main", "test-post-receive"]:
|
||||
return dict(stream=STREAM_NAME, subject=f"{branch}")
|
||||
|
||||
# Return None for cases where you don't want a notice sent
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# Zulip hook for Mercurial changeset pushes.
|
||||
#
|
||||
# This hook is called when changesets are pushed to the master repository (ie
|
||||
# This hook is called when changesets are pushed to the default repository (ie
|
||||
# `hg push`). See https://zulip.com/integrations for installation instructions.
|
||||
|
||||
import sys
|
||||
|
@ -23,7 +23,7 @@ def format_summary_line(
|
|||
information about the changeset and links to the changelog if a
|
||||
web URL has been configured:
|
||||
|
||||
Jane Doe <jane@example.com> pushed 1 commit to master (170:e494a5be3393):
|
||||
Jane Doe <jane@example.com> pushed 1 commit to default (170:e494a5be3393):
|
||||
"""
|
||||
revcount = tip - base
|
||||
plural = "s" if revcount > 1 else ""
|
||||
|
|
|
@ -28,7 +28,7 @@ client = zulip.Client(
|
|||
def get_deployment_details() -> Dict[str, str]:
|
||||
# "gear deployments" output example:
|
||||
# Activation time - Deployment ID - Git Ref - Git SHA1
|
||||
# 2017-01-07 15:40:30 -0500 - 9e2b7143 - master - b9ce57c - ACTIVE
|
||||
# 2017-01-07 15:40:30 -0500 - 9e2b7143 - main - b9ce57c - ACTIVE
|
||||
dep = subprocess.check_output(["gear", "deployments"], universal_newlines=True).splitlines()[1]
|
||||
splits = dep.split(" - ")
|
||||
|
||||
|
|
|
@ -15,12 +15,12 @@ ZULIP_API_KEY = "0123456789abcdef0123456789abcdef"
|
|||
# Returns a dictionary encoding the stream and subject to send the
|
||||
# notification to (or None to send no notification).
|
||||
#
|
||||
# The default code below will send every commit pushed to "master" to
|
||||
# The default code below will send every commit pushed to "main" to
|
||||
# * stream "deployments"
|
||||
# * topic "master"
|
||||
# * topic "main"
|
||||
# And similarly for branch "test-post-receive" (for use when testing).
|
||||
def deployment_notice_destination(branch: str) -> Optional[Dict[str, str]]:
|
||||
if branch in ["master", "test-post-receive"]:
|
||||
if branch in ["main", "master", "test-post-receive"]:
|
||||
return dict(stream="deployments", subject=f"{branch}")
|
||||
|
||||
# Return None for cases where you don't want a notice sent
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue