Version Control - Perforce

Perforce is a commercial, proprietary, centralized revision control system developed by Perforce Software, Inc. Users work on files in local client workspaces. With Aqua Data Studio users can now create a new Perforce repository in Aqua Data Studio and manage files. Users can also interact with the Perforce Command-Line Options using the Open API interface AQPerforce under com.aquafold.openapi.vcs in the AquaScript editor.

Your first Perforce Workspace using Aqua Data Studio

Now with Aqua Data Studio, you can create a Perforce workspace or select an existing Perforce client workspace that has already been set up for your computer

Connecting to an existing Perforce Workspace with Aqua Data Studio

  1. Select the Files Tab. Context-click on Filesystem
  2. Select Checkout Project
  3. Under General Tab, select Perforce
  4. 999pxEnter the Server URI, username, and password. Note that the URI starts with p4jrpc://
  5. Choose the first radio button to select an existing Perforce client workspace

Perforce Connecting
Select Checkout
Perforce Connecting
Existing Workspace

Create a new Perforce Workspace with Aqua Data Studio

  1. Select the Files Tab. Context click Filesystem
  2. Select Checkout Project
  3. Under General Tab, select Perforce
  4. Enter the Server URI, username, and password. Note that the URI starts with p4jrpc://
  5. Choose the second radio button to Create a new Perforce client workspace

Perforce Create
New Workspace

Syncing your Workspace

To populate your workspace with the depot files, do a Version Control --> Update(Sync)

  1. Select the Perforce workspace you mounted in ADS
  2. Right-click and select Update(Sync)

Perforce Syncing
your Workspace

Once all the files are updated, you see a message displaying the completion of the updates and that you have the most updated files in your workspace

Add files and Commit

  1. Create new text or SQL files or copy the files you require to be in version control to the Perforce Repository created using Aqua Data Studio
  2. Multi-Select the files, right-click and select Version Control --> Mark for Add. If you see a '+' sign before the files, these are added to version control
  3. To Commit the files, right-click on the directory and select Commit.

Perforce Add Files
Mark for Add
Perforce Add Files
Submit

Once all the files are committed, you will see a green tick mark to indicate that the files are now versioned.

Edit files - First Check Out and make changes

To edit a file, make changes and commit, you first need to Check Out. 

  1. Select the file you need to edit.
  2. Right-click and select Version Control > Check Out. Notice that the Green Tick mark now turns red. This indicates it is Versioned and can be modified now.
  3. Next, right-click and select Open
  4. Make the necessary changes

Perforce Checkout
File
Perforce Checkout
Edit File

If you are required to Edit many files, Select them all, right-click and select Check Out

Check-in Files using Aqua Data Studio - Submit 

Once you are finished with your edits, check-in files using the below steps. An SVN Commit is analogous with Perforce Submit

  1. Select the file you need to Check-in
  2. Right-click and select Version Control > Submit. Notice that the icon changes to the Green Tick

Perforce Check In Files

Revert unwanted changes

Suppose you want to restore the copy of your file to the revision last synced to your workspace, how will you proceed with the operation?

  1. Select the file you need to edit.
  2. Right-click and select Version Control > Revert. Notice that the icon changes to match the file's previous state.

Perforce Revert Files

If at all you are required to Revert entire files inside a folder, you can do so by just selecting the Folder and right-click and selecting Version Control > Revert, instead of selecting each file individually.

View Depots and Files using Aqua Data Studio

If you want to view the Depots available with the Perforce Server:

  1. Under Filesystem, select your Perforce repository. Right-click and select Version Control > Browse Depots
  2. You can see the available Depots.
  3. Expand the nodes and you can see the different folders and files

Perforce View Depot
 
Perforce View Depot
Navigate Files

Another way is

  1. Under Filesystem, select your Perforce repository. Right-click and select Version Control > Properties
  2. In the Perforce Properties dialog, click Depots
  3. You can see the available Depots.
  4. Expand the nodes and you can see the different folders and files

Edit Workspace and Client Mappings

If you want to control how the depot files appear in your Aqua Data Studio Workspace, you must map the files and directories on the Perforce server to the corresponding areas of your local server. This only sets up the view and does not transfer files to and fro.

  1. Under Filesystem, select your Perforce repository. Right-click and select Version Control > Edit Workspace Client
  2. Click on the View Tab
  3. Expand the depot
  4. Right-click on the Folder you are interested in
  5. Select from options Exclude Tree, Include Tree, Include Files, Exclude Files, Include Special .. and Exclude Special...

Perforce
Edit Workspace

 
Perforce
Edit Workspace
View Tab
Perforce
Edit Workspace
Form Tab

Notice corresponding Client Expression is generated on the right most tab. If you click on the Form Tab and navigate to the bottom you can see View with all the client expressions for the Depot

Show History

Within the Files Tab, left-click on a file, files, or directory to select, then right-click and navigate to "Version Control" to select "Show History...". This displays the Version Control history of the selection in the repository. Within the Repository Browser, expanding the tree to select the file or directory you wish to view the history on, then left-clicking it brings up its history in the History Table. The history displayed in the Repository Browser and the history displayed when selecting Version Control->Show History work similarly.

  1. The upper left pane shows the series of revision number
  2. The Changelist is the basic unit which consists of a list of files, their revision numbers, the changes you made to the files, and a comment
  3. You can view the comments for each commit under the header description 
  4. Select a commit and right-click. Now select Show Changes and you can see the list of files impacted for this particular commit.
  5. The lower panel shows the commit details, including the full diff

Perforce Show History
 
Perforce Show History
Changes

Depot Browser

The Aqua Data Studio Depot Browser is a convenient way to view all of the contents of the Perforce Server. While the Depot Browser shows details on item history, it does not show the status of local working versions. It is more for exploring the remote repository and its contents than managing the local versions of files.

To Launch the Depot Browser, right-click on an item in the Files Browser and select Version Control > Browse Depot.  A window appears with the list of files in the repository.  An expandable tree view appears on the left and history for the selected items in the tree appears on the right. Inside the tree, right-clicking on items allows to open and refresh. 

Additional Perforce features

  • Compare with Base Revision
  • Revert
  • An option to disconnect from the Perforce server.
  • Inline differences - You can use Text editors for SQL, HTML, XML, text, JavaScript, and Java support syntax highlighting and inline differences. Color-coded indicators instantly mark changes that differ from the local working copy
  • File Search  - You can search for files in specified folders by name and file contents, and even across a subset of files found by a previous search


  • No labels