Happy sandboxes and svn switch

May 08, 2008 09:54

http://bojordan.com/log/?p=574
I encourage everyone I work with to keep all of their development code in a source repository, even one-off dead-end prototype code they’re not going to check back into a main development tree. If you know you’re going to do destabilizing work, of course you’ll create a sandbox branch from the development branch and then do your work; we all know this. So, what happens if you inadvertently end up with a dead-end prototype in your working source checkout, and you didn’t have the foresight to start with a branch? It’s easy to make it as if you had.

Disclaimer: Of course, if this all fails you could lose a lot of work, so you might want to generate a quick diff or backup just in case. Just be careful.
  1. Create a development branch in our repository on the server. We are using Windows and TortoiseSVN, and our working code is from the branch at svn://svnserver/MyProject/Trunk at revision 1942. So, we use the Repo-browser in TortoiseSVN to find Trunk, select revision 1942 from the upper right-hand corner of the dialog, and then select “Copy to…” with a new location at svn://svnserver/MyProject/Sandboxes/bojordan/DeadEndPrototype. We now have a new branch, but our working code still belongs to Trunk.
  2. Right-click on my top-level checkout directory, select “Switch” from the TortoiseSVN options, and select the new branch in the “To URL:”. We know HEAD is fine, as we just created the new branch.
  3. Now, the next time we commit our code, we’ll check it back into the new branch. Glee!

Just remember: No more stale development tree archives on your development machines means cleaner, uncluttered living, and might get you one step closer to a 16 minute 5k. Or, maybe not, but you’ll still be happier.
Previous post Next post
Up