]>
code.delx.au - pymsnt/blob - src/svninfo.py
3 from tlib
.xmlw
import parseFile
11 def calcRevision(self
, svndir
):
12 entriesFile
= os
.path
.join(svndir
, "entries")
13 doc
= parseFile(entriesFile
)
14 for child
in doc
.elements():
16 num
= int(child
.getAttribute("committed-rev"))
17 self
.version
= max(num
, self
.version
)
21 def traverseDir(self
, dirname
):
22 for file in os
.listdir(dirname
):
23 if os
.path
.islink(file):
25 if os
.path
.isdir(file):
26 path
= os
.path
.join(dirname
, file)
28 self
.calcRevision(path
)
30 self
.traverseDir(path
)
32 def getSVNVersion(dirname
="."):
34 x
.traverseDir(dirname
)
37 if __name__
== "__main__":