old_revision used in a debug statement a few lines down (which is disabled unless DEBUG is set)