There are two project in which I collaborate, they live in different servers, A and B.
While A has the hg program in /opt/mercurial/bin/hg, B has it in /usr/local/bin/hg.
When I want to pull/push changes to either remote, I have to manually modify .hgrcfile in order for the option remotecmdto point to the right location of hg.
I would like to know if it is possible to setup different remotecmdpaths for different remotes so that I don’t have to manually change the path of the hgprogram everytime I need to do some remote operation.
I saw this question: Setup platform-dependent hgrc but it seemed to me that there should be a more native (something like a built-in setting) way to do this. So far I haven’t been able to find it, so any help will be welcome 🙂
Thanks!
Ideally you just get the
hgbinary into your$PATHon both servers and you don’t have to think about it anymore. That can be done in the system’s/etc/profileor in your.ssh/enviironmenton that remote server. Most people never even need to think aboutremotecmd.If they’re separate projects (or even separate clones locally of the same project) you can set the
remotecmdin the.hg/hgrcfile within each repository — settings don’t just have to be in your~/hgrcfile.Also be aware that
--remotecmdis available as a command line option for push and pull, so you could use that and even combine it with something like:and then you can just do
hg pushaReally though, just try to get
hginto your path like everyone else does.