Gameheim

Perforce changelists: check out, shelve, resolve and submit

A changelist is how Perforce packages your work before it reaches the team. This article explains how changelists, shelves and resolves work, the checks worth running before every submit, and how to do each step in Gameheim: grouping files, shelving work in progress, linking tasks in the description, resolving conflicts and submitting.

By Gianmarco Virzì, co-founder and lead developer of Virsion · Updated · 13 min read

What a Perforce changelist is, and why submits fail

In Perforce, every file you check out, add or delete goes into a pending changelist. A changelist is a numbered bundle of file operations plus a description. When you submit it, all its files become new revisions on the server together, in one atomic step: either every file is submitted or none is.

  • The default changelist is where files land when you do not choose one. It has no number until you submit it; Perforce assigns one at that moment.
  • Numbered changelists are ones you create yourself to separate pieces of work, for example one for a lighting pass and one for a bug fix, so each can be submitted on its own.
  • A shelf is a copy of the files in a pending changelist stored on the server without submitting them. The files stay checked out in your workspace. Shelving is a backup of work in progress, and a way to hand it to a teammate for review.
  • A resolve is needed when someone submitted a newer revision of a file you have open. Perforce will not let you submit over it until you decide how to combine the two versions.

Submits fail for predictable reasons: a file in the changelist is out of date and needs a resolve, a teammate holds a lock on one of the files, a file opened for add was deleted from disk, or the Unreal Editor still has a file open so it cannot be read. Found at the end of a large upload, each of these costs time. Found before the submit, each is a quick fix.

Perforce's references for p4 submit and p4 shelve cover the full command options.

How Gameheim handles changelists, shelves and submits

On the P4 Workspace page, two panels hold your pending work. Opened Files lists every file you have open, with a tab per changelist, search, and actions on a selection: Move to…, Lock, Shelve and Revert. Pending Changelists shows one card per changelist with its file count and transfer size, and the actions Submit, View, Edit, Shelve, Unshelve and Delete CL.

When an action needs a changelist, Gameheim asks which one: the Default changelist, an existing one, or Create new changelist. Tick Remember this choice for this session to stop being asked.

A submit in three steps

  1. Compose. A dialog collects the Description, the tasks to link with Link tasks, and, if AI is available to you, a generated description draft.
  2. Check. Gameheim runs a read-only pre-submit check on every file in the changelist and shows what will be transferred: files added, modified and deleted, the total size, an estimated upload time and the heaviest files.
  3. Confirm. Nothing reaches the depot until you press Submit. If the check found only warnings, the button reads Submit Anyway. If it found a blocker, fix it first.

Task references that update the board

A changelist description can reference tasks by key, and the task board updates when the submit completes. You do not have to type the syntax: tasks picked in Link tasks are written into the description for you, at the end, where the server reads them.

How to organise, shelve and submit a changelist in Gameheim

Before you start
  • The Gameheim Agent is connected and your workspace is set up.
  • Your role includes p4_workspace:checkout to open files, shelve and resolve, and p4_workspace:submit to submit.
  • To generate a description with AI: your role includes ai:use. To edit description templates: changelist_templates:manage.
  1. Create a changelist for the piece of work

    In Pending Changelists, click New CL, type a description and click Create. Keep one changelist per logical change: it makes review easier and lets you submit one piece without the other.

  2. Put the right files in it

    Files you check out, add or mark for delete from Workspace Changes go into the changelist you choose. To reorganise, select files in Opened Files and use Move to…. To drop a file you opened by mistake, Revert Unchanged reverts every open file you did not actually modify.

  3. Shelve work in progress

    Click Shelve on the changelist card (or select files in Opened Files and click Shelve). A copy of the files goes to the server; they stay checked out on your machine. The card shows a Shelved badge, and Shelved in Opened Files lists your shelved changelists, where you can Unshelve or Delete a shelf.

    Tip:Shelving before you leave for the day protects unsubmitted work against a disk failure, and lets a lead look at it without it reaching the depot.
  4. Open the submit dialog and describe the change

    Click Submit on the changelist card. Write the Description: what changed and why, in words a teammate will understand in six months. A description is required, and it is limited to 10,000 characters.

  5. Link the tasks you worked on

    Under Link tasks, search for tasks in the project and add them. For each one choose Link only, Progress with a percentage, or Completed. Gameheim appends the matching tokens to the end of the description.

  6. Optionally generate the description with AI

    In Generate with AI, pick a description template, write a couple of lines about what you did, and click Generate. The draft is built from your notes, the list of files in the changelist and the linked tasks, and it fills the description box for you to review and edit. Nothing is submitted until you confirm.

  7. Read the pre-submit check

    Click Submit in the dialog. Gameheim checks every file in the changelist without modifying anything. All clear means no conflicts were found. Otherwise each problem is listed with the fix available: sync, resolve, remove from the changelist, or contact a lock holder. Use Re-check after fixing.

  8. Resolve conflicts, then submit

    For files marked Needs resolve, choose a strategy per file and click the resolve button. Binary files such as .uasset are tagged BINARY and accept only Accept Theirs or Accept Yours. When the check is clean, press Submit. The operation appears in Agent Operations, and your tasks update when it completes.

How to organise, shelve, resolve and submit by hand with p4

The same workflow from the command line. P4V offers each step from the right-click menu of a pending changelist or file.

1. Organise the work in changelists

Create a changelist, open files in it, move files between changelists
p4 change
p4 edit -c 1234 //depot/MyGame/Content/Maps/Level01.umap
p4 reopen -c 1235 //depot/MyGame/Config/DefaultGame.ini
p4 revert -a -c 1234 //...
p4 opened -c 1234

p4 change prints the number of the new changelist when you save the form. p4 reopen -c moves files that are already open into another changelist. p4 revert -a reverts only the files you opened but did not modify.

2. Shelve work in progress

Shelve, update the shelf, unshelve elsewhere, delete the shelf
p4 shelve -c 1234
p4 shelve -r -c 1234
p4 describe -S 1234
p4 unshelve -s 1234 -c 1240
p4 shelve -d -c 1234

-r replaces the whole shelf with the files currently open in the changelist. p4 describe -S lists what is on the shelf. A teammate reviews a shelf with p4 unshelve -s into a changelist of their own workspace, and the shelf stays on the server until its owner deletes it with p4 shelve -d.

3. Check the changelist before submitting

Bring files up to date, list what needs resolving, check for locks
p4 sync //depot/MyGame/...
p4 resolve -n
p4 opened -a //depot/MyGame/Content/Maps/Level01.umap
  • Syncing before a submit brings in teammates' newer revisions. Files you have open that changed on the server are scheduled for resolve instead of overwritten.
  • p4 resolve -n lists the files that still need a resolve, without resolving anything.
  • p4 opened -a on a file shows whether someone else has it open or locked.
  • Check that every file opened for add still exists on disk, and close the Unreal Editor or save and close the assets you are submitting.

4. Resolve

Resolve non-interactively, or file by file
p4 resolve -am //depot/MyGame/Source/...
p4 resolve -at //depot/MyGame/Content/Props/Crate.uasset
p4 resolve -ay //depot/MyGame/Content/Props/Barrel.uasset
p4 resolve

-am merges text files automatically and leaves real conflicts unresolved. -at takes the server version and -ay keeps yours. Plain p4 resolve goes through the files one by one and lets you open a merge tool for text files. For binary assets only -at and -ay make sense.

5. Submit

Submit a numbered changelist, or the default one with a description
p4 submit -c 1234
p4 submit -d "Fix crate collision #DQ-12 done"

p4 submit -c opens the form so you can review the description first. -d gives the description on the command line and works only for the default changelist. If a submit fails, the files stay open in a pending changelist; for the default changelist Perforce moves them into a new numbered one and tells you its number, so you can fix the problem and run p4 submit -c with it.

By hand and in Gameheim

StepBy handIn Gameheim
New changelistp4 changeNew CL in Pending Changelists
Move files between changelistsp4 reopen -c <number> <files>Select in Opened Files, then Move to…
Shelve and unshelvep4 shelve -c, p4 unshelve -s, p4 shelve -dShelve and Unshelve on the changelist card, Shelved list in Opened Files
Check before submittingp4 sync, p4 resolve -n, p4 opened -a on each fileOne read-only pre-submit check with an upload estimate
Resolvep4 resolve -am, -at, -ayA strategy per file; binary assets limited to theirs or yours
Link the work to tasksMention the change in the task and update its status on the board yourselfLink tasks writes the tokens; tasks update when the submit from Gameheim completes

Task reference syntax in changelist descriptions

Task keys are the project code plus a number, for example DQ-12. Gameheim recognises three forms, in any case:

TokenPicker optionEffect on the task when the submit completes
#DQ-12Link onlyLinks the changelist. A task in To Do moves to In Progress
#DQ-12 progress:60ProgressSets progress to 60%. A task in To Do moves to In Progress; 100 moves it to Done
#DQ-12 doneCompletedSets the task to Done with 100% progress
  • Only keys with this project's code are applied. A key from another project stays plain text.
  • If the same task appears more than once, the strongest instruction wins: done beats any progress, and the higher percentage beats the lower.
  • Task updates happen for submits made from Gameheim. The person submitting needs permission to edit tasks (tasks:write); otherwise the submit goes through and the tasks are left unchanged.
  • Bug and decision keys can also be referenced in a description. See Bug tracking for game development and Game design decision log.
