Update modes training

This training page gives a description of update modes in Perforce IPLM, and a simple example of updating a workspace.

Update modes

In the course of development users often want to update their workspace to get the latest changes from other team members while maintaining their own changes intact. A situation might arise, for example, where the user made modifications to a number of files starting from release '15' of an IP, while other team members made their own modifications and then released them as release '16'. In this case, the user might want to update to release '16' for all the files and resources that are untouched by him, resulting in a workspace that incorporates the latest changes from team members, while leaving his own work intact.

Perforce IPLM provides 'change aware' workspace updates. In many cases work will be in progress in a given workspace with some number of local modifications. The workspace owner will wish to bring in updates from releases that other users have made, but they will often want to maintain their local changes to some degree while doing so.

There are three update modes that can be applied to Perforce IPLM workspaces:

Update Mode Description
--force Update to the exact new version, overwrite local changes
--keep-local Keep my local changes, but update everything else to the new version
--promote (default) Keep my local changes, unless they are older than the new version, update everything else to the new version

These update modes can be used with IP resources in any DM system integrated with Perforce IPLM. They also can be used with Perforce file versions, and some other DMs that support them.

The Updating the Workspace section gives a full description of what happens to individual files and resources when updating a workspace, here we will take a look at one example of updating the workspace and the associated changes.

Workspace update example

Load an IP into two workspaces ws1 and ws2.

Loading an IP into Two Workspaces
> pi ip load tutorial.gen_dig ws1 --local tutorial.gen_dig
Loading 'tutorial.gen_dig@3.TRUNK' into Workspace '/mdx/work/ws1'
┌──────────────────────┬─────────┬───────┬───────────────┐
│ NAME                 │ VERSION │  MODE │ RELATIVE PATH │
╞══════════════════════╪═════════╪═══════╪═══════════════╡
│ tutorial.gen_dig     │ 3.TRUNK │ Local │ gen_dig       │
└──────────────────────┴─────────┴───────┴───────────────┘


> pi ip load tutorial.gen_dig ws2 --local tutorial.gen_dig
Loading 'tutorial.gen_dig@3.TRUNK' into Workspace '/mdx/work/ws2'
┌──────────────────────┬─────────┬───────┬───────────────┐
│ NAME                 │ VERSION │  MODE │ RELATIVE PATH │
╞══════════════════════╪═════════╪═══════╪═══════════════╡
│ tutorial.gen_dig     │ 3.TRUNK │ Local │ gen_dig       │
└──────────────────────┴─────────┴───────┴───────────────┘

Make changes to files in first workspace (ws1) and release the IP

Changing Files within a Workspace and Releasing the IP
> pi ws st -v
Workspace ID : 96fcff79-2341-454e-b163-d9d41e4bde72
Directory    : /mdx/work/ws1
IP           : tutorial.gen_dig@3.TRUNK
Resources    :
┌──────────────────────┬──────────────────┬───────────────┬───────────┬───────────────┬───────┐
│ NAME                 │ EXPECTED VERSION │ LOCAL VERSION │ WS STATUS │ SERVER STATUS │  MODE │
╞══════════════════════╪══════════════════╪═══════════════╪═══════════╪═══════════════╪═══════╡
│ tutorial.gen_dig     │     3.TRUNK      │    3.TRUNK    │     OK    │       OK      │ Local │
└──────────────────────┴──────────────────┴───────────────┴───────────┴───────────────┴───────┘

> p4 edit gen_dig/hw_code/test/test.v 
//depot/tutorial/gen_dig/trunk/hw_code/test/test.v#1 - opened for edit

(make some trivial changes to test.v and save it)
> vi gen_dig/hw_code/test/test.v
> p4 submit -d "Made changes to test.v"Submitting change 5.
Locking 1 files ...
edit //depot/tutorial/gen_dig/trunk/hw_code/test/test.v#2
Change 5 submitted.

> pi release -d "Made changes to the verilog"Successfully created 'tutorial.gen_dig@4.TRUNK'

> pi ws st -v
Workspace ID : 96fcff79-2341-454e-b163-d9d41e4bde72
Directory    : /mdx/work/ws1
IP           : tutorial.gen_dig@4.TRUNK
Resources    :
┌──────────────────────┬──────────────────┬───────────────┬───────────┬───────────────┬───────┐
│ NAME                 │ EXPECTED VERSION │ LOCAL VERSION │ WS STATUS │ SERVER STATUS │  MODE │
╞══════════════════════╪══════════════════╪═══════════════╪═══════════╪═══════════════╪═══════╡
│ tutorial.gen_dig     │     4.TRUNK      │    4.TRUNK    │     OK    │       OK      │ Local │
└──────────────────────┴──────────────────┴───────────────┴───────────┴───────────────┴───────┘

Go to the second workspace and check the status of that workspace. Confirm that the changes seen in the first workspace are not seen in the second workspace.

Comparing the Two Workspaces
> cd ../ws2/
> pi ws st -v
Workspace ID : b3831064-84a1-4da4-af27-d557d6e65825
Directory    : /mdx/work/ws2
IP           : tutorial.gen_dig@3.TRUNK
Resources    :
┌──────────────────────┬──────────────────┬───────────────┬───────────┬───────────────────────┬───────┐
│ NAME                 │ EXPECTED VERSION │ LOCAL VERSION │ WS STATUS │     SERVER STATUS     │  MODE │
╞══════════════════════╪══════════════════╪═══════════════╪═══════════╪═══════════════════════╪═══════╡
│ tutorial.gen_dig     │     3.TRUNK      │    3.TRUNK    │     OK    │ New version available │ Local │
└──────────────────────┴──────────────────┴───────────────┴───────────┴───────────────────────┴───────┘

Run pi update and then check the status of the workspace. Users can open up the file that was edited in the first workspace and confirm the same changes are now present in the second workspace.

pi update Command
> pi update
Updating workspace. For large IP this could take a while
┌──────────────────────┬─────────────┬─────────────┬───────┬─────────┐
│ NAME                 │ OLD VERSION │ NEW VERSION │  MODE │ PATH    │
╞══════════════════════╪═════════════╪═════════════╪═══════╪═════════╡
│ tutorial.gen_dig     │   3.TRUNK   │   4.TRUNK   │ Local │ gen_dig │
└──────────────────────┴─────────────┴─────────────┴───────┴─────────┘

> pi ws st -v
Workspace ID : b3831064-84a1-4da4-af27-d557d6e65825
Directory    : /mdx/work/ws2
IP           : tutorial.gen_dig@4.TRUNK
Resources    :
┌──────────────────────┬──────────────────┬───────────────┬───────────┬───────────────┬───────┐
│ NAME                 │ EXPECTED VERSION │ LOCAL VERSION │ WS STATUS │ SERVER STATUS │  MODE │
╞══════════════════════╪══════════════════╪═══════════════╪═══════════╪═══════════════╪═══════╡
│ tutorial.gen_dig     │     4.TRUNK      │    4.TRUNK    │     OK    │       OK      │ Local │
└──────────────────────┴──────────────────┴───────────────┴───────────┴───────────────┴───────┘