summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-06-06 05:56:31 (GMT)
committerGitHub <noreply@github.com>2018-06-06 05:56:31 (GMT)
commit9aa1e721e1b8e557b3926ac168b303e728a90ea0 (patch)
treea109c159234b4b1346ecce9219916c4f14594fd8 /Tools
parentd6e789c402330905b1bd9103538d1027fcfb08a4 (diff)
downloadcpython-9aa1e721e1b8e557b3926ac168b303e728a90ea0.zip
cpython-9aa1e721e1b8e557b3926ac168b303e728a90ea0.tar.gz
cpython-9aa1e721e1b8e557b3926ac168b303e728a90ea0.tar.bz2
remove hg support from patchcheck (GH-7440)
(cherry picked from commit b8c0845fee9277b1106ceecbf7592f8806c73ec8) Co-authored-by: Benjamin Peterson <benjamin@python.org>
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/patchcheck.py24
1 files changed, 3 insertions, 21 deletions
diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py
index 8f7924f..a1253d1 100755
--- a/Tools/scripts/patchcheck.py
+++ b/Tools/scripts/patchcheck.py
@@ -44,16 +44,6 @@ def status(message, modal=False, info=None):
return decorated_fxn
-def mq_patches_applied():
- """Check if there are any applied MQ patches."""
- cmd = 'hg qapplied'
- with subprocess.Popen(cmd.split(),
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE) as st:
- bstdout, _ = st.communicate()
- return st.returncode == 0 and bstdout
-
-
def get_git_branch():
"""Get the symbolic name for the current git branch"""
cmd = "git rev-parse --abbrev-ref HEAD".split()
@@ -98,16 +88,8 @@ def get_base_branch():
@status("Getting the list of files that have been added/changed",
info=lambda x: n_files_str(len(x)))
def changed_files(base_branch=None):
- """Get the list of changed or added files from Mercurial or git."""
- if os.path.isdir(os.path.join(SRCDIR, '.hg')):
- if base_branch is not None:
- sys.exit('need a git checkout to check PR status')
- cmd = 'hg status --added --modified --no-status'
- if mq_patches_applied():
- cmd += ' --rev qparent'
- with subprocess.Popen(cmd.split(), stdout=subprocess.PIPE) as st:
- filenames = [x.decode().rstrip() for x in st.stdout]
- elif os.path.exists(os.path.join(SRCDIR, '.git')):
+ """Get the list of changed or added files from git."""
+ if os.path.exists(os.path.join(SRCDIR, '.git')):
# We just use an existence check here as:
# directory = normal git checkout/clone
# file = git worktree directory
@@ -129,7 +111,7 @@ def changed_files(base_branch=None):
filename = filename.split(' -> ', 2)[1].strip()
filenames.append(filename)
else:
- sys.exit('need a Mercurial or git checkout to get modified files')
+ sys.exit('need a git checkout to get modified files')
filenames2 = []
for filename in filenames: