Thursday, April 9, 2009

Xcode, Snapshots, and corruption

So I really like Xcode's Snapshots feature. While it is really just a poor mans SCM, I like the ability to snapshot my code, make a bunch of changes, but if those changes end up not what I want, I can easily go back to the snapshot.

Being able to do that outside of the checkout-checkin cycle of using a SCM is useful to me.

At least until Snapshots destroys my Xcode project.

Last night I tried restoring back to an older snapshot. Xcode came back with this fabulous message:
Unable to Open Project
Project ... cannot be opened because the project file cannot be parsed.

Lame. Especially since it seemed to break itself after I restored back to the Snapshot, which was missing a lot of new code.

Luckily I was able to find the location of the Snapshots:

~/Library/Application Support/Developer/Shared/SnapshotRepository.sparseimage

Close Xcode, mount that image, and find your missing Snapshot. Phew. I'll be a bit more cautious in using Snapshots going forward.

No comments: