Getting Started with P4VS

This chapter provides an overview of P4VS, the Perforce plugin for Visual Studio, as well as instructions for installing and setting it up.

About P4VS, the Perforce plugin for Visual Studio

P4VS, the Perforce plugin for Visual Studio, enables you to use Perforce as your source control from within Visual Studio.

Basic Perforce Terminology

  • Depot: The shared repository where file revisions are stored and managed by the Perforce versioning service.
  • Workspace: The area on your computer where you work with your copies of files that are under Perforce control.
  • Perforce service: The application that manages file revisions.
  • Changelist: A group of files, with a description explaining how you have changed them (for example, Fix bug #123). Changelists are assigned numbers by the Perforce versioning service so you can track them. Changelists enable you to group related files and submit them together.

The following diagram shows the relationship between workspace and depot:

The relationship between a workspace and a depot

Basic Tasks

  • Get revision: Retrieve a copy of a file version from the depot. Perforce also uses the term sync to mean get revision.
  • Check out: Enables you to change the file.
  • Mark for add or delete: indicates that the file is added to or deleted from the depot when the changelist is submitted.
  • Revert a file: Discard any changes you have made to an open file. If you open a file for edit and make changes, then change your mind and revert the file, Perforce reloads the last version you got from the depot and discards your changes.
  • Submit a changelist: Update the depot to reflect any changes you have made to files in the changelist. Submitting is an all-or-nothing operation: if there is a problem submitting one file in a changelist, none of the other files in the changelist are updated.

Using Solution Explorer with P4VS

Solution Explorer provides access to most P4VS functionality and status information.

  • When you context-click a file in Solution Explorer, all P4VS actions enabled for that file are available for selection in the context menu.
  • Badges on file icons indicate Perforce status:

    Marked for add

    Marked for add

    Marked for delete

    Marked for delete

    Checked out by you

    Checked out by you

    Checked out by another user

    Checked out by another user

    Locked

    Locked

    Version in workspace is not latest version

    Version in workspace is not latest version

    Workspace version is up to date

    Workspace version is up to date

    Needs resolve (conflicting changes have been made)

    Needs resolve (conflicting changes have been made)

    File not in Perforce depot

    File not in Perforce depot

    Marked for integrate

    Marked for integrate

    Ignored

    Ignored

    File is lazily loaded, whenever operated on by P4VS

    File is lazily loaded, whenever operated on by P4VS

Context-click a file and select Refresh in the context menu to refresh Perforce status information for the file and any of its children.

Note

If you select Automatically update files status when selection changes in the P4VS Preferences, the file’s Perforce status updates automatically when you click or hover over the file icon, without having to click Refresh.

Using P4VS toolbars in Visual Studio

P4VS provides two toolbars that you can use with Visual Studio:

  • The P4 Connection toolbar displays your current Perforce service connection (hostname:port, workspace, and user), as well as the pending changelist you are working in.
  • The P4VS toolbar provides the same menu of P4VS options as the Solution Explorer context menu.

To enable these toolbars, select View > Toolbars.

For more information

Watch our P4VS tutorial video: https://www.perforce.com/video-tutorials/plugin-visual-studio

For more information about how to use Perforce, see Introducing Helix.

For the P4VS release notes, see https://www.perforce.com/perforce/doc.current/user/p4vsnotes.txt.