Question:
How can I configure a lock/exclusive setup?
Resolution:
Exclusive checkout, or locking a file, is useful in many scenarios where it's impossible to merge changes, like with:
- Binary files
- Images, art, and 3D content
- Excel files
Configuring exclusive checkout is as simple as adding or editing locking rules to the required repositories by managing your locking rules from the Plastic SCM Server Administration Console or by using a lock.conf file.
To manage your locking rules from the Plastic SCM Server Administration Console:
- Launch webadmin
- Go to Configuration > Lock rules.
- If you want to configure global lock rules for all the repositories, in the "Global rules (all repositories)" section you must specify the rules or load the suggested common lock rules by clicking "Generate common rules".
- If you want to specify rules for a particular repository, then follow these steps:
- Click "Add" in the "Repository-specific rules" section.
- Enter the name of the repository where the rules will apply.
- Specify your own rules or load the suggested common lock rules by clicking "Generate common rules" (you can edit them as well).
- Repeat the steps above as many repositories need lock rules. Or Delete the rules for a repository if they aren't needed.
- Click "Add" in the "Repository-specific rules" section.
- Click "Apply" to save the changes.
Using the lock.conf file:
- Create or edit the lock.conf file on the server's directory with the following format:
rep:<repname> [lockserver:[<server>:<port>]]
Where:- repname is the name of the repository where you want to perform exclusive checkouts on that particular repository. If you want to specify rules for all repositories, the repname will be *.
- server is the ip or the name of the lock server.
- port is the port where the lock server is configured.
- Then, configure the paths that will be exclusive checkouts. You can specify complete paths or patterns. Specify each rule in a new line. For example:
rep:default lockserver:mainsvr:8084
*.doc
*.xls
*.jpg
vcs
This means that the *.doc, *.xls, *.jpg and document.vcs files are going to be locked on checkout for repository default in the repository server mainsvr:8084.
Or, for example:rep:battlegame lockserver:
Where the *.png pictures and all files under the /assets/textures folder that begin with model will be locked on checkout for repository battlegame.
*.png
/assets/textures/model*.* - Repeat the steps above to create exclusive checkouts for the required repositories.
- Save the lock.conf file.
Please see here for further information.