Oct 22, 2007

Compelling features in SVN. But, rarely used.

I have been using SVN for source control more than two years now. But, i haven't bothered to try out some of the features. Typically, we want to use those primitive features that are easy to understand or rather familiar to us. Checkout, Commit, Update, Show log, Diff are primitive and commonly used commands, as we mostly do Update and Commit on a daily basis. Diff is used while merging code. These commands are sufficient for simpler quotidien tasks.

But, definitely not sufficient if you are to merge a history of changes from one branch to another. I stumbled across 100s of checkins on one branch to be merged into another. Another twist was the number people who did these checkins and there were checkins by multiple persons on the same file. As a relief, i was asked to merge only my checkins from one branch to another. Exactly not a relief, but a pain, as many people had done changes to the files i modified over a period of time. I am using Tortoise SVN as client. So, my experience revolves around the tool. Still, i believe the terms and functionality are similar with respect to SVN and CVS immaterial of the client used to access the code repository.

So, the problem definition in one line:
"Pull out all your changes from one branch over a period of time and put it into another branch"

Setup: I have branch Origin and branch Target to merge my files.
Better way to tackle this:
Step 1: Select the source branch folder and go to Show Log to view the history of changes on the branch.
Step 2: Select the range of changes to view based on either Date or Revision no.
Step 3: Sort the list based on Author.
Step 4: Select the entire list of checkins done in your Author name. This action will show a list of files in the lower window. These are the entire list of files that were modified in the selected list of checkins. So, you have all the files that you modified during those checkins. Copy the list to somewhere. And, these are the files u need to merge into the Target branch. Hooray!
Step 5: Having got the list of file you need to be concerned about, next challenge would be seperate out the changes done to the same file by yourself and others. Afterall, you need to be concerned about only your changes done to the file. Previously, i would have went through Diffing two revisions. But, there is these Blame functionality. You can click on a file to be merged and do a Blame with start and end revision number. After a little time munching the bits and bytes, SVN will pull out the line by line changes made every single person on the file over the period. Awesome it is!

Another interesting functionality is the concept of Patching. Creating and Applying patch are two phases of patching. When a dev has made a bunch of code changes and needs to send it to a reviewer or configuration manager, he need not send the files seperately to the recepient. Instead, he can create a Patch which is nothing but a unified diff of working and base copy. After reviewing the unified diff(Patch), the reviewer can simply Apply the patch on the repository.

Oct 19, 2007

Synergy - cool software based KVM

The other day, my colleague was breezing his mouse and keyboard between his PC and notebook. displays. I have seen people having the bulky KVM switch box that powers users to switch between multiple PC displays. Kind of a mission control center on ur desk.. hehehe. Suprisingly, this person didn't have any such hardware stuff beneath his desk. A peek into his cubicle and this amazingly simple software called Synergy takes my breath away! Alright. No more spinning the wheel. Synergy is a virtual KVM switch implemented in software. For those dudes hearing that word for the first time, wiki here. Synergy is a client-server solution(obviously) and its Open-Source dude.

First thing home, downloaded this software from their official site. Got it installed on my two notebooks running XP and Vista. Got one of the installation as server and other as client. And, here i go. Now, i could use the mouse and keyboard of the notebook running my Synergy server to access the desktop of the notebook. So, i was moving the mouse connected to my first notebook and just crossed over to the desktop of the adjacent notebook. And, i was typing in the keyboard of first notebook to see the letters appear on the MS Word running on the other notebook.

This link has an awesome description of installing and configuring Synergy. Happy crossovers across your displays.