#!/usr/bin/python import os import subprocess for root, dirs, files in os.walk('core/'): for name in files: path = os.path.join(root, name) if path != path.lower(): print 'Will rename %s to %s' % (path, path.lower()) subprocess.Popen(['hg', 'mv', path, path.lower()]).wait()