Sunday, 8 June 2014

Perforce and Workspace

Workspace Operation :


Perforce refers workspace as a client.

A client workspace specification or client spec, tells perforce where in your local filesystem you want your workspace to be rooted. It has a view that defines the areas of the depot you want access to, and maps them to directories beneath the workspace root. Once set up has been done, you can work on files.

Perforce database model has many non-file objects, including workspace, user, user group, depots etc. The interface to these non-file objects is what perforce calls spec forms. Perforce gives a spec form to edit/create any non-file object.


1. How to create or edit client/workspace

#P4 client <client/workspace name>

This command brings up a spec form in editor for the client specified with this command. If no name is given then p4 will use the hostname of that machine. Mapping is very much important in perforce workspace.


2. Setting up current workspace.

P4 programs uses P4CLIENT environment variable to detemine the current client workspace name. If P4CLIENT is not set, the name of your hostname will be used as the current workspace name. Need to just set up P4CLIENT varaible in your environment.

2. How to delete client/workspace from the perforce server.

#p4 client -d <client/workspace name>

-d parameter causes the named client to be deleted

3. How to list all clients/workspaces in perforce server.

#p4 clients
or
#p4 workspaces

This command lists all the clients/workspace on perforce server

Each line represent

Client <client name> <date client created> root <client root> <description of client>

4. How to identify the client/workspace.

#p4 info

This will list all information like client name,host name,client root,client address,server address,server root, server date, server version and license.

5. How to see client spec form without opening up editor.

#p4 client -o <client/workspace>

-o causes the name client/workspace specification to be written to the standard output

No comments:

Post a Comment