Tuesday, April 17, 2007
Shelve Changes (New for IntelliJ in 7.0)
Update: Corrected Typo. Create Patch is a new IntelliJ feature for their upcoming 7.0 release (for which there is an early access version available for testing.) It allows you to take a set of changes and package them up into a patch file, after which it restores each packaged file to it's original version from source control. Then, at any time, you can re-apply your effectively shelved changes by applying the patch.
This allows you to work on a large change, restore everything to its original version and work on a small change, and then go back to working on your larger change.
But, a coworker recently pointed out a more interesting use for this feature. You could work on a large change, shelve the changes, then check out a fresh build the latest version of the code, and then apply the changes, effectively patching the latest version of the code! This is amazing because the thing about large changes is, they usually take a large amount of time to work meaning an active code base becomes a moving target. The way our builds work is sometimes we can't just do an update to get the latest version (because of database upgrade issues) and we have to do a full check out and build. Applying our changes to a fresh build was always a pain because we had to painstakingly copy each file and remember where it went, and then manually merge and/or overwrite each file. What a pain that IntelliJ makes literally a breeze!
The delight is almost too much to bear...