]> granicus.if.org Git - python/commitdiff
Merge: #14053: Fix "make patchcheck" to work with MQ.
authorNadeem Vawda <nadeem.vawda@gmail.com>
Wed, 22 Feb 2012 09:53:09 +0000 (11:53 +0200)
committerNadeem Vawda <nadeem.vawda@gmail.com>
Wed, 22 Feb 2012 09:53:09 +0000 (11:53 +0200)
Patch by Francisco Martín Brugué

1  2 
Misc/NEWS
Tools/scripts/patchcheck.py

diff --cc Misc/NEWS
index 389b6ab26090f4b54a320e406c4014e312b49c42,ee4287bebc9f218dbaf3e457c7c7cd1486031c90..e1024042c9dee084580741326cbafa735479eca3
+++ b/Misc/NEWS
  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
 +  useful in many automated code translation workflows.
 +
 +- Issue #13628: python-gdb.py is now able to retrieve more frames in the Python
 +  traceback if Python is optimized.
 +
 +- Issue #11996: libpython (gdb), replace "py-bt" command by "py-bt-full" and
 +  add a smarter "py-bt" command printing a classic Python traceback.
 +
  - Issue #11179: Make ccbench work under Python 3.1 and 2.7 again.
  
 +- Issue #10639: reindent.py no longer converts newlines and will raise
 +  an error if attempting to convert a file with mixed newlines.
 +  "--newline" option added to specify new line character.
 +
  Extension Modules
  -----------------
  
index 3e0155f54547971e72a042f097097d77f4b9ac1b,0e18dd9356d413e8d22dd480bc9d6ad0dbf9db01..380574a5ca7fab31fe64f34bd950b0ce8444881a
@@@ -39,13 -49,29 +49,15 @@@ def mq_patches_applied()
  @status("Getting the list of files that have been added/changed",
          info=lambda x: n_files_str(len(x)))
  def changed_files():
 -    """Get the list of changed or added files from the VCS."""
 -    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'
 -    else:
 +    """Get the list of changed or added files from Mercurial."""
 +    if not os.path.isdir(os.path.join(SRCDIR, '.hg')):
          sys.exit('need a checkout to get modified files')
  
 -    st = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)
 -    try:
 -        st.wait()
 -        if vcs == 'hg':
 -            return [x.decode().rstrip() for x in st.stdout]
 -        else:
 -            output = (x.decode().rstrip().rsplit(None, 1)[-1]
 -                      for x in st.stdout if x[0] in b'AM')
 -        return set(path for path in output if os.path.isfile(path))
 -    finally:
 -        st.stdout.close()
 +    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]
  
  
  def report_modified_files(file_paths):