Note:Because the tokens sit at the end of the description, a description cut at the 10,000-character limit would lose them. Gameheim refuses an over-long description before the submit instead of dropping your task updates silently.

Pre-submit check: what each problem means

ProblemSeverityWhat to do
Out of dateWarningA newer revision exists on the server. Use the button that syncs those files to latest, then resolve if needed. Submitting anyway may overwrite newer changes
Locked by other usersBlockerSomeone holds a lock on the file. Contact the holder; there is no automatic fix
Needs resolveBlockerChoose a resolve strategy for the file
Plugin lockedBlockerA teammate locked the plugin the file belongs to. Wait, ask them, or ask a Lead or Admin
New files removed from diskFix before submitFiles opened for add no longer exist. Remove them from the changelist
Files deleted from diskFix before submitFiles opened for edit are gone. Mark them for delete to remove them from the depot, or use Restore from server to download them again
Files that need a manual fixFix before submitThe path is too long (found before the submit), or a program holds the file (often the Unreal Editor) or its permissions are wrong (found when a submit fails). Fix it and retry
Not a local file problemRetryNetwork, server or depot permissions. Retry; if it persists, contact your Perforce administrator

If a submit fails after starting, the changelist card shows Resolve and the dialog reopens with the same categories, plus Retry submit.

Resolve strategies explained

Strategy in GameheimPerforce equivalentWhen to use it
Auto-merge (text files)p4 resolve -amCode, config and other text. Merges line by line; only lines both sides changed stay unresolved
Safe accept (no merge)p4 resolve -asClears the easy cases: accepts a version only when just one side changed, and skips the rest
Accept Theirs (depot version)p4 resolve -atDiscard your edits to this file and take the server version
Accept Yours (local version)p4 resolve -ayKeep your version and overwrite the newer server revision when you submit

Conflicts found after a sync also appear in the Sync Status panel under Conflicts to Resolve, with Theirs, Mine, Auto, Merge and Revert per file and Auto Resolve All for the whole list. Merge opens a three-way merge editor in a browser window, served by the agent on your own computer, so the file contents stay on your machine.

Important:For a binary asset, choosing Accept Yours throws away the teammate's newer revision, and Accept Theirs throws away yours. Talk to the other person before choosing. Exclusive checkout on binary files prevents this situation; see Perforce file locking for Unreal assets.

Undoing work safely: revert, remove, delete

ActionWhereWhat happens to your local file
RevertOpened Files, changelist detailsLocal changes are discarded and the depot version is restored
Remove from CLChangelist details (View)Kept as it is on disk; only the Perforce tracking is removed
Revert UnchangedOpened FilesOnly files you opened but did not modify are reverted
Delete CLChangelist cardFiles leave the changelist and it is deleted. Local content is kept unless you tick Discard local modifications (restore files from depot)

AI description templates

A template defines the structure, tone and language the AI follows for a project. It is a format specification, not a form to fill in. The built-in tags are {summary}, {notes}, {changes}, {files} and {tasks}; you can add custom tags with your own instruction, such as a {risks} tag that lists possible regressions. Open Manage templates from the template picker to create one, and mark one as the project default with Preselect this template for the project. Until a template exists, a built-in default is used. Task tokens are always added by the picker, never by the AI.

More on AI features in Gameheim: AI assistants for game projects.

Frequently asked questions

What is the difference between shelving and submitting in Perforce?

Submitting creates new revisions in the depot that everyone receives on their next sync. Shelving stores a copy of your pending files on the server without creating revisions: the team does not get them, and your files stay checked out. Shelves are used to back up work in progress, to move work between machines and to let a teammate review a change before it is submitted.

Can I submit only some files from a Perforce changelist?

A submit always sends the whole changelist. To submit only part of your work, move the other files to a different changelist first, then submit the one that is ready. In Gameheim, select the files in Opened Files and use Move to, or create a new changelist from the Pending Changelists panel.

How do I link a Perforce changelist to a task?

Put the task key in the changelist description with a hash, such as #DQ-12, optionally followed by progress:60 or done. In Gameheim you do not need to type it: pick tasks under Link tasks in the submit dialog and choose Link only, Progress or Completed. The task updates when the submit from Gameheim completes.

Why does Perforce say a file needs resolve before I can submit?

Someone submitted a newer revision of that file after you synced it, and Perforce will not let your version silently replace theirs. You resolve by merging the two versions (possible for text files), taking the server version, or keeping yours. For binary Unreal assets only the last two are possible, so one set of edits is lost.

Is shelved work safe if my computer breaks?

Yes, as long as the shelve completed. Shelved files are stored on the Perforce server, not on your disk, so another workspace can unshelve them. Work that is only saved locally, even if checked out, exists only on your machine until you shelve or submit it.