Monday 8 November 2010

Determining Which File Was Synced Using Overlay Mapping

Several overlay mappings are being used and updated in the client view, and I need to determine which depot file was actually synced to the local workspace.

When overlay mapping is used in the selected workspace client specification, it can become difficult to determine what depot file was synced to a workspace.

Using p4 fstat against a local path that has been overlaid produces information for both files in the depot.

The -Rh flag with p4 fstat limits the output to files actually synced to the client.

For example, assuming a client view of:

+//depot/a.txt //a_client/foo.txt +//depot/b.txt //a_client/foo.txt 

Syncing this client and entering the command produces:

p4 fstat -T "depotFile" -Rh //a_client/foo.txt... depotFile //depot/b.txt 

To confirm that the synced file is what is displayed, you can swap the views:

+//depot/b.txt //a_client/foo.txt  +//depot/a.txt //a_client/foo.txt 

And force sync the file:

p4 sync -f //a_client/foo.txt

The resulting fstat output is:

p4 fstat -T "depotFile" -Rh //a_client/foo.txt... depotFile //depot/a.txt

For more information on overlay mapping, refer to the P4 User's Guide section "Refining client views".


View the original article here

No comments:

Post a Comment