live-mirroring of repository
Lasse Kliemann
lasse at lassekliemann.de
Sat May 2 13:08:34 UTC 2015
Bob Hood <bhood2 at comcast.net> writes:
> On 5/2/2015 4:36 AM, Lasse Kliemann wrote:
>> Any help is appreciated. Also, of course, if you have a better idea how
>> to do such a live-mirroring, I will be happy to go with that.
>
> Just a thought, but in each of your hooks, why not check the source of the
> incoming changeset, and if it is the other repo, then do not push? That would
> likely remove any potential race condition. I seem to recall, in my past
> researches into creating Mercurial hooks, that such information is available
> to the hook code.
Yes, this is possible. I've put the following at the top of the hook
script now:
case "$2" in
'') : ;;
"$HG_URL") exit 0 ;;
*) : ;;
esac
In hgrc, I pass as $2 the correct information. This mechanism works as
intended; the futile push is avoided.
However, the hangs still occur. Maybe not as frequently as before, though.
Thanks anyways! The solution is much cleaner already this way.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20150502/998d78c6/attachment.asc>
More information about the Mercurial
mailing list