Mercurial > cpython-lru_cache-weakref
diff Tools/scripts/patchcheck.py @ 75169:1bdca2bcba6d
Merge: #14053: Fix "make patchcheck" to work with MQ.
Patch by Francisco Martín Brugué
| author | Nadeem Vawda <nadeem.vawda@gmail.com> |
|---|---|
| date | Wed, 22 Feb 2012 11:53:09 +0200 |
| parents | d403eaec64df fc5de19c66e2 |
| children | 8ecd1a1c7dfc |
line wrap: on
line diff
--- a/Tools/scripts/patchcheck.py Wed Feb 22 06:02:07 2012 +0200 +++ b/Tools/scripts/patchcheck.py Wed Feb 22 11:53:09 2012 +0200 @@ -36,6 +36,16 @@ 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 @@ 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]
