Skip to content

Commit 08c03cc

Browse files
remove hg support from patchcheck (GH-7440)
(cherry picked from commit b8c0845) Co-authored-by: Benjamin Peterson <[email protected]>
1 parent d59f97c commit 08c03cc

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

Tools/scripts/patchcheck.py

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,6 @@ def call_fxn(*args, **kwargs):
4545
return decorated_fxn
4646

4747

48-
def mq_patches_applied():
49-
"""Check if there are any applied MQ patches."""
50-
cmd = 'hg qapplied'
51-
with subprocess.Popen(cmd.split(),
52-
stdout=subprocess.PIPE,
53-
stderr=subprocess.PIPE) as st:
54-
bstdout, _ = st.communicate()
55-
return st.returncode == 0 and bstdout
56-
57-
5848
def get_git_branch():
5949
"""Get the symbolic name for the current git branch"""
6050
cmd = "git rev-parse --abbrev-ref HEAD".split()
@@ -99,16 +89,8 @@ def get_base_branch():
9989
@status("Getting the list of files that have been added/changed",
10090
info=lambda x: n_files_str(len(x)))
10191
def changed_files(base_branch=None):
102-
"""Get the list of changed or added files from Mercurial or git."""
103-
if os.path.isdir(os.path.join(SRCDIR, '.hg')):
104-
if base_branch is not None:
105-
sys.exit('need a git checkout to check PR status')
106-
cmd = 'hg status --added --modified --no-status'
107-
if mq_patches_applied():
108-
cmd += ' --rev qparent'
109-
with subprocess.Popen(cmd.split(), stdout=subprocess.PIPE) as st:
110-
filenames = [x.decode().rstrip() for x in st.stdout]
111-
elif os.path.exists(os.path.join(SRCDIR, '.git')):
92+
"""Get the list of changed or added files from git."""
93+
if os.path.exists(os.path.join(SRCDIR, '.git')):
11294
# We just use an existence check here as:
11395
# directory = normal git checkout/clone
11496
# file = git worktree directory
@@ -130,7 +112,7 @@ def changed_files(base_branch=None):
130112
filename = filename.split(' -> ', 2)[1].strip()
131113
filenames.append(filename)
132114
else:
133-
sys.exit('need a Mercurial or git checkout to get modified files')
115+
sys.exit('need a git checkout to get modified files')
134116

135117
filenames2 = []
136118
for filename in filenames:

0 commit comments

Comments
 (0)