2 # Run in source directory to change all file eol-style's
5 import os
, sys
, os
.path
8 def isSourceFile(fname
):
9 if fname
in ["SConstruct","SConscript","build.info"]:
11 ext
= os
.path
.splitext(fname
)[1]
12 return ext
in [".c",".cpp",".h",".inl",".ins",".fcd",".yy",".ll",".py"]
14 def isWindowsFile(fname
):
15 ext
= os
.path
.splitext(fname
)[1]
16 return ext
in [".dsp",".dsw"]
21 for root
, dirs
, files
in os
.walk('.'):
22 source_files
.extend([pj(root
,f
) for f
in files
if isSourceFile(f
)])
23 msvs_files
.extend([pj(root
,f
) for f
in files
if isWindowsFile(f
)])
25 print "Source files: "
27 for f
in source_files
:
30 print "Windows files: "
34 print "Setting eol-styles"
35 for f
in source_files
:
36 cmd
= "svn propset svn:eol-style native %s"%f
37 print "cmd: %s ..."%cmd
,
41 print "Setting keywords=Id"
42 for f
in source_files
:
43 cmd
= "svn propset svn:keywords Id %s"%f
44 print "cmd: %s ..."%cmd
,