diff --git a/.github/workflows/zulip-tests.yml b/.github/workflows/zulip-tests.yml index 8efb124..cb73728 100644 --- a/.github/workflows/zulip-tests.yml +++ b/.github/workflows/zulip-tests.yml @@ -3,7 +3,7 @@ name: build on: push: branches: - - master + - main pull_request: jobs: diff --git a/README.md b/README.md index 6f01bf7..cb296cb 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Zulip API -[![Build status](https://github.com/zulip/python-zulip-api/workflows/build/badge.svg?branch=master)]( -https://github.com/zulip/python-zulip-api/actions?query=branch%3Amaster+workflow%3Abuild) -[![Coverage status](https://img.shields.io/codecov/c/github/zulip/python-zulip-api/master.svg)]( +[![Build status](https://github.com/zulip/python-zulip-api/workflows/build/badge.svg)]( +https://github.com/zulip/python-zulip-api/actions?query=branch%3Amain+workflow%3Abuild) +[![Coverage status](https://img.shields.io/codecov/c/github/zulip/python-zulip-api)]( https://codecov.io/gh/zulip/python-zulip-api) This repository contains the source code for Zulip's PyPI packages: diff --git a/tools/clean-branches b/tools/clean-branches index 915491b..780f156 100755 --- a/tools/clean-branches +++ b/tools/clean-branches @@ -2,9 +2,9 @@ set -e # usage: clean-branches -# Deletes any local branches which are ancestors of origin/master, +# Deletes any local branches which are ancestors of origin/main, # and also any branches in origin which are ancestors of -# origin/master and are named like $USER-*. +# origin/main and are named like $USER-*. # usage: clean-branches --reviews # Deletes all the above mentioned branches as well as branches @@ -18,13 +18,13 @@ fi push_args=() function is_merged { - ! git rev-list -n 1 origin/master.."$1" | grep -q . + ! git rev-list -n 1 origin/main.."$1" | grep -q . } function clean_ref { ref="$1" case "$ref" in - */master | */HEAD) + */main | */HEAD) return ;; @@ -56,8 +56,8 @@ function clean_ref { esac } -if [ "$(git symbolic-ref HEAD)" != 'refs/heads/master' ]; then - echo "Check out master before you run this script." >&2 +if [ "$(git symbolic-ref HEAD)" != 'refs/heads/main' ]; then + echo "Check out main before you run this script." >&2 exit 1 fi diff --git a/tools/deploy-branch b/tools/deploy-branch index 4755f2c..a3838dc 100755 --- a/tools/deploy-branch +++ b/tools/deploy-branch @@ -17,7 +17,7 @@ branch_ref=$(git rev-list --max-count=1 "$branch") [ $? -ne 0 ] && error_out "Unknown branch: $branch" if [ "$old_ref" == "$branch_ref" ]; then - new_ref=master + new_ref=main else ref_name=$(git describe --all --exact "$old_ref") if [ $? -eq 0 ]; then @@ -31,12 +31,12 @@ fi git fetch -p -git rebase origin/master "$branch" -[ $? -ne 0 ] && error_out "Rebase onto origin/master failed" +git rebase origin/main "$branch" +[ $? -ne 0 ] && error_out "Rebase onto origin/main failed" -git push . HEAD:master -git push origin master -[ $? -ne 0 ] && error_out "Push of master to origin/master failed" +git push . HEAD:main +git push origin main +[ $? -ne 0 ] && error_out "Push of main to origin/main failed" git checkout "$new_ref" git branch -D "$branch" diff --git a/tools/fetch-rebase-pull-request b/tools/fetch-rebase-pull-request index ab3fec3..5d9df65 100755 --- a/tools/fetch-rebase-pull-request +++ b/tools/fetch-rebase-pull-request @@ -12,6 +12,6 @@ fi request_id="$1" remote=${2:-"upstream"} git fetch "$remote" "pull/$request_id/head" -git checkout -B "review-${request_id}" $remote/master +git checkout -B "review-${request_id}" $remote/main git reset --hard FETCH_HEAD git pull --rebase diff --git a/tools/lint-commits b/tools/lint-commits index 87698b6..5de2586 100755 --- a/tools/lint-commits +++ b/tools/lint-commits @@ -4,7 +4,7 @@ # Edited at Line 14 Col 97 (zulip -> python-zulip-api) # Please don't edit here; instead update the zulip/zulip copy and then resync this file. -# Lint all commit messages that are newer than upstream/master if running +# Lint all commit messages that are newer than upstream/main if running # locally or the commits in the push or PR Gh-Actions. # The rules can be found in /.gitlint @@ -16,9 +16,9 @@ $(git remote -v) " =~ ' '([^[:space:]]*)[[:space:]]*(https://github\.com/|ssh://git@github\.com/|git@github\.com:)"$repository"(\.git|/)?\ \(fetch\)' ' ]]; then - range="${BASH_REMATCH[1]}/master..HEAD" + range="${BASH_REMATCH[1]}/main..HEAD" else - range="upstream/master..HEAD" + range="upstream/main..HEAD" fi commits=$(git log "$range" | wc -l) diff --git a/tools/review b/tools/review index cb28232..8dfd56d 100755 --- a/tools/review +++ b/tools/review @@ -32,21 +32,21 @@ def check_git_pristine() -> None: exit("Git is not pristine:\n" + output) -def ensure_on_clean_master() -> None: +def ensure_on_clean_main() -> None: branch = get_git_branch() - if branch != "master": + if branch != "main": exit(f"You are still on a feature branch: {branch}") check_git_pristine() - run("git fetch upstream master") - run("git rebase upstream/master") + run("git fetch upstream main") + run("git rebase upstream/main") def create_pull_branch(pull_id: int) -> None: run("git fetch upstream pull/%d/head" % (pull_id,)) run(f"git checkout -B review-{pull_id} FETCH_HEAD") - run("git rebase upstream/master") - run("git log upstream/master.. --oneline") - run("git diff upstream/master.. --name-status") + run("git rebase upstream/main") + run("git log upstream/main.. --oneline") + run("git diff upstream/main.. --name-status") print() print("PR: %d" % (pull_id,)) @@ -59,7 +59,7 @@ def review_pr() -> None: except Exception: exit("please provide an integer pull request id") - ensure_on_clean_master() + ensure_on_clean_main() create_pull_branch(pull_id) diff --git a/zulip/integrations/bridge_with_irc/irc_mirror_backend.py b/zulip/integrations/bridge_with_irc/irc_mirror_backend.py index 9ad2fcb..5242ca0 100644 --- a/zulip/integrations/bridge_with_irc/irc_mirror_backend.py +++ b/zulip/integrations/bridge_with_irc/irc_mirror_backend.py @@ -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") diff --git a/zulip/integrations/git/post-receive b/zulip/integrations/git/post-receive index 74b5110..be5522a 100755 --- a/zulip/integrations/git/post-receive +++ b/zulip/integrations/git/post-receive @@ -7,7 +7,7 @@ # stdin in the form # # For example: -# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master +# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/main import os import os.path diff --git a/zulip/integrations/git/zulip_git_config.py b/zulip/integrations/git/zulip_git_config.py index 0f7fe7a..c9ebe17 100644 --- a/zulip/integrations/git/zulip_git_config.py +++ b/zulip/integrations/git/zulip_git_config.py @@ -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 diff --git a/zulip/integrations/hg/zulip_changegroup.py b/zulip/integrations/hg/zulip_changegroup.py index 21cc4bd..519e186 100755 --- a/zulip/integrations/hg/zulip_changegroup.py +++ b/zulip/integrations/hg/zulip_changegroup.py @@ -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 pushed 1 commit to master (170:e494a5be3393): + Jane Doe pushed 1 commit to default (170:e494a5be3393): """ revcount = tip - base plural = "s" if revcount > 1 else "" diff --git a/zulip/integrations/openshift/post_deploy b/zulip/integrations/openshift/post_deploy index 62e4a33..da2bdb9 100755 --- a/zulip/integrations/openshift/post_deploy +++ b/zulip/integrations/openshift/post_deploy @@ -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(" - ") diff --git a/zulip/integrations/openshift/zulip_openshift_config.py b/zulip/integrations/openshift/zulip_openshift_config.py index 13d0462..9150d10 100755 --- a/zulip/integrations/openshift/zulip_openshift_config.py +++ b/zulip/integrations/openshift/zulip_openshift_config.py @@ -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