Friday, June 11, 2010

Easy Perforce setup

After trying out many source code control systems, I personally found perforce to be the easiest to set up and maintain. Before settling on perforce I tried Mercurial, Subversion, CVS and Microsoft Team Foundation Server (it was so darn complicated that I gave up on it). So here I am sharing these tips / experiences with you to make your Perforce set up experience easier. But before I begin I must mention that I am not a Unix person, but here are common problems I found with these SCC:

  • What to use ? – There are so many client and server editions that I don’t know which one to download! On top of that everyone seems to have their own distinct favorite making it hard to choose.
  • Hard to install and configure -  If you are lucky to get one of these installed you need additional degree to learn how to configure them up. Mercurial was relatively easy to set up but it was not intuitive for me to add files to the depot.
  • Limited (or lack of free) integration with tools – I use visual studio for my development and it is a must for me to use a SCC that integrates with visual studio. No command line or shell support is not good enough.

I found perforce easy to set up and configure. It also is flexible to store depot files and version database at flexible locations. You can configure P4ROOT system variable to indicate to perforce where you want it to store version database (make sure you restart perforce service after setting P4ROOT). To specify where perforce should store files in depot, type p4 depot <depot_name> where depot_name is the name of your depot (default is “depot”). This will bring up notepad configuration for depot where you can specify depot location in the Map: section (you can also use absolute paths but any path relative or absolute must always end with \… so for example D:\Depot\…). I strongly suggest having P4Root same as depot root since it makes it convenient for performing backups. Also perforce client P4V is standard client which integrates with a lot of IDEs including visual studio ! I hope this makes your perforce setup experience smoother !