Perforce 2004.2 P4Report User's Guide
<< Previous Chapter
Defect Tracking
Table of Contents
Index
Perforce on the Web
Next Chapter >>
Database Schema and SQL Keywords

Chapter 4
Codeline Management

For details about supported functions, refer to Appendix B, P4Report Functions.

Which changelists affect a release?

To list changes without including integrations:

select change from changes
     where filespec = '//depot/main/release2.0/...';
To list changes including integrations, include the options='integrated' clause:

select change from changes
     where filespec = '//depot/main/release2.0/...'
     and p4options = 'integrated';

How many changes are in this release?

If the release is a branch:

select count(*) from changes
     where filespec = '//depot/release1.1/...';
If the release is stored in a label:

select count(*) from changes
     where filespec = '//...@release1.1';

Which changes are in this release?

If the release is a branch:

select * from changes
     where filespec = '//depot/release1.1/...';
If the release is stored in a label:

select * from changes
     where filespec = '//...@release1.1';

Which files changed after being branched?

When you integrate files to a new branch, the files in the new branch have a revision number of 1. This query detects files with higher revision numbers by seeking files that have more than more record in the FILES table. Using this logic, the following query detects all changed files in //depot/branch1/... :

select file, count(*) from files
     where file like '//depot/branch1/%' group
     by file having count(*) > 1;

Is a particular change in a specified branch?

The answer returned by this query is independent of whether the change was made in a specified branch or integrated from another branch.

select fromfile, endfromrev from files, integs
     where change = 123 and
     file = tofile and
     how in ('copy into', 'merge into', 'branch into', 'delete into') and
     fromfile like '//depot/branch1/%' and
     revision between starttorev and endtorev
union select file, revision from files
     where change = 123 and
     file like '//depot/branch1/%';


Perforce 2004.2 P4Report User's Guide
<< Previous Chapter
Defect Tracking
Table of Contents
Index
Perforce on the Web
Next Chapter >>
Database Schema and SQL Keywords
Please send comments and questions about this manual to manual@perforce.com.
Copyright 2002-2005 Perforce Software. All rights reserved.
Last updated: 12/28/05