A quick python script to clean up a “used to be” cvs or svn working directory – I know that TortoiseSVN has an export feature but TortoiseCVS does not.
[code lang=”python”]
“””
Removes all cvs and svn directories
usage: “CVSSVNCleanup.py true” to delete all cvs and svn directories
“CVSSVNCleanup.py” to view all cvs and svn directories
“””
import os
import shutil
import sys
#get a list of all the root level directories
lDirs=os.listdir(os.curdir)
if len(sys.argv) > 1 and sys.argv[1].lower()==”true”:
delete = True
else:
delete = False
for d in lDirs:
for root,dirs,files in os.walk(d):
for dirName in dirs:
if dirName.lower() == “.svn” or dirName.lower() == “cvs”:
curDir = os.getcwd()+”\\”+root+”\\”+dirName
if delete == True:
shutil.rmtree(curDir)
curDir = curDir + ” – Deleted”
print curDir
continue
print “Finished”
[/code]