Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9f64f73

Browse files
committed
Issue #14053: Fix "make patchcheck" to work with MQ.
Patch by Francisco Martín Brugué
1 parent 7ef825f commit 9f64f73

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,9 @@ Build
483483
Tools/Demos
484484
-----------
485485

486+
- Issue #14053: patchcheck.py ("make patchcheck") now works with MQ patches.
487+
Patch by Francisco Martín Brugué.
488+
486489
- Issue #13930: 2to3 is now able to write its converted output files to another
487490
directory tree as well as copying unchanged files and altering the file
488491
suffix. See its new -o, -W and --add-suffix options. This makes it more

Tools/scripts/patchcheck.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,25 @@ def call_fxn(*args, **kwargs):
3636
return decorated_fxn
3737

3838

39+
def mq_patches_applied():
40+
"""Check if there are any applied MQ patches."""
41+
cmd = 'hg qapplied'
42+
with subprocess.Popen(cmd.split(),
43+
stdout=subprocess.PIPE,
44+
stderr=subprocess.PIPE) as st:
45+
bstdout, _ = st.communicate()
46+
return st.returncode == 0 and bstdout
47+
48+
3949
@status("Getting the list of files that have been added/changed",
4050
info=lambda x: n_files_str(len(x)))
4151
def changed_files():
4252
"""Get the list of changed or added files from the VCS."""
4353
if os.path.isdir(os.path.join(SRCDIR, '.hg')):
4454
vcs = 'hg'
4555
cmd = 'hg status --added --modified --no-status'
56+
if mq_patches_applied():
57+
cmd += ' --rev qparent'
4658
elif os.path.isdir('.svn'):
4759
vcs = 'svn'
4860
cmd = 'svn status --quiet --non-interactive --ignore-externals'

0 commit comments

Comments
 (0)