Perforce P4V Client Tutorial
Perforce P4V Client Tutorial
2
Getting Started with P4V
July 2007
This manual copyright 2005-2007 Perforce Software.
All rights reserved.
Perforce software and documentation is available from http://www.perforce.com. You may download and use
Perforce programs, but you may not sell or redistribute them. You may download, print, copy, edit, and redistribute
the documentation, but you may not sell it, or sell any documentation derived from it. You may not modify or attempt
to reverse engineer the programs.
Perforce programs and documents are available from our Web site as is. No warranty or support is provided. Warran-
ties and support, along with higher capacity servers, are sold by Perforce Software.
Perforce Software assumes no responsibility or liability for any errors or inaccuracies that may appear in this book.
By downloading and using our programs and documents you agree to these terms.
Perforce and Inter-File Branching are trademarks of Perforce Software. Perforce software includes software developed
by the University of California, Berkeley and its contributors.
All other brands or product names are trademarks or registered trademarks of their respective companies or organi-
zations.
Table of Contents
Basic Concepts.....................................................................................................5
Connecting to a Server.......................................................................................6
Navigating the Main Screen..............................................................................8
Setting up your workspace ...............................................................................9
Managing your Files ........................................................................................11
Getting files from the depot........................................................................11
Checking out files from the depot .............................................................12
Editing files in your workspace .................................................................12
Diffing files to view your edits...................................................................12
Discarding edits by reverting .....................................................................13
Checking your edits into the depot ...........................................................13
Displaying a file’s revision history ............................................................15
Graphical Reporting Tools...............................................................................15
Viewing file revisions as a diagram...........................................................16
Browsing file revisions using Time-lapse View .......................................17
Displaying folder history using the folder diff tool ................................18
Important and Useful Features.......................................................................19
Tooltips...........................................................................................................19
Drag and drop...............................................................................................19
File views .......................................................................................................20
Tearing off tabs .............................................................................................21
Setting Preferences .......................................................................................21
Migrating from P4Win .....................................................................................22
Next Steps ..........................................................................................................25
P4V, the Perforce Visual client, is Perforce’s cross-platform graphical user interface. You
can use P4V on Windows, Macintosh, UNIX and Linux computers and benefit from an
identical interface regardless of platform. This introductory guide provides some Perforce
basics and an orientation to P4V’s layout and features. For more details about P4V,
consult its online help. To learn more about Perforce, consult the user documentation on
our Web site.
To use Perforce to manage files, you typically connect to a Perforce server using a client
program like P4V. P4V enables you to check files in and out, and perform the various
other necessary tasks. The following sections tell you how to perform basic tasks and
point out powerful features and shortcuts.
Basic Concepts
P4V connects your computer to a Perforce server to move files between Perforce depots and
your workspace, as shown below.
(workspace) (depot)
• Server: the program that executes the commands sent by client programs, maintains
depot files, and tracks the state of workspaces. The Perforce Server typically runs on a
central machine, connected to client machines by the network.
• Depot: a file repository on the Perforce server. It contains all existing versions of all files
ever submitted to the server. There can be multiple depots on a single server. The
examples in this guide show a single depot.
Connecting to a Server
To gain access to your depots, you must connect to a server. To connect to a server:
1. Launch P4V. P4V displays the following connection dialog:
2. Specify the following settings (your Perforce administrator can provide you with this
information)
• Server: the name of the computer where your Perforce server is running.
• Port: the port number assigned to the server
• User: your Perforce user name
3. To connect, click OK. P4V displays its main screen, as shown in the following figure.
Left pane: displays files Log pane: displays the Perforce commands
and folders. The Depot tab that P4V issues, plus error messages and
displays files in the results.
Perforce server, and the
Workspace tab displays
files in the workspace on
your computer
View: enables you to restrict the Root: specifies the location on your
depot files to which you have access. computer under which Perforce stores
Set the view to ensure that you see copies of depot files. Specify a
only what you need to see. meaningful name, and make sure it’s
not set to your computer’s root
directory!
To change a workspace specification, click . To display and set the client view
graphically, click the View tab. Browse to desired files and folders and context-click to
include them or exclude them from the client view, as shown in the following figure.
Click Save to save changes. Click the “x” to dismiss the Workspace
specification list.
In the left pane, note that the file displays a green dot, indicating that it is present in your
workspace:
Now the file resides in your workspace. If you want to edit the file, you must first check it
out.
In the left pane, note that the file displays a red check mark, indicating that you checked it
out:
Note that, when you check out a file, Perforce adds it to a changelist, which is a list of
related files. You can use changelists to group related files, for example, all files that
contain changes required to implement a new product feature. To view the changelist,
choose View > Pending Changelists or click in the toolbar.
Now you’re ready to edit your files.
pane and choose Diff against Revision. P4V launches P4Diff, displaying the differences
between the two files. For example:
1. Display pending changelists: click in the toolbar. P4V displays a list of pending
changelists, as shown in the following figure. To display the files in a changelist,
expand it
2. Double-click the changelist in which your file is open. P4V displays the details, as
shown in the following figure.
3. Enter a description explaining the changes you made and click Submit. The Log
pane displays a message confirming that your changelist was submitted, similar to
the following.
Change 7941 submitted.
submit complete. 1 file affected.
This diagram shows you when the file was created and how it was branched, and enables
you to view details about each version submitted to the depot and navigate through the
graph using the navigation map. For more details about the information displayed in the
revision graph, consult P4V online help.
Slider: move to
sweep through
revisions
Using Time-lapse View, you can sweep through all revisions of the file using the slider,
noting when changes were made and who made them. Again, for details, consult P4V
online help.
2. To display the changes that occurred between two revisions of a folder, drag and
drop one of the revisions on the other.
P4V displays the changes as shown in the following figure. This example shows that,
between the selected revisions, a file was edited and checked in. File highlights are color-
coded to indicate additions, changes, and deletions. Expand folders and scroll to locate
changes of interest. To skip to the next or previous change, click the right and left arrows.
Tooltips
P4V provides tooltips for many objects on the screen. For example, to display the status of
a file, hold the mouse cursor over the file in the left pane. P4V displays a tooltip like the
following one.
Another example: to display a changelist description, click in the toolbar and hold the
mouse cursor over the changelist in the right pane. There are tooltips for all the P4V
buttons, too.
File views
If you use Perforce to manage graphics files, P4V’s thumbnail views enable you to
preview the files. To display thumbnails, click the Files tab in the right pane, then select
the desired thumbnail size from the title bar.
Setting Preferences
To configure P4V, choose Tools > Preferences. The tabbed Preferences dialog is
displayed. In particular, the Editor tab enables you to associate applications with file
types, overriding any operating system associations. The Diff and Merge tabs enable you
to configure external applications, in case you prefer tools other than those that are
bundled with P4V.
Next Steps
This guide helps you to start working with files using P4V and points out important basic
features, but P4V enables you to do much more: create jobs, branch groups of files, and
handle file conflicts that arise in team development settings.
Perforce superusers can perform administrative operations by choosing Tools >
Administration. Using the Administration tool, superusers can manage users and groups,
and their access to files and folders within the depot. Some administrative functions must
still be performed using the Perforce command-line client (p4). For details, see the Perforce
Command Reference and the Perforce System Administrator’s Guide.
To become expert with P4V:
• Consult the P4V online help and read the Perforce user documentation available from
the Perforce Web site.
• Use tooltips.
• Pay attention to the file icons and decorations in the left pane. The decorations and
icons display a great deal of information about the type and status of a file.
• Start reading the Log pane.
• Learn drag and drop shortcuts to simplify operations on large sets of files.
• Use P4V views and filtering features to enable you to selectively display information.
To get the whole picture, read the P4V online help, Introducing Perforce and the Perforce
System Administrator’s Guide. The guides, which are available from the Perforce web site,
describe the full set of features that the Perforce Server provides. Perforce Technical
Support is always ready to help you, and there’s a thriving community of Perforce users
active on the perforce-users mailing list. Consult our web site for details.