DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Automatic CVS Add
Spider a directory using:
find . -type d ! \( -name "*CVS" \) -exec python cvsAdd.py {} \;
find . -name "*.py" -exec python cvsAdd.py {} \;
in cvsAdd.py, put the following:
import sys, pexpect, getpass
PASS='myPass'
def cvsAdd(fname):
global PASS
if not PASS:
PASS = getpass.getpass()
child = pexpect.spawn('cvs add "%s"' % fname)
child.expect("me@my-cvs-host password:")
child.sendline(PASS)
for line in child:
print line
cvsAdd(sys.argv[1])





