Menu

[r528]: / trunk / cppunit / devtools / cvs-root-update.py  Maximize  Restore  History

Download this file

18 lines (14 with data), 704 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Explore directory recursively and replace cvs root for access by the specified developper.
# Put together by a newbie to python, use at your own risk!
import os
import sys
def updateCVSRoot( developper, dirName, fileNames ):
print "Exploring: ", os.path.abspath( dirName )
if ( fileNames.count( 'Root' ) > 0 ) and os.path.basename(dirName) == 'CVS':
cvsroot_path = os.path.join( dirName, 'Root' )
new_root = ':ext:%s@cppunit.cvs.sourceforge.net:/cvsroot/cppunit' % developper
file( cvsroot_path, 'wt' ).write( new_root )
print 'Updated:', cvsroot_path
if __name__ == '__main__':
developper = sys.argv[1]
os.path.walk( ".", updateCVSRoot, developper )
MongoDB Logo MongoDB