Support for exclusive locking in personal servers

There are certain types of files that cannot be merged and therefore must only be changed by one user at a time. Examples include binary files, Microsoft Word files, and digital assets such as 3D models. In Helix, to ensure that only one user at a time writes changes to a file, you assign the file the filetype +l. This gives the user a global exclusive lock on the file when they open it for edit.

You can enable the support of exclusive locking in personal servers for the p4 edit, p4 delete, and p4 revert commands. To do this, pass the --remote=remote option, where remote specifies the shared server from which you cloned the locked file. The lock is held in the shared server. All personal servers which cloned the file from the shared server must observe this lock restriction.

Note

For exclusive locking to work, the shared server must be configured as a commit server. For instructions on how to do this, see "Create commit and edge server configurations" in the "Commit-edge Architecture" chapter of the Helix Versioning Engine Administrator Guide: Multi-site Deployment.

Once you have the locked file in the shared server:

  • you can safely change the file, submit your changes, and push to the shared server; your lock releases automatically at the end of the push
  • no other user is allowed to either edit that file or push it from their personal server

Exclusive locking works as follows for each of the three commands:

  • For p4 edit, the --remote=remote option opens the file for edit in your personal server, and additionally — if the file is of type +l — takes a global exclusive lock on the file in the shared server from which you cloned the file. That global exclusive lock is retained until you push the updated file to the shared server, or until you use p4 revert --remote=remote to revert the file.
  • For p4 delete, the --remote=remote option opens the file for delete in your personal server, and additionally — if the file is of type +l — takes a global exclusive lock on the file in the shared server from which which you cloned the file. That global exclusive lock is retained until you push the deleted file to the shared server, or until you use p4 revert --remote=remote filename to revert the file.
  • For p4 revert, the --remote=remote option reverts the named file in your personal server, and additionally — if the file is of type +l — releases the global exclusive lock on the file in the shared server from which you cloned the file.