I'm not so happy about calling out to <code>diff</code> and <code>cat</code> here for same reason as above.  There is a python-native module for creating/manipulating diffs: http://docs.python.org/release/2.6.8/library/difflib.html#module-difflib