I imported files into a repo that were supposed to end with the .{} extension, not .{{} as they ended up having.
I could have used a shell script to accomplish this, but I’m forcing myself to do this with Python and relearn a lot of things I’ve forgotten in the last year or so. I placed the following in a file named fix.py and dropped it into the directory of files I wanted to rename. It was a shallow directory, so I didn’t have to recursively rename files.
import os
import glob
files_to_fix = glob.glob('*.{{}')
for file in files_to_fix:
command = "svn mv %s %s" % (file, file.replace("{{}","{}"))
os.system(command)
The command basically comes down to:
svn mv file.{{} file.{}
Update:
Instead of:
command = "svn mv %s %s" % (file, file.replace("{{}","{}"))
I used:
command = """svn mv "%s" "%s" """ % (file, file.replace("{{}","{}"))
This was to catch file names that had spaces in them.