Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b8c0845f
Commit
b8c0845f
authored
Jun 05, 2018
by
Benjamin Peterson
Committed by
GitHub
Jun 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove hg support from patchcheck (GH-7440)
parent
3a5b0d89
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
21 deletions
+3
-21
Tools/scripts/patchcheck.py
Tools/scripts/patchcheck.py
+3
-21
No files found.
Tools/scripts/patchcheck.py
View file @
b8c0845f
...
@@ -44,16 +44,6 @@ def status(message, modal=False, info=None):
...
@@ -44,16 +44,6 @@ def status(message, modal=False, info=None):
return
decorated_fxn
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
():
def
get_git_branch
():
"""Get the symbolic name for the current git branch"""
"""Get the symbolic name for the current git branch"""
cmd
=
"git rev-parse --abbrev-ref HEAD"
.
split
()
cmd
=
"git rev-parse --abbrev-ref HEAD"
.
split
()
...
@@ -98,16 +88,8 @@ def get_base_branch():
...
@@ -98,16 +88,8 @@ def get_base_branch():
@
status
(
"Getting the list of files that have been added/changed"
,
@
status
(
"Getting the list of files that have been added/changed"
,
info
=
lambda
x
:
n_files_str
(
len
(
x
)))
info
=
lambda
x
:
n_files_str
(
len
(
x
)))
def
changed_files
(
base_branch
=
None
):
def
changed_files
(
base_branch
=
None
):
"""Get the list of changed or added files from Mercurial or git."""
"""Get the list of changed or added files from git."""
if
os
.
path
.
isdir
(
os
.
path
.
join
(
SRCDIR
,
'.hg'
)):
if
os
.
path
.
exists
(
os
.
path
.
join
(
SRCDIR
,
'.git'
)):
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'
)):
# We just use an existence check here as:
# We just use an existence check here as:
# directory = normal git checkout/clone
# directory = normal git checkout/clone
# file = git worktree directory
# file = git worktree directory
...
@@ -129,7 +111,7 @@ def changed_files(base_branch=None):
...
@@ -129,7 +111,7 @@ def changed_files(base_branch=None):
filename
=
filename
.
split
(
' -> '
,
2
)[
1
].
strip
()
filename
=
filename
.
split
(
' -> '
,
2
)[
1
].
strip
()
filenames
.
append
(
filename
)
filenames
.
append
(
filename
)
else
:
else
:
sys
.
exit
(
'need a
Mercurial or
git checkout to get modified files'
)
sys
.
exit
(
'need a git checkout to get modified files'
)
filenames2
=
[]
filenames2
=
[]
for
filename
in
filenames
:
for
filename
in
filenames
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment