Perforce Version Control

Source Code Control System (SCCS)

Manuals

You can find all of the Perforce manuals online at Perforce.

Tips on Using Perforce

This section is for everyone on the project to add their own tips and tricks for using Perforce. If there isn't a subheading for what you want to contribute, add a new one.

What is Perforce?

Perforce Perforce is a Software Configuration Management System (SCM) that runs as a client / server architecture.

The server consists of a central database and a file repository.

The central database contains system-related data, such as changelists, change descriptions, and file attributes. The repository contains all revisions which are encoded in ASCII or Unicode, depending on the server configuration.

How can I use Perforce to access CLforJava? ?

There are four access points to Perforce: P4V? /P4Win (GUI), P4 (Command line), P4Web? (Web based interface / Read-only), and the transparent P4DTI? (used to synchronize bugs in Bugzilla).

  • P4V? -Crossplatform GUI / P4Win? -Windows based GUI
  • P4-command line interface can run in any command shell or script.
  • P4Web? -the web interface, provides read-only access to the file repository. It also gives access to the bug database.
  • P4DTI? (Perforce Defect Tracking Integration), provides a transparent interface to Bugzilla, allowing for jobs or bugs to be accessed, modified, or created by either Perforce or Bugzilla.

How do I access the Perforce Server?

*Before you will be able to connect to Perforce you will need to have a username/password setup by a perforce administrator.

Currently we are in the process of creating a script that will create a Bugzilla account for you when you receive a Perforce account. The way this will work is that the username and email you use to become a Perforce user will be used to create a Bugzilla account. The username will stay the same and will also be your password until you change it in Bugzilla by going to Preferences. The reason for this is that it will allow for easier use of P4DTI? which requires matching email addresses between Perforce and Bugzilla.

Using P4/P4Win

For your OS you must first download the Perforce Visual Client (P4V? or P4Win? for Windows Users) from http://www.perforce.com/perforce/downloads/index.html

  1. Mac users will have to mount P4.dmg and open the disc. The user will then have to drag both p4v.app and p4merge.app to the folder of his/her choice, but it is recommended that the user place the folders in his/her applications folder. The user will then be able to run P4V? by clicking p4v.app.
  2. Run Perforce and go to Settings => Switch Port Client User and type the appropriate information.
Perforce users should make a new Client Spec/Workpsace. DO NOT take one that already exists.
General client configuration:
Perforce Server Name: clforjava.cs.cofc.edu (If server name is not asked for use clforjava.cs.cofc.edu:1666 for the port)
Port: 1666
Client: Prior to creating a client spec of the users choice, browse client spec list to ensure that the client spec is unique. It is recommended to use the "Set to Default" checkbox when initially configuring Perforce.
Username: User's username
The user will then be prompted for his/her password.
Required Folder to Sync: //depot/CLforJava ( There are many other folders that you can sync but are not required and require a large chuck of hard drive space.)
Expand depot and right-click on the CLforJava? directory and choose Sync=>Sync to Head Revision.

You may also wish to check out the HowTo section for extra help setting up P4Win? , syncing, and handling changelists.

Using P4 (command-line)

To use the command line client interface, the user will need to download the latest version of P4 from http://www.perforce.com/perforce/downloads/index.html.

The command line guide is located at http://perforce.com/perforce/doc.082/manuals/cmdref/index.html.

Windows

Run the executable and install Perforce.

Linux and Mac

Download the P4 executable at http://www.perforce.com/perforce/downloads/index.html. Make the P4 file and executable.

Setting P4 Variables (Windows)

  1. Edit the config files via command line. There are a few necessary variables that need to be set to be able to access the Perforce Server.
    1. P4CLIENT? : Name of the current client workspace.
      1. Example: p4 set P4CLIENT? = (When initially setting up P4, the user will need to use the command "p4 clients" to view other clients to ensure that the client spec name is unique.)
    2. P4EDITOR? : The editor invoked by the Perforce commands that use forms.
      1. Example: p4 set P4EDITOR? =notepad
    3. P4USER? : The user's username.
      1. Example: p4 set P4USER? =user567
    4. P4PASSWD? : The user's password.
      1. Example: p4 set P4PASSWD? =password
    5. P4PORT? : The host and port number of the Perforce Server.
      1. Example: p4 set P4PORT? =clforjava.cs.cofc.edu:1666
  2. To sync with the current build of CLforJava? type "p4 sync"
    1. To display a sync without actually syncing with the server flag the command with "-n", like "p4 sync -n".
      1. Note: //depot/CLforJava contain the files necessary to build ClforJava? . There are many other directories that contain other information relative to the project, but are not necessary to build CLforJava? .
  3. To edit a file use "p4 edit filename".
  4. To submit use"p4 submit".

What are the rules concerning documentation etiquette?

There can be many changed made to a single file that can make it difficult for the project leader to understand. Usually, a few descriptive sentences will do the trick that tells why the change was made. Therefore developers must abide by the documentation etiquette described here.

  1. The user will have to explain what change was made and why.
  2. If the change was made, because of a bug, then the bug must be described and the cause of the bug must also be described. The user must also give an example of correct output and give the resulting invalid output.
  3. The user will also need to give in detail what other files the change may affect.

Integration of SCM and Bug Tracker (in the process)

During Spring 2006, an attempt was made to try and integrated the SCM (Perforce) and the bug tracker (Bugzilla) through the use of Raven Brook's P4DTI. This would allow bugs that are submitted through Bugzilla to show up within Perforce, making for a more efficient system. However, at the time, the integration was not feasible due to elderly server that was being used. The problem came about within the Mandrake distribution, which would not allow the team to install a Python MySQL? module. During the summer of 2006, the server is going to be replaced and a more flexible linux distributions will be added.

List of Resources

Words of Advice

To save time, try installing the MySQL? for Python module first. A lot of time was spent updating Bugzilla, and installing the P4DTI? , and was ultimately stopped by the Python module. If the module installs properly, upgrade Bugzilla to the newest release that supports P4DTI? . Then install P4DTI? , and try to run the replicator. Keep in mind that the email addresses in Perforce and Bugzilla must be the same in order for the replicator to do its job. Most of the documentation for the program is included in the zip download of the DTI. It is recommended that you download the files and familiarize yourself with them before attempting to install the integration. It is very scarcely documented, making the integration of Perforce and Bugzilla a non-trivial endeavor.
Topic revision: r24 - 2010-01-13 - 15:56:16 - RyanMoore
 
Home
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback