Preface

This guide tells you how to use the Helix Command-Line Client (p4). If you’re new to version management systems, you don’t know basic Helix concepts, or you’ve never used Helix before, read Introducing Helix before reading this guide. This guide assumes a good basic understanding of version control.

Perforce provides many applications that enable you to manage your files, including the Helix Command-Line Client, GUIs — such as P4V — and plug-ins. The Helix Command-Line Client enables you to script and to perform administrative tasks that are not supported by Helix GUIs.

Getting started with Helix

If this is your first time working with Helix, here’s how to get started:

  1. Read Introducing Helix to learn the basics.

    At a minimum, learn the following concepts: changelist, depot, client workspace, sync, and submit. For short definitions, refer to the glossary at the back of this guide.

  2. Ask your Helix administrator for the host and port for your Helix service.

    If you intend to experiment with Helix and don’t want to risk damaging your production depot, ask the Helix administrator to start another service for test purposes. For details about installing the Helix service, refer to the Helix Versioning Engine Administrator Guide: Fundamentals.

  3. Use this guide to help you install the Helix Command-Line Client and configure your client workspace, unless your system administrator has already configured your machine. See “Configuring P4”, for details.
  4. Learn to perform the following tasks:

    • sync (transfer selected files from the repository to your computer)
    • submit (transfer changed files from your workspace to the repository)
    • revert (discard changes)

    See “Managing Files and Changelists”, for details.

  5. Learn to refine your client view. See Refining workspace views for details.

These basic skills enable you to do much of your daily work. Other tasks involving code base maintenance (streams, branching and labeling) and workflow (jobs) tend to be less frequently done. This guide includes details about performing these tasks using p4 commands.

What’s new in this guide for 2015.2

This section provides a list of changes to this guide for the Helix Versioning Engine 2015.2 release. For a list of all new functionality and major bug fixes in Helix Versioning Engine 2015.2, see the Helix Versioning Engine 2015.2 Release Notes.

Streams are now documented in their own chapter

See “Streams”.

Pass label specifier in stream’s import path

You can now pass a label specifier in an import path for a stream. See The stream specification.

Store streams more than one level below depot name

Stream path depths are no longer limited to 1. Your administrator sets the permitted level for a depot using the p4 depot command; the names of all streams rooted in that depot must conform to this depth. This means that the stream name you set in the Stream field of the stream spec must conform to this depth. For more information, see the discussion of the Stream field in The stream specification.

p4 stream edits current stream by default

By default, p4 stream edits the stream associated with your current workspace. The command throws an error if you’re not using a stream workspace. See Stream workspaces.

Pass changelist to p4 switch

You can now set the workspace view to match the version of a stream as of a specified changelist and sync the files to the versions matching that same changelist, by passing stream@change to p4 switch. See Managing stream workspaces.

Stream specs openable and submittable

Stream specifications may now be opened and submitted, enabling them to be staged on a particular client and tested before being submitted atomically in a changelist along with a set of files. See Updating streams.

p4 submit submits open stream specs

When you run p4 submit, in addition to any open files being submitted, now any open stream specifications will also be submitted. See Making changes to a stream spec and associated files atomically.

p4 shelve shelves open stream specs

When you run p4 shelve, in addition to any open files being shelved, now any open stream specifications will also be shelved. See Making changes to a stream spec and associated files atomically.

p4 shelve unshelves open stream specs

When you run p4 unshelve, in addition to any shelved files being unshelved, now any shelved stream specifications will also be unshelved. See Making changes to a stream spec and associated files atomically.

Update client’s have list to match workspace contents

A user can now update their client’s have list to match what’s in the client workspace, using the p4 reconcile command’s new -k option. See Add files outside of Helix and then use p4 reconcile -k.

Helix now supports the UTF8 file type

See Helix File Types.

Report ignore mappings

Helix can now report the ignore mappings computed from the rules in the P4IGNORE file, using the new p4 ignores command. See Reporting ignored files.

Helix documentation

The following table lists and describes key documents for Helix users, developers, and administrators. For complete information see the following:

http://www.perforce.com/documentation

For specific information about…​ See this documentation…​

Introduction to version control concepts and workflows; Helix architecture, and related products.

Introducing Helix

Using the command-line interface to perform software version management and codeline management; working with Helix streams; jobs, reporting, scripting, and more.

Helix Versioning Engine User Guide

Basic workflows using P4V, the cross-platform Helix desktop client.

P4V User Guide

Working with personal and shared servers and understanding the distributed versioning features of the Helix Versioning engine.

Using Distributed Versioning with Helix

p4 command line (reference).

P4 Command Reference, p4 help

Installing and administering the Helix versioning engine, including user management, security settings.

Helix Versioning Engine Administrator Guide: Fundamentals

Installing and configuring Helix servers (proxies, replicas, and edge servers) in a distributed environment.

Helix Versioning Engine Administrator Guide: Multi-site Deployment

Installing and administering a Helix server cluster for high performance and automated failover.

Helix Versioning Engine Administrator Guide: Cluster Management

Helix plug-ins and integrations.

IDEs: Using IDE Plug-ins
Defect trackers: Defect Tracking Gateway Guide
Others: online help from the Helix menu or web site

Developing custom Helix applications using the Helix C/C++ API.

C/C++ API User Guide

Working with Helix in Ruby, Perl, Python, and PHP.

APIs for Scripting

Syntax conventions

Helix documentation uses the following syntax conventions to describe command line syntax.

Notation Meaning

literal

Monospace font indicates a word or other notation that must be used in the command exactly as shown.

italics

Italics indicate a parameter for which you must supply specific information. For example, for a serverid parameter, you must supply the id of the server.

[-f]

Square brackets indicate that the enclosed elements are optional. Omit the brackets when you compose the command.

Elements that are not bracketed are required.

…​

Ellipses (…​) indicate that the preceding element can be repeated as often as needed.

element1 | element2

A vertical bar ( | ) indicates that either element1 or element2 is required.

Please give us feedback

We are interested in receiving opinions on this manual from our users. In particular, we’d like to hear from users who have never used Perforce before. Does this guide teach the topic well? Please let us know what you think; we can be reached at [email protected].

If you need assistance, or wish to provide feedback about any of our products, contact [email protected].