hgrc hooks changegroup multiplatform
Jérôme Godbout
jerome at bodycad.com
Mon Jun 5 14:30:15 UTC 2017
Hi,
first here is the use case, we have a repos that is the central where all
the official changes ends up once reviewed. This repos is accessible by
developer by mounting a network drive.
We have a hook to execute a scripts that will do refresh data on other
server when a user push new rev to the central repos. My problems is that
we have Linux and Windows OS mounting the drive and have a problems with
executing the hook on both OS.
We did both scripts that we placed into the repos folder directly ( not
inside the .hg):
*refresh_redmine.cmd* // For windows execution
*refresh_redmine* // *nix which is essentially a .sh into bash, removed
the extension to have the same executable name
For Windows the following scripts hgrc ontot the central repos:
*[hooks]*
*changegroup.refresh_redmine = refresh_redmine*
This work like expected. But with *nix system, the executable is not into
the current path.
For Linux the command is never found. Is there a way to add the repos path
to the environment to have the same behavior on both platform?
so I have to do the follwoing to make it work.
./*refresh_redmine*
but this brake the proper behavior for Windows user.
I also tried the following:
*changegroup.refresh_redmine = refresh_redmine || ./refresh_redmine*
Sadly this break since the windows doesn't recognize this syntax. It does
work for *nix.
Here's what I would like to avoid:
- Specify the hgrc behavior on each client (it's bound to be forgotten)
- Having multiple platforms support
- Avoid having to add the repos path to all environment path of each
*nix user/machine
What I ideally would like:
*Solution #1*: A way to add the repos path into a var into the hgrc with
*nix path for both platform (windows could replace the / with \ or have a
path that support both):
*changegroup.refresh_redmine = ${REPOS_PATH}/refresh_redmine*
*Solution #2*: Add some environment path for the hgrc execution only
*[hooks]*
*changegrouppath = **${REPOS_PATH}*
*changegroup.refresh_redmine = refresh_redmine*
Maybe someone have a good solution/workaround for this?
[image: bodycad] <https://www.bodycad.com/>
Jerome Godbout
Software Developer
2035 rue du Haut-Bord, Québec, QC, Canada. G1N 4R7
T: +1 418 527-1388
E: jerome at bodycad.com
www.bodycad.com
The contents of this email message and any attachments are intended solely
for the addressee(s) and may contain confidential and/or privileged
information and may be legally protected from disclosure. If you are not
the intended recipient of this message or their agent, or if this message
has been addressed to you in error, please immediately alert the sender by
reply email and then delete this message and any attachments. If you are
not the intended recipient, you are hereby notified that any use,
dissemination, copying, or storage of this message or its attachments is
strictly prohibited.
Le contenu de ce message et les pièces jointes sont destinés uniquement
pour le(s) destinataire(s) et peuvent contenir des informations
confidentielles et / ou privilégiées qui peuvent être protégées légalement
contre toute divulgation. Si vous n'êtes pas le destinataire de ce message
ou son agent, ou si ce message vous a été adressé par erreur, sâil vous
plaît avertir immédiatement l'expéditeur par courriel de réponse, puis
supprimer ce message et les pièces jointes. Si vous n'êtes pas le
destinataire prévu, vous êtes par la présente informé que toute
utilisation, diffusion, copie, ou stockage de ce message ou de ses pièces
jointes est strictement interdit.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial/attachments/20170605/b08be1a5/attachment.html>
More information about the Mercurial
mailing list