How can you lock files using an Hg repository hosted by Bitbucket?

Because our project handles a lot of binary files and art assets (game developed in Unity 3D) we really need locking ala SVN to keep our artists from stomping all over eachother. I know there is a locking extension for Hg, but how do I use it with a bitbucket hosted repo? Can I? I'm worried that even if I figure it out, TortoiseHg won't have a graphical hook for locking whch defeats the purpose since it is finicky artists that need the feature and asking them to use the command line is like asking a cat to take a shower.

3 answers

I'm the author of the lock extension ( You cannot use it with Bitbucket since it must be enabled on both the client- and the server-side (and Bitbucket doesn't allow you to enable extensions on the server-side).


Bitbucket doesn't offer any server side hooks configuration options at the moment. In adiditon to that, we don't recommend placing image/binary file data in Mercurial. All your code is fine, but the image data doesn't work well with Mercurial and your repository will grow very fast.

At the moment, I'm not aware of any great tools for this workflow, but perhaps someone else here can make a suggestion.

You can apply a commit policy to your Mercurial repos using the Commit Policy Plugin, and reject the commits that would try to modify the files you wanted to lock. You can lock directories, files or mixed.

Here is the tutorial for implementing commit policies with Bitbucket Cloud.

Suggest an answer

Log in or Join to answer
Community showcase
Maarten Cautreels
Posted Thursday in Off-topic

Friday Fun: What's your favourite beer/drink

As a Belgian, beer-lover and home brewer, beer is one of my great passions. I love the fact that with just a few ingredients (usually just water, hop and malt) you can create so many different tastes...

288 views 38 9
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot