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.