I've added a handy console command from the Team Foundation Server Power Tools to the end of our code generation batch file to undo checkouts on any file that hasn't actually changed.
This way the code generator can work blindly off the data source and the change set only contains the files that have actually changed.
tfpt uu "C:\Development\ProjectRoot" /noget /recursive
See also: