Perforce Utilities


Here are some scripts which I've written in the hope they will be useful to others. You them at your own risk.

Scripts

Back to Table of Contents

p4abuse.pl p4abuse.pl is a small perl script designed to help a system administrator detect abuses of a Perforce system. Currently, it will highlight two common errors: using a client from multiple hosts, and use of a client by multiple users.
rename_depot.pl rename_depot.pl allows a sysadmin to rename a Perforce depot whilst preserving the entire history of the depot. It does this by editing a checkpoint file, so the user must checkpoint their database first, and then recover from the edited checkpoint at the end. ALWAYS ensure that appropriate backups are taken before using this script.
specsaver.rb specsaver.rb versions all client/label/branch specs along with global data like typemaps, protections and jobspec. It requires P4Ruby but is much more efficient as a result.

Modules

Back to Table of Contents

P4table.rb

P4table is a Ruby module rather than a script. P4table allows you to treat a Perforce repository a bit like a database with the concept of tables and records. Each record is a Perforce job so the fields in the table are specified using the Perforce jobspec. Using jobs means that all records are indexed so you can search on any field. Additionally each record is also archived as a versioned text file so you not only have the records, but also all revisions of every record.

I've created some documentation using RDoc which hopefully will make a few details clear.

Requires P4Ruby