Over a million developers have joined DZone.

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])
Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}