OK, this was not straight forward but it was mainly because of paths and permissions issues.
My local repository is here: /Applications/MAMP/htdocs/aproj/
On the remote machine I need to get a copy of this so I issue the following:
sudo hg -v clone ssh://me@192.168.1.107//Applications/MAMP/htdocs/aproj/ /var/www/aproj/
This will clone the repository.
After making changes I try to push them from the local repo to the remote server using:
sudo hg push ssh://me@192.168.1.105//var/www/aproj/
but this will fail with the error:
remote: Not trusting file /var/www/aproj/.hg/hgrc from untrusted user root, group root
remote: Not trusting file /var/www/aproj/.hg/hgrc from untrusted user root, group root
remote: abort: could not lock repository /var/www/aproj/: Permission denied
abort: unexpected response: empty string
This stems from the local repo having different owner (and group?) from the remote.
I can, however, do a pull from the remote repo (note I am inside var/www/aproj/:
sudo hg pull
Then update to implement the pulled changes:
sudo hg update
and that gets things working for the time being.
One really weird thing I ran into. on the local machine I can issue a command to mercurial with no problem. For example:
hg info
However, doing that via ssh from the remote server failed with the message that ‘hg could not be found’. The path to hg was set correctly (as evidence by ‘echo $PATH’) but I still had to symlink hg from /usr/bin/ in order to get it to work (from the remote machine… it worked fine locally).
Update: how to fix the untrusted user error… in your .hgrc add:
[trusted]
users=*
groups=*






#1 by Ethan on September 2, 2010 - 1:51 pm
You can also add trusted.users=root in /etc/mercurial/hgrc, and that should enable root-trust of hgrc files in individual repositories hosted on that machine. As an administrator for a central repository, this is much easier than begging each user to please add a trust setting for your machine, and also avoids having them trust everyone (as suggested by users=* in your solution)
[Translate]
#2 by Stuart on September 2, 2010 - 2:01 pm
Thanks Ethan. This is a good point that I wasn’t aware of.
[Translate]