Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make mercurial run script on push?

Tags:

mercurial

I have a server which hosts a mercurial repository with hgwebdir. Is it possible to make mercurial to run a script when someone pushes to this repository?
Currently I use a script that checks the repository state every few minutes, but this is obviously an ugly solution.

like image 882
mbq Avatar asked Jun 25 '10 18:06

mbq


2 Answers

You have to add a hook to your Mercurial server:

  • Edit .hg/hgrc (or mercurial.ini on Windows)
  • Add or edit the [hooks] section
  • Associate a shell command to the hook you are interested in (in your case, the changegroup hook)

Look at Handling repository events with hooks in the Mercurial red-bean book for more details.

like image 133
marcslogic Avatar answered Oct 23 '22 07:10

marcslogic


You might want to take a look at mercurial hooks,

http://hgbook.red-bean.com/read/handling-repository-events-with-hooks.html

like image 20
in3xes Avatar answered Oct 23 '22 07:10

in3xes