miércoles, 9 de febrero de 2011

Removing the .svn directories

I usually have this problem after coping a subversion downloaded directory tree. The .svn directories that are created in each directory are copied too. I created the following python script to get rid of them. You must be careful when using it because it deletes with no warning.

#!/usr/bin/env python

import shutil
import os

for root, dirs, files in os.walk (".", topdown=True):
for name in dirs:
if name == (".svn"):
fileName = os.path.join (root, name)
print fileName
shutil.rmtree (fileName)

No hay comentarios:

Publicar un comentario