Adding hook on lookup

Cédric Krier cedric.krier at b2ck.com
Thu Jul 26 07:53:46 UTC 2018


Hi,

Until recently, I used the extension hgwebcachingproxy [1] to maintain
local repositories as cache for our CI machines. But the extension does
not work anymore with latest mercurial versions.
So I found an easy replacement solution to maintain an up to date cache
repository locally by using a hook like this (I do not need automatic
creation):

    [hooks]
    preoutgoing = hg pull

It works very well for `hg clone <path>` but it does not with a revision
`hg clone -r <rev> <path>` (how our CI is cloning).
With revision option, it does not work because a lookup is performed
before the preoutgoing hook is triggered and so if the revision has not
yet been pull, it raises an error.
For now, I patched mercurial to trigger a hook on lookup command. Do you
think it makes sense to have this hook in standard? If yes, what should
be the name of this hook, 'lookup'?


[1] https://bitbucket.org/Unity-Technologies/hgwebcachingproxy

Thanks,
-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.krier at b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 376 bytes
Desc: not available
URL: <http://www.mercurial-scm.org/pipermail/mercurial/attachments/20180726/1a471bf5/attachment.sig>


More information about the Mercurial mailing list