File Locking

Martin Geisler mg at aragost.com
Thu Aug 18 16:27:58 UTC 2011


Johan Samyn <johan.samyn at gmail.com> writes:

> On 18-08-2011 15:44, Martin Geisler wrote:
>> "Clark Hwang" <Chwang at guhsd.net> writes:
>>
>> Hi,
>>
>> This is a reply to an old thread -- I've CCed those of you who seemed to
>> be interested in a way to lock files in Mercurial. I hope it is still
>> relevant to some of you.
>>
>>> I'm trying to convince my office to go with Mercurial instead of
>>> Subversion. One of the requirement will be to have the ability to lock
>>> files so another user would not be able to check it out. Is it
>>> possible to implement file locking with Mercurial? Are there sample
>>> hooks are there?
>> I've written an extension for locking files, please see
>>
>>   https://bitbucket.org/aragost/hglock
>>   http://mercurial.selenic.com/wiki/LockExtension/NewDesign
>>
>
> Hi Martin,
> Something is not clear to me after reading the page mentioned above. If
> you have a central repo with already existing cloned work repos, do you
> have to reclone them after executing "hg init-lock" on the central repo
> ? Do you have to do anything else to have them pick up the locking
> config from the central repo ?

No recloning is necessary, enabling the extension in a client repository
is enough.

The init-lock command is there to catch configuration mistakes where a
client uses the wrong lock repository by accident. Now, that mistake
will be noted because the repository is not a lock repository. It was
something my client wanted after having fiddled with the config for a
while, only to realize that the lock repository was the wrong one.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://mercurial.aragost.com/kick-start/



More information about the Mercurial mailing list