[llvm] efcdedd - git-llvm: Drop dependency on github module
Tom Stellard via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 25 00:08:25 PDT 2019
Author: Tom Stellard
Date: 2019-10-25T00:04:31-07:00
New Revision: efcdedd2e72bd47d019f5873e2faf35a27e32b43
URL: https://github.com/llvm/llvm-project/commit/efcdedd2e72bd47d019f5873e2faf35a27e32b43
DIFF: https://github.com/llvm/llvm-project/commit/efcdedd2e72bd47d019f5873e2faf35a27e32b43.diff
LOG: git-llvm: Drop dependency on github module
This was required for blocking merge commits, but now that we have
branch protections, we don't need this.
Added:
Modified:
llvm/utils/git-svn/git-llvm
Removed:
################################################################################
diff --git a/llvm/utils/git-svn/git-llvm b/llvm/utils/git-svn/git-llvm
index 7a4d8c2d178a..5ebfcf1bde2d 100755
--- a/llvm/utils/git-svn/git-llvm
+++ b/llvm/utils/git-svn/git-llvm
@@ -36,7 +36,6 @@ import subprocess
import sys
import time
import getpass
-import github
assert sys.version_info >= (2, 7)
try:
@@ -204,12 +203,12 @@ def get_fetch_url():
return 'https://{}'.format(GIT_URL)
-def get_push_url(user='', token='', ssh=False):
+def get_push_url(user='', ssh=False):
if ssh:
return 'ssh://{}'.format(GIT_URL)
- return 'https://{}@{}'.format(token, GIT_URL)
+ return 'https://{}'.format(GIT_URL)
def get_revs_to_push(branch):
@@ -222,7 +221,7 @@ def get_revs_to_push(branch):
return commits
-def git_push_one_rev(rev, dry_run, branch, github_ctx, github_token):
+def git_push_one_rev(rev, dry_run, branch):
# Check if this a merge commit by counting the number of parent commits.
# More than 1 parent commmit means this is a merge.
num_parents = len(git('show', '--no-patch', '--format="%P"', rev).split())
@@ -238,7 +237,7 @@ def git_push_one_rev(rev, dry_run, branch, github_ctx, github_token):
return
# Second push to actually push the commit
- git('push', get_push_url(token = github_token), '{}:{}'.format(rev, branch), print_raw_stderr=True)
+ git('push', get_push_url(), '{}:{}'.format(rev, branch), print_raw_stderr=True)
def cmd_push(args):
@@ -261,13 +260,8 @@ def cmd_push(args):
if not ask_confirm("Are you sure you want to create %d commits?" % len(revs)):
die("Aborting")
- # FIXME: I'm really trying to avoid prompting twice for the password, the only
- # way I can see to do that is require an authentication token instead of a
- # password, because you can embedded authentication tokens into the URL.
- github_token = getpass.getpass("Auth token for https://github.com':")
- g = github.Github(github_token)
for r in revs:
- git_push_one_rev(r, dry_run, args.branch, g, github_token)
+ git_push_one_rev(r, dry_run, args.branch)
if __name__ == '__main__':
More information about the llvm-commits
mailing list