# Work properly with Tryton repositories

**URL:** <https://discuss.tryton.org/t/work-properly-with-tryton-repositories/2481>\
**Category:** Developer\
**Created:** [March 25, 2020, 7:40am UTC](https://discuss.tryton.org/t/work-properly-with-tryton-repositories/2481 "2020-03-25T07:40:12Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![2cadz](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/2cadz/32/130_2.png) [@2cadz](https://discuss.tryton.org/u/2cadz)\
**Post date:** [March 25, 2020, 7:40am UTC](https://discuss.tryton.org/t/work-properly-with-tryton-repositories/2481/1 "2020-03-25T07:40:12Z")

</div>

Hello,

I clone the tryton repository as indicated on the website:

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

```

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

```auto
cd tryton-env
hg pull -u

```

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

```auto
...
/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.

---

<div class="post-metadata">

**Author:** ![maxx](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/maxx/32/2320_2.png) [@maxx](https://discuss.tryton.org/u/maxx)\
**Post date:** [March 25, 2020, 8:01am UTC](https://discuss.tryton.org/t/work-properly-with-tryton-repositories/2481/2 "2020-03-25T08:01:27Z")

</div>

See [https://hg.tryton.org/tryton-env/file/tip/README](https://hg.tryton.org/tryton-env/file/tip/README)

```auto
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

```

---

<div class="post-metadata">

**Author:** ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)\
**Post date:** [March 25, 2020, 8:04am UTC](https://discuss.tryton.org/t/work-properly-with-tryton-repositories/2481/3 "2020-03-25T08:04:40Z")

</div>

> [@2cadz](#):
>
> ```auto
> ...
> /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 ?

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.

---

<div class="post-metadata">

**Author:** ![2cadz](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/2cadz/32/130_2.png) [@2cadz](https://discuss.tryton.org/u/2cadz)\
**Post date:** [March 25, 2020, 8:39am UTC](https://discuss.tryton.org/t/work-properly-with-tryton-repositories/2481/4 "2020-03-25T08:39:12Z")

</div>

> [@pokoli](#):
>
> 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?

---

<div class="post-metadata">

**Author:** ![josesalvador](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/josesalvador/32/602_2.png) [@josesalvador](https://discuss.tryton.org/u/josesalvador)\
**Post date:** [March 25, 2020, 8:49am UTC](https://discuss.tryton.org/t/work-properly-with-tryton-repositories/2481/5 "2020-03-25T08:49:13Z")

</div>

> [@2cadz](#):
>
> How do you do this? by a bash script? or is there an option in mercurial?

You just have to follow the [README](https://hg.tryton.org/tryton-env/file/tip/README) instructions.

---

<div class="post-metadata">

**Author:** ![2cadz](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/2cadz/32/130_2.png) [@2cadz](https://discuss.tryton.org/u/2cadz)\
**Post date:** [March 25, 2020, 11:45am UTC](https://discuss.tryton.org/t/work-properly-with-tryton-repositories/2481/6 "2020-03-25T11:45:59Z")

</div>

That’s my `~/.hgrc`

```auto
[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?

---

<div class="post-metadata">

**Author:** ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)\
**Post date:** [March 25, 2020, 12:02pm UTC](https://discuss.tryton.org/t/work-properly-with-tryton-repositories/2481/7 "2020-03-25T12:02:14Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![2cadz](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/2cadz/32/130_2.png) [@2cadz](https://discuss.tryton.org/u/2cadz)\
**Post date:** [March 25, 2020, 2:24pm UTC](https://discuss.tryton.org/t/work-properly-with-tryton-repositories/2481/8 "2020-03-25T14:24:56Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![josesalvador](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/josesalvador/32/602_2.png) [@josesalvador](https://discuss.tryton.org/u/josesalvador)\
**Post date:** [March 25, 2020, 3:28pm UTC](https://discuss.tryton.org/t/work-properly-with-tryton-repositories/2481/9 "2020-03-25T15:28:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)\
**Post date:** [April 24, 2020, 3:28pm UTC](https://discuss.tryton.org/t/work-properly-with-tryton-repositories/2481/10 "2020-04-24T15:28:13Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
