|
Synopsis
Access, set, or delete a persistent variable
Syntax
p4 [g-opts] counter countername p4 [g-opts] counter countername value p4 [g-opts] counter -d countername
Description
Counters provide long-term variable storage for scripts that access Perforce. For example, the Perforce review daemon uses a counter (review) that stores the number of the last processed changelist.
When used in the form p4 counter countername, the value of variable countername is returned. When p4 counter countername value is used, the value of variable countername is set to value.
The Perforce server uses three counters in the course of its regular operations: change, job, and journal.
Options
-d countername
|
Delete variable countername from the Perforce server.
|
g_opts
|
See the Global Options section.
|
Usage Notes
Can File Arguments Use Revision Specifier?
|
Can File Arguments Use Revision Range?
|
Minimal Access Level Required
|
---|
N/A
|
N/A
|
list to display a counter's value; review to set a new value
|
- If a counter does not exist, its value will be returned as zero; counter names are not stored in the database until set to a nonzero value.
- The last changelist number known to the Perforce server (the output of p4 counter change) includes pending changelists created by users, but not yet submitted to the depot. If you're writing change review daemons, you may also want to know the changelist number of the last submitted changelist, which is obtainable as the second field of the output of a p4 changes -m 1 -s submitted command.
Related Commands
|