Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
If you've picked up this book simply because of its riveting title, you may be wondering what Perforce is. Perforce is a software configuration management (SCM) system. SCM systems are used by software developers to keep track of all the software they build and all the components that go into it.
A good SCM system can explain the mysteries of software development and head off its disasters—mysteries like lost bug fixes, and disasters like botched file merges. In large-scale and commercial environments, good SCM is absolutely essential to producing good software.
It's All Software and We're All Software DevelopersSCM was once concerned with files that computer programmers produced. Now it is concerned with files of all types that a business produces. Software, when viewed from the perspective of SCM, is any endeavor that calls a computer home. Documention, web content, spreadsheets, schematics, graphics, sound—it's all software. If it's stored in computer files and gets built, embedded, or packaged into a deliverable result, it's software. The term software developer may not sound like it applies to web content authors, graphic artists, test engineers, and technical writers, but for the purpose of this book, anyone whose work involves creating computer files from intellectual thought is a software developer. |
Perforce, like all SCM systems, keeps track of changes as people do concurrent, parallel work on files. It logs activity, reports who did what; compares, merges, and branches files; and stores files and file configurations. Some of Perforce's most salient features are:
The depot
Perforce stores files in a protected repository known as the depot. The depot is a centrally located, permanent archive of all file content submitted by users.[*]
[*] The data format of the Perforce depot is not proprietary; it is, in fact, consistent with the RCS archive format. Because of this, there is a common misperception that Perforce is an RCS wrapper. It's not.
Workspaces
Perforce users work on files in workspaces, private disk areas of their own that contain copies of depot files. In this book we'll describe effective ways developers can use workspaces, and we'll also discuss how workspaces can be used to automate nightly builds, release packaging, web staging, and other software production tasks.
Changelists
Perforce changelists tie files changed together into single units of work. Every change to the depot can be traced to a changelist, and every changelist marks a known, reproducible state of the depot; the depot evolves as changelists are submitted. In the Perforce view of SCM, it is the changelist—not the file revision, nor the delta—that is the atomic transaction of software development. This book will discuss a variety of ways changelists can be used, including treating them as snapshots and using them to identify file dependencies.
Filespecs and views
The Perforce filespec syntax, and the views that use it, allow selection of files for Perforce operations. Filespecs can define not only the common file collections, like directories, but arbitrary collections of files that constitute codelines, modules, delivery streams, and other containers. They are the key to treating collections of files as versioned objects that can be inspected, rolled back, branched, labeled, compared, and merged at any version.
Jobs
In Perforce you can record externally defined tasks and states—bug reports, feature requests, and project milestones, for example—in objects it calls jobs. Jobs can be linked to changelists to provide a record of software changes related to tasks. Jobs are also the linchpin of any integration between Perforce and external systems, as we'll see in later chapters.
Branching
Perforce uses Inter-File Branching to model file variants. In the traditional version tree branching model used by most SCM systems, a file can be be branched and merged only into revisions of itself. In Perforce, any two files can have a branching relationship; branched files are peers, not offshoots, of their originals. A number of chapters in this book are dedicated to describing Perforce branching and its unexpectedly useful applications.
Integration history
In Perforce, branching and merging are referred to as integration. Perforce records a history of integration events and uses it to direct merges and prevent unnecessary remerging. In this book you'll see how Perforce does that and learn how to anticipate the effect of merges you perform.
Change tracking
Perforce combines filespecs, changelists, jobs, and integration history to track changes as they are merged from branch to branch. In this book you'll learn how these objects can be used to determine whether a change—a bug fix, for example—made in one branch has been merged to another, no matter how distantly related.
In addition to these features, which could be considered the interesting capabilities of Perforce, there are also the standard housekeeping and productivity features you're likely to find in any SCM system, including labels, triggers, change notification, graphical merge tools, file histories, and so forth.