Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding hooks to TortoiseHg

I am using TortoiseHg and would like to apply a hook to my repo. My repo's .hg/hgrc file is as follows:

[hooks]
pretxncommit = python:hg_checksize.newbinsize

The thing is that I don't know where TortoiseHg's PYTHONPATH variable is set. How do I change it? Or where do I put my Python file so that it is visible by TortoiseHg's Python interpreter?

I cannot find any mention of hooks in TortoiseHg's documentation or through Google?

like image 346
hekevintran Avatar asked Mar 20 '10 08:03

hekevintran


2 Answers

you can put your .py wherever you like and use a full path to it. the syntax is then

[hooks] 
pretxncommit.myhook = python:/path/to/my.py:newbinsize
like image 98
jk. Avatar answered Sep 20 '22 11:09

jk.


To enable in-process hooks in TortoiseHg you must put your *.py file into C:\Program Files\TortoiseHg\library.zip. TortoiseHg loads Python files from library.zip.

Reinstalling TortoiseHg will probably mean having to repeat this step.

like image 24
hekevintran Avatar answered Sep 20 '22 11:09

hekevintran