Set up Perforce for FieldWorks

From LSDevLinux
Jump to: navigation, search

Instructions to install and configure Perforce to connect to the FieldWorks source code repository.

Install Perforce

Go to the Perforce download page, and download the Perforce Visual Client (P4V) for your platform. (Or for connecting to hydra, use p4v r9.2 32-bit or 64-bit.)


After downloading and opening the .dmg file, drag the p4v application to your Applications folder. You may optionally drag the other two applications as well.


Choose either 32-bit or 64-bit, then save this file anywhere on your disk. In a terminal window:

$ sudo mkdir -p /opt/perforce
$ sudo tar -C /opt/perforce --no-same-owner --no-same-permissions -xf /path/to/p4v.tgz
$ sudo ln -s /opt/perforce/p4v-2010.2.317255/bin/p4v /usr/local/bin/p4v

In the tar command, instead of typing the path to the p4v.tgz file you can drag the file icon to the terminal window to paste its path.

In the ln command, substitute the number that is in your /opt/perforce directory. (You can press TAB to get filename auto-completion, to save typing errors.)

Add a p4v icon to your Gnome panel or desktop by following these instructions:

  • Do one of the following:
    • Right-click the Gnome panel and choose Add to Panel. Click Custom Application Launcher, click Add.
    • Right-click the desktop and choose Create Launcher.
  • In the Name box, type p4v
  • In the Command box, paste /usr/local/bin/p4v
  • Click the icon on the left in the Create Launcher dialog.
  • Choose an icon such as /opt/perforce/p4v-2010.2.317255/lib/p4v/P4VResources/icons/p4v_32_low.png
  • In the Create Launcher dialog, click OK.

Set up and check out from Perforce

Now run the Perforce client to get the data from Calgary/FW_7.0. You can run it by clicking the p4v icon in your Applications folder (Mac) or Gnome panel or desktop (Linux). On Linux you can also run it from a terminal by typing p4v.

The first time you run the p4v Perforce client, it starts with a wizard. Setup perforce by following these instructions:

  • Click Run Wizard or Yes to run the Connection Setup Wizard.
  • In the Host box, type (or hydra)
  • In the Port number box, type 1934 (or 1935) and click Next.
  • Click Log in to server .. with an existing user account.
  • In the User box, type your username (or anonymous if you do not have a username) and click Next. Enter your password if needed.
  • Click Create a new workspace, and in the Workspace name box, type the name of your new workspace, such as username-machinename. Don't worry about the Location box. Click Next.
  • Click No, I will copy files to my workspace later, and click Next. Click Finish.
  • In the main P4V window, choose Connection > Edit Current Workspace.
  • In the Root box, type YOURHOMEDIR/p4repo and click OK (substituting YOURHOMEDIR with the full path to your home directory, such as /home/bob). A dialog box appears.
  • In the dialog box, click Change Root.
  • In the next dialog box, click Do Not Copy.
  • In the main P4V window, click the Depot tab.
  • In the Depot tree pane, navigate to //depot/Calgary/FW_7.0, right-click that FW_7.0 and choose Get Latest Revision. Doing this will download the repository branch to your workspace in ~/p4repo.

Updating from Perforce

Your Perforce workspace can be updated to the latest code in the Perforce repository by clicking the Depot tab, navigating to //depot/Calgary/FW_7.0, right-clicking FW_7.0, and choosing Get Latest Revision.