.hgrc/hooks automatic hook directory

Marcin Kasperski Marcin.Kasperski at mekk.waw.pl
Fri Jan 4 23:07:06 UTC 2019


> For example, if I want to run script after every clone, it is
> impossible to create this
> script in `~/.hgrc/hook/post-clone` to make it executed automatically?

In most cases I wanted things like that, I ended up converting hook (or
hooks pack) into extension. Which is easy to install and makes
installation one-time affair. And extension can easily execute on many
paths without specific config.

Cleanest example of this approach is probably
   https://bitbucket.org/Mekk/mercurial-update_version
which is in fact pre-tag hook packaged-as-extension (and augmented with
various ways to configure „where am I to work”). In practice I mostly
enabled it per big directory trees and don't even remember about it
anymore.

Mayhaps your case could be handled similarly, via some simple extension
(which would either setup post-clone hook, or just would augment clone
directly)?



More information about the Mercurial mailing list