pretxnchangegroup hook fails because it can't acquire lock

Mick Jordan mick.jordan at oracle.com
Wed Nov 6 16:24:58 CST 2013


On 11/6/13 12:10 PM, Simon King wrote:
> On Wed, Nov 6, 2013 at 5:02 PM, Mick Jordan <mick.jordan at oracle.com> wrote:
>> So my tests were very revealing, output below. My code looks essentialy like
>> your example now. Executive summary is:
>>
>> 1. The commands.push returns False regardless of whether the changegroup
>> hook at remote-2 succeeds or fails,    no exception is generated.
>> 2. In the remote-2 failure case, the inprocess outgoing returns 0 and shows
>> the unpushed changeset, but the subprocess outgoing returns 1. This is
>> consistent with the idea that the external view simply doesn't see the new
>> changsets at all.
>>
>> Success case:
>>
>> remote: adding changesets
>> remote: adding manifests
>> remote: adding file changes
>> remote: added 5 changesets with 8 changes to 5 files
>> remote: pushing to /remote-2
>> remote: searching for changes
>> remote: pushResult: False
>> remote: comparing with remote-2
>> remote: searching for changes
>> remote: no changes found
>> remote: outgoingResult: 1
>> remote: subprocessResult: 1
>>
>> Failure case:
>>
>> remote: adding changesets
>> remote: adding manifests
>> remote: adding file changes
>> remote: added 1 changesets with 1 changes to 1 files
>> remote: pushing to remote-2
>> remote: searching for changes
>> remote: pushResult: False
>> remote: comparing with remote-2
>> remote: searching for changes
>> remote: changeset:   770:61d7055a5627
>> remote: tag:         tip
>> remote: user:        Mick Jordan <mick.jordan at oracle.com>
>> remote: date:        Tue Nov 05 17:08:47 2013 -0800
>> remote: summary:     NEW_FILE
>> remote:
>> remote: outgoingResult: 0
>> remote: subprocessResult: 1
>>
> I'm confused. Did my test script exhibit the same problem when run on
> your system?
You script works as expected as does a modification that uses a 
changegroup hook that does a rollback or remote-2 and returns 1. But 
note that push is returning False (i.e. success) even though the hook 
failed.
>
> Your output doesn't look the same as mine. We should see 'comparing
> remote-2" twice, once for the in-process case and once for the
> subprocess, so I'm not convinced that you are actually doing the same
> test.
I had taken the body of your hook and used it in my hook on the server side.
> Are you sure that your hook in remote-2 is really failing (ie.
> returning non-zero)? If it were calling "hg rollback" but then
> returning 0, that might explain some of what you are seeing.
>
Definitely.

So something is different in the http/hgweb context. I have other 
evidence that the subprocess behavior is different. We have an author 
check on the incoming changesets before the push that I just enabled. If 
I use a call(['hg', 'out',...]) it fails with result 1 (i.e. no 
differences). If I use commands.outgoing, I see the changesets. To some 
extent this is academic since, if we have to use inprocess for the push, 
we might as well use inprocess for everything.

Which leads me to ask how I can pass global options, e.g., --quiet, to, 
e.g., command.outgoing. Looking at the code I can't see how to do that.

Mick



More information about the Mercurial mailing list