Browse Source

Merge: #14053: Fix "make patchcheck" to work with MQ.

Patch by Francisco Martín Brugué
pull/2332/head
Nadeem Vawda 14 years ago
parent
commit
6721149501
  1. 3
      Misc/NEWS
  2. 12
      Tools/scripts/patchcheck.py

3
Misc/NEWS

@ -1990,6 +1990,9 @@ IDLE
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

12
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]

Loading…
Cancel
Save