I am mikek's Blog

The personal blog of Mike Karthauser, who you may know from Brightstorm Limited or the internet.

Cakephp 1.2 RC4 Released

It won’t be long now until my favorite php framework becomes a full release, and todays announcement that the RC4 candidate is out fills me full of festive joy.

Well done to all the devs who made this possible. I look forward to trying out the improvements in this release and the imminent arrival of the full release.

You can read the announcement here.

Advertisements

Filed under: development, , ,

Rollback with subversion

I use svn all the the time. SVN or version control is an essential part of colaborative working, and provides the means to quickly deploy only changes and allows rollback to previous versions of individual files should you commit something hooky.

The project i am working on is a migration of a app from cakephp1.1 to cakephp1.2. We’re nearly ready to deploy. Client yesterday says ok, one version for live so i delete out of the repo and the old app folder and replace it with my new one. Loverly.

So today (literally 5 mins after the delete/move the client now says he wants both versions to go live side by side. What next?

After a bit of headscratching and furious googling, the anwer is found..

From http://pontus.ullgren.com/view/SVN_by_Example#Rollback_with_subversion

To me a rollback is when you want to undo one or more commited changes. Subversion does not let you delete repository revisions so instead you need to appened a new revision at the end of the trunk/branch.

This can be achived by manualy editing all files (removing any files/directories that might have been added) and then check in the result. Another and quicker way to do it is to do a “reversed merge”, that is to merge the newer (faulty) version with the older.

$ svn merge -r 4:2 .
U testfile.txt
$ svn ci -m "Rollbacked to revision 2"
Sending testfile.txt
Transmitting file data .
Committed revision 5.
$ svn diff file:///tmp/testrepo/trunk/@2 file:///tmp/testrepo/trunk/@5
$ svn diff file:///tmp/testrepo/trunk/@4 file:///tmp/testrepo/trunk/@5
Index: testfile.txt
===================================================================
--- testfile.txt (revision 4)
+++ testfile.txt (revision 5)
@@ -1,3 +1 @@
Added file in revision 2
-Added a new line in rev 3
-Added yet another line in rev 4

Result, easy merged svn. No kittens killed

Filed under: development,

what's hot

Flickr Photos

Sponsor Mike run the Bath Half marathon

mikek on twitter