Depending on your server configuration, it might be difficult to get the path to your local repo. Im trying to create a Mercurial hook that runs when the commits are being pushed to the main repository. Which will perform a pull from your local repo and then an automatic update. What is Mercurials equivalent to the prepare-commit-message hook in Git Basically what Im looking for is any hook that runs as part of a commit but before the commit message has been edited by. hgrc file of each repository accessed by Trac (if TracMercurial is installed in a Trac plugins directory, download hooks.py and place it somewhere. For Mercurial, add the following entries to the. Be sure to set the hook scripts as executable.
I'm assuming this because typically the server would simply act as a master repository for you and your developers to access (and also to be subject to backups, etc.), and would not need the explicit hg update.Īssuming you are executing code on the server, you can try and replace the push and the update with this command: The post-commit hook will do nothing if you only update the repository by pushing to it. You could write a post-commit hook to perform the push after each commit, but this is not advised because it prevents you from correcting simple mistakes during the commit and before the push.īecause you're trying to perform an update on 'the server' I'm assuming you are executing a version of the code in your repository on the server. Git Build Hook Maven Plugin - A maven plugin for managing client side (local) git configuration and installing hooks for those working on your project. Hooks is a command line git hook management tool. The first two steps you have described: hg commit -m Īre required as per the fact that commits are kept completely separate from the server in Mercurial (and most other DVCS as well). pre-commit - A framework for managing and maintaining multi-language pre-commit hooks.