Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
8ff21203
Kaydet (Commit)
8ff21203
authored
Mar 09, 2006
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Directly read working copy data to obtain list of properties.
üst
84457af2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
8 deletions
+34
-8
svneol.py
Tools/scripts/svneol.py
+34
-8
No files found.
Tools/scripts/svneol.py
Dosyayı görüntüle @
8ff21203
...
@@ -28,14 +28,43 @@ For a file not under version control:
...
@@ -28,14 +28,43 @@ For a file not under version control:
and for a file with a binary mime-type property:
and for a file with a binary mime-type property:
svn: File 'Lib
\t
est
\t
est_pep263.py' has binary mime type property
svn: File 'Lib
\t
est
\t
est_pep263.py' has binary mime type property
TODO: This is slow, and especially on Windows, because it invokes a new svn
command-line operation for every file with the right extension.
"""
"""
import
re
import
re
import
os
import
os
def
proplist
(
root
,
fn
):
"Return a list of property names for file fn in directory root"
path
=
os
.
path
.
join
(
root
,
".svn"
,
"props"
,
fn
+
".svn-work"
)
try
:
f
=
open
(
path
)
except
IOError
:
# no properties file: not under version control
return
[]
result
=
[]
while
1
:
# key-value pairs, of the form
# K <length>
# <keyname>NL
# V length
# <value>NL
# END
line
=
f
.
readline
()
if
line
.
startswith
(
"END"
):
break
assert
line
.
startswith
(
"K "
)
L
=
int
(
line
.
split
()[
1
])
key
=
f
.
read
(
L
)
result
.
append
(
key
)
f
.
readline
()
line
=
f
.
readline
()
assert
line
.
startswith
(
"V "
)
L
=
int
(
line
.
split
()[
1
])
value
=
f
.
read
(
L
)
f
.
readline
()
f
.
close
()
return
result
possible_text_file
=
re
.
compile
(
r"\.([hc]|py|txt)$"
)
.
search
possible_text_file
=
re
.
compile
(
r"\.([hc]|py|txt)$"
)
.
search
for
root
,
dirs
,
files
in
os
.
walk
(
'.'
):
for
root
,
dirs
,
files
in
os
.
walk
(
'.'
):
...
@@ -43,9 +72,6 @@ for root, dirs, files in os.walk('.'):
...
@@ -43,9 +72,6 @@ for root, dirs, files in os.walk('.'):
dirs
.
remove
(
'.svn'
)
dirs
.
remove
(
'.svn'
)
for
fn
in
files
:
for
fn
in
files
:
if
possible_text_file
(
fn
):
if
possible_text_file
(
fn
):
path
=
os
.
path
.
join
(
root
,
fn
)
if
'svn:eol-style'
not
in
proplist
(
root
,
fn
):
p
=
os
.
popen
(
'svn proplist "
%
s"'
%
path
)
path
=
os
.
path
.
join
(
root
,
fn
)
guts
=
p
.
read
()
p
.
close
()
if
'eol-style'
not
in
guts
:
os
.
system
(
'svn propset svn:eol-style native "
%
s"'
%
path
)
os
.
system
(
'svn propset svn:eol-style native "
%
s"'
%
path
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment