Perforce Command Reference:   [Index]  [Prev] [Next]


p4 change

Synopsis

Create or edit a changelist specification

Syntax

p4 [g-opts] change [-f] [changelist#]
p4 [g-opts] change -d [-f] changelist#
p4 [g-opts] change -o [changelist#]
p4 [g-opts] change -i [-f]

Description

When files are opened for edit with p4 add, p4 delete, p4 edit, or p4 integrate, the files are listed in a changelist. Edits to the files are kept in the local client workspace until the changelist is sent to the depot with p4 submit. By default, files are opened within the default changelist, but multiple changelists can be created and edited with the p4 change command.

p4 change brings up a form for editing or viewing in the editor defined by the environment or registry variable EDITOR. When no arguments are provided, this command will create a new, numbered changelist. Changelist numbers are assigned in sequence, and changelists may be renumbered automatically on submission in order to keep the numeric order of submitted changelists identical to the chronological order.

p4 change changelist# can be used to edit the description of a pending changelist, and may be used to view the fields of a submitted changelist.

The default changelist will be assigned a number if p4 submit of the changelist fails. The changelist must be referred to by number from that point forward.

Form Fields

Field Name Type Description
Change: Read-only Contains the change number if editing an existing changelist, or new if creating a new changelist.
Client: Read-only Name of current client workspace.
User: Read-only Name of current Perforce user.
Status: Read-only value pending, submitted, or new. Not editable by the user. The status is new when the changelist is created; pending when its been created but has not yet been submitted to the depot with p4 submit, and submitted when its contents have been stored in the depot with p4 submit.
Description: Writable Textual description of changelist. This value must be changed before submission, and cannot be changed after submission except by the Perforce superuser.
Jobs: List A list of jobs that are fixed by this changelist. Controlled by (...new job info here...). Jobs may be deleted from this list, but may not be added. This field will not appear when editing the specification of an existing, pending changelist.
Files: List List of files being submitted in this changelist. Files may be deleted from this list, but may not be changed or added. This field will not appear when editing the specification of an existing, pending changelist.

Options

-d Delete the changelist. This is usually allowed only with pending changelists that contain no files, but the superuser can delete changelists under other circumstances with the addition of the -f flag.
-f Allows the description of a submitted changelist to be edited. Available only to Perforce superusers.
-f -d Delete a submitted changelist. Only the superuser can use this command, and the changelist must have had all its files removed from the system with p4 obliterate.
-o Write a changelist description to standard output.
-i Read a changelist description from standard input. Input must be in the same format at that used by the p4 change form.

Usage Notes

Minimal
Access Level Required
open

Multiple changelists should be created by users when editing files to handle different logical tasks. For example, if edits to files foo and bar fix a particular bug, and edits to files baz adds a new feature, foo and bar should be opened in one changelist, and baz should be opened in a different changelist.

p4 change changelist# edits the specification of an existing changelist, but does not display the files or jobs that are linked to the changelist. Use p4 opened -c changelist# to see a list of files linked to a particular changelist, p4 fixes -c changelist# to see a list of jobs linked to a particular changelist, p4 reopen to move a file from one changelist to another, or p4 revert to remove a file from all pending changelists.

Examples

p4 change Create a new changelist.
p4 change -c 30 Edit the specification of changelist 30.
p4 change -d 29 Delete changelist 29. This will succeed only if changelist 29 is pending and contains no files.

Related Commands

To submit a changelist to the depot

p4 submit

To move a file from one changelist to another

p4 reopen

To remove a file from all pending changelists

p4 revert

To list changelists meeting particular criteria

p4 changes

To list opened files

p4 opened

To list fixes linked to particular changelists

p4 fixes

To link a job to a a particular changelist

p4 fix

To remove a job from a particular changelist

p4 fix -d

To list all the files listed in a changelist

p4 opened -c changelist#



Perforce Command Reference:   [Index]  [Prev] [Next]


Copyright 1998 Perforce Software.
Contact us at [email protected]
Last updated: 06/14/98