diff options
author | Nadeem Vawda <nadeem.vawda@gmail.com> | 2012-02-22 09:46:41 (GMT) |
---|---|---|
committer | Nadeem Vawda <nadeem.vawda@gmail.com> | 2012-02-22 09:46:41 (GMT) |
commit | 9f64f731933bfebf6767a42a0ae75503c1936454 (patch) | |
tree | 601d6d6a240d6b6379d74a4d8e193b95a5705bd9 | |
parent | 7ef825fdabdc8cfa7117f3f8ad40f7f622ce823b (diff) | |
download | cpython-9f64f731933bfebf6767a42a0ae75503c1936454.zip cpython-9f64f731933bfebf6767a42a0ae75503c1936454.tar.gz cpython-9f64f731933bfebf6767a42a0ae75503c1936454.tar.bz2 |
Issue #14053: Fix "make patchcheck" to work with MQ.
Patch by Francisco Martín Brugué
-rw-r--r-- | Misc/NEWS | 3 | ||||
-rwxr-xr-x | Tools/scripts/patchcheck.py | 12 |
2 files changed, 15 insertions, 0 deletions
@@ -483,6 +483,9 @@ Build Tools/Demos ----------- +- Issue #14053: patchcheck.py ("make patchcheck") now works with MQ patches. + Patch by Francisco Martín Brugué. + - Issue #13930: 2to3 is now able to write its converted output files to another directory tree as well as copying unchanged files and altering the file suffix. See its new -o, -W and --add-suffix options. This makes it more diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py index dc6b932..0e18dd9 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(): @@ -43,6 +53,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' |