1. Armin Rigo
  2. cpython-withatomic


Nadeem Vawda  committed 179bc75

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

Patch by Francisco Martín Brugué

  • Participants
  • Parent commits 48a9106
  • Branches 2.7

Comments (0)

Files changed (3)

File Misc/ACKS

View file
 Gary S. Brown
 Oleg Broytmann
 Dave Brueck
+Francisco Martín Brugué
 Stan Bubrouski
 Erik de Bueger
 Dick Bulterman

File Misc/NEWS

View file
+- 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

File Tools/scripts/patchcheck.py

View file
     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():
     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'