pretxnchangegroup hook fails because it can't acquire lock

Mick Jordan mick.jordan at oracle.com
Mon Nov 4 20:16:24 CST 2013


I have a pretxnchangegroup hook on a repo 'x' that runs a python script 
that, essentially, calls "hg push x-2', where other tests runs to 
determine whether the changegroup should be accepted. The repo is on a 
server that is receiving the push via http, using Apache 2.2 and hgweb. 
All the repo files are group apache and the owner of the files is 
trusted in the apache user .hgrc file. The system is essentially a Red 
Hat Linux 6.

Mercurial is 2.2.2 and running under Python 2.6.6, which is the default 
installed Python. The hook script is running under python2.7.5, as it 
needs features from that version.

First, 'hg outgoing http://x' works fine, so the basic permissions are 
correct (it too a while to get that far).

However, the 'hg push http://x'  does not. The "hg push x-2" in the hook 
hangs waiting for the lock on 'x' and eventually times out. I can see 
the lock file in 'x/.hg/store' which is a symbolic link to the python 
process running hgweb.cgi (and hence the hook). Now, almost exactly the 
same configuration exists on another machine, running slightly different 
versions of Apache, hg, Linux and python and works flawlessly. So what 
is the problem on my machine? Does 'push' really need the lock? Is it 
yet another weird permissions problem?

I can verify in another shell that I can clone 'x' to, say, 'y', but if 
I also explicitly attempt to then  'hg push 'y' ', I get the same 
'waiting for lock message'.

Someone who understand the Mercurial locking system please explain why 
this works on one machine but not another?

Thanks
Mick Jordan






More information about the Mercurial mailing list