dirdiff.py
- March 8th, 2008This is simple script for creating a zip file that can be used to patch a directory with a newer version.
It is pretty easy to use.
python dirdiff.py newdir olddir diff.zip
Newdir has changes that need to be added to olddir.To apply the changes all we have to do is run unzip.
unzip diff.zip -d olddir
There are a couple of limitations in the script. There is no way of telling it to ignore particular files or directories. Since I work with svn I have to get rid of the .svn directories by doing an svn export before running the script. It doesn’t do anything smart with end of lines or spaces. This is not a issue for me because I make sure all my code follows unix end of lines. And since the output is a zip file, it won’t delete files or directories that are no longer present in the new version.