Listing the affected files in a Subversion revision
A quick trick that I'm finding very useful for those little deployments that don't require a full export of the Subversion repository. A little regex on the standard verbose output of the Subversion log like so:
svn log -r HEAD -v | egrep '^ +[A-Z]'
will output a list of the files included in the specified revision, e.g.:
The letters "A", "M" or "D" denote whether the file was added, modified or deleted.
A little bit of Python looping and manipulation later, and there's a very nice little code snippet:
pipe = os.popen("svn log -r "HEAD -v | egrep '^ +[A-Z]'") lstUpload =  lstRemove =  for i in pipe.readlines(): file = i.strip().replace('/trunk/','').split(' ') if file == 'A' or file == 'M': lstUpload.append(file) if file == 'D': lstRemove.append(file)
Which gives us a list of files to upload to the live server, and a list of files to delete from it. Very quick and easy - bung it in your Fabric script and rest easy pilgrim.