Feeds

Subversion versus Perforce

Popular source code management tools go head to head

Securing Web Applications Made Simple and Scalable

Perforce essentials

Perforce always installs as a server daemon and deployment is straightforward. Although it uses a customized BerkeleyDB, Robertson assures us that it does not suffer from lock-ups. In addition, Perforce offers a generous range of command-line tools, GUI clients, and IDE plug-ins.

You can integrate Perforce with Apache through a module called WebKeeper - allowing browser access to repositories but with limited features - or use a standalone Perforce web server called P4Web, which is more complete. Windows users get P4V, an excellent GUI client which improves on the older P4Win.

Perforce is keen to include users who are not necessarily programmers, and to promote this the company has plug-ins for applications including Microsoft Office, Adobe Photoshop, and Adobe Dreamweaver through a driver that emulates FTP. You can also access Perforce repositories through ODBC, or use the reporting tool P4Report.

A key concept in Perforce is the Changelist, which is a set of changes made to the repository at a particular time. By contrast, Subversion changesets have to be derived by comparing revisions. As with Subversion, commits are atomic. Triggers are supported, and using these is the only way to configure Perforce for external authentication, using an LDAP server or Windows Active Directory. This is one aspect of Perforce which is not as seamless as it should be. Perforce is modular. This Windows installer shows the essential modules for both client and server.

essential modules for client and server

To lock or not to lock

Old-style source control works on the basis that only one person at a time can modify a file. Lock the file, edit, then check-in and release the lock. This is viable for small teams, though aggravating when someone has locked the file you want to edit. The model is unsuitable for substantial open-source projects.

Subversion therefore adopts a liberal approach. Your working files are always writable, and anyone can submit changes. If you submit changes to a file that has changed since you last updated it from the repository, the two versions are merged, either automatically, or with human intervention when that is not possible. The outcome is smoother team working, at the expense of an occasionally difficult merge.

Another possibility is to give most users read-only access to the repository. In this case, changes are submitted to project administrators in the form of patches. The admins have the task of merging the patches after checking their contents. This is a common model for open-source, and one which both Subversion and Perforce support through diff commands, letting you create patch files.

Perforce falls in between old-style locking and Subversion’s liberalism. Perforce marks working files read-only unless you check them out for edit. Multiple users can check-out the same file, but will be warned. You can easily find out who else is editing the file. By contrast, with Subversion there is normally no way to tell; all files are always checked out for edit.

Early versions of Subversion did not support locking at all, but this is no longer the case. You can now lock files, query files to see who has locked them, and even mark files as requiring locks before edits. This makes sense for binary files where merging is impossible. So Subversion now supports the locking model, though liberalism remains in that any user can break a lock on request. It’s also true that Perforce fully supports parallel working, though unlike Subversion it does not positively encourage it.

Bridging the IT gap between rising business demands and ageing tools

More from The Register

next story
NO MORE ALL CAPS and other pleasures of Visual Studio 14
Unpicking a packed preview that breaks down ASP.NET
Cheer up, Nokia fans. It can start making mobes again in 18 months
The real winner of the Nokia sale is *drumroll* ... Nokia
Mozilla fixes CRITICAL security holes in Firefox, urges v31 upgrade
Misc memory hazards 'could be exploited' - and guess what, one's a Javascript vuln
Put down that Oracle database patch: It could cost $23,000 per CPU
On-by-default INMEMORY tech a boon for developers ... as long as they can afford it
Google shows off new Chrome OS look
Athena springs full-grown from Chromium project's head
Apple: We'll unleash OS X Yosemite beta on the MASSES on 24 July
Starting today, regular fanbois will be guinea pigs, it tells Reg
HIDDEN packet sniffer spy tech in MILLIONS of iPhones, iPads – expert
Don't panic though – Apple's backdoor is not wide open to all, guru tells us
prev story

Whitepapers

Designing a Defense for Mobile Applications
Learn about the various considerations for defending mobile applications - from the application architecture itself to the myriad testing technologies.
Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Top 8 considerations to enable and simplify mobility
In this whitepaper learn how to successfully add mobile capabilities simply and cost effectively.
Seven Steps to Software Security
Seven practical steps you can begin to take today to secure your applications and prevent the damages a successful cyber-attack can cause.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.