mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Taught svneol to look at .c and .h files too, and
it found a bunch more in need of svn:eol-style.
This commit is contained in:
parent
d87f81f5f3
commit
84457af29e
2 changed files with 95 additions and 92 deletions
|
@ -3,8 +3,8 @@
|
||||||
"""
|
"""
|
||||||
SVN helper script.
|
SVN helper script.
|
||||||
|
|
||||||
Try to set the svn:eol-style property to "native" on every .py and .txt file
|
Try to set the svn:eol-style property to "native" on every .py, .txt, .c and
|
||||||
in the directory tree rooted at the current directory.
|
.h file in the directory tree rooted at the current directory.
|
||||||
|
|
||||||
Files with the svn:eol-style property already set (to anything) are skipped.
|
Files with the svn:eol-style property already set (to anything) are skipped.
|
||||||
|
|
||||||
|
@ -30,16 +30,19 @@ and for a file with a binary mime-type property:
|
||||||
svn: File 'Lib\test\test_pep263.py' has binary mime type property
|
svn: File 'Lib\test\test_pep263.py' has binary mime type property
|
||||||
|
|
||||||
TODO: This is slow, and especially on Windows, because it invokes a new svn
|
TODO: This is slow, and especially on Windows, because it invokes a new svn
|
||||||
command-line operation for every .py and .txt file.
|
command-line operation for every file with the right extension.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import re
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
possible_text_file = re.compile(r"\.([hc]|py|txt)$").search
|
||||||
|
|
||||||
for root, dirs, files in os.walk('.'):
|
for root, dirs, files in os.walk('.'):
|
||||||
if '.svn' in dirs:
|
if '.svn' in dirs:
|
||||||
dirs.remove('.svn')
|
dirs.remove('.svn')
|
||||||
for fn in files:
|
for fn in files:
|
||||||
if fn.endswith('.py') or fn.endswith('.txt'):
|
if possible_text_file(fn):
|
||||||
path = os.path.join(root, fn)
|
path = os.path.join(root, fn)
|
||||||
p = os.popen('svn proplist "%s"' % path)
|
p = os.popen('svn proplist "%s"' % path)
|
||||||
guts = p.read()
|
guts = p.read()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue