Work properly with Tryton repositories

Hello,

I clone the tryton repository as indicated on the website:

 hg clone https://hg.tryton.org/tryton-env

I’m trying to update this repository with the last changes:

cd tryton-env
hg pull -u

And on each sub-deposit I have the following warning:

...
/bin/sh: 1: .hooks/link_modules: not found
warning: update.modules hook exited with status 127
...

Is this normal? what did i forget or not do ?

Regards.

See https://hg.tryton.org/tryton-env/file/tip/README

To have symlinks for modules created automatically on Mercurial update, add

the following line to the hooks section of your .hg/hgrc:

    update.modules = .hooks/link_modules

It seems you added the hook on the global hgrc file which executes it on each repository.
You should only activate the hook on the tryton-env repository.

How do you do this? by a bash script? or is there an option in mercurial?

You just have to follow the README instructions.

That’s my ~/.hgrc

[ui]
username = Christophe <xt0ph@adiczion.net>
ignore = ~/.hgignore
interface = curses

[hooks]
update.modules = .hooks/link_modules

and with my ~/.hgrc, I have the warning on each sub-repository hence my question. As suggested by @pokoli is there a way to apply the update.modules hook only on the tryton-env repository?

You should not add the [hooks] on your ~/.hgrc but on the .hgrc file which is inside of the .hg folder in the directory you cloned tryton-env.

This is becasue the hook should be execute only on the tryton-env repository (so we declare in it’s own mercurial configuration).

Ah ok thank, I didn’t understand that it was in this directory. Is there a reason why this file is not part of the repository?

.hgrc is the configuration file for mercurial repository so each user can customize it in the way he wants