summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2012-02-22 11:53:09 +0200
committerNadeem Vawda <nadeem.vawda@gmail.com>2012-02-22 11:53:09 +0200
commit6721149501a68ab52c7d1f83300ecd6d5656cbb3 (patch)
tree7f02992acd2eefbbf8bb2c0f4c46cab397f93e4f /Tools
parente7ad4190586a8a76d90ad7501bbbb5b3f011da5a (diff)
parent9f64f731933bfebf6767a42a0ae75503c1936454 (diff)
downloadcpython-git-6721149501a68ab52c7d1f83300ecd6d5656cbb3.tar.gz
Merge: #14053: Fix "make patchcheck" to work with MQ.
Patch by Francisco Martín Brugué
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/patchcheck.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py
index 3e0155f545..380574a5ca 100755
--- a/Tools/scripts/patchcheck.py
+++ b/Tools/scripts/patchcheck.py
@@ -36,6 +36,16 @@ 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
+
+
@status("Getting the list of files that have been added/changed",
info=lambda x: n_files_str(len(x)))
def changed_files():
@@ -44,6 +54,8 @@ def changed_files():
sys.exit('need a checkout to get modified files')
cmd = 'hg status --added --modified --no-status'
+ if mq_patches_applied():
+ cmd += ' --rev qparent'
with subprocess.Popen(cmd.split(), stdout=subprocess.PIPE) as st:
return [x.decode().rstrip() for x in st.stdout]