« November 2008 »
SunMonTueWedThuFriSat
      
1
2
3
4
5
7
8
9
10
11
12
13
14
15
16
21
22
23
24
25
26
27
28
29
30
      
Today
XML

Neat blogs

Navigation

Editing

Powered by Roller Weblogger.

statcounter.com

clustrmaps.com

Locations of visitors to this page

technorati.com

20081120 Thursday November 20, 2008
Locking down a gate/respository

So I'm not a mean gatekeeper - I try to not lock down our gate. I feel like I should just be able to ask people not to integrate anything. But the reality is that you can't count on everyone getting the message. So, you need to lock down the gate.

I knew how to do that in Teamware, but I've never had that need with Mercurial. Until today that is - a nasty branch merge with onnv_103.

So to lock down a Mercurial gate with Sun's extensions, you can use lock.py:

[nfs4hg@aus1500-home ~]> which lock.py
/pool/nfs4hg/bin/lock.py
[nfs4hg@aus1500-home nfs41-gate]> lock.py -n -R /pool/ws/nfs41-gate
[write]: None

Okay, no one has a write lock, so let's grab one:

[nfs4hg@aus1500-home nfs41-gate]> lock.py -R /pool/ws/nfs41-gate
[nfs4hg@aus1500-home nfs41-gate]> lock.py -n -R /pool/ws/nfs41-gate
[write]:
        nfs4hg
        th199096

By the way, where is this configured?

[nfs4hg@aus1500-home ~]> grep lock /pool/ws/nfs41-gate/.hg/hgrc 
#   5. lockdir must be readable by whomever will pull/push
lockdir = public/lock
wlock = nfs4hg, th199096
# These hooks check the lock before anything happens.
prechangegroup.0 = python:hook.lockchk.lockchk
# then comment it out, let them push, uncomment, and unlock the gate.

So the lock only works on the gate and not the clone. You can find more about this in the source of lock.py.

Ohh, and even though I haven't tested it, you release the gate easily enough with a unlock.py.


Originally posted on Kool Aid Served Daily
Copyright (C) 2008, Kool Aid Served Daily