p4 submit
Synopsis
Send changes made to open files to the depot.
Syntax
p4 [g-opts
] submit [-r] [-s] [-f submitoption
] --noretransfer 0|1
p4 [g-opts
] submit [-r] [-s] [-f submitoption
] files
p4 [g-opts
] submit [-r] [-f submitoption
] -d description
p4 [g-opts
] submit [-r] [-f submitoption
] -d description
file
p4 [g-opts
] submit [-r] [-f submitoption
] --noretransfer 0|1 -c changelist
p4 [g-opts
] submit -e shelvedchange
p4 [g-opts
] submit -i [-r] [-s] [-f submitoption
]
Description
When a file has been opened by p4 add, p4 edit, p4 delete, or p4 integrate, the file is listed in a changelist. The user's changes to the file are made only within in the client workspace copy until the changelist is sent to the depot with p4 submit.
By default, files are opened within the default changelist, but new
numbered changelists can be created with
p4 change. To
submit the default changelist, use p4 submit; to submit
a numbered changelist, use p4 submit -c
changelist
.
By default, all files in the changelist are submitted to the depot,
and files open for edit
, add
,
and branch
are closed when submitted, whether
there are any changes to the files or not. To change this default
behavior, set the SubmitOptions:
field in the
p4 client form
for your workspace. To override your workspace's
SubmitOptions:
setting from the command line, use
p4 submit -f submitoption
.
When used with the default changelist, p4 submit brings
up a form for editing in the editor defined by the EDITOR
(or P4EDITOR
) environment
variable. Files can be deleted from the changelist by deleting them from
the form, but these files will remain open in the next default changelist.
To close a file and remove it from all changelists, use
p4 revert.
All changelists have a Status:
field; the value of
this field is pending
or submitted
.
Submitted changelists have been successfully submitted with p4
submit; pending changelists have been created by the user but
not yet been submitted successfully.
p4 submit works atomically: either all the files listed in the changelist are saved in the depot, or none of them are. p4 submit fails if it is interrupted, or if any of the files in the changelist are not found in the current client workspace, are locked in another client workspace (with p4 lock), or require resolution and remain unresolved.
Before committing a changelist, p4 submit briefly locks
all files being submitted. If any file cannot be locked or submitted, the
files are left open in a numbered pending changelist. By default, the
files in a failed submit operation are left locked unless the
submit.unlocklocked
configurable is set. Files are
unlocked even if they were manually locked prior to submit if submit fails
when submit.unlocklocked
is set.
If p4 submit fails while processing the default changelist, the changelist is assigned the next number in the changelist sequence, and the default changelist is emptied. The changelist that failed submission must be resubmitted by number after the problems are fixed.
If p4 submit fails, some or all of the files might have
been copied to the server. By default, retrying a failed submit transfers
all these files again unless the submit.noretransfer
configurable is set, in which case the server attempts to detect if the
files have already been transferred and does not re-transfer all files
when retrying a failed submit. You can use the
--noretransfer
option to override the
submit.noretransfer
configurable and allow the user to
choose the preferred re-transfer behavior for the current submit
operation.
To supply a changelist description from the command line, use the
-d
option. No change description dialog is presented. The
-d
option works only with the default changelist, not
with numbered changelists.
Form Fields
Field Name |
Type |
Description |
---|---|---|
|
Read-only |
The change number, or |
|
Read-only |
Name of current client workspace. |
|
Read-only |
Name of current Perforce user. |
|
Read-only, value |
One of
The status is |
|
Writable |
Textual description of changelist. This value must be changed. |
|
List |
A list of jobs that are fixed by this changelist. This field does not appear if there are no relevant jobs. Any job that meets the jobview criteria as specified on the p4 user form are listed here by default, but can be deleted from this list. |
|
Writable, value |
Type of change: A restricted shelved or committed changelist denies access to users who do not own the changelist and who do not have list permission to at least one file in the changelist. A restricted pending (unshelved) changelist denies access to non-owners of the changelist. Public changes are displayed without these restrictions. |
|
List |
A list of files being submitted in this changelist. Files can be deleted from this list, but cannot be changed or added. |
Options
|
Submit changelist number Changelists are assigned numbers either manually by the user with p4 change, or automatically by Perforce when submission of the default changelist fails. |
|
Submit shelved changelist number
The
To submit a shelved change, all files in the shelved change must
be up to date and resolved. No files may be open in any
workspace at the same change number. Your
p4 client
form's |
|
Immediately submit the default changelist with the
|
|
Override the
|
|
Set to 1 to have the server avoid re-transferring files that
have already been archived after a failed submit operation; set
to 0 to have the server retransfer all files after a failed
submit operation. This setting overrides the setting of the
|
|
Read a changelist specification from standard input. Input must be in the same format at that used by the p4 submit form. |
|
Reopen files for |
|
Allows jobs to be assigned arbitrary status values on submission
of the changelist, rather than the default status of
On new changelists, the fix status is displayed as the special
status
This option works in conjunction with the
|
|
See the “Global Options” section. |
Usage Notes
Can File Arguments Use Revision Specifier? |
Can File Arguments Use Revision Range? |
Minimal Access Level Required |
---|---|---|
No |
No |
|
-
A file's location within the depot is determined by intersection of its locations in the workspace with the client view as set within the p4 client form.
-
The atomic nature of p4 submit allows files to be grouped in changelists according to their purpose. For example, a single changelist might contain changes to three files that fix a single bug.
-
When used with a numbered changelist, p4 submit does not display a form. To change the description information for a numbered changelist, use p4 change -c
changelist
. -
A single file pattern can be specified as an option to a p4 submit of the default changelist. This file pattern limits which files in the default changelist are included in the submission; files that don't match the file pattern are moved to the next default changelist.
The file pattern option to p4 submit can only be used when submitting the default changelist.
-
A progress indicator is available for p4 submit if you request it with p4 -I submit.
Examples
p4 submit |
Submit the default changelist. The user's revisions of the files in this changelist are stored in the depot. |
p4 submit -c 41 |
Submit changelist 41. |
p4 submit *.txt |
Submit only those files in the default changelist that have a
suffix of |
p4 submit -d "header files" *.h |
Submit only those files in the default changelist that have a
suffix of |