The Perforce Sample Depot provides you with a working example of a Perforce Server that can be used for testing or training. The Sample Depot demonstrates a typical depot organization along with some sensible naming conventions. It provides enough files and revision history to enable you to perform interesting and meaningful SCM tasks.
The Sample Depot contains several example projects, such as Jam, a software build tool written in C. The Sample Depot is not, however, intended to be a current archive of source code. For the latest Jam source code, see the Jam project in the Perforce Public Depot.
The Sample Depot also contains several streams, showing the Jam product's most recent development and release efforts. These streams were branched from the original Jam codelines. Other streams show new development for a product called PB, the Dynatable sample project from the Google Web Toolkit, and documents for an internal department.
The Sample Depot demonstrates several methods for arranging your source code or Web development repository. Both the source code and Web development directories are organized to support a "mainline" development model. Perforce advocates use of a mainline model for concurrent development. More information on the mainline model can be found in white papers on the Perforce Web site. In particular, see the High-level Best Practices in Software Configuration Management and Software Life-Cycle Modeling white papers. For further reference, see the book Practical Perforce.
ftp://ftp.perforce.com/perforce/tools/sampledepot.zip
ftp://ftp.perforce.com/perforce/tools/sampledepot.tar.gz
cd C:\ unzip sampledepot.zipAgain, if you don't have the unzip program on your computer, use WinZip or another compression utility that can extract .zip format files.
gunzip sampledepot.tar.gz tar xf sampledepot.tar
When the file is uncompressed, it creates a directory named PerforceSample. The PerforceSample directory contains nine items:
# a file containing Perforce metadata | |
# checkpoint checksum | |
# a directory containing Perforce archive files | |
# a directory containing Perforce archive files | |
# a directory containing Perforce archive files | |
# a directory containing Perforce archive files | |
# a directory containing Perforce archive files | |
# a directory containing Perforce archive files | |
# a description of the Sample Depot including installation instructions | |
# a directory containing Perforce archive files for a spec depot | |
# a directory containing Perforce archive files |
The PerforceSample directory is referred to as your P4ROOT location.
p4d -r C:\PerforceSample -jr C:\PerforceSample\checkpoint
p4d -r /tmp/PerforceSample -jr /tmp/PerforceSample/checkpoint
The preceding step creates the Perforce database files in your C:\PerforceSample (P4ROOT) directory. Your Perforce database is now installed.
p4d -r . -xu
On Windows, start the Perforce Server by issuing the following command at the command prompt:
p4d -r C:\PerforceSample -p 1492When the server starts, it displays the message "Perforce Server starting...". The Perforce Server is now started and listening for client connections on port number 1492.
NOTE: The DOS command shell window remains open and appears inactive when the Perforce Server is running and listening for client connections. For the purpose of simplicity, this installation example uses the command shell start method. In most cases, however, Windows users start the Perforce Server as a Windows Service and not use a DOS command shell.
On Unix, assuming you unzipped the sampledepot.zip file in your /tmp directory, start your Perforce Server by issuing the following command:
p4d -r /tmp/PerforceSample -p 1492
You are now ready to use Perforce Sample Depot! You can inspect the contents of the Sample Depot using either P4V, a graphical user interface, or P4, the command line interface. To verify your connection to the Sample Depot using P4, open a new command shell instance and issue the following command:
p4 -p 1492 infoFor help with Perforce command syntax and options, issue the following command:
p4 -p 1492 helpTo stop the Perforce Server, issue the following command:
p4 -p 1492 admin stop
You can connect as user bruno with no password, and create other accounts for use.
The Sample Depot is organized as follows:
//pb //gwt-streams
//depot/Jamgraph //depot/Talkhouse //gwt
|
|
Software Development Branching Methodology
The Sample Depot contains five software development projects:
Ongoing development work occurs in the MAIN or trunk branch under
each software project's name.
//pb/main //depot/Jamgraph/MAIN //gwt-streams/main
For example:
//depot/Jamgraph/DEV For example:
//jam/rel2.2 //jam/rel2.3 //gwt-streams/release2.0 //depot/Jamgraph/REL1.0 //depot/Talkhouse/rel1.0 //depot/Talkhouse/rel1.5 |
Web Site Branching Methodology
For Web site development, the example workflow is as follows. Web page authors edit files under:
|
|
Document Management Methodology
For document management, the example workflow is as follows. HR staff submits drafts under:
|
|
Miscellaneous Shared Files
Perforce can be used to store files that are shared between your
development and corporate staff. For example, manuals and marketing
documents are stored in the following path:
|
|