summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2012-02-22 09:40:09 (GMT)
committerNadeem Vawda <nadeem.vawda@gmail.com>2012-02-22 09:40:09 (GMT)
commitf00011aff4e5b0986a0f0d36ba324c0ca8b983d1 (patch)
treebbd6a2dd194574ee0ee4e9ee124574245959df45 /Tools
parent93291534b717390c06aa7ba51361cf5be51349ad (diff)
downloadcpython-f00011aff4e5b0986a0f0d36ba324c0ca8b983d1.zip
cpython-f00011aff4e5b0986a0f0d36ba324c0ca8b983d1.tar.gz
cpython-f00011aff4e5b0986a0f0d36ba324c0ca8b983d1.tar.bz2
Issue #14053: Fix "make patchcheck" to work with MQ.
Patch by Francisco Martín Brugué
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/patchcheck.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py
index 2834fef..438e44e 100755
--- a/Tools/scripts/patchcheck.py
+++ b/Tools/scripts/patchcheck.py
@@ -36,6 +36,20 @@ 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'
+ st = subprocess.Popen(cmd.split(),
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ try:
+ bstdout, _ = st.communicate()
+ return st.returncode == 0 and bstdout
+ finally:
+ st.stdout.close()
+ st.stderr.close()
+
+
@status("Getting the list of files that have been added/changed",
info=lambda x: n_files_str(len(x)))
def changed_files():
@@ -43,6 +57,8 @@ def changed_files():
if os.path.isdir(os.path.join(SRCDIR, '.hg')):
vcs = 'hg'
cmd = 'hg status --added --modified --no-status'
+ if mq_patches_applied():
+ cmd += ' --rev qparent'
elif os.path.isdir('.svn'):
vcs = 'svn'
cmd = 'svn status --quiet --non-interactive --ignore-externals'