Checking in files and working with changelists
To check in a file, you must submit a changelist. Whenever you mark files for add or delete, check them out, integrate (merge or copy), or schedule them for resolve, the files are added to changelists. Perforce changelists are lists of actions to be performed on files. The actions in the changelist are performed when you submit the changelist. Pending changelists are changelists that have yet to be submitted. Changelists are assigned unique numbers by the Perforce service. In addition, a default changelist is maintained for each client workspace. If submission of the default changelist fails, the Perforce service assigns it a number.
Checking in files
To check in files (submit a changelist):
-
Open the Submit dialog by doing one of the following:
- Context-click the file icon of a file that is checked out, marked for add, or marked for delete, and choose Submit… to open the Submit Files dialog.
- Go to View > Pending changelists, context-click a changelist, and choose Submit… to open the Submit Files dialog.
Note that the Submit Changelist and Submit Files dialogs are functionally identical; they differ only in how you access them.
-
In the Submit Changelist or Submit Files dialog, enter a description or edit the existing description, and select the files you want to check in.
You can also perform the following actions:
- Remove files from the changelist.
- Revert unchanged files in the changelist (removing the unchanged files from the changelist, canceling the check-out, and leaving them synced to the version you originally checked out) or submit only changed files (moving the unchanged files to the default changelist after the current changelist is submitted).
- Check out submitted files after you submit them.
- Associate the changelist with a job and set the job status upon submit. For more information about jobs, see Using jobs (defect tracking).
- Perform a diff on a file pending submission by context-clicking the file and selecting Diff Against Have Revision. For more information, see Comparing files using diff.
- Optional) Click Save to save your changelist options without checking in files.
- Click Submit to check in your files.
Displaying changelists
To display changelists:
-
Go to View > Pending changelists or View > Submitted changelists to open the Pending or Submitted tool windows.
To change the order in which columns are displayed, drag the column headings right or left to the desired position. To sort by column, click the sort arrow on a column heading.
-
Optional) Filter the displayed changelists:
Enter your filter criteria in the **Folder/file, User**, and **Workspace** fields.
To filter by file, enter the full path of the file in the workspace. The filtering process is case-sensitive.
Click **Filter**.
-
View changelist details by doing one of the following:
- Select a changelist to display details in the fields below the changelist viewer, including description, files, jobs, and user.
- Click the arrow next to the changelist row to expand the changelist row and view the files included in the changelist.
Editing changelists
You can edit and perform actions on a pending changelist using the Pending tool window and the Pending Changelist dialog.
To edit a changelist from the Pending tool window:
- Go to View > Pending changelists.
- Context-click the changelist or file row in the viewer.
-
Perform any of the following actions or edits on a changelist or file within a changelist:
- Submit the changelist
- Move files to another changelist
- Revert files
- Shelve, unshelve, delete, or view shelved files
- Remove or view associated jobs
- Diff files
- Change filetype
- Lock and unlock files
- Change owner and workspace
- Create a new pending changelist
To edit a changelist from the Pending Changelist dialog:
- Go to View > Pending changelists.
- Open the Pending Changelist dialog by context-clicking the changelist in the viewer and selecting Edit Pending Changelist changelist name.
-
Perform any of the following actions or edits:
- Edit the changelist description
- Restrict access
- Select files for inclusion
- Move files to another changelist
- Revert files
- Unshelve, delete, or view shelved files
- Attach or view associated jobs
- Perform a diff on a file pending submission by context-clicking the file and selecting Diff Against Have Revision. For more information, see Comparing files using diff.
- Click OK to save your changes.
Restricting access to changelists
By default, all users can view a pending or submitted changelist, regardless of whether they are permitted access to the files
in the changelist by the protections table. To prevent users from seeing a changelist, check the Restrict Access to Changelist
option when you edit a pending or submitted changelist.
This option enables the following restrictions:
- Pending changelists: visible only to the owner, regardless of whether other users have access to checked-out files.
- Pending changelists containing shelved files: visible only to users who have access to one or more of the shelved files.
- Submitted changelists: visible only to users who have access to one or more of the files that were submitted in the changelist.
Moving a file to another changelist
To move a file from its current changelist to another one, do one of the following:
- Context-click the file in Solution Explorer and select Manage Files > Move to another Changelist….
- Context-click the file in the Pending tool window and select Move to another Changelist….
In the dialog that opens, select the changelist you want to move the file to.
Setting changelist display preferences
To minimize the time it takes P4VS to handle very large changelists, limit the number of files displayed in a changelist by setting the Maximum number of files displayed per changelist field in the Perforce preferences under Tools > Options > Source Control. See Setting Perforce preferences.
You can still submit changelists with more than the specified number of files, but the file lists are displayed as follows:
- Pending and Submitted tabs display
There are
###
files in this changelist. - Details tab displays the list of files in a simple text box (with no P4VS file badges).