From: Nadeem Vawda Date: Wed, 22 Feb 2012 09:53:09 +0000 (+0200) Subject: Merge: #14053: Fix "make patchcheck" to work with MQ. X-Git-Tag: v3.3.0a1~95 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6721149501a68ab52c7d1f83300ecd6d5656cbb3;p=python Merge: #14053: Fix "make patchcheck" to work with MQ. Patch by Francisco Martín Brugué --- 6721149501a68ab52c7d1f83300ecd6d5656cbb3 diff --cc Misc/NEWS index 389b6ab260,ee4287bebc..e1024042c9 --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -1990,23 -1417,8 +1990,26 @@@ IDL 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 ----------------- diff --cc Tools/scripts/patchcheck.py index 3e0155f545,0e18dd9356..380574a5ca --- a/Tools/scripts/patchcheck.py +++ b/Tools/scripts/patchcheck.py @@@ -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):