Skip to content

Instantly share code, notes, and snippets.

@JeffJacobson
Created February 1, 2012 23:45
Show Gist options
  • Save JeffJacobson/1720204 to your computer and use it in GitHub Desktop.
Save JeffJacobson/1720204 to your computer and use it in GitHub Desktop.
Remove ".exclude" extension from all files in a directory without losing SVN history
"""Remove the ".exclude" extension from all files in this directory.
"""
import os, re, pysvn
# Get all of the files in the directory.
excludeFiles = os.listdir('.')
# Filter so only those ending with ".exclude" are in the list.
regex = re.compile('.+\.exclude$', re.IGNORECASE)
excludeFiles = filter(lambda f: regex.search(f), excludeFiles)
client = pysvn.Client()
for f in excludeFiles:
client.move(f, f[:-8])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment