Schema Documentation

Copyright 1999,2000 Perforce Software. All rights reserved.

Database files sorted alphabetically, numbers refer to locking order and version.

Filename Lock
Order
Vers. Table Description
db.boddate 20 0 BodyDate Job data for date-valued attributes.
db.bodtext 21 0 BodyText Job data for non-date-valued attributes.
db.change 13 0 Change A changelist record.
db.counters 0 0 Counters A Perforce counter.
db.depot 3 0 Depot A depot specification.
db.desc 14 0 Desc A change description record.
db.domain 4 1 Domain A domain record.
db.fix 18 1 Fix A fix record.
db.fixrev 19 0 Fix Records in db.fixrev look exactly like db.fix records.
db.group 2 2 Group A user group.
db.have 7 1 Have A file in the have list.
db.integ 8 0 Integ An integration record.
db.ixdate 22 0 IndexDate Indexing data for date-valued job attributes.
db.ixtext 23 0 IndexText Indexing data for non-date-valued job attributes.
db.job 15 0 Job A record in the jobs table.
db.jobpend 16 0 Job Obsoleted in 98.2. Records in db.jobpend looked exactly like db.job records.
db.jobdesc 17 0 JobDesc Obsoleted in 98.2.
db.locks 9 1 Locks Locked/Unlocked files.
db.protect 24 2 Protect A record in the protections table.
db.rev 10 3 Rev A revision record.
db.revcx 11 0 RevCx Revision change index.
db.review 6 0 Review A reviewer record.
db.trigger 25 0 Trigger A line in a Perforce trigger.
db.user 1 2 User A user record.
db.view 5 0 View A view record.
db.working 12 1 Working A record in the working changelist.


BodyDate - Job data for date-valued attributes (db.boddate)

Name Type Explanation
key String Key: Key for BodyDate record
attr Int Secondary key: Attribute number
date Date Attribute value

Related record types: BodyText, IndexDate, and IndexText.


BodyText - Job data for non-date-valued attributes (db.bodtext)

Name Type Explanation
key String Key: Key for BodyText record
attr Int Secondary Key: Attribute number
date Text Attribute value

Related record types: BodyDate, IndexDate, and IndexText.


Change - A change record (db.change)

Name Type Explanation
change Change Key: A change number
descKey Change Change number of the first changelist with this description.
(When a changelist is renumbered on submission, the description is preserved.)
client Domain A client name; the client from which the change was submitted.
user User A user name; the user who submitted the change.
date Date The date at which the change was submitted.
status Status Status of changelist: pending or committed.
description DescShort Short description (first 31 characters) of change.


Counters - Perforce counters table (db.counters)

Name Type Explanation
name Counter Key: Name of counter
value Int Value of counter


Depot - Depot specifications (db.depot)

Name Type Explanation
name Domain Key: Name of depot.
type DepotType Type of depot (local or remote)
address Text For remote depots, the P4PORT address of the remote server.
For local depots, the address is simply the string subdir.
map Text The depot's map (path translation information).
For local depots, this will be a path relative to the root directory.
For remote depots, this will be specified in terms of the remote server's namespace.


Desc - A change description record (db.desc)

Name Type Explanation
descKey Change Key: Change number to which this description applies
description Text Change description in full


Domain - A domain record (db.domain)

Name Type Explanation
name Domain Key: Name of domain.
type DomainType Type of domain: client, label, branch, or depot.
host Text Associated host (optional).
mount Text Client root.
owner User Name of user who created the domain.
updateDate Date Date of last update to domain specification.
accessDate Date Date of last access to domain specification.
options DomainOpts Options for client, label, and branch domains.
description Text Description of domain.


Fix - A fix record (db.fix and db.fixrev)

Name Type Explanation
job Job Key: Job name
change Change Secondary key: Changelist linked to job.
date Date Date of fix.
status FixStatus Status of job - Defunct in 99.1
client Domain Client...
user User ...and user who fixed the job.

The same data structure is used in both the db.fix and db.fixrev files.


Group - A user group (db.group)

Name Type Explanation
user User Key: The user who created the group.
group User Secondary key: The group name.
isSubGroup Int Flag: 0 for groups which are not subgroups, 1 for groups which are subgroups.
maxResults MaxResult MaxResults setting for the group.


Have - A file in the have list (db.have)

Name Type Explanation
clientFile File Key: Name of file in client workspace.
depotFile File Name of file on depot.
haveRev Rev Have revision.
type FileType Type of file. (introduced in 99.2)


Integ - An integration record (db.integ)

Name Type Explanation
toFile File Key: File from which integration is being performed.
fromFile File Secondary key: File to which integration is being performed.
startFromRev Rev Tertiary key: Starting revision of fromFile
endFromRev Rev Ending revision of fromFile.
If integrating from a single revision (i.e. not a revision range),
the startFromRev and endFromRev fields will be identical.
toRev Rev Revision of toFile into which integration is being performed.
how IntegHow Integration method: variations on merge/branch/copy/ignore/delete.
committed Int Flag: 0 for pending, 1 for committed.
resolved Resolved Resolution method: unresolved, resolved manually,
or resolved as part of a branch or delete.
change Change Changelist associated with the integration.

By way of example - here is the output of a p4 filelog on a file:

... #31 change 2552 integrate on 1997/01/12 by user@client (filetype) 'description of change'
... ... merge from //depot/main/p4-win/Jamfile#2,#4
... ... branch into //depot/r97.1/p4/Jamfile#1

Field Value
FromFile Jamfile
ToFile Jamfile
startFromRev 2
endFromRev 4
toRev 31


IndexDate - Indexing data for date-valued job attributes (db.ixdate)

Name Type Explanation
date Date Key: Date
attr Int Secondary key: Attribute number
value String Tertiary key: Attribute value

Related record types: IndexText, BodyDate, and BodyText.


IndexText - Indexing data for non-date-valued job attributes (db.ixtext)

Name Type Explanation
word String Key: A word in a job body
attr Int Secondary key: Attribute number
value String Tertiary key: Attribute value

Related record types: IndexDate, BodyDate, and BodyText.


Job - A job record (db.job)

Name Type Explanation
job Job Key: A job name.
xuser User User name. Defunct. See db.bodtext.
xdate Date Date. Defunct. See db.boddate.
xstatus JobStat Job Status. Defunct. See db.bodtext.
description DescShort First 31 characters of job description.

The same data structure was also used in the file db.jobpend, which was obsoleted in 98.2.


JobDesc - A job description - obsoleted in 98.2 (db.jobdesc)

Name Type Explanation
xjob Job Key: Defunct.
xdescription Text Defunct.


Locks - Locked/Unlocked files (db.locks)

Name Type Explanation
depotFile File Key: File in depot.
client Domain Secondary key: Domain (client) in which file is open.
user User User who presently has file open.
action Action File is presently open for add, edit, delete, branch, integrate, or import.
isLocked Int Flag: 0 for unlocked, 1 for locked.


Protect - A record in the protections table (db.protect)

Name Type Explanation
seq Int Key: Sequence; used internally for parsing multiple-line protection specifications.
isGroup Int Flag: 0 for a per-user setting, 1 for a per-group setting.
user UserWild User(s) for whom this record applies.
host DomainWild Domain(s) for which this record applies.
perm Perm Permissions to be applied.
mapFlag MapFlag Flag: Map the files in or out?
depotFile Mapping Files to be mapped in/out.


Rev - A revision record (db.rev)

Name Type Explanation
depotFile File Key: File name as it appears in the depot.
depotRev Rev Secondary key: Revision number.
type FileType Flags denoting file type.
action Action Action performed on file: add, edit, delete, branch, integ, or import.
change Change Changelist associated with this revision.
date Date Date of changelist submission for this revision.
modTime Date Date of last modification of the file when submitted.
digest Digest MD5 digest of the full file at this revision level.
This is usually generated by p4 verify, but if
not generated, it will be created on-the-fly with commands
like p4 diff, etc.
lbrFile File Filename for librarian's purposes.
Specifies location in the depot's data which, when used with the client root, holds the file.
LbrRev LbrRev Revision number in the librarian's archive.
lbrType FileType File type for librarian's purposes.


RevCx - Revision change index (db.revcx)

Name Type Explanation
change Change Key: Changelist associated with this revision
depotFile File Secondary key: Filename in depot.
depotRev Rev Revision number of the filename in depot.
action Action File was opened for add/edit/delete/branch/integrate/import.

This is a subset of the information in the Rev table, but with different indexing.


Review - A reviewer record (db.review)

Name Type Explanation
user User Key: Use
seq Int Secondary key: Sequence; used internally for parsing multiple-line review specs.
mapFlag MapFlag Flag to map files in/out of review process
depotFile Mapping Files to be mapped in/out of review process
type Reviewer Type of reviewer: presently only one (review).


Trigger - A line in a Perforce trigger (db.trigger)

Name Type Explanation
seq Int Key: Sequence; used internally for parsing multiple-line triggers.
trigger String Trigger name
mapFlag MapFlag Flag: are files mapped in or mapped out of trigger?
depotFile Mapping Flag: 0 for mapped-in files (the default), 1 for files excluded with the - prefix.
action Text Action to be performed by trigger.


User - A user record (db.user)

Name Type Explanation
user User Key: A user name.
email Text The user's e-mail address.
jobView Text The user's jobview.
updateDate Date Date of last update to user record.
accessDate Date Date of last access of user record.
fullName Text User's full name.
password Password MD5 hash of user's password.


View - A view record (db.view)

Name Type Explanation
name Domain Key: Name of domain to which view applies
seq Int Secondary key: Sequence; used internally for parsing multiple-line triggers.
mapFlag MapFlag Flag: 0 for mapped-in files (the default), 1 for files excluded with the - prefix.
viewFile Mapping The right-hand side (client side) of the view.
For label views, this is automatically generated as the
depot side of the view, but with the depot name replaced
by the label name.
depotFile Mapping The left-hand side (depot side) of the view.


Working - A record in the working changelist (db.working)

Name Type Explanation
clientFile File Key: Name of file on client.
depotFile File Name of file in depot.
client Domain Client domain.
user User User name
haveRev Rev Revision presently in user's client workspace.
This is normally identical to workRev except for the case
in which you've tried to submit a file where you no longer have the
head revision. Perforce schedules the integrate (i.e. moves workRev
to headRev, but doesn't change the haveRev, so that a
p4 revert will return the file originally checked-out instead of
the new head revision.
workRev Rev Working revision; this is identical to the haveRev
except in the case described above.
type FileType File type
action Action User has file open for add/edit/delete/branch/integrate/import?
change Change Associated changelist, if a changelist is associated with a file.
date modTime Date when file was opened and added to the working changelist.
isLocked Int Flag: 0 for unlocked, 1 for locked.


Int - An integer

Value Explanation
Int An ASCII string representing an integer value.


Int1 - A 1-byte integer

Value Explanation
Int1 An ASCII string representing an integer value from 0..255.


Action - Action types for revision updates

Action Explanation
0 add; user adds a file.
1 edit; user edits a file.
2 delete; user deletes a file.
3 branch; add via integration.
4 integ; edit via integration.
5 import; add via remote integration.


Change - A changelist number

Value Explanation
Change number An ASCII string representing a changelist number.
The string 0 refers to the default changelist. (i.e. a new change)


Counter - A counter name

Type Explanation
Name An ASCII string representing a counter name. Counter names
must contain no spaces, contain no slashes, and be identifiers
(i.e. cannot begin with a dash and cannot be all-numeric)


Date - Time and date

Value Explanation
Date An ASCII string representing the number of seconds since the Epoch.
(i.e. the number of seconds since 00:00:00 UTC, January 1, 1970.
919283152 is a date in early 1999.)


DepotType - Type of depot

Value Explanation
0 A local depot.
1 A remote depot.


DescShort - Shortened comment field derived from larger one

String Explanation
Text The first 31 characters of a Text string.


Digest - A 16-byte MD5 digest of a block of text

Value Explanation
Digest An ASCII string representing the hex digits of the 16-byte MD5 digest.


Domain - A client, label, branch, or depot name

Domain Explanation
Name An ASCII string representing the client, label, branch, or depot name.
See also DomainType and DomainOpts.


DomainOpts - Options for client, label, and branch domains

Domain Options Comments
DomainFlags: Domain options
Value Explanation
0x0001 Modtime: set for modtime, unset for nomodtime.
0x0002 Clobber: set for clobber, unset for noclobber.
0x0004 Allwrite: set for allwrite, unset for noallwrite.
0x0008 Locked: set for locked, unset for unlocked.
0x0010 NoCRLF: set for nocrlf, unset for crlf.
0x0020 Compress: set for compress, unset for nocompress.
Clients:
Modtime, Clobber, Compress, NoCRLF, Locked, and Allwrite flags are legal.

Labels:
Locked is only legal flag.

Branches:
Locked is only legal flag.

Depots:
No flags are applicable. Should be set to 0x0000.


Domain - Domain types (client/branch/label/depot)

Domain Type Comments
DomTypeType:
Value Explanation
c Client
l Label
b Branch
d Depot
DomTypeType: Valid types for clients, labels, branches, and depots.
DomainType:
Value Explanation
Domain Type Presently one of the characters c, l, b, or d.
DomainType: A value from DomTypeType above.


DomainWild - Domains that can contain wildcards

Type Explanation
Name A Domain name that can contain wildcards.


File - A file name

Value Explanation
File name An ASCII string of up to 128 characters, representing a filename.
Note that no path information is included in a filename.
(e.g. The filename for foo://bar/baz.txt is baz.txt.)
Also see FileType.


FileType - File type for client/server

Storage Type Comments
FileStorageType:
Value Explanation
0x0000 RCS
0x0001 binary
0x0002 tiny (uncompressed)
0x0003 compressed
0x0021 save only one revision
0x002F storage type bit mask
FileType - file type for client/server

The layout is as follows:

     0xXXXX
       ||||
       |||+- storage method
       ||+-- storage method modifiers
       |+--- client access method + modifiers
       +---- client access modifiers known to server

SetOld() handles conversion from when the type was a uchar and
each indicator was only a nybble: 0xF0 was moved to 0xF00 and 0x02
was moved to 0x10.

No one ever sets these values literally -- only symbolically.
But we define them here for completeness.

0xFFFF stands for file type unset.
FileStorageMods:
Value Explanation
0x0010 Keyed
0x00D0 Storage modifier bit mask
FileClientType:
Value Explanation
0x0000 Text
0x0100 Binary
0x0400 Symlink
0x0500 Resource
0x0900 RawText (no CRLF)
0x0D00 Client type bit mask
FileClientMods:
Value Explanation
0x0200 Executable bit set
0x1000 Always writable
0xF200 Client modifier bits


FixStatus - how a change affects a job

This is a wrapper around DmtText (case sensitive string) that handles the pre-2000.1 "closed" default value.


IntegHow - How was an integration performed

Value Explanation
0 merge from; integration with other changes.
1 merge into; reverse merge.
2 branch from; integration was branch of file.
3 branch into; reverse branch.
4 copy from; integration took source file whole.
5 copy into; reverse take.
6 ignored; integration ignored source changes.
7 ignored by; reverse copy.
8 delete from; integration of delete.
9 delete into; reverse delete.
10 dirty merge into; reverse of integration downgraded to edit.
11 dirty branch into; reverse of branch downgraded to add.

Definitions of terms in above table:
Type Definition
merge A normal three-way merge, dirty or pure.
branch First-time creation of target file.
copy The target file became identical to the source file.
ignore The target didn't take the source changes.
delete A delete was integrated.

Note that all integration records should have a corresponding reverse record. The branch from (2) and merge from (0) options have corresponding "dirty" reverse records for cases where the target file took more than one change or was (re)opened for "edit" or "add".

Also note that merge from is in the first slot for compatibility with the pre-#827 server that never filled it in.


Job - A job name

Value Explanation
Job Name An 8-character ASCII string representing a job name.
The string is composed of a two-character prefix and a 6-character job number.


JobStat - Job status

Status Explanation
0 Job is open; change is still plastic.
1 Job is closed; change has been committed.
2 Job is suspended; change is open but not being worked on.


LbrRev - Revision numbers in the librarian's archive

Value Explanation
Revision Revision for librarian. Used internally.
Usually a 1. prefix that is prepended to the librarian's filename.


MapFlag - Map/Unmap flag

Value Explanation
[null] The Mapping is included.
- The Mapping is not included.


Mapping - A mapping

Value Explanation
Mapping An ASCII string of up to 128 characters, representing a mapping.
A mapping looks like a File name, but permits the use of wildcards.


MaxResult - A group's MaxResults setting

Value Explanation
MaxResult An ASCII representation of the integer holding the MaxResult setting.
If 0, MaxResults is unlimited.


Password - MD5 hash of a user's password

Value Explanation
Password MD5 hash of user's password.
Displayed as ****** within the application.


Perm - Permissions

Bit Explanation
0x01 list; the user can list file names.
0x02 read; the user can read files.
0x04 integ from; permits files to be used as
the source for 'p4 integrate'
0x08 open; the user can check files out.
0x10 write; the user can check files in.
0x20 review; the user can run as a reviewer.
0x40 super; the user can change permissions.
0x07 up to integ from
0x1F up to write
0x7F up to super

Permissions compare as follows: none < list < read < integ from < open < write/review < super, with the caveat that write permission does not imply review permission, and vice versa.


ResolvedStatus - How was an integration resolved

Status Explanation
0 Not yet resolved.
1 Resolved manually.
2 Resolved automatically as part of a branch.
3 Resolved automatically as part of a delete.


Rev - A revision number for a depot file

Value Explanation
Revision number An ASCII string representing a revision number.
The string 0 refers to revision #none.


Reviewer - Reviewer type

Value Explanation
0 review; at present, there is only one reviewer type.


Status - Status of a changelist

Status Explanation
0 pending (i.e. a pending changelist)
1 committed (i.e. a submitted changelist)


String - A string

Value Explanation
String An ASCII string up to 1024 characters in length.
Depending on the context in which the string is used,
one or more of the following restrictions may apply:
  • Cannot be empty
  • Cannot consist solely of a dash (-)
  • Cannot be all-numeric
  • Cannot contain non-printable characters
  • Spaces are replaced with underscores (i.e. _)
  • Revision characters (i.e. # and @) are prohibited
  • Slashes (i.e. /) are prohibited
  • Wildcards (i.e. ... and *) are prohibited


Text - Formatted text strings

String Explanation
Text An ASCII string of up to 128 characters.
Whitespace will be replaced by blanks.


User - A user name

User Explanation
User A user name. Unlike UserWild, wildcards are not allowed.


UserWild - User names that contain wildcards

UserWild Explanation
UserWild A user name. Unlike User, wildcards are allowed.


Copyright 1999 Perforce Software. All rights reserved.