From 650d7eeaa18627b8b52bc17871e5305b205e720b Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Mon, 27 Jun 2011 17:59:45 -0500 Subject: remove svn support --- Tools/scripts/patchcheck.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'Tools/scripts/patchcheck.py') diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py index e767edabd9..b0de2161c7 100644 --- a/Tools/scripts/patchcheck.py +++ b/Tools/scripts/patchcheck.py @@ -38,9 +38,6 @@ def changed_files(): if os.path.isdir('.hg'): vcs = 'hg' cmd = 'hg status --added --modified --no-status' - elif os.path.isdir('.svn'): - vcs = 'svn' - cmd = 'svn status --quiet --non-interactive --ignore-externals' else: sys.exit('need a checkout to get modified files') -- cgit v1.2.1 From 7bae39e4075538ee21881f517519b10511297cc0 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Mon, 27 Jun 2011 18:25:06 -0500 Subject: general cleaning up --- Tools/scripts/patchcheck.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'Tools/scripts/patchcheck.py') diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py index b0de2161c7..d42bc8a4bf 100644 --- a/Tools/scripts/patchcheck.py +++ b/Tools/scripts/patchcheck.py @@ -36,7 +36,6 @@ def status(message, modal=False, info=None): def changed_files(): """Get the list of changed or added files from the VCS.""" if os.path.isdir('.hg'): - vcs = 'hg' cmd = 'hg status --added --modified --no-status' else: sys.exit('need a checkout to get modified files') @@ -44,12 +43,7 @@ def changed_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)) + return [x.decode().rstrip() for x in st.stdout] finally: st.stdout.close() @@ -69,10 +63,8 @@ def report_modified_files(file_paths): def normalize_whitespace(file_paths): """Make sure that the whitespace for .py files have been normalized.""" reindent.makebackup = False # No need to create backups. - fixed = [] - for path in (x for x in file_paths if x.endswith('.py')): - if reindent.check(path): - fixed.append(path) + fixed = [path for path in file_paths if path.endswith('.py') and + reindent.check(path)] return fixed -- cgit v1.2.1 From 05d67e3ec8c313ab557e42757fe07cac095aefc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Sun, 31 Jul 2011 18:41:25 +0200 Subject: Small cleanup --- Tools/scripts/patchcheck.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'Tools/scripts/patchcheck.py') diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py index b01f77cec6..204407eb55 100755 --- a/Tools/scripts/patchcheck.py +++ b/Tools/scripts/patchcheck.py @@ -39,18 +39,13 @@ def status(message, modal=False, info=None): @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')): - cmd = 'hg status --added --modified --no-status' - 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() + cmd = 'hg status --added --modified --no-status' + with subprocess.Popen(cmd.split(), stdout=subprocess.PIPE) as st: return [x.decode().rstrip() for x in st.stdout] - finally: - st.stdout.close() def report_modified_files(file_paths): -- cgit v1.2.1 From 1c8465cbc2e3869180c4e888540fdc8eeba502c9 Mon Sep 17 00:00:00 2001 From: Ross Lagerwall Date: Sun, 11 Mar 2012 19:21:07 +0200 Subject: Modify patchcheck.py to check for changes to configure.in. It now reports if configure and pyconfig.h.in weren't regenerated but configure.in was changed. --- Tools/scripts/patchcheck.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Tools/scripts/patchcheck.py') diff --git a/Tools/scripts/patchcheck.py b/Tools/scripts/patchcheck.py index 380574a5ca..0ca712ad31 100755 --- a/Tools/scripts/patchcheck.py +++ b/Tools/scripts/patchcheck.py @@ -132,6 +132,21 @@ def reported_news(file_paths): """Check if Misc/NEWS has been changed.""" return 'Misc/NEWS' in file_paths +@status("configure regenerated", modal=True, info=str) +def regenerated_configure(file_paths): + """Check if configure has been regenerated.""" + if 'configure.in' in file_paths: + return "yes" if 'configure' in file_paths else "no" + else: + return "not needed" + +@status("pyconfig.h.in regenerated", modal=True, info=str) +def regenerated_pyconfig_h_in(file_paths): + """Check if pyconfig.h.in has been regenerated.""" + if 'configure.in' in file_paths: + return "yes" if 'pyconfig.h.in' in file_paths else "no" + else: + return "not needed" def main(): file_paths = changed_files() @@ -151,6 +166,10 @@ def main(): credit_given(special_files) # Misc/NEWS changed. reported_news(special_files) + # Regenerated configure, if necessary. + regenerated_configure(file_paths) + # Regenerated pyconfig.h.in, if necessary. + regenerated_pyconfig_h_in(file_paths) # Test suite run and passed. if python_files or c_files: -- cgit v1.2.1