A tiny script to change the Root of a CVS working copy.
#!/usr/bin/python import os import os.path import sys def usage(status): print "Usage: cvs-chroot [new-cvs-root]" sys.exit(status) def chroot(newroot, dir, files): (path, currdir) = os.path.split(dir) if currdir == "CVS": root_file = os.path.join(dir, "Root") print "Modifying " + root_file try: f = open(root_file, "w") f.write(newroot + "\n") f.close() except IOError, msg: print msg if len(sys.argv) != 2: print usage(1) newroot = sys.argv[1] os.path.walk(".", chroot, newroot) sys.exit(0)