How to run "hg update" via mercurial incoming hook
Asked Answered
C

1

6

What is the correct way of running hg update in an incoming hook?

Is it:

[hooks]
incoming.foo = hg update

Or this

Or is there a more elegant way of doing this?

Celestyn answered 24/4, 2012 at 6:40 Comment(0)
L
8

The FAQ makes this suggestion:

[hooks]
changegroup = hg update

This goes in .hg/hgrc on the remote repository

So, indeed, this is the simple and correct way of doing it. Your example used incoming, but that hook runs once for every single changeset. The changegroup hook is done once after all changes have been pulled in, so I think it may suit your needs better.

If you end up needing more control, you can create an in-process hook script to fulfill those needs. The Wiki has some good examples.

Lobelia answered 4/5, 2012 at 17:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.