Hook issue

Matt Mackall mpm at selenic.com
Wed Feb 8 13:47:12 CST 2012


On Wed, 2012-02-08 at 03:35 -0800, HardikShahatOpsHub wrote:
> In hgrc file if following configuration made 
> pretxncommit.policy = python:.hg\precommit.py:checkCommitMessage
> 
> in that i am using SOAPpy to call webservice and validate commit message,
> now issue is that hook failed and throw exception like below.
> 
> abort:No module named SOAPpy

> I verified that i had installed SOAPPy in python. 
> and also this is not import Error, this is abort error, so can you guide me.

It actually is an ImportError and is handled thusly:

http://www.selenic.com/hg/file/e1d8218d733b/mercurial/dispatch.py#l157

Note that message uses "abort: %s". Given that there's no space in your
reported message AND you have inconsistent capitalization of the second
'p' in 'SOAPpy' in your message, I'm going to go out on a limb and guess
you've got a capitalization error in your import and the error message
has the right capitalization because it was manually transcribed the
(from memory?). Perhaps your code even works correctly on Windows.. but
not on your Linux server, where module names suddenly become case
sensitive.

Failing that, you should try importing and testing SOAPpy in a simpler
to use place, like a post-status hook, and print the contents of
sys.path.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list