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 white paper. For further reference, see the book Practical Perforce.
The Sample Depot requires a Perforce Server version 2011.1 or later. Installation instructions are below.
For information on the Sample Depot without Streams, see The Perforce Sample Depot Without Streams.
The Sample Depot is organized as follows:
- Stream-based Software Development Projects
- Software Development Projects
- Web Site Development
- Stream-based Document Management
- Miscellaneous Shared Files
Software Development Branching Methodology
The Sample Depot contains five software development projects:
PB, Jam, Jamgraph, Talkhouse, and GWT.
Ongoing development work occurs in the MAIN or trunk branch under each software project's name. For example:
or, in the case of the Talkhouse project, a main-dev branch:
Branches are created for feature development. Such branches isolate development work that might destabilize the MAIN branch. For example:
When code is ready for release, a release branch is created under the project name. For example:
Web Site Branching Methodology
For Web site development, the example workflow is as follows.
Web page authors edit files under:
Files are copied to a staging area for final review before going live:
After passing review, files are copied to a live branch for publishing:
For a discussion of various strategies for using Perforce for Web site development, see Web Content Management with Perforce.
Document Management Methodology
For document management, the example workflow is as follows.
HR staff submits drafts under:
Files are copied to a review area before going live:
After passing review by the HR manager, files are copied to a live stream for publishing:
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:
Word documents, Excel spread sheets, and Powerpoint slides can be managed using the Perforce Plug-in for Microsoft Office (P4OFC) available from our Web site.
The installation of the Sample Depot assumes that you have first installed a Perforce Server and client application. A 2011.1 or later version Perforce Server is required. To download Perforce for your platform, go to the Perforce Downloads page. For instructions on how to install Perforce, see the Ten Minute Test Drive page.
To install and use the Sample Depot:
- Download the Sample Depot from our ftp site. The Sample Depot is contained in a .zip file for Windows
or as a gzipped tar file for non-Windows platforms
Again, if you use a case-insensitive platform, such as Windows, use sampledepot.zip. If your are using a case-sensitive platform, such as Linux, use the gzipped tar file, sampledepot.tar.gz.
The size of the sampledepot archive file is about 15MB and uncompresses to just over 25MB.
An older, non-streams-enabled Sample Depot is still available as a .zip file only. This older Sample Depot requires a version 2006.2 or later Perforce Server.
Uncompress the sampledepot.zip file using a standard compression utility such as unzip or WinZip. For example, on Windows, select Start > Program Files > Accessories > Command Prompt from the menu. When the DOS command shell appears, issue the following command:
cd C:\<sampledepot.zip directory>
Again, if you don't have the unzip program on your computer, use WinZip or another compression utility that can extract .zip format files.
On non-Windows platforms, extract the package using:
tar xvf sampledepot.tar
When the file is uncompressed, it creates a directory named PerforceSample. The PerforceSample directory contains nine items:
- checkpoint # file containing Perforce metadata
- checkpoint.md5 # checkpoint checksum
- depot # directory containing Perforce archive files
- gwt # directory containing Perforce archive files
- gwt-streams # directory containing Perforce archive files
- HR # directory containing Perforce archive files
- jam # directory containing Perforce archive files
- pb # directory containing Perforce archive files
- spec # directory containing Perforce archive files for the spec depot
- system # directory containing Perforce archive files
- readme.html # description of the Sample Depot including installation instructions
The PerforceSample directory is referred to as your P4ROOT location.
- Copy the p4d executable to the PerforceSample directory.
copy p4d.exe "C:\PerforceSample" cd "C:\PerforceSample"
On non-Windows environments, assuming you gunzipped the sampledepot.tar.gz file in your /tmp directory:
cp p4d /tmp/PerforceSample
To create your sample Perforce database, restore the checkpoint file by issuing the following command where C:\PerforceSample is replaced by the location of the PerforceSample directory:
p4d -r C:\PerforceSample -jr C:\PerforceSample\checkpoint
On non-Windows environments, assuming you unzipped the sampledepot.zip file in your /tmp directory:
./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.
To ensure that the database format is consistent with the Perforce Server version that you are using upgrade your Sample Depot.
To upgrade to p4d 2013.2 or earlier:
p4d -r . -xu
If the command is successful, you will see the message:
Start the Perforce Server.
On Windows, start the Perforce Server by issuing the following command at the command prompt:
p4d -r C:\PerforceSample -p 1492
When 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. The command prompt will not return until you stop Perforce.
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, not from a DOS command shell. When running as a Windows Service, the service listens for Perforce client connections in the background.
On UNIX, assuming you unzipped the sampledepot.tar.gz file in your /tmp directory, start your Perforce Server by issuing the following command:
./p4d -r /tmp/PerforceSample -p 1492 -d
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. Specify your server as localhost or the name of your machine. Choose port 1492. Specify your name as the user, or use the supplied user, bruno, with no password. Create your own client workspace, or create a directory c:\P4DemoWorkspaces\bruno_ws and use the supplied bruno user. On non-Windows platforms, choose a new workspace root directory or make a new workspace.
To verify your connection to the Sample Depot using P4, open a new command shell instance and issue the following command:
p4 -p 1492 info
For help with Perforce command syntax and options, issue the following command:
p4 -p 1492 help
To stop the Perforce Server, issue the following command:
p4 -p 1492 admin stop
For basic instructions on using P4V to connect a Perforce Server, see the Ten Minute Test Drive, or consult the P4V Help menu.
For additional information on setting up the Perforce Server or using Perforce applications, see the main documentation page on our Web site. If you encounter any problems installing or using the Sample Depot, please contact Perforce Support at firstname.lastname@example.org.