HgLock-LE - is the extension for SCM Mercurial that allow users to inform each other in case of parallel file modification in one local repository.

1. Status

This extension is not distributed with Mercurial.

Author: Vladimir Legeza

Repository: https://bitbucket.org/legeza/hglock-le

2. Overview

LE in ext. name means "Local (Extension)". "Local" because there is another project with a similar name (LockExtension) that stores locks on a remote server.

"Extension" because originally, functionality of this extension was implemented as a bash script in late 2008 that still available at


Current version was born in early 2012 during the during the process of learning python programming.

Some times developers, especially web developers, perform code modification directly in place where this code is working. And usually they like to do it much more then get their own copy from repo, edit, put changes back and update working instance. And this extension was developed especially for these guys.

Another example of extension usage is that sume you are a SysAdmin and you didn't got enought servers to deploy and use such systems like cfengine and puppet but you'd like to supervise you configuration files in the same strong way without making large amount of garbled files like:


.. and so on ..

Dozens or even hundreds of such files can be replaced my one SCM which will trace all changes and versions (especially when change related to several files).

HgLock-LE - is the tool that will help you to not to loose your changes in case of some one else is able to edit the same bunch of files in the same time (and hence avoid possible service downtime).

3. Configuration

To enable extension you need to add following line into "extension" section of preferred hgrc file:

  hglock = /path/to/hglock.py

Also, if you would like to send email notifications about breaking locks you need to configure "email" section. As minimal configuration you may use these two lines:

  method = /usr/sbin/sendmail

and set environment 'EMAIL' variable. (Should be compatible with RFC 2822) Example:

$ EMAIL="Vladimir Legeza <vladimir.legeza@gmail.com>"
$ export EMAIL

it will use sendmail to inform your colleague in case you break his or her locks (use -f option to do so). Also possible to send emails directly to server over SMTP. See additional information about this in Mercurial documentation.


HgLockLEExtension (last edited 2012-12-10 06:40:38 by rcl)