Sunday, 8 June 2014

What is Perforce (SCM Tool) ?

What is Perforce ?

Perforce is an enterprise version management system in which users connect to a shared file repository. Perforce applications are used to transfer files between the file repository and individual users' workstations.


Perforce is widely used because of its portability and platform independent file syntax that it provides.

Perforce provides its own uniform syntax for refering to workspace and depot contents. This syntax is known as a file specifier or filespec. A filespec can refer to a single file or a collection of files, to a specific revision or a range of revisions, and to depot files or workspace files.

The filespec syntax appies to all operation system, perforce converts filespecs to native file references for local operations.



What is Depot & Workspace ?

"Depots" - where perforce keeps master file content and "workspace" - where users work on the files are hierachical structures of directories and files.

A filespec uses "//" to indicate the root of the hierachy, and "/" as a directory path and file name seperator.

i.e.

//depot/ReleaseX-2014-R1/conf/onel.sh.


We often refer to an entire repository as "the depot", However, there can be multiple depots in perforce repository.

The filespec root idetifies the name of the depot. The filespec "//depot/ReleaseX-2014-R1/conf/onel.sh" refers to a depot named "depot"

Wildcard and File collections .

When filespecs contains wildcards, they define entire collections of files instead of single file.

"*" wildcard matches characters in filenames at a directory level.

i.e

For filespec like,

ProjectA/d*/*.html

can define collection of files

ProjectA/dev/index.html
ProjectA/dev/diag.html
ProjectA/doc/index.html


"..." wildcad matches characters in filenames at or below directory level. A filespect that ends in "/..." is a succinct referece to the complete colletion of files in directory hierarchy.

i.e

For,

ProjectA/... refers to the files in the ProjectA directory

ProjectA/bin/win32/app.exe
ProjectA/bin/win32/app.dll
ProjectA/dev/index.html
ProjectA/dev/main.cpp
ProjectA/doc/app/index.html
ProjectA/doc/app/reference.html
ProjectA/doc/diagnostic.html


Views and Mappings

A filespace is a special case of the perforce construct called view.

Perforce database stores views for variety of uses, including access permission, labels, branching, triggers and chage reviews. The scope of every perforce operation is constrained by the views that affect it.

some of the views involed - filespec view or workspace view



p4 dirs
p4 depots
p4 changes
p4 describe
p4 files
p4 filelog
p4 annotate
p4 print
p4 diff2



No comments:

Post a Comment