pretxnchangegroup hook fails because it can't acquire lock

Mick Jordan mick.jordan at oracle.com
Tue Nov 5 21:48:37 CST 2013


On 11/5/13 6:04 PM, Mick Jordan wrote:
> On 11/5/13 3:16 PM, Mick Jordan wrote:
>>
>> I think I'm good to go now. I'd like to thank you for all your help.
>>
> Hmm, one more thing. I had assumed that:
>
>    mercurial.commands.push(...)
>
> returned False if the push succeeded, since you returned it as the 
> value of your example hook (and False means success). However, I am 
> getting False even when the changegroup hook in the target fails 
> (returns True), vis:
>
> [Tue Nov 05 17:46:23 2013] [error] [client ...] rollback target repo...
> [Tue Nov 05 17:46:23 2013] [error] [client ...] warning: 
> changegroup.waitforack hook exited with status 3
>
Actually it's worse than that. After the commands.push returns I call 
(in a sub-process):

hg -q -R repo out --template '{node|short}:{author}' repo-target

This should return 0 as there should be outgoing changes as repo-target 
has rolled back, but it returns 1. If I run the command from a shell 
after the it's all done, it certainly returns 0 and shows me the 
changeset. The documentation on pretxnchangegroup at 
http://hgbook.red-bean.com/read/handling-repository-events-with-hooks.html 
is very unclear as several people have commented.

Mick

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial/attachments/20131105/42be5e63/attachment.html>


More information about the Mercurial mailing list